[Scummvm-git-logs] scummvm master -> 1296eb0c2acc3e0d1d8d049cc2ddd54bf3dde28f

bluegr noreply at scummvm.org
Sun Nov 14 13:52:41 UTC 2021


This automated email contains information about 70 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
44219dfa1a BACKENDS: Use nullptr
e92e232788 BASE: Use nullptr
cb61ec37c4 COMMON: Use nullptr
62797daf3c DEVTOOLS: Use nullptr
c97917c8f5 ACCESS: Use nullptr
b125faf954 ADL: Use nullptr
f1f4657b10 AGI: Use nullptr
8c81b5026a AGOS: Use nullptr
a386075217 AGS: Use nullptr
57cdbc9072 ASYLUM: Use nullptr
91e321d334 AVALANCHE: Use nullptr
bb4f811b12 BBVS: Use nullptr
6965dd663e BLADERUNNER: Use nullptr
369eae5f35 BURIED: Use nullptr
69f45d9258 CGE: Use nullptr
7f476c844f CGE2: Use nullptr
6d232990cf CHEWY: Use nullptr
0b818ad3f6 CINE: Use nullptr
6a59febd46 COMPOSER: Use nullptr
52e1aa78a0 CRUISE: Use nullptr
158cf7734b CRYO: Use nullptr
441992ae3b CRYOMNI3D: Use nullptr
02cfffcb67 DIRECTOR: Use nullptr
8c0f10e817 DM: Use nullptr
5adade14d2 DRACI: Use nullptr
9937cc49bb DRAGONS: Use nullptr
8672b6281c DRASCULA: Use nullptr
2c23cf985f DREAMWEB: Use nullptr
0111a08560 GLK: Use nullptr
882eb43608 GNAP: Use nullptr
8d91d66a15 GOB: Use nullptr
3162ad4dfb GRIFFON: Use nullptr
415986010e GRIM: Use nullptr
0909948281 GROOVIE: Use nullptr
5c3b20d5e9 HADESCH: Use nullptr
138f943076 HDB: Use nullptr
13bcd9a0f7 HOPKINS: Use nullptr
94e1c56272 HUGO: Use nullptr
91816427ca HYPNO: Use nullptr
75bfc1290b ICB: Use nullptr
49d745bbe4 ILLUSIONS: Use nullptr
7fa7b12c91 KINGDOM: Use nullptr
da751361a4 KYRA: Use nullptr
4c473a5e4d LAB: Use nullptr
f8881f661b LASTEXPRESS: Use nullptr
429d8c9bc2 LILLIPUT: Use nullptr
04eacfa7d3 LURE: Use nullptr
619a6bafe3 MACVENTURE: Use nullptr
6333092801 MADE: Use nullptr
b55edb580a MADS: Use nullptr
e808737662 MOHAWK: Use nullptr
bbbcd1c899 MORTEVIELLE: Use nullptr
dda887aaba MYST3: Use nullptr
3a51911db2 NANCY: Use nullptr
9dab832214 NEVERHOOD: Use nullptr
1b73b90224 NGI: Use nullptr
b458ea47dd PARALLACTION: Use nullptr
3bc29bd60f PEGASUS: Use nullptr
9394b5301f PETKA: Use nullptr
635377951e PINK: Use nullptr
6c33355418 PLAYGROUND3D: Use nullptr
b56293beaf PLUMBERS: Use nullptr
5733e3de1c PRINCE: Use nullptr
5a830a7bae PRIVATE: Use nullptr
59a6446d8c QUEEN: Use nullptr
2930d37788 SAGA: Use nullptr
f544cb934d SAGA2: Use nullptr
940c7bfc14 SCI: Use nullptr
ed5489929c SCUMM: Use nullptr
1296eb0c2a SHERLOCK: Use nullptr


Commit: 44219dfa1a722f8cc86e22b47f9bf2c578aae177
    https://github.com/scummvm/scummvm/commit/44219dfa1a722f8cc86e22b47f9bf2c578aae177
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
BACKENDS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    backends/audiocd/default/default-audiocd.cpp
    backends/audiocd/win32/win32-audiocd.cpp
    backends/cloud/box/boxtokenrefresher.cpp
    backends/cloud/dropbox/dropboxtokenrefresher.cpp
    backends/cloud/googledrive/googledrivetokenrefresher.cpp
    backends/cloud/onedrive/onedrivetokenrefresher.cpp
    backends/dialogs/win32/win32-dialogs.cpp
    backends/events/sdl/sdl-events.cpp
    backends/fs/stdiostream.cpp
    backends/fs/windows/windows-fs.cpp
    backends/graphics/opengl/texture.cpp
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    backends/keymapper/hardware-input.cpp
    backends/log/log.cpp
    backends/midi/windows.cpp
    backends/mixer/sdl/sdl-mixer.cpp
    backends/modular-backend.cpp
    backends/networking/curl/connectionmanager.cpp
    backends/networking/sdl_net/localwebserver.cpp
    backends/platform/psp/png_loader.cpp
    backends/platform/psp/psppixelformat.cpp
    backends/platform/sdl/opendingux/opendingux.cpp
    backends/platform/sdl/sdl-window.cpp
    backends/platform/sdl/sdl.cpp
    backends/platform/sdl/win32/win32-window.cpp
    backends/platform/sdl/win32/win32.cpp
    backends/platform/sdl/win32/win32_wrapper.cpp
    backends/saves/savefile.cpp
    backends/saves/windows/windows-saves.cpp
    backends/taskbar/win32/win32-taskbar.cpp
    backends/text-to-speech/windows/windows-text-to-speech.cpp
    backends/timer/default/default-timer.cpp


diff --git a/backends/audiocd/default/default-audiocd.cpp b/backends/audiocd/default/default-audiocd.cpp
index e49ad36306..807c7bff7b 100644
--- a/backends/audiocd/default/default-audiocd.cpp
+++ b/backends/audiocd/default/default-audiocd.cpp
@@ -110,13 +110,13 @@ bool DefaultAudioCDManager::play(int track, int numLoops, int startFrame, int du
 		// the requested track.
 		Common::Array<Common::String> trackNames;
 		fillPotentialTrackNames(trackNames, track);
-		Audio::SeekableAudioStream *stream = 0;
+		Audio::SeekableAudioStream *stream = nullptr;
 
 		for (Common::Array<Common::String>::iterator i = trackNames.begin(); !stream && i != trackNames.end(); ++i) {
 			stream = Audio::SeekableAudioStream::openStreamFile(*i);
 		}
 
-		if (stream != 0) {
+		if (stream != nullptr) {
 			Audio::Timestamp start = Audio::Timestamp(0, startFrame, 75);
 			Audio::Timestamp end = duration ? Audio::Timestamp(0, startFrame + duration, 75) : stream->getLength();
 
diff --git a/backends/audiocd/win32/win32-audiocd.cpp b/backends/audiocd/win32/win32-audiocd.cpp
index a90e3a7a43..5656cd88e6 100644
--- a/backends/audiocd/win32/win32-audiocd.cpp
+++ b/backends/audiocd/win32/win32-audiocd.cpp
@@ -140,7 +140,7 @@ bool Win32AudioCDStream::readFrame(int frame, int16 *buffer) {
 	           buffer,
 	           kBytesPerFrame,
 	           &bytesReturned,
-	           NULL);
+	           nullptr);
 }
 
 
@@ -199,7 +199,7 @@ bool Win32AudioCDManager::openCD(int drive) {
 	// Construct the drive path and try to open it
 	Common::String drivePath = Common::String::format("\\\\.\\%c:", drives[drive]);
 	TCHAR *tDrivePath = Win32::stringToTchar(drivePath);
-	_driveHandle = CreateFile(tDrivePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+	_driveHandle = CreateFile(tDrivePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
 	free(tDrivePath);
 	if (_driveHandle == INVALID_HANDLE_VALUE) {
 		warning("Failed to open drive %c:\\, error %d", drives[drive], (int)GetLastError());
@@ -232,7 +232,7 @@ bool Win32AudioCDManager::openCD(const Common::String &drive) {
 	// Construct the drive path and try to open it
 	Common::String drivePath = Common::String::format("\\\\.\\%c:", drives[0]);
 	TCHAR *tDrivePath = Win32::stringToTchar(drivePath);
-	_driveHandle = CreateFile(tDrivePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+	_driveHandle = CreateFile(tDrivePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
 	free(tDrivePath);
 	if (_driveHandle == INVALID_HANDLE_VALUE) {
 		warning("Failed to open drive %c:\\, error %d", drives[0], (int)GetLastError());
@@ -323,7 +323,7 @@ bool Win32AudioCDManager::loadTOC() {
 	                  &tocData,
 	                  sizeof(tocData),
 	                  &bytesReturned,
-	                  NULL);
+	                  nullptr);
 	if (!result) {
 		debug("Failed to query the CD TOC: %d", (int)GetLastError());
 		return false;
@@ -362,7 +362,7 @@ Win32AudioCDManager::DriveList Win32AudioCDManager::detectDrives() {
 		Common::String gamePath = ConfMan.get("path");
 		TCHAR *tGamePath = Win32::stringToTchar(gamePath);
 		TCHAR fullPath[MAX_PATH];
-		DWORD result = GetFullPathName(tGamePath, MAX_PATH, fullPath, 0);
+		DWORD result = GetFullPathName(tGamePath, MAX_PATH, fullPath, nullptr);
 		free(tGamePath);
 
 		if (result > 0 && result < sizeof(fullPath) && Common::isAlpha(fullPath[0]) && fullPath[1] == ':' && tryAddDrive(toupper(fullPath[0]), drives))
diff --git a/backends/cloud/box/boxtokenrefresher.cpp b/backends/cloud/box/boxtokenrefresher.cpp
index db52672173..fb84993ef2 100644
--- a/backends/cloud/box/boxtokenrefresher.cpp
+++ b/backends/cloud/box/boxtokenrefresher.cpp
@@ -124,7 +124,7 @@ void BoxTokenRefresher::finishError(Networking::ErrorResponse error) {
 void BoxTokenRefresher::setHeaders(Common::Array<Common::String> &headers) {
 	_headers = headers;
 	curl_slist_free_all(_headersList);
-	_headersList = 0;
+	_headersList = nullptr;
 	for (uint32 i = 0; i < headers.size(); ++i)
 		CurlJsonRequest::addHeader(headers[i]);
 }
diff --git a/backends/cloud/dropbox/dropboxtokenrefresher.cpp b/backends/cloud/dropbox/dropboxtokenrefresher.cpp
index 63995fa360..436f9a9034 100644
--- a/backends/cloud/dropbox/dropboxtokenrefresher.cpp
+++ b/backends/cloud/dropbox/dropboxtokenrefresher.cpp
@@ -111,7 +111,7 @@ void DropboxTokenRefresher::finishError(Networking::ErrorResponse error) {
 void DropboxTokenRefresher::setHeaders(Common::Array<Common::String> &headers) {
 	_headers = headers;
 	curl_slist_free_all(_headersList);
-	_headersList = 0;
+	_headersList = nullptr;
 	for (uint32 i = 0; i < headers.size(); ++i)
 		CurlJsonRequest::addHeader(headers[i]);
 }
diff --git a/backends/cloud/googledrive/googledrivetokenrefresher.cpp b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
index 089b46e1f9..7b4e1347ee 100644
--- a/backends/cloud/googledrive/googledrivetokenrefresher.cpp
+++ b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
@@ -112,7 +112,7 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) {
 void GoogleDriveTokenRefresher::setHeaders(Common::Array<Common::String> &headers) {
 	_headers = headers;
 	curl_slist_free_all(_headersList);
-	_headersList = 0;
+	_headersList = nullptr;
 	for (uint32 i = 0; i < headers.size(); ++i)
 		CurlJsonRequest::addHeader(headers[i]);
 }
diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
index b456732233..a396747d65 100644
--- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp
+++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
@@ -141,7 +141,7 @@ void OneDriveTokenRefresher::finishError(Networking::ErrorResponse error) {
 void OneDriveTokenRefresher::setHeaders(Common::Array<Common::String> &headers) {
 	_headers = headers;
 	curl_slist_free_all(_headersList);
-	_headersList = 0;
+	_headersList = nullptr;
 	for (uint32 i = 0; i < headers.size(); ++i)
 		CurlJsonRequest::addHeader(headers[i]);
 }
diff --git a/backends/dialogs/win32/win32-dialogs.cpp b/backends/dialogs/win32/win32-dialogs.cpp
index 0b23d61ba0..b279b9bd1c 100644
--- a/backends/dialogs/win32/win32-dialogs.cpp
+++ b/backends/dialogs/win32/win32-dialogs.cpp
@@ -70,7 +70,7 @@
 #include "common/translation.h"
 
 Win32DialogManager::Win32DialogManager(SdlWindow_Win32 *window) : _window(window) {
-	CoInitialize(NULL);
+	CoInitialize(nullptr);
 }
 
 Win32DialogManager::~Win32DialogManager() {
@@ -82,14 +82,14 @@ HRESULT winCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid,
 	typedef HRESULT(WINAPI *SHFunc)(PCWSTR, IBindCtx *, REFIID, void **);
 
 	SHFunc func = (SHFunc)(void *)GetProcAddress(GetModuleHandle(TEXT("shell32.dll")), "SHCreateItemFromParsingName");
-	if (func == NULL)
+	if (func == nullptr)
 		return E_NOTIMPL;
 
 	return func(pszPath, pbc, riid, ppv);
 }
 
 HRESULT getShellPath(IShellItem *item, Common::String &path) {
-	LPWSTR name = NULL;
+	LPWSTR name = nullptr;
 	HRESULT hr = item->GetDisplayName(SIGDN_FILESYSPATH, &name);
 	if (SUCCEEDED(hr)) {
 		char *str = Win32::unicodeToAnsi(name);
@@ -107,9 +107,9 @@ Common::DialogManager::DialogResult Win32DialogManager::showFileBrowser(const Co
 	if (!Win32::confirmWindowsVersion(6, 0))
 		return result;
 
-	IFileOpenDialog *dialog = NULL;
+	IFileOpenDialog *dialog = nullptr;
 	HRESULT hr = CoCreateInstance(CLSID_FileOpenDialog,
-		NULL,
+		nullptr,
 		CLSCTX_INPROC_SERVER,
 		IID_IFileOpenDialog,
 		reinterpret_cast<void **> (&(dialog)));
@@ -141,8 +141,8 @@ Common::DialogManager::DialogResult Win32DialogManager::showFileBrowser(const Co
 		LPWSTR str;
 		if (ConfMan.hasKey("browser_lastpath")) {
 			str = Win32::ansiToUnicode(ConfMan.get("browser_lastpath").c_str());
-			IShellItem *item = NULL;
-			hr = winCreateItemFromParsingName(str, NULL, IID_IShellItem, reinterpret_cast<void **> (&(item)));
+			IShellItem *item = nullptr;
+			hr = winCreateItemFromParsingName(str, nullptr, IID_IShellItem, reinterpret_cast<void **> (&(item)));
 			if (SUCCEEDED(hr)) {
 				hr = dialog->SetDefaultFolder(item);
 			}
@@ -154,7 +154,7 @@ Common::DialogManager::DialogResult Win32DialogManager::showFileBrowser(const Co
 
 		if (SUCCEEDED(hr)) {
 			// Get the selection from the user
-			IShellItem *selectedItem = NULL;
+			IShellItem *selectedItem = nullptr;
 			hr = dialog->GetResult(&selectedItem);
 			if (SUCCEEDED(hr)) {
 				Common::String path;
@@ -167,7 +167,7 @@ Common::DialogManager::DialogResult Win32DialogManager::showFileBrowser(const Co
 			}
 
 			// Save last path
-			IShellItem *lastFolder = NULL;
+			IShellItem *lastFolder = nullptr;
 			hr = dialog->GetFolder(&lastFolder);
 			if (SUCCEEDED(hr)) {
 				Common::String path;
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 9cf043ee37..4432ef7dff 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -72,7 +72,7 @@ void SdlEventSource::loadGameControllerMappingFile() {
 #endif
 
 SdlEventSource::SdlEventSource()
-	: EventSource(), _scrollLock(false), _joystick(0), _lastScreenID(0), _graphicsManager(0), _queuedFakeMouseMove(false),
+	: EventSource(), _scrollLock(false), _joystick(nullptr), _lastScreenID(0), _graphicsManager(nullptr), _queuedFakeMouseMove(false),
 	  _lastHatPosition(SDL_HAT_CENTERED), _mouseX(0), _mouseY(0), _engineRunning(false)
 #if SDL_VERSION_ATLEAST(2, 0, 0)
 	  , _queuedFakeKeyUp(false), _fakeKeyUp(), _controller(nullptr)
diff --git a/backends/fs/stdiostream.cpp b/backends/fs/stdiostream.cpp
index 8afcc3c000..0ba9eacc35 100644
--- a/backends/fs/stdiostream.cpp
+++ b/backends/fs/stdiostream.cpp
@@ -126,7 +126,7 @@ StdioStream *StdioStream::makeFromPath(const Common::String &path, bool writeMod
 
 	if (handle)
 		return new StdioStream(handle);
-	return 0;
+	return nullptr;
 }
 
 #endif
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index f682625d27..18a93ce208 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -81,7 +81,7 @@ const char* WindowsFilesystemNode::tcharToChar(const TCHAR *str) {
 	return str;
 #else
 	static char multiByteString[MAX_PATH];
-	WideCharToMultiByte(CP_UTF8, 0, str, _tcslen(str) + 1, multiByteString, MAX_PATH, NULL, NULL);
+	WideCharToMultiByte(CP_UTF8, 0, str, _tcslen(str) + 1, multiByteString, MAX_PATH, nullptr, nullptr);
 	return multiByteString;
 #endif
 }
@@ -202,7 +202,7 @@ AbstractFSNode *WindowsFilesystemNode::getParent() const {
 	assert(_isValid || _isPseudoRoot);
 
 	if (_isPseudoRoot)
-		return 0;
+		return nullptr;
 
 	WindowsFilesystemNode *p = new WindowsFilesystemNode();
 	if (_path.size() > 3) {
@@ -229,7 +229,7 @@ Common::SeekableWriteStream *WindowsFilesystemNode::createWriteStream() {
 }
 
 bool WindowsFilesystemNode::createDirectory() {
-	if (CreateDirectory(charToTchar(_path.c_str()), NULL) != 0)
+	if (CreateDirectory(charToTchar(_path.c_str()), nullptr) != 0)
 		setFlags();
 
 	return _isValid && _isDirectory;
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp
index c3ed85fc61..1695517d79 100644
--- a/backends/graphics/opengl/texture.cpp
+++ b/backends/graphics/opengl/texture.cpp
@@ -91,7 +91,7 @@ void GLTexture::create() {
 	if (_width != 0 && _height != 0) {
 		// Allocate storage for OpenGL texture.
 		GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, _glIntFormat, _width, _height,
-		                     0, _glFormat, _glType, NULL));
+		                     0, _glFormat, _glType, nullptr));
 	}
 }
 
@@ -135,7 +135,7 @@ void GLTexture::setSize(uint width, uint height) {
 		if (oldWidth != _width || oldHeight != _height) {
 			bind();
 			GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, _glIntFormat, _width,
-			                     _height, 0, _glFormat, _glType, NULL));
+			                     _height, 0, _glFormat, _glType, nullptr));
 		}
 	}
 }
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 22b19554de..dd8ead495a 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -564,7 +564,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
 
 		// Read the current window position
 		int _xWindowPos;
-		SDL_GetWindowPosition(_window->getSDLWindow(), &_xWindowPos, NULL);
+		SDL_GetWindowPosition(_window->getSDLWindow(), &_xWindowPos, nullptr);
 
 		// Relocate the window to the center of the screen in case we try to draw
 		// outside the window area. In this case, _xWindowPos always returns 0.
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 4f185e3474..acc405bcba 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -59,7 +59,7 @@ void SdlGraphicsManager::deactivateManager() {
 		g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
 	}
 
-	_eventSource->setGraphicsManager(0);
+	_eventSource->setGraphicsManager(nullptr);
 }
 
 SdlGraphicsManager::State SdlGraphicsManager::getState() const {
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 91579909fb..412e9c3d01 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -59,7 +59,7 @@
 
 static OSystem::GraphicsMode s_supportedGraphicsModes[] = {
 	{"surfacesdl", _s("SDL Surface"), GFX_SURFACESDL},
-	{0, 0, 0}
+	{nullptr, nullptr, 0}
 };
 
 #if SDL_VERSION_ATLEAST(2, 0, 0)
@@ -90,7 +90,7 @@ static AspectRatio getDesiredAspectRatio() {
 	Common::String desiredAspectRatio = ConfMan.get("desired_screen_aspect_ratio");
 
 	for (size_t i = 0; i < AR_COUNT; i++) {
-		assert(desiredAspectRatioAsStrings[i] != NULL);
+		assert(desiredAspectRatioAsStrings[i] != nullptr);
 
 		if (!scumm_stricmp(desiredAspectRatio.c_str(), desiredAspectRatioAsStrings[i])) {
 			return desiredAspectRatios[i];
@@ -114,11 +114,11 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
 #if defined(WIN32) && !SDL_VERSION_ATLEAST(2, 0, 0)
 	_originalBitsPerPixel(0),
 #endif
-	_screen(0), _tmpscreen(0),
+	_screen(nullptr), _tmpscreen(nullptr),
 	_screenFormat(Graphics::PixelFormat::createFormatCLUT8()),
 	_cursorFormat(Graphics::PixelFormat::createFormatCLUT8()),
 	_useOldSrc(false),
-	_overlayscreen(0), _tmpscreen2(0),
+	_overlayscreen(nullptr), _tmpscreen2(nullptr),
 	_screenChangeCount(0),
 	_mouseData(nullptr), _mouseSurface(nullptr),
 	_mouseOrigSurface(nullptr), _cursorDontScale(false), _cursorPaletteDisabled(true),
@@ -151,7 +151,7 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
 	_videoMode.aspectRatioCorrection = false;
 #endif
 
-	_scalerPlugin = NULL;
+	_scalerPlugin = nullptr;
 	_maxExtraPixels = ScalerMan.getMaxExtraPixels();
 
 	_videoMode.fullscreen = ConfMan.getBool("fullscreen");
@@ -842,7 +842,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
 	const Uint32 aMask = ((0xFF >> format.aLoss) << format.aShift);
 	_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
 						_screenFormat.bytesPerPixel * 8, rMask, gMask, bMask, aMask);
-	if (_screen == NULL)
+	if (_screen == nullptr)
 		error("allocating _screen failed");
 
 #ifdef USE_RGB_COLOR
@@ -891,7 +891,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
 	detectSupportedFormats();
 #endif
 
-	if (_hwScreen == NULL) {
+	if (_hwScreen == nullptr) {
 		// DON'T use error(), as this tries to bring up the debug
 		// console, which WON'T WORK now that _hwScreen is hosed.
 
@@ -920,7 +920,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
 						_hwScreen->format->Bmask,
 						_hwScreen->format->Amask);
 
-	if (_tmpscreen == NULL)
+	if (_tmpscreen == nullptr)
 		error("allocating _tmpscreen failed");
 
 	if (_useOldSrc) {
@@ -936,7 +936,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
 						_hwScreen->format->Bmask,
 						_hwScreen->format->Amask);
 
-	if (_overlayscreen == NULL)
+	if (_overlayscreen == nullptr)
 		error("allocating _overlayscreen failed");
 
 	_overlayFormat = convertSDLPixelFormat(_overlayscreen->format);
@@ -949,7 +949,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
 						_hwScreen->format->Bmask,
 						_hwScreen->format->Amask);
 
-	if (_tmpscreen2 == NULL)
+	if (_tmpscreen2 == nullptr)
 		error("allocating _tmpscreen2 failed");
 
 	return true;
@@ -958,7 +958,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
 void SurfaceSdlGraphicsManager::unloadGFXMode() {
 	if (_screen) {
 		SDL_FreeSurface(_screen);
-		_screen = NULL;
+		_screen = nullptr;
 	}
 
 #if SDL_VERSION_ATLEAST(2, 0, 0)
@@ -967,33 +967,33 @@ void SurfaceSdlGraphicsManager::unloadGFXMode() {
 
 	if (_hwScreen) {
 		SDL_FreeSurface(_hwScreen);
-		_hwScreen = NULL;
+		_hwScreen = nullptr;
 	}
 
 	if (_tmpscreen) {
 		SDL_FreeSurface(_tmpscreen);
-		_tmpscreen = NULL;
+		_tmpscreen = nullptr;
 	}
 
 	if (_tmpscreen2) {
 		SDL_FreeSurface(_tmpscreen2);
-		_tmpscreen2 = NULL;
+		_tmpscreen2 = nullptr;
 	}
 
 	if (_overlayscreen) {
 		SDL_FreeSurface(_overlayscreen);
-		_overlayscreen = NULL;
+		_overlayscreen = nullptr;
 	}
 
 #ifdef USE_OSD
 	if (_osdMessageSurface) {
 		SDL_FreeSurface(_osdMessageSurface);
-		_osdMessageSurface = NULL;
+		_osdMessageSurface = nullptr;
 	}
 
 	if (_osdIconSurface) {
 		SDL_FreeSurface(_osdIconSurface);
-		_osdIconSurface = NULL;
+		_osdIconSurface = nullptr;
 	}
 #endif
 
@@ -1013,22 +1013,22 @@ bool SurfaceSdlGraphicsManager::hotswapGFXMode() {
 	// Keep around the old _screen & _overlayscreen so we can restore the screen data
 	// after the mode switch.
 	SDL_Surface *old_screen = _screen;
-	_screen = NULL;
+	_screen = nullptr;
 	SDL_Surface *old_overlayscreen = _overlayscreen;
-	_overlayscreen = NULL;
+	_overlayscreen = nullptr;
 
 	// Release the HW screen surface
 	if (_hwScreen) {
 		SDL_FreeSurface(_hwScreen);
-		_hwScreen = NULL;
+		_hwScreen = nullptr;
 	}
 	if (_tmpscreen) {
 		SDL_FreeSurface(_tmpscreen);
-		_tmpscreen = NULL;
+		_tmpscreen = nullptr;
 	}
 	if (_tmpscreen2) {
 		SDL_FreeSurface(_tmpscreen2);
-		_tmpscreen2 = NULL;
+		_tmpscreen2 = nullptr;
 	}
 
 	// Setup the new GFX mode
@@ -1045,8 +1045,8 @@ bool SurfaceSdlGraphicsManager::hotswapGFXMode() {
 	SDL_SetColors(_screen, _currentPalette, 0, 256);
 
 	// Restore old screen content
-	SDL_BlitSurface(old_screen, NULL, _screen, NULL);
-	SDL_BlitSurface(old_overlayscreen, NULL, _overlayscreen, NULL);
+	SDL_BlitSurface(old_screen, nullptr, _screen, nullptr);
+	SDL_BlitSurface(old_overlayscreen, nullptr, _overlayscreen, nullptr);
 
 	// Free the old surfaces
 	SDL_FreeSurface(old_screen);
@@ -1133,7 +1133,7 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 			// do that in theory, but it won't unless the factor actually changes (which it doesn't). Now, the code
 			// in SourceScaler::setSource() looks a bit fishy, e. g. the *src argument isn't even used. But otherwise
 			// it does what we want here at least...
-			_scalerPlugin->setSource(0, _tmpscreen->pitch, _videoMode.screenWidth, _videoMode.screenHeight, _maxExtraPixels);
+			_scalerPlugin->setSource(nullptr, _tmpscreen->pitch, _videoMode.screenWidth, _videoMode.screenHeight, _maxExtraPixels);
 		}
 
 		origSurf = _screen;
@@ -1346,7 +1346,7 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 }
 
 bool SurfaceSdlGraphicsManager::saveScreenshot(const Common::String &filename) const {
-	assert(_hwScreen != NULL);
+	assert(_hwScreen != nullptr);
 
 	Common::StackLock lock(_graphicsMutex);
 
@@ -1420,7 +1420,7 @@ void SurfaceSdlGraphicsManager::copyRectToScreen(const void *buf, int pitch, int
 	assert(_transactionMode == kTransactionNone);
 	assert(buf);
 
-	if (_screen == NULL) {
+	if (_screen == nullptr) {
 		warning("SurfaceSdlGraphicsManager::copyRectToScreen: _screen == NULL");
 		return;
 	}
@@ -1715,7 +1715,7 @@ void SurfaceSdlGraphicsManager::clearOverlay() {
 void SurfaceSdlGraphicsManager::grabOverlay(Graphics::Surface &surface) const {
 	assert(_transactionMode == kTransactionNone);
 
-	if (_overlayscreen == NULL)
+	if (_overlayscreen == nullptr)
 		return;
 
 	if (SDL_LockSurface(_overlayscreen) == -1)
@@ -1736,7 +1736,7 @@ void SurfaceSdlGraphicsManager::grabOverlay(Graphics::Surface &surface) const {
 void SurfaceSdlGraphicsManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
 	assert(_transactionMode == kTransactionNone);
 
-	if (_overlayscreen == NULL)
+	if (_overlayscreen == nullptr)
 		return;
 
 	const byte *src = (const byte *)buf;
@@ -2332,7 +2332,7 @@ void SurfaceSdlGraphicsManager::removeOSDMessage() {
 		_forceRedraw = true;
 	}
 
-	_osdMessageSurface = NULL;
+	_osdMessageSurface = nullptr;
 	_osdMessageAlpha = SDL_ALPHA_TRANSPARENT;
 }
 
@@ -2367,12 +2367,12 @@ void SurfaceSdlGraphicsManager::updateOSD() {
 void SurfaceSdlGraphicsManager::drawOSD() {
 	if (_osdMessageSurface) {
 		SDL_Rect dstRect = getOSDMessageRect();
-		SDL_BlitSurface(_osdMessageSurface, 0, _hwScreen, &dstRect);
+		SDL_BlitSurface(_osdMessageSurface, nullptr, _hwScreen, &dstRect);
 	}
 
 	if (_osdIconSurface) {
 		SDL_Rect dstRect = getOSDIconRect();
-		SDL_BlitSurface(_osdIconSurface, 0, _hwScreen, &dstRect);
+		SDL_BlitSurface(_osdIconSurface, nullptr, _hwScreen, &dstRect);
 	}
 }
 
@@ -2632,7 +2632,7 @@ void SurfaceSdlGraphicsManager::SDL_UpdateRects(SDL_Surface *screen, int numrect
 	viewport.h = _activeArea.drawRect.height();
 
 	SDL_RenderClear(_renderer);
-	SDL_RenderCopy(_renderer, _screenTexture, NULL, &viewport);
+	SDL_RenderCopy(_renderer, _screenTexture, nullptr, &viewport);
 	SDL_RenderPresent(_renderer);
 }
 
diff --git a/backends/keymapper/hardware-input.cpp b/backends/keymapper/hardware-input.cpp
index ba8cce6492..505a1c1250 100644
--- a/backends/keymapper/hardware-input.cpp
+++ b/backends/keymapper/hardware-input.cpp
@@ -229,7 +229,7 @@ const KeyTableEntry defaultKeys[] = {
 	{"LMETA",     KEYCODE_LMETA,     "Left "  META_KEY_NAME },
 	{"RMETA",     KEYCODE_RMETA,     "Right " META_KEY_NAME },
 
-	{0, KEYCODE_INVALID, 0}
+	{nullptr, KEYCODE_INVALID, nullptr}
 };
 
 // TODO: Add NUM_LOCK
diff --git a/backends/log/log.cpp b/backends/log/log.cpp
index 829fc3b1ad..db602ecd59 100644
--- a/backends/log/log.cpp
+++ b/backends/log/log.cpp
@@ -32,7 +32,7 @@ namespace Backends {
 namespace Log {
 
 Log::Log(OSystem *system)
-	: _system(system), _stream(0), _startOfLine(true) {
+	: _system(system), _stream(nullptr), _startOfLine(true) {
 	assert(system);
 }
 
@@ -58,7 +58,7 @@ void Log::close() {
 		print("--- Log closed successfully.\n");
 
 		delete _stream;
-		_stream = 0;
+		_stream = nullptr;
 	}
 }
 
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index 73ebd1e373..62deae6102 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -69,7 +69,7 @@ int MidiDriver_WIN::open() {
 	if (_isOpen)
 		return MERR_ALREADY_OPEN;
 
-	_streamEvent = CreateEvent(NULL, true, true, NULL);
+	_streamEvent = CreateEvent(nullptr, true, true, nullptr);
 	MMRESULT res = midiOutOpen((HMIDIOUT *)&_mo, _device, (DWORD_PTR)_streamEvent, 0, CALLBACK_EVENT);
 	if (res != MMSYSERR_NOERROR) {
 		check_error(res);
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp
index 25d267006f..c56edaa26e 100644
--- a/backends/mixer/sdl/sdl-mixer.cpp
+++ b/backends/mixer/sdl/sdl-mixer.cpp
@@ -85,7 +85,7 @@ void SdlMixerManager::init() {
 		debug(1, "SDL mixer sound format: %d differs from desired: %d", _obtained.format, desired.format);
 		SDL_CloseAudio();
 
-		if (SDL_OpenAudio(&fmt, NULL) != 0) {
+		if (SDL_OpenAudio(&fmt, nullptr) != 0) {
 			warning("Could not open audio device: %s", SDL_GetError());
 
 			// The mixer is not marked as ready
@@ -204,7 +204,7 @@ void SdlMixerManager::suspendAudio() {
 int SdlMixerManager::resumeAudio() {
 	if (!_audioSuspended)
 		return -2;
-	if (SDL_OpenAudio(&_obtained, NULL) < 0) {
+	if (SDL_OpenAudio(&_obtained, nullptr) < 0) {
 		return -1;
 	}
 	SDL_PauseAudio(0);
diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp
index 63ecfeb93d..a0e1010b9d 100644
--- a/backends/modular-backend.cpp
+++ b/backends/modular-backend.cpp
@@ -33,13 +33,13 @@
 
 ModularGraphicsBackend::ModularGraphicsBackend()
 	:
-	_graphicsManager(0) {
+	_graphicsManager(nullptr) {
 
 }
 
 ModularGraphicsBackend::~ModularGraphicsBackend() {
 	delete _graphicsManager;
-	_graphicsManager = 0;
+	_graphicsManager = nullptr;
 }
 
 bool ModularGraphicsBackend::hasFeature(Feature f) {
@@ -293,16 +293,16 @@ void ModularGraphicsBackend::saveScreenshot() {
 
 ModularMixerBackend::ModularMixerBackend()
 	:
-	_mixerManager(0) {
+	_mixerManager(nullptr) {
 
 }
 
 ModularMixerBackend::~ModularMixerBackend() {
 	// _audiocdManager needs to be deleted before _mixerManager to avoid a crash.
 	delete _audiocdManager;
-	_audiocdManager = 0;
+	_audiocdManager = nullptr;
 	delete _mixerManager;
-	_mixerManager = 0;
+	_mixerManager = nullptr;
 }
 
 MixerManager *ModularMixerBackend::getMixerManager() {
diff --git a/backends/networking/curl/connectionmanager.cpp b/backends/networking/curl/connectionmanager.cpp
index 21381d9a3d..2190e15b5c 100644
--- a/backends/networking/curl/connectionmanager.cpp
+++ b/backends/networking/curl/connectionmanager.cpp
@@ -38,7 +38,7 @@ DECLARE_SINGLETON(Networking::ConnectionManager);
 
 namespace Networking {
 
-ConnectionManager::ConnectionManager(): _multi(0), _timerStarted(false), _frame(0) {
+ConnectionManager::ConnectionManager(): _multi(nullptr), _timerStarted(false), _frame(0) {
 	curl_global_init(CURL_GLOBAL_ALL);
 	_multi = curl_multi_init();
 }
@@ -130,7 +130,7 @@ void connectionsThread(void *ignored) {
 
 void ConnectionManager::startTimer(int interval) {
 	Common::TimerManager *manager = g_system->getTimerManager();
-	if (manager->installTimerProc(connectionsThread, interval, 0, "Networking::ConnectionManager's Timer")) {
+	if (manager->installTimerProc(connectionsThread, interval, nullptr, "Networking::ConnectionManager's Timer")) {
 		_timerStarted = true;
 	} else {
 		warning("Failed to install Networking::ConnectionManager's timer");
diff --git a/backends/networking/sdl_net/localwebserver.cpp b/backends/networking/sdl_net/localwebserver.cpp
index bd5806ee80..e56398a5dc 100644
--- a/backends/networking/sdl_net/localwebserver.cpp
+++ b/backends/networking/sdl_net/localwebserver.cpp
@@ -84,7 +84,7 @@ void localWebserverTimer(void *ignored) {
 
 void LocalWebserver::startTimer(int interval) {
 	Common::TimerManager *manager = g_system->getTimerManager();
-	if (manager->installTimerProc(localWebserverTimer, interval, 0, "Networking::LocalWebserver's Timer")) {
+	if (manager->installTimerProc(localWebserverTimer, interval, nullptr, "Networking::LocalWebserver's Timer")) {
 		_timerStarted = true;
 	} else {
 		warning("Failed to install Networking::LocalWebserver's timer");
@@ -110,7 +110,7 @@ void LocalWebserver::start(bool useMinimalMode) {
 
 	// Create a listening TCP socket
 	IPaddress ip;
-	if (SDLNet_ResolveHost(&ip, NULL, _serverPort) == -1) {
+	if (SDLNet_ResolveHost(&ip, nullptr, _serverPort) == -1) {
 		error("LocalWebserver: SDLNet_ResolveHost: %s\n", SDLNet_GetError());
 	}
 
@@ -286,7 +286,7 @@ void LocalWebserver::resolveAddress(void *ipAddress) {
 
 	// default way (might work everywhere, surely works on Windows)
 	const char *name = SDLNet_ResolveIP(ip);
-	if (name == NULL) {
+	if (name == nullptr) {
 		warning("LocalWebserver: SDLNet_ResolveIP: %s", SDLNet_GetError());
 	} else {
 		IPaddress localIp;
diff --git a/backends/platform/psp/png_loader.cpp b/backends/platform/psp/png_loader.cpp
index 502ebf52cc..f23a8533f4 100644
--- a/backends/platform/psp/png_loader.cpp
+++ b/backends/platform/psp/png_loader.cpp
@@ -106,15 +106,15 @@ void PngLoader::libReadFunc(png_structp pngPtr, png_bytep data, png_size_t lengt
 
 bool PngLoader::basicImageLoad() {
 	DEBUG_ENTER_FUNC();
-	_pngPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+	_pngPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
 	if (!_pngPtr)
 		return false;
 
-	png_set_error_fn(_pngPtr, (png_voidp) NULL, (png_error_ptr) NULL, warningFn);
+	png_set_error_fn(_pngPtr, (png_voidp) nullptr, (png_error_ptr) nullptr, warningFn);
 
 	_infoPtr = png_create_info_struct(_pngPtr);
 	if (!_infoPtr) {
-		png_destroy_read_struct(&_pngPtr, NULL, NULL);
+		png_destroy_read_struct(&_pngPtr, nullptr, nullptr);
 		return false;
 	}
 	// Set the png lib to use our read function
@@ -126,12 +126,12 @@ bool PngLoader::basicImageLoad() {
 	png_read_info(_pngPtr, _infoPtr);
 	int interlaceType;
 	png_get_IHDR(_pngPtr, _infoPtr, (png_uint_32 *)&_width, (png_uint_32 *)&_height, &_bitDepth,
-		&_colorType, &interlaceType, NULL, NULL);
+		&_colorType, &interlaceType, nullptr, nullptr);
 	_channels = png_get_channels(_pngPtr, _infoPtr);
 
 	if (_colorType & PNG_COLOR_MASK_PALETTE) {
 		int paletteSize;
-		png_get_PLTE(_pngPtr, _infoPtr, NULL, &paletteSize);
+		png_get_PLTE(_pngPtr, _infoPtr, nullptr, &paletteSize);
 		_paletteSize = paletteSize;
 	}
 
@@ -145,7 +145,7 @@ bool PngLoader::findImageDimensions() {
 	bool status = basicImageLoad();
 
 	PSP_DEBUG_PRINT("width[%d], height[%d], paletteSize[%d], bitDepth[%d], channels[%d], rowBytes[%d]\n", _width, _height, _paletteSize, _bitDepth, _channels, png_get_rowbytes(_pngPtr, _infoPtr));
-	png_destroy_read_struct(&_pngPtr, &_infoPtr, NULL);
+	png_destroy_read_struct(&_pngPtr, &_infoPtr, nullptr);
 	return status;
 }
 
@@ -156,7 +156,7 @@ bool PngLoader::loadImageIntoBuffer() {
 	DEBUG_ENTER_FUNC();
 
 	if (!basicImageLoad()) {
-		png_destroy_read_struct(&_pngPtr, &_infoPtr, NULL);
+		png_destroy_read_struct(&_pngPtr, &_infoPtr, nullptr);
 		return false;
 	}
 	png_set_strip_16(_pngPtr);		// Strip off 16 bit channels in case they occur
@@ -197,18 +197,18 @@ bool PngLoader::loadImageIntoBuffer() {
 
 	unsigned char *line = (unsigned char*) malloc(rowBytes);
 	if (!line) {
-		png_destroy_read_struct(&_pngPtr, NULL, NULL);
+		png_destroy_read_struct(&_pngPtr, nullptr, nullptr);
 		PSP_ERROR("Couldn't allocate line\n");
 		return false;
 	}
 
 	for (size_t y = 0; y < _height; y++) {
-		png_read_row(_pngPtr, line, NULL);
+		png_read_row(_pngPtr, line, nullptr);
 		_buffer->copyFromRect(line, rowBytes, 0, y, _width, 1);	// Copy into buffer
 	}
 	free(line);
 	png_read_end(_pngPtr, _infoPtr);
-	png_destroy_read_struct(&_pngPtr, &_infoPtr, NULL);
+	png_destroy_read_struct(&_pngPtr, &_infoPtr, nullptr);
 
 	return true;
 }
diff --git a/backends/platform/psp/psppixelformat.cpp b/backends/platform/psp/psppixelformat.cpp
index 999c4fa973..f83641864d 100644
--- a/backends/platform/psp/psppixelformat.cpp
+++ b/backends/platform/psp/psppixelformat.cpp
@@ -71,7 +71,7 @@ void PSPPixelFormat::convertFromScummvmPixelFormat(const Graphics::PixelFormat *
 		PSPPixelFormat::Type &paletteType,
 		bool &swapRedBlue) {
 	swapRedBlue = false;	 // no red-blue swap by default
-	PSPPixelFormat::Type *target = 0;	// which one we'll be filling
+	PSPPixelFormat::Type *target = nullptr;	// which one we'll be filling
 
 	if (!pf) {	// Default, pf is NULL
 		bufferType = Type_Palette_8bit;
diff --git a/backends/platform/sdl/opendingux/opendingux.cpp b/backends/platform/sdl/opendingux/opendingux.cpp
index a3c84d244b..f46817f5b0 100644
--- a/backends/platform/sdl/opendingux/opendingux.cpp
+++ b/backends/platform/sdl/opendingux/opendingux.cpp
@@ -57,7 +57,7 @@ static const Common::KeyTableEntry odKeyboardButtons[] = {
 	{ "JOY_DOWN",		Common::KEYCODE_DOWN,		_s("D-pad Down")	},
 	{ "JOY_LEFT",		Common::KEYCODE_LEFT,		_s("D-pad Left")	},
 	{ "JOY_RIGHT",		Common::KEYCODE_RIGHT,		_s("D-pad Right")	},
-	{0,			Common::KEYCODE_INVALID,	0			}
+	{nullptr,			Common::KEYCODE_INVALID,	nullptr			}
 };
 
 static const Common::HardwareInputTableEntry odJoystickButtons[] = {
@@ -145,7 +145,7 @@ void OSystem_SDL_Opendingux::initBackend() {
         }
 #endif
 	// Create the savefile manager
-	if (_savefileManager == 0) {
+	if (_savefileManager == nullptr) {
 		_savefileManager = new DefaultSaveFileManager(SAVE_PATH);
 	}
 
diff --git a/backends/platform/sdl/sdl-window.cpp b/backends/platform/sdl/sdl-window.cpp
index e94211b9cd..70b2e6444a 100644
--- a/backends/platform/sdl/sdl-window.cpp
+++ b/backends/platform/sdl/sdl-window.cpp
@@ -258,7 +258,7 @@ void SdlWindow::getDisplayDpi(float *dpi, float *defaultDpi) const {
 
 	if (dpi) {
 #if SDL_VERSION_ATLEAST(2, 0, 4)
-		if (SDL_GetDisplayDPI(getDisplayIndex(), NULL, dpi, NULL) != 0) {
+		if (SDL_GetDisplayDPI(getDisplayIndex(), nullptr, dpi, nullptr) != 0) {
 			*dpi = systemDpi;
 		}
 #else
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 04ed348d50..ac8b95cad8 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -87,10 +87,10 @@ OSystem_SDL::OSystem_SDL()
 #ifdef USE_SDL_NET
 	_initedSDLnet(false),
 #endif
-	_logger(0),
-	_eventSource(0),
+	_logger(nullptr),
+	_eventSource(nullptr),
 	_eventSourceWrapper(nullptr),
-	_window(0) {
+	_window(nullptr) {
 }
 
 OSystem_SDL::~OSystem_SDL() {
@@ -105,24 +105,24 @@ OSystem_SDL::~OSystem_SDL() {
 	// of our managers must be deleted *before* we call SDL_Quit().
 	// Hence, we perform the destruction on our own.
 	delete _savefileManager;
-	_savefileManager = 0;
+	_savefileManager = nullptr;
 	if (_graphicsManager) {
 		dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->deactivateManager();
 	}
 	delete _graphicsManager;
-	_graphicsManager = 0;
+	_graphicsManager = nullptr;
 	delete _window;
-	_window = 0;
+	_window = nullptr;
 	delete _eventManager;
-	_eventManager = 0;
+	_eventManager = nullptr;
 	delete _eventSourceWrapper;
 	_eventSourceWrapper = nullptr;
 	delete _eventSource;
-	_eventSource = 0;
+	_eventSource = nullptr;
 	delete _audiocdManager;
-	_audiocdManager = 0;
+	_audiocdManager = nullptr;
 	delete _mixerManager;
-	_mixerManager = 0;
+	_mixerManager = nullptr;
 
 #ifdef ENABLE_EVENTRECORDER
 	// HACK HACK HACK
@@ -132,10 +132,10 @@ OSystem_SDL::~OSystem_SDL() {
 	delete _timerManager;
 #endif
 
-	_timerManager = 0;
+	_timerManager = nullptr;
 
 	delete _logger;
-	_logger = 0;
+	_logger = nullptr;
 
 #ifdef USE_DISCORD
 	delete _presence;
@@ -161,11 +161,11 @@ void OSystem_SDL::init() {
 	// Disable OS cursor
 	SDL_ShowCursor(SDL_DISABLE);
 
-	if (_window == 0)
+	if (_window == nullptr)
 		_window = new SdlWindow();
 
 #if defined(USE_TASKBAR)
-	if (_taskbarManager == 0)
+	if (_taskbarManager == nullptr)
 		_taskbarManager = new Common::TaskbarManager();
 #endif
 
@@ -232,7 +232,7 @@ void OSystem_SDL::initBackend() {
 	// Search for legacy gfx_mode and replace it
 	ScalerMan.updateOldSettings();
 
-	if (_graphicsManager == 0) {
+	if (_graphicsManager == nullptr) {
 #ifdef USE_OPENGL
 		// Setup a list with both SDL and OpenGL graphics modes. We only do
 		// this whenever the subclass did not already set up an graphics
@@ -263,15 +263,15 @@ void OSystem_SDL::initBackend() {
 		}
 #endif
 
-		if (_graphicsManager == 0) {
+		if (_graphicsManager == nullptr) {
 			_graphicsManager = new SurfaceSdlGraphicsManager(_eventSource, _window);
 		}
 	}
 
-	if (_savefileManager == 0)
+	if (_savefileManager == nullptr)
 		_savefileManager = new DefaultSaveFileManager();
 
-	if (_mixerManager == 0) {
+	if (_mixerManager == nullptr) {
 		_mixerManager = new SdlMixerManager();
 		// Setup and start mixer
 		_mixerManager->init();
@@ -282,7 +282,7 @@ void OSystem_SDL::initBackend() {
 
 	g_eventRec.registerTimerManager(new SdlTimerManager());
 #else
-	if (_timerManager == 0)
+	if (_timerManager == nullptr)
 		_timerManager = new SdlTimerManager();
 #endif
 
@@ -518,7 +518,7 @@ Common::HardwareInputSet *OSystem_SDL::getHardwareInputSet() {
 
 void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) {
 	// First log to stdout/stderr
-	FILE *output = 0;
+	FILE *output = nullptr;
 
 	if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
 		output = stdout;
@@ -665,7 +665,7 @@ void OSystem_SDL::delayMillis(uint msecs) {
 }
 
 void OSystem_SDL::getTimeAndDate(TimeDate &td, bool skipRecord) const {
-	time_t curTime = time(0);
+	time_t curTime = time(nullptr);
 	struct tm t = *localtime(&curTime);
 	td.tm_sec = t.tm_sec;
 	td.tm_min = t.tm_min;
@@ -818,12 +818,12 @@ bool OSystem_SDL::setGraphicsMode(int mode, uint flags) {
 		}
 
 		// Next setup the cursor again
-		CursorMan.pushCursor(0, 0, 0, 0, 0, 0);
+		CursorMan.pushCursor(nullptr, 0, 0, 0, 0, 0);
 		CursorMan.popCursor();
 
 		// Next setup cursor palette if needed
 		if (_graphicsManager->getFeatureState(kFeatureCursorPalette)) {
-			CursorMan.pushCursorPalette(0, 0, 0);
+			CursorMan.pushCursorPalette(nullptr, 0, 0);
 			CursorMan.popCursorPalette();
 		}
 
diff --git a/backends/platform/sdl/win32/win32-window.cpp b/backends/platform/sdl/win32/win32-window.cpp
index 47d77a8ad1..fdcd6139e8 100644
--- a/backends/platform/sdl/win32/win32-window.cpp
+++ b/backends/platform/sdl/win32/win32-window.cpp
@@ -31,7 +31,7 @@
 #include <windows.h>
 
 void SdlWindow_Win32::setupIcon() {
-	HMODULE handle = GetModuleHandle(NULL);
+	HMODULE handle = GetModuleHandle(nullptr);
 	HICON   ico    = LoadIcon(handle, MAKEINTRESOURCE(1001 /* IDI_ICON */));
 	if (ico) {
 		HWND hwnd = getHwnd();
@@ -60,7 +60,7 @@ HWND SdlWindow_Win32::getHwnd() {
 		return wminfo.window;
 #endif
 	}
-	return NULL;
+	return nullptr;
 }
 
 #endif
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index bb972c8927..b69ce7c021 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -87,7 +87,7 @@ void OSystem_Win32::init() {
 
 WORD GetCurrentSubsystem() {
 	// HMODULE is the module base address. And the PIMAGE_DOS_HEADER is located at the beginning.
-	PIMAGE_DOS_HEADER EXEHeader = (PIMAGE_DOS_HEADER)GetModuleHandle(NULL);
+	PIMAGE_DOS_HEADER EXEHeader = (PIMAGE_DOS_HEADER)GetModuleHandle(nullptr);
 	assert(EXEHeader->e_magic == IMAGE_DOS_SIGNATURE);
 	// PIMAGE_NT_HEADERS is bitness dependant.
 	// Conveniently, since it's for our own process, it's always the correct bitness.
@@ -160,7 +160,7 @@ bool OSystem_Win32::displayLogFile() {
 	// Try opening the log file with the default text editor
 	// log files should be registered as "txtfile" by default and thus open in the default text editor
 	TCHAR *tLogFilePath = Win32::stringToTchar(_logFilePath);
-	HINSTANCE shellExec = ShellExecute(getHwnd(), NULL, tLogFilePath, NULL, NULL, SW_SHOWNORMAL);
+	HINSTANCE shellExec = ShellExecute(getHwnd(), nullptr, tLogFilePath, nullptr, nullptr, SW_SHOWNORMAL);
 	if ((intptr_t)shellExec > 32) {
 		free(tLogFilePath);
 		return true;
@@ -175,14 +175,14 @@ bool OSystem_Win32::displayLogFile() {
 
 	TCHAR cmdLine[MAX_PATH * 2];  // CreateProcess may change the contents of cmdLine
 	_stprintf(cmdLine, TEXT("rundll32 shell32.dll,OpenAs_RunDLL %s"), tLogFilePath);
-	BOOL result = CreateProcess(NULL,
+	BOOL result = CreateProcess(nullptr,
 	                            cmdLine,
-	                            NULL,
-	                            NULL,
+	                            nullptr,
+	                            nullptr,
 	                            FALSE,
 	                            NORMAL_PRIORITY_CLASS,
-	                            NULL,
-	                            NULL,
+	                            nullptr,
+	                            nullptr,
 	                            &startupInfo,
 	                            &processInformation);
 	free(tLogFilePath);
@@ -197,7 +197,7 @@ bool OSystem_Win32::displayLogFile() {
 
 bool OSystem_Win32::openUrl(const Common::String &url) {
 	TCHAR *tUrl = Win32::stringToTchar(url);
-	HINSTANCE result = ShellExecute(getHwnd(), NULL, tUrl, NULL, NULL, SW_SHOWNORMAL);
+	HINSTANCE result = ShellExecute(getHwnd(), nullptr, tUrl, nullptr, nullptr, SW_SHOWNORMAL);
 	free(tUrl);
 	// ShellExecute returns a value greater than 32 if successful
 	if ((intptr_t)result <= 32) {
@@ -252,7 +252,7 @@ Common::String OSystem_Win32::getScreenshotsPath() {
 		_tcscat(picturesPath, TEXT("\\Screenshots\\"));
 	} else {
 		// Use the My Pictures folder
-		if (SHGetFolderPathFunc(NULL, CSIDL_MYPICTURES, NULL, SHGFP_TYPE_CURRENT, picturesPath) != S_OK) {
+		if (SHGetFolderPathFunc(nullptr, CSIDL_MYPICTURES, nullptr, SHGFP_TYPE_CURRENT, picturesPath) != S_OK) {
 			warning("Unable to access My Pictures directory");
 			return Common::String();
 		}
@@ -261,7 +261,7 @@ Common::String OSystem_Win32::getScreenshotsPath() {
 
 	// If the directory already exists (as it should in most cases),
 	// we don't want to fail, but we need to stop on other errors (such as ERROR_PATH_NOT_FOUND)
-	if (!CreateDirectory(picturesPath, NULL)) {
+	if (!CreateDirectory(picturesPath, nullptr)) {
 		if (GetLastError() != ERROR_ALREADY_EXISTS)
 			error("Cannot create ScummVM Screenshots folder");
 	}
@@ -289,8 +289,8 @@ Common::String OSystem_Win32::getDefaultConfigFileName() {
 		if (Win32::getApplicationDataDirectory(configFile)) {
 			_tcscat(configFile, TEXT("\\" DEFAULT_CONFIG_FILE));
 
-			FILE *tmp = NULL;
-			if ((tmp = _tfopen(configFile, TEXT("r"))) == NULL) {
+			FILE *tmp = nullptr;
+			if ((tmp = _tfopen(configFile, TEXT("r"))) == nullptr) {
 				// Check windows directory
 				TCHAR oldConfigFile[MAX_PATH];
 				uint ret = GetWindowsDirectory(oldConfigFile, MAX_PATH);
@@ -330,7 +330,7 @@ Common::String OSystem_Win32::getDefaultLogFileName() {
 			return Common::String();
 		}
 		_tcscat(logFile, TEXT("\\Logs"));
-		CreateDirectory(logFile, NULL);
+		CreateDirectory(logFile, nullptr);
 	}
 
 	_tcscat(logFile, TEXT("\\scummvm.log"));
@@ -349,7 +349,7 @@ bool OSystem_Win32::detectPortableConfigFile() {
 	Win32::getProcessDirectory(portableConfigFile, MAX_PATH);
 	_tcscat(portableConfigFile, TEXT("\\" DEFAULT_CONFIG_FILE));
 	FILE *file = _tfopen(portableConfigFile, TEXT("r"));
-	if (file == NULL) {
+	if (file == nullptr) {
 		return false;
 	}
 	fclose(file);
@@ -359,7 +359,7 @@ bool OSystem_Win32::detectPortableConfigFile() {
 	// (Notepad++ does this too.)
 	if (Win32::confirmWindowsVersion(6, 0)) {
 		TCHAR programFiles[MAX_PATH];
-		if (SHGetFolderPathFunc(NULL, CSIDL_PROGRAM_FILES, NULL, SHGFP_TYPE_CURRENT, programFiles) == S_OK) {
+		if (SHGetFolderPathFunc(nullptr, CSIDL_PROGRAM_FILES, nullptr, SHGFP_TYPE_CURRENT, programFiles) == S_OK) {
 			_tcscat(portableConfigFile, TEXT("\\"));
 			if (_tcsstr(portableConfigFile, programFiles) == portableConfigFile) {
 				return false;
@@ -398,7 +398,7 @@ BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName
 }
 
 Win32ResourceArchive::Win32ResourceArchive() {
-	EnumResourceNames(NULL, MAKEINTRESOURCE(256), &EnumResNameProc, (LONG_PTR)this);
+	EnumResourceNames(nullptr, MAKEINTRESOURCE(256), &EnumResNameProc, (LONG_PTR)this);
 }
 
 bool Win32ResourceArchive::hasFile(const Common::Path &path) const {
@@ -428,26 +428,26 @@ const Common::ArchiveMemberPtr Win32ResourceArchive::getMember(const Common::Pat
 Common::SeekableReadStream *Win32ResourceArchive::createReadStreamForMember(const Common::Path &path) const {
 	Common::String name = path.toString();
 	TCHAR *tName = Win32::stringToTchar(name);
-	HRSRC resource = FindResource(NULL, tName, MAKEINTRESOURCE(256));
+	HRSRC resource = FindResource(nullptr, tName, MAKEINTRESOURCE(256));
 	free(tName);
 
-	if (resource == NULL)
-		return 0;
+	if (resource == nullptr)
+		return nullptr;
 
-	HGLOBAL handle = LoadResource(NULL, resource);
+	HGLOBAL handle = LoadResource(nullptr, resource);
 
-	if (handle == NULL)
-		return 0;
+	if (handle == nullptr)
+		return nullptr;
 
 	const byte *data = (const byte *)LockResource(handle);
 
-	if (data == NULL)
-		return 0;
+	if (data == nullptr)
+		return nullptr;
 
-	uint32 size = SizeofResource(NULL, resource);
+	uint32 size = SizeofResource(nullptr, resource);
 
 	if (size == 0)
-		return 0;
+		return nullptr;
 
 	return new Common::MemoryReadStream(data, size);
 }
diff --git a/backends/platform/sdl/win32/win32_wrapper.cpp b/backends/platform/sdl/win32/win32_wrapper.cpp
index 2f7a1c099f..3db3bc38ce 100644
--- a/backends/platform/sdl/win32/win32_wrapper.cpp
+++ b/backends/platform/sdl/win32/win32_wrapper.cpp
@@ -40,7 +40,7 @@ ULONGLONG VerSetConditionMaskFunc(ULONGLONG dwlConditionMask, DWORD dwTypeMask,
 	typedef ULONGLONG(WINAPI *VerSetConditionMaskFunction)(ULONGLONG conditionMask, DWORD typeMask, BYTE conditionOperator);
 
 	VerSetConditionMaskFunction verSetConditionMask = (VerSetConditionMaskFunction)(void *)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "VerSetConditionMask");
-	if (verSetConditionMask == NULL)
+	if (verSetConditionMask == nullptr)
 		return 0;
 
 	return verSetConditionMask(dwlConditionMask, dwTypeMask, dwConditionMask);
@@ -50,7 +50,7 @@ BOOL VerifyVersionInfoFunc(LPOSVERSIONINFOEXA lpVersionInformation, DWORD dwType
 	typedef BOOL(WINAPI *VerifyVersionInfoFunction)(LPOSVERSIONINFOEXA versionInformation, DWORD typeMask, DWORDLONG conditionMask);
 
 	VerifyVersionInfoFunction verifyVersionInfo = (VerifyVersionInfoFunction)(void *)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "VerifyVersionInfoA");
-	if (verifyVersionInfo == NULL)
+	if (verifyVersionInfo == nullptr)
 		return FALSE;
 
 	return verifyVersionInfo(lpVersionInformation, dwTypeMask, dwlConditionMask);
@@ -129,7 +129,7 @@ wchar_t *ansiToUnicode(const char *s) {
 #else
 	uint codePage = CP_UTF8;
 #endif
-	DWORD size = MultiByteToWideChar(codePage, 0, s, -1, NULL, 0);
+	DWORD size = MultiByteToWideChar(codePage, 0, s, -1, nullptr, 0);
 
 	if (size > 0) {
 		LPWSTR result = (LPWSTR)calloc(size, sizeof(WCHAR));
@@ -137,7 +137,7 @@ wchar_t *ansiToUnicode(const char *s) {
 			return result;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 char *unicodeToAnsi(const wchar_t *s) {
@@ -146,15 +146,15 @@ char *unicodeToAnsi(const wchar_t *s) {
 #else
 	uint codePage = CP_UTF8;
 #endif
-	DWORD size = WideCharToMultiByte(codePage, 0, s, -1, NULL, 0, 0, 0);
+	DWORD size = WideCharToMultiByte(codePage, 0, s, -1, nullptr, 0, nullptr, nullptr);
 
 	if (size > 0) {
 		char *result = (char *)calloc(size, sizeof(char));
-		if (WideCharToMultiByte(codePage, 0, s, -1, result, size, 0, 0) != 0)
+		if (WideCharToMultiByte(codePage, 0, s, -1, result, size, nullptr, nullptr) != 0)
 			return result;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 TCHAR *stringToTchar(const Common::String& s) {
@@ -188,7 +188,7 @@ char **getArgvUtf8(int *argc) {
 	for (int i = 0; i < *argc; ++i) {
 		argv[i] = Win32::unicodeToAnsi(wargv[i]);
 	}
-	argv[*argc] = NULL; // null terminated array
+	argv[*argc] = nullptr; // null terminated array
 
 	LocalFree(wargv);
 	return argv;
diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp
index 753a1c1fcb..67848076f4 100644
--- a/backends/saves/savefile.cpp
+++ b/backends/saves/savefile.cpp
@@ -81,10 +81,10 @@ int64 OutSaveFile::size() const {
 }
 
 bool SaveFileManager::copySavefile(const String &oldFilename, const String &newFilename, bool compress) {
-	InSaveFile *inFile = 0;
-	OutSaveFile *outFile = 0;
+	InSaveFile *inFile = nullptr;
+	OutSaveFile *outFile = nullptr;
 	uint32 size = 0;
-	void *buffer = 0;
+	void *buffer = nullptr;
 	bool success = false;
 
 	inFile = openForLoading(oldFilename);
@@ -100,7 +100,7 @@ bool SaveFileManager::copySavefile(const String &oldFilename, const String &newF
 			inFile->read(buffer, size);
 			bool error = inFile->err();
 			delete inFile;
-			inFile = 0;
+			inFile = nullptr;
 
 			if (!error) {
 				outFile->write(buffer, size);
diff --git a/backends/saves/windows/windows-saves.cpp b/backends/saves/windows/windows-saves.cpp
index 39a32cf422..8f3e1b9623 100644
--- a/backends/saves/windows/windows-saves.cpp
+++ b/backends/saves/windows/windows-saves.cpp
@@ -44,7 +44,7 @@ WindowsSaveFileManager::WindowsSaveFileManager(bool isPortable) {
 	}
 
 	_tcscat(defaultSavepath, TEXT("\\Saved games"));
-	if (!CreateDirectory(defaultSavepath, NULL)) {
+	if (!CreateDirectory(defaultSavepath, nullptr)) {
 		if (GetLastError() != ERROR_ALREADY_EXISTS)
 			error("Cannot create ScummVM Saved games folder");
 	}
diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp
index c8d2f04106..b6be77b8eb 100644
--- a/backends/taskbar/win32/win32-taskbar.cpp
+++ b/backends/taskbar/win32/win32-taskbar.cpp
@@ -71,16 +71,16 @@
 // System.Title property key, values taken from http://msdn.microsoft.com/en-us/library/bb787584.aspx
 const PROPERTYKEY PKEY_Title = { /* fmtid = */ { 0xF29F85E0, 0x4FF9, 0x1068, { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 } }, /* propID = */ 2 };
 
-Win32TaskbarManager::Win32TaskbarManager(SdlWindow_Win32 *window) : _window(window), _taskbar(NULL), _count(0), _icon(NULL) {
+Win32TaskbarManager::Win32TaskbarManager(SdlWindow_Win32 *window) : _window(window), _taskbar(nullptr), _count(0), _icon(nullptr) {
 	// Do nothing if not running on Windows 7 or later
 	if (!Win32::confirmWindowsVersion(6, 1))
 		return;
 
-	CoInitialize(NULL);
+	CoInitialize(nullptr);
 
 	// Try creating instance (on fail, _taskbar will contain NULL)
 	HRESULT hr = CoCreateInstance(CLSID_TaskbarList,
-	                              0,
+	                              nullptr,
 	                              CLSCTX_INPROC_SERVER,
 	                              IID_ITaskbarList3,
 	                              reinterpret_cast<void **> (&(_taskbar)));
@@ -89,7 +89,7 @@ Win32TaskbarManager::Win32TaskbarManager(SdlWindow_Win32 *window) : _window(wind
 		// Initialize taskbar object
 		if (FAILED(_taskbar->HrInit())) {
 			_taskbar->Release();
-			_taskbar = NULL;
+			_taskbar = nullptr;
 		}
 	} else {
 		warning("[Win32TaskbarManager::init] Cannot create taskbar instance");
@@ -99,7 +99,7 @@ Win32TaskbarManager::Win32TaskbarManager(SdlWindow_Win32 *window) : _window(wind
 Win32TaskbarManager::~Win32TaskbarManager() {
 	if (_taskbar)
 		_taskbar->Release();
-	_taskbar = NULL;
+	_taskbar = nullptr;
 
 	if (_icon)
 		DestroyIcon(_icon);
@@ -110,11 +110,11 @@ Win32TaskbarManager::~Win32TaskbarManager() {
 void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) {
 	//warning("[Win32TaskbarManager::setOverlayIcon] Setting overlay icon to: %s (%s)", name.c_str(), description.c_str());
 
-	if (_taskbar == NULL)
+	if (_taskbar == nullptr)
 		return;
 
 	if (name.empty()) {
-		_taskbar->SetOverlayIcon(_window->getHwnd(), NULL, L"");
+		_taskbar->SetOverlayIcon(_window->getHwnd(), nullptr, L"");
 		return;
 	}
 
@@ -124,7 +124,7 @@ void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Commo
 		return;
 
 	TCHAR *tIconPath = Win32::stringToTchar(iconPath);
-	HICON pIcon = (HICON)::LoadImage(NULL, tIconPath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
+	HICON pIcon = (HICON)::LoadImage(nullptr, tIconPath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
 	free(tIconPath);
 	if (!pIcon) {
 		warning("[Win32TaskbarManager::setOverlayIcon] Cannot load icon!");
@@ -141,25 +141,25 @@ void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Commo
 }
 
 void Win32TaskbarManager::setProgressValue(int completed, int total) {
-	if (_taskbar == NULL)
+	if (_taskbar == nullptr)
 		return;
 
 	_taskbar->SetProgressValue(_window->getHwnd(), completed, total);
 }
 
 void Win32TaskbarManager::setProgressState(TaskbarProgressState state) {
-	if (_taskbar == NULL)
+	if (_taskbar == nullptr)
 		return;
 
 	_taskbar->SetProgressState(_window->getHwnd(), (TBPFLAG)state);
 }
 
 void Win32TaskbarManager::setCount(int count) {
-	if (_taskbar == NULL)
+	if (_taskbar == nullptr)
 		return;
 
 	if (count == 0) {
-		_taskbar->SetOverlayIcon(_window->getHwnd(), NULL, L"");
+		_taskbar->SetOverlayIcon(_window->getHwnd(), nullptr, L"");
 		return;
 	}
 
@@ -171,7 +171,7 @@ void Win32TaskbarManager::setCount(int count) {
 	//        ScummVM font drawing and extract the contents at
 	//        the end?
 
-	if (_count != count || _icon == NULL) {
+	if (_count != count || _icon == nullptr) {
 		// Cleanup previous icon
 		_count = count;
 		if (_icon)
@@ -196,21 +196,21 @@ void Win32TaskbarManager::setCount(int count) {
 
 		// Get DC
 		HDC hdc;
-		hdc = GetDC(NULL);
+		hdc = GetDC(nullptr);
 		HDC hMemDC = CreateCompatibleDC(hdc);
-		ReleaseDC(NULL, hdc);
+		ReleaseDC(nullptr, hdc);
 
 		// Create a bitmap mask
-		HBITMAP hBitmapMask = CreateBitmap(16, 16, 1, 1, NULL);
+		HBITMAP hBitmapMask = CreateBitmap(16, 16, 1, 1, nullptr);
 
 		// Create the DIB section with an alpha channel
 		void *lpBits;
-		HBITMAP hBitmap = CreateDIBSection(hdc, (BITMAPINFO *)&bi, DIB_RGB_COLORS, (void **)&lpBits, NULL, 0);
+		HBITMAP hBitmap = CreateDIBSection(hdc, (BITMAPINFO *)&bi, DIB_RGB_COLORS, (void **)&lpBits, nullptr, 0);
 		HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
 
 		// Load the icon background
-		HICON hIconBackground = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(1002 /* IDI_COUNT */));
-		DrawIconEx(hMemDC, 0, 0, hIconBackground, 16, 16, 0, 0, DI_NORMAL);
+		HICON hIconBackground = LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(1002 /* IDI_COUNT */));
+		DrawIconEx(hMemDC, 0, 0, hIconBackground, 16, 16, 0, nullptr, DI_NORMAL);
 		DeleteObject(hIconBackground);
 
 		// Draw the count
@@ -276,7 +276,7 @@ void Win32TaskbarManager::setCount(int count) {
 void Win32TaskbarManager::addRecent(const Common::String &name, const Common::String &description) {
 	//warning("[Win32TaskbarManager::addRecent] Adding recent list entry: %s (%s)", name.c_str(), description.c_str());
 
-	if (_taskbar == NULL)
+	if (_taskbar == nullptr)
 		return;
 
 	// ANSI version doesn't seem to work correctly with Win7 jump lists, so explicitly use Unicode interface.
@@ -284,10 +284,10 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St
 
 	// Get the ScummVM executable path.
 	WCHAR path[MAX_PATH];
-	GetModuleFileNameW(NULL, path, MAX_PATH);
+	GetModuleFileNameW(nullptr, path, MAX_PATH);
 
 	// Create a shell link.
-	if (SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC, IID_IShellLinkW, reinterpret_cast<void **> (&link)))) {
+	if (SUCCEEDED(CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC, IID_IShellLinkW, reinterpret_cast<void **> (&link)))) {
 		// Convert game name and description to Unicode.
 		LPWSTR game = Win32::ansiToUnicode(name.c_str());
 		LPWSTR desc = Win32::ansiToUnicode(description.c_str());
diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp
index 599d8aab45..65d66d1b98 100644
--- a/backends/text-to-speech/windows/windows-text-to-speech.cpp
+++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp
@@ -56,9 +56,9 @@ WindowsTextToSpeechManager::WindowsTextToSpeechManager()
 	_threadParams.queue = &_speechQueue;
 	_threadParams.state = &_speechState;
 	_threadParams.mutex = &_speechMutex;
-	_thread = NULL;
-	_speechMutex = CreateMutex(NULL, FALSE, NULL);
-	if (_speechMutex == NULL) {
+	_thread = nullptr;
+	_speechMutex = CreateMutex(nullptr, FALSE, nullptr);
+	if (_speechMutex == nullptr) {
 		_speechState = BROKEN;
 		warning("Could not create TTS mutex");
 	}
@@ -66,12 +66,12 @@ WindowsTextToSpeechManager::WindowsTextToSpeechManager()
 
 void WindowsTextToSpeechManager::init() {
 	// init COM
-	if (FAILED(::CoInitialize(NULL)))
+	if (FAILED(::CoInitialize(nullptr)))
 		return;
 
 	// init audio
 	ISpObjectTokenCategory *pTokenCategory;
-	HRESULT hr = CoCreateInstance(CLSID_SpObjectTokenCategory, NULL, CLSCTX_ALL, IID_ISpObjectTokenCategory, (void **)&pTokenCategory);
+	HRESULT hr = CoCreateInstance(CLSID_SpObjectTokenCategory, nullptr, CLSCTX_ALL, IID_ISpObjectTokenCategory, (void **)&pTokenCategory);
 	if (SUCCEEDED(hr)) {
 		hr = pTokenCategory->SetId(SPCAT_AUDIOOUT, TRUE);
 		if (SUCCEEDED(hr)) {
@@ -79,11 +79,11 @@ void WindowsTextToSpeechManager::init() {
 			hr = pTokenCategory->GetDefaultTokenId(&tokenId);
 			if (SUCCEEDED(hr)) {
 				ISpObjectToken *pToken;
-				hr = CoCreateInstance(CLSID_SpObjectToken, NULL, CLSCTX_ALL, IID_ISpObjectToken, (void **)&pToken);
+				hr = CoCreateInstance(CLSID_SpObjectToken, nullptr, CLSCTX_ALL, IID_ISpObjectToken, (void **)&pToken);
 				if (SUCCEEDED(hr)) {
-					hr = pToken->SetId(NULL, tokenId, FALSE);
+					hr = pToken->SetId(nullptr, tokenId, FALSE);
 					if (SUCCEEDED(hr)) {
-						hr = pToken->CreateInstance(NULL, CLSCTX_ALL, IID_ISpAudio, (void **)&_audio);
+						hr = pToken->CreateInstance(nullptr, CLSCTX_ALL, IID_ISpAudio, (void **)&_audio);
 					}
 				}
 				CoTaskMemFree(tokenId);
@@ -96,7 +96,7 @@ void WindowsTextToSpeechManager::init() {
 	}
 
 	// init voice
-	hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&_voice);
+	hr = CoCreateInstance(CLSID_SpVoice, nullptr, CLSCTX_ALL, IID_ISpVoice, (void **)&_voice);
 	if (FAILED(hr)) {
 		warning("Could not initialize TTS voice");
 		return;
@@ -128,11 +128,11 @@ WindowsTextToSpeechManager::~WindowsTextToSpeechManager() {
 
 	clearState();
 
-	if (_thread != NULL) {
+	if (_thread != nullptr) {
 		WaitForSingleObject(_thread, INFINITE);
 		CloseHandle(_thread);
 	}
-	if (_speechMutex != NULL) {
+	if (_speechMutex != nullptr) {
 		CloseHandle(_speechMutex);
 	}
 	if (_voice)
@@ -154,7 +154,7 @@ DWORD WINAPI startSpeech(LPVOID parameters) {
 			break;
 		}
 		WCHAR *currentSpeech = params->queue->front();
-		_voice->Speak(currentSpeech, SPF_PURGEBEFORESPEAK | SPF_ASYNC | SPF_PARSE_SAPI, 0);
+		_voice->Speak(currentSpeech, SPF_PURGEBEFORESPEAK | SPF_ASYNC | SPF_PARSE_SAPI, nullptr);
 		ReleaseMutex(*params->mutex);
 
 		while (*(params->state) != WindowsTextToSpeechManager::PAUSED)
@@ -163,7 +163,7 @@ DWORD WINAPI startSpeech(LPVOID parameters) {
 
 		WaitForSingleObject(*params->mutex, INFINITE);
 		if (!params->queue->empty() && params->queue->front() == currentSpeech) {
-			if (currentSpeech != NULL)
+			if (currentSpeech != nullptr)
 				free(currentSpeech);
 			params->queue->pop_front();
 		}
@@ -223,13 +223,13 @@ bool WindowsTextToSpeechManager::say(const Common::U32String &str, Action action
 
 	if (!isSpeaking() && !isPaused()) {
 		DWORD threadId;
-		if (_thread != NULL) {
+		if (_thread != nullptr) {
 			WaitForSingleObject(_thread, INFINITE);
 			CloseHandle(_thread);
 		}
 		_speechState = SPEAKING;
-		_thread = CreateThread(NULL, 0, startSpeech, &_threadParams, 0, &threadId);
-		if (_thread == NULL) {
+		_thread = CreateThread(nullptr, 0, startSpeech, &_threadParams, 0, &threadId);
+		if (_thread == nullptr) {
 			warning("Could not create speech thread");
 			_speechState = READY;
 			return true;
@@ -252,7 +252,7 @@ bool WindowsTextToSpeechManager::stop() {
 		_speechQueue.pop_front();
 	}
 	// Stop the current speech
-	_voice->Speak(NULL, SPF_PURGEBEFORESPEAK | SPF_ASYNC, 0);
+	_voice->Speak(nullptr, SPF_PURGEBEFORESPEAK | SPF_ASYNC, nullptr);
 	_speechState = READY;
 	ReleaseMutex(_speechMutex);
 	_audio->SetState(SPAS_RUN, 0);
@@ -278,13 +278,13 @@ bool WindowsTextToSpeechManager::resume() {
 		return false;
 	_voice->Resume();
 	DWORD threadId;
-	if (_thread != NULL) {
+	if (_thread != nullptr) {
 		WaitForSingleObject(_thread, INFINITE);
 		CloseHandle(_thread);
 	}
 	_speechState = SPEAKING;
-	_thread = CreateThread(NULL, 0, startSpeech, &_threadParams, 0, &threadId);
-	if (_thread == NULL) {
+	_thread = CreateThread(nullptr, 0, startSpeech, &_threadParams, 0, &threadId);
+	if (_thread == nullptr) {
 		warning("Could not create speech thread");
 		_speechState = READY;
 		return true;
@@ -352,7 +352,7 @@ void WindowsTextToSpeechManager::createVoice(void *cpVoiceToken) {
 	WCHAR *descW;
 	char *buffer;
 	Common::String desc;
-	HRESULT hr = voiceToken->GetStringValue(NULL, &descW);
+	HRESULT hr = voiceToken->GetStringValue(nullptr, &descW);
 	if (SUCCEEDED(hr)) {
 		buffer = Win32::unicodeToAnsi(descW);
 		desc = buffer;
@@ -383,7 +383,7 @@ void WindowsTextToSpeechManager::createVoice(void *cpVoiceToken) {
 		warning("Could not get the language attribute for voice: %s", desc.c_str());
 		return;
 	}
-	Common::String language = lcidToLocale(wcstol(data, NULL, 16));
+	Common::String language = lcidToLocale(wcstol(data, nullptr, 16));
 	CoTaskMemFree(data);
 
 	// only get the voices for the current language
@@ -416,7 +416,7 @@ void WindowsTextToSpeechManager::createVoice(void *cpVoiceToken) {
 }
 
 Common::String WindowsTextToSpeechManager::lcidToLocale(LCID locale) {
-	int nchars = GetLocaleInfo(locale, LOCALE_SISO639LANGNAME, NULL, 0);
+	int nchars = GetLocaleInfo(locale, LOCALE_SISO639LANGNAME, nullptr, 0);
 	TCHAR *languageCode = new TCHAR[nchars];
 	GetLocaleInfo(locale, LOCALE_SISO639LANGNAME, languageCode, nchars);
 	Common::String result = Win32::tcharToString(languageCode);
@@ -433,7 +433,7 @@ void WindowsTextToSpeechManager::updateVoices() {
 	unsigned long ulCount = 0;
 
 	ISpObjectTokenCategory *cpCategory;
-	HRESULT hr = CoCreateInstance(CLSID_SpObjectTokenCategory, NULL, CLSCTX_ALL, IID_ISpObjectTokenCategory, (void**)&cpCategory);
+	HRESULT hr = CoCreateInstance(CLSID_SpObjectTokenCategory, nullptr, CLSCTX_ALL, IID_ISpObjectTokenCategory, (void**)&cpCategory);
 	if (SUCCEEDED(hr)) {
 		hr = cpCategory->SetId(L"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech_OneCore\\Voices", FALSE);
 		if (!SUCCEEDED(hr)) {
@@ -441,7 +441,7 @@ void WindowsTextToSpeechManager::updateVoices() {
 		}
 
 		if (SUCCEEDED(hr)) {
-			hr = cpCategory->EnumTokens(NULL, NULL, &cpEnum);
+			hr = cpCategory->EnumTokens(nullptr, nullptr, &cpEnum);
 		}
 	}
 
@@ -450,9 +450,9 @@ void WindowsTextToSpeechManager::updateVoices() {
 	}
 	_voice->SetVolume(0);
 	while (SUCCEEDED(hr) && ulCount--) {
-		hr = cpEnum->Next(1, &cpVoiceToken, NULL);
+		hr = cpEnum->Next(1, &cpVoiceToken, nullptr);
 		_voice->SetVoice(cpVoiceToken);
-		if (SUCCEEDED(_voice->Speak(L"hi, this is test", SPF_PURGEBEFORESPEAK | SPF_ASYNC | SPF_IS_NOT_XML, 0)))
+		if (SUCCEEDED(_voice->Speak(L"hi, this is test", SPF_PURGEBEFORESPEAK | SPF_ASYNC | SPF_IS_NOT_XML, nullptr)))
 			createVoice(cpVoiceToken);
 		else
 			cpVoiceToken->Release();
@@ -461,7 +461,7 @@ void WindowsTextToSpeechManager::updateVoices() {
 	// and we could easily be in NO_VOICE or BROKEN state here, in which the stop() wouldn't work
 	_audio->SetState(SPAS_STOP, 0);
 	_audio->SetState(SPAS_RUN, 0);
-	_voice->Speak(NULL, SPF_PURGEBEFORESPEAK | SPF_ASYNC | SPF_IS_NOT_XML, 0);
+	_voice->Speak(nullptr, SPF_PURGEBEFORESPEAK | SPF_ASYNC | SPF_IS_NOT_XML, nullptr);
 	_voice->SetVolume(_ttsState->_volume);
 	cpEnum->Release();
 
diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp
index 02f1f0ed8e..45097feb29 100644
--- a/backends/timer/default/default-timer.cpp
+++ b/backends/timer/default/default-timer.cpp
@@ -45,13 +45,13 @@ void insertPrioQueue(TimerSlot *head, TimerSlot *newSlot) {
 
 	const uint32 nextFireTime = newSlot->nextFireTime;
 	TimerSlot *slot = head;
-	newSlot->next = 0;
+	newSlot->next = nullptr;
 
 	// Insert the new slot into the sorted list of already scheduled
 	// timers in such a way that the list stays sorted...
 	while (true) {
 		assert(slot);
-		if (slot->next == 0 || nextFireTime < slot->next->nextFireTime) {
+		if (slot->next == nullptr || nextFireTime < slot->next->nextFireTime) {
 			newSlot->next = slot->next;
 			slot->next = newSlot;
 			return;
@@ -63,7 +63,7 @@ void insertPrioQueue(TimerSlot *head, TimerSlot *newSlot) {
 
 DefaultTimerManager::DefaultTimerManager() :
 	_timerCallbackNext(0),
-	_head(0) {
+	_head(nullptr) {
 
 	_head = new TimerSlot();
 }
@@ -77,7 +77,7 @@ DefaultTimerManager::~DefaultTimerManager() {
 		delete slot;
 		slot = next;
 	}
-	_head = 0;
+	_head = nullptr;
 }
 
 void DefaultTimerManager::handler() {
@@ -150,7 +150,7 @@ bool DefaultTimerManager::installTimerProc(TimerProc callback, int32 interval, v
 	slot->interval = interval;
 	slot->nextFireTime = g_system->getMillis() + interval / 1000;
 	slot->nextFireTimeMicro = interval % 1000;
-	slot->next = 0;
+	slot->next = nullptr;
 
 	insertPrioQueue(_head, slot);
 


Commit: e92e232788d7665e1022dbf92555a4586d9f855e
    https://github.com/scummvm/scummvm/commit/e92e232788d7665e1022dbf92555a4586d9f855e
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
BASE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    base/commandLine.cpp
    base/main.cpp
    base/plugins.cpp


diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 27189d4b84..b304181fd1 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -520,7 +520,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
 	// Iterate over all command line arguments and parse them into our string map.
 	for (int i = 1; i < argc; ++i) {
 		s = argv[i];
-		s2 = (i < argc-1) ? argv[i+1] : 0;
+		s2 = (i < argc-1) ? argv[i+1] : nullptr;
 
 		if (s[0] != '-') {
 			// The argument doesn't start with a dash, so it's not an option.
@@ -1463,7 +1463,7 @@ void upgradeTargets() {
 		DetectionResults detectionResults = EngineMan.detectGames(files);
 		DetectedGames candidates = detectionResults.listRecognizedGames();
 
-		DetectedGame *g = 0;
+		DetectedGame *g = nullptr;
 
 		// We proceed as follows:
 		// * If detection failed to produce candidates, skip.
diff --git a/base/main.cpp b/base/main.cpp
index 2f64877a0c..21f98c1fc7 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -118,18 +118,18 @@ static const Plugin *detectPlugin() {
 	// At this point the engine ID and game ID must be known
 	if (engineId.empty()) {
 		warning("The engine ID is not set for target '%s'", ConfMan.getActiveDomainName().c_str());
-		return 0;
+		return nullptr;
 	}
 
 	if (gameId.empty()) {
 		warning("The game ID is not set for target '%s'", ConfMan.getActiveDomainName().c_str());
-		return 0;
+		return nullptr;
 	}
 
 	const Plugin *plugin = EngineMan.findPlugin(engineId);
 	if (!plugin) {
 		warning("'%s' is an invalid engine ID. Use the --list-engines command to list supported engine IDs", engineId.c_str());
-		return 0;
+		return nullptr;
 	}
 
 	// Query the plugin for the game descriptor
@@ -139,7 +139,7 @@ static const Plugin *detectPlugin() {
 	PlainGameDescriptor game = metaEngine.findGame(gameId.c_str());
 	if (!game.gameId) {
 		warning("'%s' is an invalid game ID for the engine '%s'. Use the --list-games option to list supported game IDs", gameId.c_str(), engineId.c_str());
-		return 0;
+		return nullptr;
 	}
 
 	return plugin;
@@ -163,7 +163,7 @@ static Common::Error runGame(const Plugin *plugin, const Plugin *enginePlugin, O
 	Common::FSNode dir(ConfMan.get("path"));
 	Common::String target = ConfMan.getActiveDomainName();
 	Common::Error err = Common::kNoError;
-	Engine *engine = 0;
+	Engine *engine = nullptr;
 
 #if defined(SDL_BACKEND) && defined(USE_OPENGL) && defined(USE_RGB_COLOR)
 	// HACK: We set up the requested graphics mode setting here to allow the
@@ -435,7 +435,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
 	// soonest possible moment to ensure debug output starts early on, if
 	// requested.
 	if (settings.contains("debuglevel")) {
-		gDebugLevel = (int)strtol(settings["debuglevel"].c_str(), 0, 10);
+		gDebugLevel = (int)strtol(settings["debuglevel"].c_str(), nullptr, 10);
 		printf("Debuglevel (from command line): %d\n", gDebugLevel);
 		settings.erase("debuglevel"); // This option should not be passed to ConfMan.
 	} else if (ConfMan.hasKey("debuglevel"))
@@ -569,13 +569,13 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
 #endif
 
 	// Unless a game was specified, show the launcher dialog
-	if (0 == ConfMan.getActiveDomain())
+	if (nullptr == ConfMan.getActiveDomain())
 		launcherDialog();
 
 	// FIXME: We're now looping the launcher. This, of course, doesn't
 	// work as well as it should. In theory everything should be destroyed
 	// cleanly, so this is now enabled to encourage people to fix bits :)
-	while (0 != ConfMan.getActiveDomain()) {
+	while (nullptr != ConfMan.getActiveDomain()) {
 		saveLastLaunchedTarget(ConfMan.getActiveDomainName());
 
 		EngineMan.upgradeTargetIfNecessary(ConfMan.getActiveDomainName());
@@ -703,7 +703,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
 
 		// reset the graphics to default
 		setupGraphics(system);
-		if (0 == ConfMan.getActiveDomain()) {
+		if (nullptr == ConfMan.getActiveDomain()) {
 			launcherDialog();
 		}
 	}
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 09b731aab8..f012e569bd 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -254,7 +254,7 @@ void FilePluginProvider::addCustomDirectories(Common::FSList &dirs) const {
 
 #pragma mark -
 
-PluginManager *PluginManager::_instance = NULL;
+PluginManager *PluginManager::_instance = nullptr;
 
 PluginManager &PluginManager::instance() {
 	if (_instance)
@@ -345,7 +345,7 @@ void PluginManagerUncached::init() {
 	_allEnginePlugins.clear();
 	ConfMan.setBool("always_run_fallback_detection_extern", false);
 
-	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // empty the engine plugins
+	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, nullptr, false); // empty the engine plugins
 
 #ifndef DETECTION_STATIC
 	Common::String detectPluginName = "detection";
@@ -433,7 +433,7 @@ bool PluginManagerUncached::loadPluginByFileName(const Common::String &filename)
 	if (filename.empty())
 		return false;
 
-	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
+	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, nullptr, false);
 
 	PluginList::iterator i;
 	for (i = _allEnginePlugins.begin(); i != _allEnginePlugins.end(); ++i) {
@@ -509,7 +509,7 @@ void PluginManagerUncached::unloadDetectionPlugin() {
 #endif
 
 void PluginManagerUncached::loadFirstPlugin() {
-	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
+	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, nullptr, false);
 
 	// let's try to find one we can load
 	for (_currentPlugin = _allEnginePlugins.begin(); _currentPlugin != _allEnginePlugins.end(); ++_currentPlugin) {
@@ -521,7 +521,7 @@ void PluginManagerUncached::loadFirstPlugin() {
 }
 
 bool PluginManagerUncached::loadNextPlugin() {
-	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
+	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, nullptr, false);
 
 	if (!_currentPlugin || _currentPlugin == _allEnginePlugins.end())
 		return false;
@@ -590,11 +590,11 @@ void PluginManager::loadAllPluginsOfType(PluginType type) {
 
 void PluginManager::unloadAllPlugins() {
 	for (int i = 0; i < PLUGIN_TYPE_MAX; i++)
-		unloadPluginsExcept((PluginType)i, NULL);
+		unloadPluginsExcept((PluginType)i, nullptr);
 }
 
 void PluginManager::unloadPluginsExcept(PluginType type, const Plugin *plugin, bool deletePlugin /*=true*/) {
-	Plugin *found = NULL;
+	Plugin *found = nullptr;
 	for (PluginList::iterator p = _pluginsInMem[type].begin(); p != _pluginsInMem[type].end(); ++p) {
 		if (*p == plugin) {
 			found = *p;
@@ -606,7 +606,7 @@ void PluginManager::unloadPluginsExcept(PluginType type, const Plugin *plugin, b
 		}
 	}
 	_pluginsInMem[type].clear();
-	if (found != NULL) {
+	if (found != nullptr) {
 		_pluginsInMem[type].push_back(found);
 	}
 }
@@ -816,7 +816,7 @@ const Plugin *EngineManager::findPlugin(const Common::String &engineId) const {
 		if (engineId == (*iter)->get<MetaEngineDetection>().getEngineId())
 			return *iter;
 
-	return 0;
+	return nullptr;
 }
 
 const Plugin *PluginManager::findLoadedPlugin(const Common::String &engineId) {
@@ -826,7 +826,7 @@ const Plugin *PluginManager::findLoadedPlugin(const Common::String &engineId) {
 		if (engineId == (*iter)->get<MetaEngine>().getName())
 			return *iter;
 
-	return 0;
+	return nullptr;
 }
 
 const Plugin *PluginManager::findEnginePlugin(const Common::String &engineId) {
@@ -855,7 +855,7 @@ const Plugin *PluginManager::findEnginePlugin(const Common::String &engineId) {
 		}
 	} while (PluginMan.loadNextPlugin());
 
-	return 0;
+	return nullptr;
 }
 
 QualifiedGameDescriptor EngineManager::findTarget(const Common::String &target, const Plugin **plugin) const {
@@ -1030,7 +1030,7 @@ Plugin *ScalerManager::findScalerPlugin(const char *name) const {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 uint ScalerManager::findScalerPluginIndex(const char *name) const {


Commit: cb61ec37c48758f04bd7366329b642539856735a
    https://github.com/scummvm/scummvm/commit/cb61ec37c48758f04bd7366329b642539856735a
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
COMMON: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    common/installshield_cab.cpp
    common/mdct.cpp
    common/sinewindows.cpp
    common/str.cpp
    common/stuffit.cpp
    common/unicode-bidi.cpp


diff --git a/common/installshield_cab.cpp b/common/installshield_cab.cpp
index efa93f6669..bd03a9acaf 100644
--- a/common/installshield_cab.cpp
+++ b/common/installshield_cab.cpp
@@ -244,7 +244,7 @@ SeekableReadStream *InstallShieldCabinet::createReadStreamForMember(const Path &
 	ScopedPtr<SeekableReadStream> stream(SearchMan.createReadStreamForMember(getVolumeName((entry.volume == 0) ? 1 : entry.volume)));
 	if (!stream) {
 		warning("Failed to open volume for file '%s'", name.c_str());
-		return 0;
+		return nullptr;
 	}
 
 	if (!(entry.flags & 0x04)) {
@@ -291,7 +291,7 @@ Archive *makeInstallShieldArchive(const String &baseName) {
 	InstallShieldCabinet *cab = new InstallShieldCabinet();
 	if (!cab->open(baseName)) {
 		delete cab;
-		return 0;
+		return nullptr;
 	}
 
 	return cab;
diff --git a/common/mdct.cpp b/common/mdct.cpp
index 78ec193263..4595055429 100644
--- a/common/mdct.cpp
+++ b/common/mdct.cpp
@@ -35,7 +35,7 @@
 
 namespace Common {
 
-MDCT::MDCT(int bits, bool inverse, double scale) : _bits(bits), _fft(0) {
+MDCT::MDCT(int bits, bool inverse, double scale) : _bits(bits), _fft(nullptr) {
 	_size = 1 << bits;
 
 	_fft = new FFT(_bits - 2, inverse);
diff --git a/common/sinewindows.cpp b/common/sinewindows.cpp
index 3c52d38256..accf89348e 100644
--- a/common/sinewindows.cpp
+++ b/common/sinewindows.cpp
@@ -1070,7 +1070,7 @@ static const float sineWindow4096[4096] = {
 };
 
 static const float *sineWindows[13] = {
-	0             , 0             , 0             , 0            , 0            ,
+	nullptr             , nullptr             , nullptr             , nullptr            , nullptr            ,
 	sineWindow32  , sineWindow64  , sineWindow128 , sineWindow256, sineWindow512,
 	sineWindow1024, sineWindow2048, sineWindow4096
 };
diff --git a/common/str.cpp b/common/str.cpp
index 67c4c88d0e..7ce1fd8f37 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -330,7 +330,7 @@ size_t String::rfind(char c, size_t pos) const {
 }
 
 size_t String::findFirstOf(char c, size_t pos) const {
-	const char *strP = (pos >= _size) ? 0 : strchr(_str + pos, c);
+	const char *strP = (pos >= _size) ? nullptr : strchr(_str + pos, c);
 	return strP ? strP - _str : npos;
 }
 
@@ -907,7 +907,7 @@ const char *scumm_strcasestr(const char *s, const char *find) {
 		do {
 			do {
 				if ((sc = *s++) == 0)
-					return (NULL);
+					return (nullptr);
 			} while ((char)tolower((unsigned char)sc) != c);
 		} while (scumm_strnicmp(s, find, len) != 0);
 		s--;
diff --git a/common/stuffit.cpp b/common/stuffit.cpp
index 11452d9f67..43d46fe038 100644
--- a/common/stuffit.cpp
+++ b/common/stuffit.cpp
@@ -44,7 +44,7 @@ public:
 
 	bool open(const Common::String &filename);
 	void close();
-	bool isOpen() const { return _stream != 0; }
+	bool isOpen() const { return _stream != nullptr; }
 
 	// Common::Archive API implementation
 	bool hasFile(const Common::Path &path) const override;
@@ -531,7 +531,7 @@ Common::Archive *createStuffItArchive(const Common::String &fileName) {
 
 	if (!archive->open(fileName)) {
 		delete archive;
-		return 0;
+		return nullptr;
 	}
 
 	return archive;
diff --git a/common/unicode-bidi.cpp b/common/unicode-bidi.cpp
index 7e18fa0c3b..56bb0867b4 100644
--- a/common/unicode-bidi.cpp
+++ b/common/unicode-bidi.cpp
@@ -45,12 +45,12 @@ uint32 GetFriBiDiParType(BiDiParagraph dir) {
 
 UnicodeBiDiText::UnicodeBiDiText(const Common::U32String &str, BiDiParagraph dir) :
 	logical(str), _pbase_dir(GetFriBiDiParType(dir)),
-	_log_to_vis_index(NULL), _vis_to_log_index(NULL) {
+	_log_to_vis_index(nullptr), _vis_to_log_index(nullptr) {
 	initWithU32String(str);
 }
 
 UnicodeBiDiText::UnicodeBiDiText(const Common::String &str, const Common::CodePage page,
-		uint32 *pbase_dir) : logical(str), _log_to_vis_index(NULL), _vis_to_log_index(NULL) {
+		uint32 *pbase_dir) : logical(str), _log_to_vis_index(nullptr), _vis_to_log_index(nullptr) {
 	_pbase_dir = *pbase_dir;
 	initWithU32String(str.decode(page));
 	*pbase_dir = _pbase_dir;
@@ -62,13 +62,13 @@ UnicodeBiDiText::~UnicodeBiDiText() {
 }
 
 uint32 UnicodeBiDiText::getVisualPosition(uint32 logicalPos) const {
-	if (NULL != _log_to_vis_index && logicalPos < size()) {
+	if (nullptr != _log_to_vis_index && logicalPos < size()) {
 		return _log_to_vis_index[logicalPos];
 	}
 	return logicalPos;
 }
 uint32 UnicodeBiDiText::getLogicalPosition(uint32 visualPos) const {
-	if (NULL != _log_to_vis_index && visualPos < size()) {
+	if (nullptr != _log_to_vis_index && visualPos < size()) {
 		return _vis_to_log_index[visualPos];
 	}
 	return visualPos;
@@ -93,15 +93,15 @@ void UnicodeBiDiText::initWithU32String(const U32String &input) {
 		visual_str,
 		(FriBidiStrIndex *)_log_to_vis_index,	// position_L_to_V_list,
 		(FriBidiStrIndex *)_vis_to_log_index,	// position_V_to_L_list,
-		NULL									// embedding_level_list
+		nullptr									// embedding_level_list
 	)) {
 		warning("initWithU32String: calling fribidi_log2vis failed");
 		delete[] visual_str;
 		delete[] _log_to_vis_index;
 		delete[] _vis_to_log_index;
 		visual = input;
-		_log_to_vis_index = NULL;
-		_vis_to_log_index = NULL;
+		_log_to_vis_index = nullptr;
+		_vis_to_log_index = nullptr;
 	} else {
 		visual = U32String((uint32 *)visual_str, input.size());
 		delete[] visual_str;


Commit: 62797daf3cc10ff87af26bdd6e29dfa3ab00f570
    https://github.com/scummvm/scummvm/commit/62797daf3cc10ff87af26bdd6e29dfa3ab00f570
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
DEVTOOLS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    devtools/convbdf.cpp
    devtools/create_hugo/create_hugo.cpp
    devtools/create_kyradat/create_kyradat.cpp
    devtools/create_kyradat/games.cpp
    devtools/create_kyradat/md5.cpp
    devtools/create_kyradat/pak.cpp
    devtools/create_kyradat/resources.cpp
    devtools/create_lure/create_lure_dat.cpp
    devtools/create_lure/process_actions.cpp
    devtools/create_mortdat/create_mortdat.cpp
    devtools/create_neverhood/create_neverhood.cpp
    devtools/create_neverhood/md5.cpp
    devtools/create_project/cmake.cpp
    devtools/create_project/create_project.cpp
    devtools/create_project/msvc.cpp
    devtools/create_project/xcode.cpp
    devtools/create_supernova/create_supernova.cpp
    devtools/create_supernova/file.cpp
    devtools/create_supernova/po_parser.cpp
    devtools/create_teenagent/create_teenagent.cpp
    devtools/create_titanic/memorypool.cpp
    devtools/create_titanic/winexe_pe.cpp
    devtools/create_titanic/zlib.cpp
    devtools/create_translations/create_translations.cpp
    devtools/create_translations/po_parser.cpp
    devtools/create_xeen/memorypool.cpp
    devtools/extract_mort/extract_mort.cpp
    devtools/make-scumm-fontdata.cpp
    devtools/md5table.cpp
    devtools/skycpt/TextFile.cpp
    devtools/skycpt/cpthelp.cpp


diff --git a/devtools/convbdf.cpp b/devtools/convbdf.cpp
index 88bb078f0b..d6eb785fb1 100644
--- a/devtools/convbdf.cpp
+++ b/devtools/convbdf.cpp
@@ -66,8 +66,8 @@ struct BdfFont {
 	BdfBoundingBox *boxes;
 
 	void reset() {
-		familyName = 0;
-		slant = 0;
+		familyName = nullptr;
+		slant = nullptr;
 		maxAdvance = 0;
 		size = 0;
 		height = 0;
@@ -78,9 +78,9 @@ struct BdfFont {
 		defaultCharacter = 0;
 		numCharacters = 0;
 
-		bitmaps = 0;
-		advances = 0;
-		boxes = 0;
+		bitmaps = nullptr;
+		advances = nullptr;
+		boxes = nullptr;
 	}
 
 	BdfFont() {
@@ -231,7 +231,7 @@ int main(int argc, char *argv[]) {
 
 			int encoding = -1;
 			int xAdvance;
-			unsigned char *bitmap = 0;
+			unsigned char *bitmap = nullptr;
 			BdfBoundingBox bbox = font.defaultBox;
 
 			while (true) {
@@ -347,13 +347,13 @@ int main(int argc, char *argv[]) {
 	// Free the advance table, in case all glyphs use the same advance
 	if (hasFixedAdvance) {
 		delete[] font.advances;
-		font.advances = 0;
+		font.advances = nullptr;
 	}
 
 	// Free the box table, in case all glyphs use the same box
 	if (hasFixedBBox) {
 		delete[] font.boxes;
-		font.boxes = 0;
+		font.boxes = nullptr;
 	}
 
 	// Adapt for the fact that we never use encoding 0.
@@ -367,10 +367,10 @@ int main(int argc, char *argv[]) {
 	// Try to compact the tables
 	if (charsAvailable < font.numCharacters) {
 		unsigned char **bitmaps = new unsigned char *[charsAvailable];
-		BdfBoundingBox *boxes = 0;
+		BdfBoundingBox *boxes = nullptr;
 		if (!hasFixedBBox)
 			boxes = new BdfBoundingBox[charsAvailable];
-		unsigned char *advances = 0;
+		unsigned char *advances = nullptr;
 		if (!hasFixedAdvance)
 			advances = new unsigned char[charsAvailable];
 
@@ -384,7 +384,7 @@ int main(int argc, char *argv[]) {
 				if (!hasFixedAdvance)
 					advances[i] = font.advances[encoding];
 			} else {
-				bitmaps[i] = 0;
+				bitmaps[i] = nullptr;
 			}
 		}
 
@@ -399,7 +399,7 @@ int main(int argc, char *argv[]) {
 	}
 
 	char dateBuffer[256];
-	time_t curTime = time(0);
+	time_t curTime = time(nullptr);
 	snprintf(dateBuffer, sizeof(dateBuffer), "%s", ctime(&curTime));
 
 	// Finally output the cpp source file to stdout
diff --git a/devtools/create_hugo/create_hugo.cpp b/devtools/create_hugo/create_hugo.cpp
index dd7776ae39..594fd67392 100644
--- a/devtools/create_hugo/create_hugo.cpp
+++ b/devtools/create_hugo/create_hugo.cpp
@@ -855,7 +855,7 @@ int main(int argc, char *argv[]) {
 	FILE* src_file;
 	char buf[2];
 	src_file = fopen("btn_1.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_1.bmp");
 		fclose(outFile);
 		return -1;
@@ -871,7 +871,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_1_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_1_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -887,7 +887,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_2.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_2.bmp");
 		fclose(outFile);
 		return -1;
@@ -903,7 +903,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_2_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_2_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -919,7 +919,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_3.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_3.bmp");
 		fclose(outFile);
 		return -1;
@@ -935,7 +935,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_3_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_3_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -951,7 +951,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_4.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_4.bmp");
 		fclose(outFile);
 		return -1;
@@ -967,7 +967,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_4_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_4_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -983,7 +983,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_5.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_5.bmp");
 		fclose(outFile);
 		return -1;
@@ -999,7 +999,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_5_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_5_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -1015,7 +1015,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_6.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_6.bmp");
 		fclose(outFile);
 		return -1;
@@ -1031,7 +1031,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_6_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_6_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -1047,7 +1047,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_7.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_7.bmp");
 		fclose(outFile);
 		return -1;
@@ -1063,7 +1063,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_7_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_7_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -1079,7 +1079,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_8.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_8.bmp");
 		fclose(outFile);
 		return -1;
@@ -1095,7 +1095,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_8_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_8_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -1111,7 +1111,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_9.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_9.bmp");
 		fclose(outFile);
 		return -1;
@@ -1127,7 +1127,7 @@ int main(int argc, char *argv[]) {
 	fclose(src_file);
 
 	src_file = fopen("btn_9_off.bmp", "rb");
-	if (src_file == NULL) {
+	if (src_file == nullptr) {
 		perror("btn_9_off.bmp");
 		fclose(outFile);
 		return -1;
@@ -1263,7 +1263,7 @@ void writeScreenActs(FILE *outFile, const uint16 *screenActs[], int nbrElem) {
 
 	writeUint16BE(outFile, nbrElem);
 	for (int i = 0; i < nbrElem; i++) {
-		if (screenActs[i] == 0)
+		if (screenActs[i] == nullptr)
 			writeUint16BE(outFile, 0);
 		else {
 			nbrSubElem = 1;
@@ -1283,7 +1283,7 @@ void writeObjectArray(FILE *outFile, const object_t objects[], int nbrElem) {
 	for (int i = 0; i < nbrElem; i++) {
 		writeUint16BE(outFile, objects[i].nounIndex);
 		writeUint16BE(outFile, objects[i].dataIndex);
-		if (objects[i].stateDataIndex == NULL)
+		if (objects[i].stateDataIndex == nullptr)
 			writeUint16BE(outFile, 0);
 		else {
 			nbrSubElem = 1;
@@ -1337,7 +1337,7 @@ void writeActListArray(FILE *outFile, const actList actListArr[], int nbrElem) {
 
 	writeUint16BE(outFile, nbrElem);
 	for (int i = 0; i < nbrElem; i++) {
-		for (nbrSubElem = 0; actListArr[i][nbrSubElem] != NULL; nbrSubElem++)
+		for (nbrSubElem = 0; actListArr[i][nbrSubElem] != nullptr; nbrSubElem++)
 			;
 		writeUint16BE(outFile, nbrSubElem);
 		for (int j = 0; j < nbrSubElem; j++) {
diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp
index 6ac12b2a60..2847638e00 100644
--- a/devtools/create_kyradat/create_kyradat.cpp
+++ b/devtools/create_kyradat/create_kyradat.cpp
@@ -1163,7 +1163,7 @@ const ExtractFilename *getFilenameDesc(const int id) {
 		if (i->id == id)
 			return i;
 	}
-	return 0;
+	return nullptr;
 }
 
 bool isLangSpecific(const int id) {
diff --git a/devtools/create_kyradat/games.cpp b/devtools/create_kyradat/games.cpp
index 27eb8da9be..67c3fc0f83 100644
--- a/devtools/create_kyradat/games.cpp
+++ b/devtools/create_kyradat/games.cpp
@@ -173,7 +173,7 @@ const Game * const gameDescs[] = {
 	lolGames,
 	eob1Games,
 	eob2Games,
-	0
+	nullptr
 };
 
 // Need tables
@@ -4435,7 +4435,7 @@ const GameNeed gameNeedTable[] = {
 	//{ kEoB2, kPlatformPC98, kNoSpecial, eob2PC98Need },
 	{ kEoB2, kPlatformFMTowns, kNoSpecial, eob2FMTownsNeed },
 
-	{ -1, -1, -1, 0 }
+	{ -1, -1, -1, nullptr }
 };
 
 } // end of anonymous namespace
@@ -4446,5 +4446,5 @@ const int *getNeedList(const Game *g) {
 			return need->entries;
 	}
 
-	return 0;
+	return nullptr;
 }
diff --git a/devtools/create_kyradat/md5.cpp b/devtools/create_kyradat/md5.cpp
index 705275f73b..b42f9041cd 100644
--- a/devtools/create_kyradat/md5.cpp
+++ b/devtools/create_kyradat/md5.cpp
@@ -228,7 +228,7 @@ bool md5_file(const char *name, uint8 digest[16], uint32 length) {
 	FILE *f;
 
 	f = fopen(name, "rb");
-	if (f == NULL) {
+	if (f == nullptr) {
 		printf("md5_file couldn't open '%s'\n", name);
 		return false;
 	}
diff --git a/devtools/create_kyradat/pak.cpp b/devtools/create_kyradat/pak.cpp
index 78fe418c6b..9427d56210 100644
--- a/devtools/create_kyradat/pak.cpp
+++ b/devtools/create_kyradat/pak.cpp
@@ -31,7 +31,7 @@ bool PAKFile::loadFile(const char *file, const bool isAmiga) {
 		return true;
 
 	delete _fileList;
-	_fileList = 0;
+	_fileList = nullptr;
 
 	FILE *pakfile = fopen(file, "rb");
 	if (!pakfile)
@@ -47,7 +47,7 @@ bool PAKFile::loadFile(const char *file, const bool isAmiga) {
 
 	fclose(pakfile);
 
-	const char *currentName = 0;
+	const char *currentName = nullptr;
 
 	uint32 startoffset = _isAmiga ? READ_BE_UINT32(buffer) : READ_LE_UINT32(buffer);
 	uint32 endoffset = 0;
@@ -73,7 +73,7 @@ bool PAKFile::loadFile(const char *file, const bool isAmiga) {
 		assert(data);
 		memcpy(data, buffer + startoffset, endoffset - startoffset);
 		addFile(currentName, data, endoffset - startoffset);
-		data = 0;
+		data = nullptr;
 
 		if (endoffset == filesize)
 			break;
@@ -152,7 +152,7 @@ bool PAKFile::outputAllFiles() {
 }
 
 bool PAKFile::outputFileAs(const char *f, const char *fn) {
-	FileList *cur = (_fileList != 0) ? _fileList->findEntry(f) : 0;
+	FileList *cur = (_fileList != nullptr) ? _fileList->findEntry(f) : nullptr;
 
 	if (!cur) {
 		error("file '%s' not found", f);
@@ -177,10 +177,10 @@ bool PAKFile::outputFileAs(const char *f, const char *fn) {
 }
 
 const uint8 *PAKFile::getFileData(const char *file, uint32 *size) {
-	FileList *cur = (_fileList != 0) ? _fileList->findEntry(file) : 0;
+	FileList *cur = (_fileList != nullptr) ? _fileList->findEntry(file) : nullptr;
 
 	if (!cur)
-		return 0;
+		return nullptr;
 
 	if (size)
 		*size = cur->size;
@@ -234,10 +234,10 @@ bool PAKFile::addFile(const char *name, uint8 *data, uint32 size) {
 }
 
 bool PAKFile::removeFile(const char *name) {
-	for (FileList *cur = _fileList, *last = 0; cur; last = cur, cur = cur->next) {
+	for (FileList *cur = _fileList, *last = nullptr; cur; last = cur, cur = cur->next) {
 		if (scumm_stricmp(cur->filename, name) == 0) {
 			FileList *next = cur->next;
-			cur->next = 0;
+			cur->next = nullptr;
 			delete cur;
 			if (last)
 				last->next = next;
diff --git a/devtools/create_kyradat/resources.cpp b/devtools/create_kyradat/resources.cpp
index ea13d5e86b..e9635c9718 100644
--- a/devtools/create_kyradat/resources.cpp
+++ b/devtools/create_kyradat/resources.cpp
@@ -4572,7 +4572,7 @@ static const ResourceProvider resourceProviders[] = {
 	{ kLoLCharacterDefs, kLoL, kPlatformDOS, kTalkieDemoVersion, EN_ANY, &kLoLCharacterDefsDOSCDDemoProvider },
 	{ kLoLCharacterDefs, kLoL, kPlatformDOS, kTalkieDemoVersion, FR_FRA, &kLoLCharacterDefsDOSCDDemoProvider },
 	{ kLoLCharacterDefs, kLoL, kPlatformDOS, kTalkieDemoVersion, DE_DEU, &kLoLCharacterDefsDOSCDDemoProvider },
-	{ kMaxResIDs, kKyra1, kPlatformDOS, kNoSpecial, UNK_LANG, NULL }
+	{ kMaxResIDs, kKyra1, kPlatformDOS, kNoSpecial, UNK_LANG, nullptr }
 };
 
 const ResourceProvider *obtainResourceProviders() {
diff --git a/devtools/create_lure/create_lure_dat.cpp b/devtools/create_lure/create_lure_dat.cpp
index f5498370a4..1f29874b2c 100644
--- a/devtools/create_lure/create_lure_dat.cpp
+++ b/devtools/create_lure/create_lure_dat.cpp
@@ -1333,49 +1333,49 @@ void save_fight_segment(byte *&data, uint16 &totalSize) {
 
 #define NUM_TEXT_ENTRIES 56
 const char *englishTextStrings[NUM_TEXT_ENTRIES] = {
-	"Get", NULL, "Push", "Pull", "Operate", "Open", "Close", "Lock", "Unlock", "Use",
-	"Give", "Talk to", "Tell", "Buy", "Look", "Look at", "Look through", "Ask", NULL,
+	"Get", nullptr, "Push", "Pull", "Operate", "Open", "Close", "Lock", "Unlock", "Use",
+	"Give", "Talk to", "Tell", "Buy", "Look", "Look at", "Look through", "Ask", nullptr,
 	"Drink", "Status", "Go to", "Return", "Bribe", "Examine",
 	"Credits", "Restart game", "Save game", "Restore game", "Quit", "Fast Text\x8B",
 	"Slow Text\x8B", "Sound on", "Sound off", "(nothing)", " for ", " to ", " on ",
 	"and then", "finish", "Are you sure (y/n)?",
 	"You are carrying ", "nothing", "You have ", "groat", "groats",
-	NULL, "the ", "a ", "a ", "an ", "an ", "an ", "an ", NULL, NULL
+	nullptr, "the ", "a ", "a ", "an ", "an ", "an ", "an ", nullptr, nullptr
 };
 
 const char *italianTextStrings[NUM_TEXT_ENTRIES] = {
-	"Prendi", NULL,	"Spingi", "Tira", "Aziona", "Apri", "Chiudi", "Blocca",
+	"Prendi", nullptr, "Spingi", "Tira", "Aziona", "Apri", "Chiudi", "Blocca",
 	"Sblocca", "Usa", "Dai", "Parla con", "Ordina a", "Compra", "Guarda", "Osserva",
-	"Guarda attraverso", "Chiedi", NULL,  "Bevi", "Stato", "Vai a", "Ritorna",
+	"Guarda attraverso", "Chiedi", nullptr, "Bevi", "Stato", "Vai a", "Ritorna",
 	"Corrompi", "Esamina",
 	"Crediti", "Ricomincia", "Salva gioco", "Ripristina", "Abbandona", "Testo lento\x8B",
 	"Testo veloce\x8B",  "Sonoro acceso", "Sonoro spento",
 	"(niente)", " per ", " a ", " su ",
 	"e poi", "finito", "Sei sicuro (s/n)?",
 	"Stai portando ", "niente", "Hai ", "soldo", "soldi",
-	NULL, "l' ", "la ", NULL, "le ", "i ", "il ", NULL, NULL, NULL
+	nullptr, "l' ", "la ", nullptr, "le ", "i ", "il ", nullptr, nullptr, nullptr
 };
 
 const char frenchUnlockStr[] = {'D', '\x7f', 'v', 'e', 'r', 'r', 'o', 'u', 'i', 'l', 'l', 'e', '\0'};
 const char frenchCreditsStr[] = {'C', 'r', '\x7f', 'd', 'i', 't', 's', '\0'};
 
 const char *frenchTextStrings[NUM_TEXT_ENTRIES] = {
-	"Prends", NULL, "Pousse", "Tire", "Actionne", "Ouvre", "Ferme", "Verrouille",
-	frenchUnlockStr, "Utilise", "Donne", "Parle \0x81", "Dis \x81", NULL,
-	"Regarde", "Observe", "Regarde par", "Demande \x81", NULL, "Bois", "Statut",
+	"Prends", nullptr, "Pousse", "Tire", "Actionne", "Ouvre", "Ferme", "Verrouille",
+	frenchUnlockStr, "Utilise", "Donne", "Parle \0x81", "Dis \x81", nullptr,
+	"Regarde", "Observe", "Regarde par", "Demande \x81", nullptr, "Bois", "Statut",
 	"Va \x81", "Reviens", "Corromps", "Examine",
 	frenchCreditsStr, "Recommencer", "Sauvegarder", "Restituer", "Quitter",
 	"Texte rapide\x8b", "Texte lent  \x8b", "Avec son", "Sans son",
 	"(rien)", " avec ", " \x81 ", " sur ", "et puis", "fin",
 	"Vous  \x83tes s\x89r (o/n)?",
 	"Vous avez ", "rien", "et vous avez ", "sou", "sous",
-	NULL, "les", "l'", "l'", "le", "le", "la", "la", NULL, NULL
+	nullptr, "les", "l'", "l'", "le", "le", "la", "la", nullptr, nullptr
 };
 
 const char *germanTextStrings[NUM_TEXT_ENTRIES] = {
-	"Nimm", NULL, "Schiebe", "Ziehe", "Bet\x8dtige", "\x90" "ffne", "Schlie\x92h" "e",
+	"Nimm", nullptr, "Schiebe", "Ziehe", "Bet\x8dtige", "\x90" "ffne", "Schlie\x92h" "e",
 	"Sperre", "Steck Schl\x8cssel in", "Benutze", "Gib", "Sprich mit", "Befehl an",
-	NULL, "Betrachte", "Betrachte", "Schau durch", "Verlange", NULL, "Trink",
+	nullptr, "Betrachte", "Betrachte", "Schau durch", "Verlange", nullptr, "Trink",
 	"Status", "Geh zu", "Zur\x8c" "ck", "Besteche", "Untersuche",
 	"Mitwirkende", "Spiel neu starten", "Spiel sichern", "Gesichertes Spiel laden",
 	"Abbrechen", "Schneller Text\x8b",
@@ -1386,14 +1386,14 @@ const char *germanTextStrings[NUM_TEXT_ENTRIES] = {
 };
 
 const char *spanishTextStrings[NUM_TEXT_ENTRIES] = {
-	"Coge", NULL, "Empuja", "Tira de", "Opera", "Abre", "Cierra", "Atranca", "Desatranca", "Usa",
-	"Dale", "Habla con", "Dile a", "Compra", "Obsevar", "Observe", "Mirar por", "P\x97" "dele", NULL,
+	"Coge", nullptr, "Empuja", "Tira de", "Opera", "Abre", "Cierra", "Atranca", "Desatranca", "Usa",
+	"Dale", "Habla con", "Dile a", "Compra", "Obsevar", "Observe", "Mirar por", "P\x97" "dele", nullptr,
 	"Bebe", "Estado", "Ve a", "Regresa", "Sobornar", "Examinar",
 	"Cr\x7f" "ditos", "Reiniciar", "Salvar juego", "Recuperar jue", "Abandonar", "Texto r\x98pido\x8b",
 	"Texto lento \x8b", "Sonido activado   ", "Sonido desactivado ", "(nada)", " con ", " a ", " con ",
 	"y luego", "eso es todo", "\x94" "Est\x98s seguro? (S/N)",
 	"Llevas ", "nada", "y tienes ", "moneda", "monedas",
-	"el ", "la ", "los ", "las ", "este ", "esta ", "estos ", "estas ", NULL, NULL
+	"el ", "la ", "los ", "las ", "este ", "esta ", "estos ", "estas ", nullptr, nullptr
 };
 
 void save_text_strings(byte *&data, uint16 &totalSize) {
@@ -1410,7 +1410,7 @@ void save_text_strings(byte *&data, uint16 &totalSize) {
 	// Calculate the total needed space
 	totalSize = sizeof(uint16);
 	for (index = 0; index < NUM_TEXT_ENTRIES; ++index) {
-		if (textStrings[index] != NULL)
+		if (textStrings[index] != nullptr)
 			totalSize += strlen(textStrings[index]);
 		++totalSize;
 	}
@@ -1421,7 +1421,7 @@ void save_text_strings(byte *&data, uint16 &totalSize) {
 	char *p = (char *) data + sizeof(uint16);
 
 	for (index = 0; index < NUM_TEXT_ENTRIES; ++index) {
-		if (textStrings[index] == NULL)
+		if (textStrings[index] == nullptr)
 			*p++ = '\0';
 		else {
 			strcpy(p, textStrings[index]);
@@ -1485,7 +1485,7 @@ const DecoderEntry englishDecoders[] = {
 	{"111111111111101", '\xa7'}, {"1111111111111100", '/'}, {"1111111111111101", 'Q'},
 	{"11111111111111100", '\xa8'}, {"11111111111111101", '('}, {"111111111111111100", ')'},
 	{"111111111111111101", '\x99'}, {"11111111111111111", '\xa9'},
-	{NULL, '\0'}
+	{nullptr, '\0'}
 };
 
 const DecoderEntry konamiDecoders[] = {
@@ -1531,7 +1531,7 @@ const DecoderEntry konamiDecoders[] = {
 	{ "11111111111111100", '\x99' }, { "111111111111111010", '(' }, { "111111111111111011", ')' },
 	{ "111111111111111100", '\xB2' }, { "111111111111111101", '\xDA' },
 	{ "11111111111111111", '\xEC' },
-	{ NULL, '\0' }
+	{ nullptr, '\0' }
 };
 
 const DecoderEntry italianDecoders[] = {
@@ -1564,7 +1564,7 @@ const DecoderEntry italianDecoders[] = {
 	{"1111111111111100", (char) 0x4B}, {"1111111111111101", (char) 0x22}, {"111111111111111000", (char) 0x09},
 	{"111111111111111001", (char) 0x28}, {"11111111111111101", (char) 0x29}, {"111111111111111100", (char) 0x4A},
 	{"111111111111111101", (char) 0x59}, {"11111111111111111", (char) 0x78},
-	{NULL, '\0'}
+	{nullptr, '\0'}
 };
 
 const DecoderEntry frenchDecoders[] = {
@@ -1609,7 +1609,7 @@ const DecoderEntry frenchDecoders[] = {
 	{"1111111111111011", (char) 0x28}, {"1111111111111100", (char) 0x29}, {"1111111111111101", (char) 0x5A},
 	{"11111111111111100", (char) 0x86}, {"11111111111111101", (char) 0x58}, {"11111111111111110", (char) 0x84},
 	{"11111111111111111", (char) 0xA2},
-	{NULL, '\0'}
+	{nullptr, '\0'}
 };
 
 const DecoderEntry germanDecoders[] = {
@@ -1653,7 +1653,7 @@ const DecoderEntry germanDecoders[] = {
 	{"11111111111111010", (char) 0xBC}, {"11111111111111011", (char) 0x28}, {"111111111111111000", (char) 0x29},
 	{"111111111111111001", (char) 0x59}, {"11111111111111101", (char) 0xBB}, {"11111111111111110", (char) 0xBD},
 	{"11111111111111111", (char) 0xC0},
-	{NULL, '\0'}
+	{nullptr, '\0'}
 };
 
 const DecoderEntry spanishDecoders[] = {
@@ -1688,7 +1688,7 @@ const DecoderEntry spanishDecoders[] = {
 	{"1111111111111100", (char) 0x5A}, {"1111111111111101", (char) 0x8C}, {"11111111111111100", (char) 0x28},
 	{"11111111111111101", (char) 0x29}, {"11111111111111110", (char) 0x4B}, {"111111111111111110", (char) 0x58},
 	{"111111111111111111", (char) 0x91},
-	{NULL, '\0'}
+	{nullptr, '\0'}
 };
 
 void save_string_decoder_data(byte *&data, uint16 &totalSize) {
@@ -1702,7 +1702,7 @@ void save_string_decoder_data(byte *&data, uint16 &totalSize) {
 
 	totalSize = 1;
 	const DecoderEntry *pSrc = list;
-	while (pSrc->sequence != NULL) {
+	while (pSrc->sequence != nullptr) {
 		totalSize += strlen(pSrc->sequence) + 2;
 		++pSrc;
 	}
@@ -1711,7 +1711,7 @@ void save_string_decoder_data(byte *&data, uint16 &totalSize) {
 	char *pDest = (char *)data;
 
 	pSrc = list;
-	while (pSrc->sequence != NULL) {
+	while (pSrc->sequence != nullptr) {
 		*pDest++ = pSrc->character;
 		strcpy(pDest, pSrc->sequence);
 		pDest += strlen(pSrc->sequence) + 1;
@@ -1872,7 +1872,7 @@ void getEntry(uint8 entryIndex, uint16 &resourceId, byte *&data, uint16 &size) {
 		break;
 
 	default:
-		data = NULL;
+		data = nullptr;
 		size = 0;
 		resourceId = 0xffff;
 		break;
@@ -1955,7 +1955,7 @@ void createFile(const char *outFilename) {
 
 	resourceFlag = true;
 	for (int resIndex=0; resIndex < 0xBE; ++resIndex) {
-		resourceData = NULL;
+		resourceData = nullptr;
 
 		// Get next data entry
 		if (resourceFlag)
@@ -2054,7 +2054,7 @@ bool validate_executable() {
 
 
 int main(int argc, char *argv[]) {
-	const char /**inFilename,*/ *outFilename = 0;
+	const char /**inFilename,*/ *outFilename = nullptr;
 
 	if (argc == 1) {
 		printf("Format: %s output_filename [lureExecutable ..]\n", argv[0]);
diff --git a/devtools/create_lure/process_actions.cpp b/devtools/create_lure/process_actions.cpp
index abf32b6fba..bf164bfa6e 100644
--- a/devtools/create_lure/process_actions.cpp
+++ b/devtools/create_lure/process_actions.cpp
@@ -380,7 +380,7 @@ void read_action_sequence(byte *&data, uint16 &totalSize) {
 	for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) {
 		randomActions[roomIndex].offset = lureExe.readWord();
 		randomActions[roomIndex].numEntries = 0;
-		randomActions[roomIndex].entries = NULL;
+		randomActions[roomIndex].entries = nullptr;
 	}
 
 	// Next get the set of offsetes for the start of each sequence
@@ -540,7 +540,7 @@ void read_action_sequence(byte *&data, uint16 &totalSize) {
 
 	// Free up the random room action array
 	for (roomIndex = 0; roomIndex < 1; ++roomIndex) {
-		if (randomActions[roomIndex].entries != NULL)
+		if (randomActions[roomIndex].entries != nullptr)
 			delete[] randomActions[roomIndex].entries;
 	}
 	delete[] randomActions;
diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index ac1aaba8d1..aa55327cce 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -36,12 +36,12 @@
 
 bool File::open(const char *filename, AccessMode mode) {
 	f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
-	return (f != NULL);
+	return (f != nullptr);
 }
 
 void File::close() {
 	fclose(f);
-	f = NULL;
+	f = nullptr;
 }
 
 int File::seek(int32 offset, int whence) {
diff --git a/devtools/create_neverhood/create_neverhood.cpp b/devtools/create_neverhood/create_neverhood.cpp
index 8940abc6c1..b207ac5adb 100644
--- a/devtools/create_neverhood/create_neverhood.cpp
+++ b/devtools/create_neverhood/create_neverhood.cpp
@@ -81,7 +81,7 @@ byte *getData(uint32 offset) {
 }
 
 const char *getStringP(uint32 offset) {
-	return offset != 0 ? (const char*)getData(offset) : NULL;
+	return offset != 0 ? (const char*)getData(offset) : nullptr;
 }
 
 uint32 calcHash(const char *value) {
diff --git a/devtools/create_neverhood/md5.cpp b/devtools/create_neverhood/md5.cpp
index 0477002654..522bb012f9 100644
--- a/devtools/create_neverhood/md5.cpp
+++ b/devtools/create_neverhood/md5.cpp
@@ -228,7 +228,7 @@ bool md5_file(const char *name, uint8 digest[16], uint32 length) {
 	FILE *f;
 
 	f = fopen(name, "rb");
-	if (f == NULL) {
+	if (f == nullptr) {
 		printf("md5_file couldn't open '%s'\n", name);
 		return false;
 	}
diff --git a/devtools/create_project/cmake.cpp b/devtools/create_project/cmake.cpp
index 8569df91e6..2b5651a4d2 100644
--- a/devtools/create_project/cmake.cpp
+++ b/devtools/create_project/cmake.cpp
@@ -36,28 +36,28 @@ CMakeProvider::CMakeProvider(StringList &global_warnings, std::map<std::string,
 
 const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *feature, bool useSDL2) const {
 	static const Library s_libraries[] = {
-		{ "sdl",        "sdl",               kSDLVersion1,   "FindSDL",      "SDL",      "SDL_INCLUDE_DIR",       "SDL_LIBRARY",         0            },
-		{ "sdl",        "sdl2",              kSDLVersion2,   0,              "SDL2",     0,                       "SDL2_LIBRARIES",      0            },
-		{ "freetype",   "freetype2",         kSDLVersionAny, "FindFreetype", "Freetype", "FREETYPE_INCLUDE_DIRS", "FREETYPE_LIBRARIES",  0            },
-		{ "libz",       "zlib",              kSDLVersionAny, "FindZLIB",     "ZLIB",     "ZLIB_INCLUDE_DIRS",     "ZLIB_LIBRARIES",      0            },
-		{ "png",        "libpng",            kSDLVersionAny, "FindPNG",      "PNG",      "PNG_INCLUDE_DIRS",      "PNG_LIBRARIES",       0            },
-		{ "jpeg",       "libjpeg",           kSDLVersionAny, "FindJPEG",     "JPEG",     "JPEG_INCLUDE_DIRS",     "JPEG_LIBRARIES",      0            },
-		{ "mpeg2",      "libmpeg2",          kSDLVersionAny, "FindMPEG2",    "MPEG2",    "MPEG2_INCLUDE_DIRS",    "MPEG2_mpeg2_LIBRARY", 0            },
-		{ "flac",       "flac",              kSDLVersionAny, 0,              0,          0,                       0,                     "FLAC"       },
-		{ "mad",        "mad",               kSDLVersionAny, 0,              0,          0,                       0,                     "mad"        },
-		{ "ogg",        "ogg",               kSDLVersionAny, 0,              0,          0,                       0,                     "ogg"        },
-		{ "vorbis",     "vorbisfile vorbis", kSDLVersionAny, 0,              0,          0,                       0,                     "vorbisfile vorbis" },
-		{ "tremor",     "vorbisidec",        kSDLVersionAny, 0,              0,          0,                       0,                     "vorbisidec" },
-		{ "theora",     "theoradec",         kSDLVersionAny, 0,              0,          0,                       0,                     "theoradec"  },
-		{ "fluidsynth", "fluidsynth",        kSDLVersionAny, 0,              0,          0,                       0,                     "fluidsynth" },
-		{ "faad",       "faad2",             kSDLVersionAny, 0,              0,          0,                       0,                     "faad"       },
-		{ "fribidi",    "fribidi",           kSDLVersionAny, 0,              0,          0,                       0,                     "fribidi"    },
-		{ "discord",    "discord",           kSDLVersionAny, 0,              0,          0,                       0,                     "discord-rpc"},
-		{ "opengl",     0,                   kSDLVersionAny, "FindOpenGL",   "OpenGL",   "OPENGL_INCLUDE_DIR",    "OPENGL_gl_LIBRARY",   0            },
-		{ "glew",       "glew",              kSDLVersionAny, "FindGLEW",     "GLEW",     "GLEW_INCLUDE_DIR",      "GLEW_LIBRARIES",      0            },
-		{ "libcurl",    "libcurl",           kSDLVersionAny, "FindCURL",     "CURL",     "CURL_INCLUDE_DIRS",     "CURL_LIBRARIES",      0            },
-		{ "sdlnet",     0,                   kSDLVersion1,   "FindSDL_net",  "SDL_net",  "SDL_NET_INCLUDE_DIRS",  "SDL_NET_LIBRARIES",   0            },
-		{ "sdlnet",     "SDL2_net",          kSDLVersion2,   0,              0,          0,                       0,                     "SDL2_net"   }
+		{ "sdl",        "sdl",               kSDLVersion1,   "FindSDL",      "SDL",      "SDL_INCLUDE_DIR",       "SDL_LIBRARY",         nullptr      },
+		{ "sdl",        "sdl2",              kSDLVersion2,   nullptr,        "SDL2",     nullptr,                 "SDL2_LIBRARIES",      nullptr      },
+		{ "freetype",   "freetype2",         kSDLVersionAny, "FindFreetype", "Freetype", "FREETYPE_INCLUDE_DIRS", "FREETYPE_LIBRARIES",  nullptr      },
+		{ "libz",       "zlib",              kSDLVersionAny, "FindZLIB",     "ZLIB",     "ZLIB_INCLUDE_DIRS",     "ZLIB_LIBRARIES",      nullptr      },
+		{ "png",        "libpng",            kSDLVersionAny, "FindPNG",      "PNG",      "PNG_INCLUDE_DIRS",      "PNG_LIBRARIES",       nullptr      },
+		{ "jpeg",       "libjpeg",           kSDLVersionAny, "FindJPEG",     "JPEG",     "JPEG_INCLUDE_DIRS",     "JPEG_LIBRARIES",      nullptr      },
+		{ "mpeg2",      "libmpeg2",          kSDLVersionAny, "FindMPEG2",    "MPEG2",    "MPEG2_INCLUDE_DIRS",    "MPEG2_mpeg2_LIBRARY", nullptr      },
+		{ "flac",       "flac",              kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "FLAC"       },
+		{ "mad",        "mad",               kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "mad"        },
+		{ "ogg",        "ogg",               kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "ogg"        },
+		{ "vorbis",     "vorbisfile vorbis", kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "vorbisfile vorbis" },
+		{ "tremor",     "vorbisidec",        kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "vorbisidec" },
+		{ "theora",     "theoradec",         kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "theoradec"  },
+		{ "fluidsynth", "fluidsynth",        kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "fluidsynth" },
+		{ "faad",       "faad2",             kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "faad"       },
+		{ "fribidi",    "fribidi",           kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "fribidi"    },
+		{ "discord",    "discord",           kSDLVersionAny, nullptr,        nullptr,    nullptr,                 nullptr,               "discord-rpc"},
+		{ "opengl",     nullptr,             kSDLVersionAny, "FindOpenGL",   "OpenGL",   "OPENGL_INCLUDE_DIR",    "OPENGL_gl_LIBRARY",   nullptr      },
+		{ "glew",       "glew",              kSDLVersionAny, "FindGLEW",     "GLEW",     "GLEW_INCLUDE_DIR",      "GLEW_LIBRARIES",      nullptr      },
+		{ "libcurl",    "libcurl",           kSDLVersionAny, "FindCURL",     "CURL",     "CURL_INCLUDE_DIRS",     "CURL_LIBRARIES",      nullptr      },
+		{ "sdlnet",     nullptr,             kSDLVersion1,   "FindSDL_net",  "SDL_net",  "SDL_NET_INCLUDE_DIRS",  "SDL_NET_LIBRARIES",   nullptr      },
+		{ "sdlnet",     "SDL2_net",          kSDLVersion2,   nullptr,        nullptr,    nullptr,                 nullptr,               "SDL2_net"   }
 	};
 
 	for (unsigned int i = 0; i < sizeof(s_libraries) / sizeof(s_libraries[0]); i++) {
@@ -69,7 +69,7 @@ const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *f
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void CMakeProvider::createWorkspace(const BuildSetup &setup) {
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 13560123fe..2ac70b08ee 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -108,7 +108,7 @@ std::map<std::string, bool> isEngineEnabled;
 int main(int argc, char *argv[]) {
 #ifndef USE_WIN32_API
 	// Initialize random number generator for UUID creation
-	std::srand((unsigned int)std::time(0));
+	std::srand((unsigned int)std::time(nullptr));
 #endif
 
 	if (argc < 2) {
@@ -135,7 +135,7 @@ int main(int argc, char *argv[]) {
 	setup.features = getAllFeatures();
 
 	ProjectType projectType = kProjectNone;
-	const MSVCVersion *msvc = NULL;
+	const MSVCVersion *msvc = nullptr;
 	int msvcVersion = 0;
 
 	// Parse command line arguments
@@ -451,7 +451,7 @@ int main(int argc, char *argv[]) {
 	StringList globalWarnings;
 	std::map<std::string, StringList> projectWarnings;
 
-	CreateProjectTool::ProjectProvider *provider = NULL;
+	CreateProjectTool::ProjectProvider *provider = nullptr;
 
 	switch (projectType) {
 	default:
@@ -1239,7 +1239,7 @@ const MSVCVersion *getMSVCVersion(int version) {
 			return &s_msvc[i];
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 int getInstalledMSVC() {
@@ -1248,9 +1248,9 @@ int getInstalledMSVC() {
 	// Use the Visual Studio Installer to get the latest version
 	const char *vsWhere = "\"\"%PROGRAMFILES(X86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -latest -legacy -property installationVersion\"";
 	FILE *pipe = _popen(vsWhere, "rt");
-	if (pipe != NULL) {
+	if (pipe != nullptr) {
 		char version[50];
-		if (fgets(version, 50, pipe) != NULL) {
+		if (fgets(version, 50, pipe) != nullptr) {
 			latest = atoi(version);
 		}
 		_pclose(pipe);
@@ -1260,12 +1260,12 @@ int getInstalledMSVC() {
 	if (latest == 0) {
 		HKEY key;
 		LONG err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7"), 0, KEY_QUERY_VALUE | KEY_WOW64_32KEY, &key);
-		if (err == ERROR_SUCCESS && key != NULL) {
+		if (err == ERROR_SUCCESS && key != nullptr) {
 			const MSVCList msvc = getAllMSVCVersions();
 			for (MSVCList::const_reverse_iterator i = msvc.rbegin(); i != msvc.rend(); ++i) {
 				std::ostringstream version;
 				version << i->version << ".0";
-				err = RegQueryValueExA(key, version.str().c_str(), NULL, NULL, NULL, NULL);
+				err = RegQueryValueExA(key, version.str().c_str(), nullptr, nullptr, nullptr, nullptr);
 				if (err == ERROR_SUCCESS) {
 					latest = i->version;
 					break;
@@ -1460,7 +1460,7 @@ FileList listDirectory(const std::string &dir) {
 
 void createDirectory(const std::string &dir) {
 #if defined(_WIN32) || defined(WIN32)
-	if (!CreateDirectoryA(dir.c_str(), NULL)) {
+	if (!CreateDirectoryA(dir.c_str(), nullptr)) {
 		if (GetLastError() != ERROR_ALREADY_EXISTS) {
 			error("Could not create folder \"" + dir + "\"");
 		}
@@ -1496,7 +1496,7 @@ FileNode *scanFiles(const std::string &dir, const StringList &includeList, const
 	FileList files = listDirectory(dir);
 
 	if (files.empty())
-		return 0;
+		return nullptr;
 
 	FileNode *result = new FileNode(dir);
 	assert(result);
@@ -1532,7 +1532,7 @@ FileNode *scanFiles(const std::string &dir, const StringList &includeList, const
 
 	if (result->children.empty()) {
 		delete result;
-		return 0;
+		return nullptr;
 	} else {
 		result->children.sort(compareNodes);
 		return result;
diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp
index 90986f9ba3..72bc683c06 100644
--- a/devtools/create_project/msvc.cpp
+++ b/devtools/create_project/msvc.cpp
@@ -55,32 +55,32 @@ MSVCProvider::MSVCProvider(StringList &global_warnings, std::map<std::string, St
 std::string MSVCProvider::getLibraryFromFeature(const char *feature, const BuildSetup &setup, bool isRelease) const {
 	static const MSVCLibrary s_libraries[] = {
 		// Libraries
-		{       "sdl", "SDL.lib",                   "SDLd.lib",      "winmm.lib imm32.lib version.lib setupapi.lib",    0 },
-		{      "sdl2", "SDL2.lib",                  "SDL2d.lib",     "winmm.lib imm32.lib version.lib setupapi.lib",    0 },
-		{      "libz", "zlib.lib",                  "zlibd.lib",     0,                                                 0 },
-		{       "mad", "mad.lib",                   0,               0,                                                 "libmad.lib" },
-		{   "fribidi", "fribidi.lib",               0,               0,                                                 0 },
-		{       "ogg", "ogg.lib",                   0,               0,                                                 "libogg_static.lib" },
-		{    "vorbis", "vorbis.lib vorbisfile.lib", 0,               0,                                                 "libvorbisfile_static.lib libvorbis_static.lib" },
-		{      "flac", "FLAC.lib",                  0,               0,                                                 "libFLAC_static.lib win_utf8_io_static.lib" },
-		{       "png", "libpng16.lib",              "libpng16d.lib", 0,                                                 0 },
-		{       "gif", "gif.lib",                   0,               0,                                                 0 },
-		{      "faad", "faad.lib",                  0,               0,                                                 "libfaad.lib" },
-		{     "mpeg2", "mpeg2.lib",                 0,               0,                                                 "libmpeg2.lib" },
-		{    "theora", "theora.lib",                0,               0,                                                 "libtheora_static.lib" },
-		{  "freetype", "freetype.lib",              "freetyped.lib", 0,                                                 0 },
-		{      "jpeg", "jpeg.lib",                  0,               0,                                                 "jpeg-static.lib" },
-		{"fluidsynth", "fluidsynth.lib",            0,               0,                                                 "libfluidsynth.lib" },
-		{ "fluidlite", "fluidlite.lib",             0,               0,                                                 0 },
-		{   "libcurl", "libcurl.lib",               "libcurl-d.lib", "ws2_32.lib wldap32.lib crypt32.lib normaliz.lib", 0 },
-		{    "sdlnet", "SDL_net.lib",               0,               "iphlpapi.lib",                                    0 },
-		{   "sdl2net", "SDL2_net.lib",              0,               "iphlpapi.lib",                                    "SDL_net.lib" },
-		{   "discord", "discord-rpc.lib",           0,               0,                                                 0 },
-		{      "glew", "glew32.lib",                "glew32d.lib",   0,                                                 0 },
+		{       "sdl", "SDL.lib",                   "SDLd.lib",      "winmm.lib imm32.lib version.lib setupapi.lib",    nullptr },
+		{      "sdl2", "SDL2.lib",                  "SDL2d.lib",     "winmm.lib imm32.lib version.lib setupapi.lib",    nullptr },
+		{      "libz", "zlib.lib",                  "zlibd.lib",     nullptr,                                           nullptr },
+		{       "mad", "mad.lib",                   nullptr,         nullptr,                                           "libmad.lib" },
+		{   "fribidi", "fribidi.lib",               nullptr,         nullptr,                                           nullptr },
+		{       "ogg", "ogg.lib",                   nullptr,         nullptr,                                           "libogg_static.lib" },
+		{    "vorbis", "vorbis.lib vorbisfile.lib", nullptr,         nullptr,                                           "libvorbisfile_static.lib libvorbis_static.lib" },
+		{      "flac", "FLAC.lib",                  nullptr,         nullptr,                                           "libFLAC_static.lib win_utf8_io_static.lib" },
+		{       "png", "libpng16.lib",              "libpng16d.lib", nullptr,                                           nullptr },
+		{       "gif", "gif.lib",                   nullptr,         nullptr,                                           nullptr },
+		{      "faad", "faad.lib",                  nullptr,         nullptr,                                           "libfaad.lib" },
+		{     "mpeg2", "mpeg2.lib",                 nullptr,         nullptr,                                           "libmpeg2.lib" },
+		{    "theora", "theora.lib",                nullptr,         nullptr,                                           "libtheora_static.lib" },
+		{  "freetype", "freetype.lib",              "freetyped.lib", nullptr,                                           nullptr },
+		{      "jpeg", "jpeg.lib",                  nullptr,         nullptr,                                           "jpeg-static.lib" },
+		{"fluidsynth", "fluidsynth.lib",            nullptr,         nullptr,                                           "libfluidsynth.lib" },
+		{ "fluidlite", "fluidlite.lib",             nullptr,         nullptr,                                           nullptr },
+		{   "libcurl", "libcurl.lib",               "libcurl-d.lib", "ws2_32.lib wldap32.lib crypt32.lib normaliz.lib", nullptr },
+		{    "sdlnet", "SDL_net.lib",               nullptr,         "iphlpapi.lib",                                    nullptr },
+		{   "sdl2net", "SDL2_net.lib",              nullptr,         "iphlpapi.lib",                                    "SDL_net.lib" },
+		{   "discord", "discord-rpc.lib",           nullptr,         nullptr,                                           nullptr },
+		{      "glew", "glew32.lib",                "glew32d.lib",   nullptr,                                           nullptr },
 		// Feature flags with library dependencies
-		{   "updates", "winsparkle.lib",            0,               0,                                                 0 },
-		{       "tts", 0,                           0,               "sapi.lib",                                        0 },
-		{    "opengl", 0,                           0,               "opengl32.lib",                                    0 }
+		{   "updates", "winsparkle.lib",            nullptr,         nullptr,                                           nullptr },
+		{       "tts", nullptr,                     nullptr,         "sapi.lib",                                        nullptr },
+		{    "opengl", nullptr,                     nullptr,         "opengl32.lib",                                    nullptr }
 	};
 
 	// HACK for switching SDL_net to SDL2_net
@@ -89,7 +89,7 @@ std::string MSVCProvider::getLibraryFromFeature(const char *feature, const Build
 		feature = sdl2net;
 	}
 
-	const MSVCLibrary *library = 0;
+	const MSVCLibrary *library = nullptr;
 	for (unsigned int i = 0; i < sizeof(s_libraries) / sizeof(s_libraries[0]); i++) {
 		if (std::strcmp(feature, s_libraries[i].feature) == 0) {
 			library = &s_libraries[i];
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index 0e89654408..e9980c7282 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -220,7 +220,7 @@ XcodeProvider::Group *XcodeProvider::Group::getChildGroup(const std::string &nam
 }
 
 XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path) {
-	if (_rootSourceGroup == NULL) {
+	if (_rootSourceGroup == nullptr) {
 		assert(path == _projectRoot);
 		_rootSourceGroup = new Group(this, "Sources", path, path);
 		_groups.add(_rootSourceGroup);
@@ -272,7 +272,7 @@ void XcodeProvider::addBuildFile(const std::string &id, const std::string &name,
 
 XcodeProvider::XcodeProvider(StringList &global_warnings, std::map<std::string, StringList> &project_warnings, const int version)
 	: ProjectProvider(global_warnings, project_warnings, version) {
-	_rootSourceGroup = NULL;
+	_rootSourceGroup = nullptr;
 }
 
 void XcodeProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) {
diff --git a/devtools/create_supernova/create_supernova.cpp b/devtools/create_supernova/create_supernova.cpp
index 34f6a43f42..374e1f9420 100644
--- a/devtools/create_supernova/create_supernova.cpp
+++ b/devtools/create_supernova/create_supernova.cpp
@@ -13,7 +13,7 @@
 const char *lang[] = {
 	"en",
 	"it",
-	NULL
+	nullptr
 };
 
 void writeDatafile(File& outputFile, int fileNumber, const char* language, int part) {
diff --git a/devtools/create_supernova/file.cpp b/devtools/create_supernova/file.cpp
index d54258d5a4..a43517b034 100644
--- a/devtools/create_supernova/file.cpp
+++ b/devtools/create_supernova/file.cpp
@@ -2,12 +2,12 @@
 
 bool File::open(const char *filename, AccessMode mode) {
 	f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
-	return (f != NULL);
+	return (f != nullptr);
 }
 
 void File::close() {
 	fclose(f);
-	f = NULL;
+	f = nullptr;
 }
 
 int File::seek(int32 offset, int whence) {
diff --git a/devtools/create_supernova/po_parser.cpp b/devtools/create_supernova/po_parser.cpp
index 05a8ac14a7..d2661dcd8a 100644
--- a/devtools/create_supernova/po_parser.cpp
+++ b/devtools/create_supernova/po_parser.cpp
@@ -5,7 +5,7 @@
 
 #include "po_parser.h"
 
-PoMessageList::PoMessageList() : _list(NULL), _size(0), _allocated(0) {
+PoMessageList::PoMessageList() : _list(nullptr), _size(0), _allocated(0) {
 }
 
 PoMessageList::~PoMessageList() {
@@ -15,11 +15,11 @@ PoMessageList::~PoMessageList() {
 }
 
 int PoMessageList::compareString(const char* left, const char* right) {
-	if (left == NULL && right == NULL)
+	if (left == nullptr && right == nullptr)
 		return 0;
-	if (left == NULL)
+	if (left == nullptr)
 		return -1;
-	if (right == NULL)
+	if (right == nullptr)
 		return 1;
 	return strcmp(left, right);
 }
@@ -32,7 +32,7 @@ int PoMessageList::compareMessage(const char *msgLeft, const char *contextLeft,
 }
 
 void PoMessageList::insert(const char *translation, const char *msg, const char *context) {
-	if (msg == NULL || *msg == '\0' || translation == NULL || *translation == '\0')
+	if (msg == nullptr || *msg == '\0' || translation == nullptr || *translation == '\0')
 		return;
 
 	// binary-search for the insertion index
@@ -68,8 +68,8 @@ void PoMessageList::insert(const char *translation, const char *msg, const char
 }
 
 const char *PoMessageList::findTranslation(const char *msg, const char *context) {
-	if (msg == NULL || *msg == '\0')
-		return NULL;
+	if (msg == nullptr || *msg == '\0')
+		return nullptr;
 
 	// binary-search for the message
 	int leftIndex = 0;
@@ -84,13 +84,13 @@ const char *PoMessageList::findTranslation(const char *msg, const char *context)
 		else
 			leftIndex = midIndex + 1;
 	}
-	return NULL;
+	return nullptr;
 }
 
 PoMessageList *parsePoFile(const char *file) {
 	FILE *inFile = fopen(file, "r");
 	if (!inFile)
-		return NULL;
+		return nullptr;
 
 	char msgidBuf[1024], msgctxtBuf[1024], msgstrBuf[1024];
 	char line[1024], *currentBuf = msgstrBuf;
@@ -198,8 +198,8 @@ char *parseLine(const char *line, const char *field) {
 	// It is used to parse the header of the po files to find the language name
 	// and the charset.
 	const char *str = strstr(line, field);
-	if (str == NULL)
-		return NULL;
+	if (str == nullptr)
+		return nullptr;
 	str += strlen(field);
 	// Skip spaces
 	while (*str != '\0' && isspace(*str)) {
@@ -211,7 +211,7 @@ char *parseLine(const char *line, const char *field) {
 		++len;
 	}
 	if (len == 0)
-		return NULL;
+		return nullptr;
 	// Create result string
 	char *result = new char[len + 1];
 	strncpy(result, str, len);
diff --git a/devtools/create_teenagent/create_teenagent.cpp b/devtools/create_teenagent/create_teenagent.cpp
index 2f180bb814..916cfe28b6 100644
--- a/devtools/create_teenagent/create_teenagent.cpp
+++ b/devtools/create_teenagent/create_teenagent.cpp
@@ -33,7 +33,7 @@ int main(int argc, char *argv[]) {
 	const char *dat_name = "teenagent.dat";
 
 	FILE *fout = fopen(dat_name, "wb");
-	if (fout == NULL) {
+	if (fout == nullptr) {
 		perror("opening output file");
 		exit(1);
 	}
diff --git a/devtools/create_titanic/memorypool.cpp b/devtools/create_titanic/memorypool.cpp
index 13c640b6ad..55715a810e 100644
--- a/devtools/create_titanic/memorypool.cpp
+++ b/devtools/create_titanic/memorypool.cpp
@@ -43,7 +43,7 @@ static size_t adjustChunkSize(size_t chunkSize) {
 MemoryPool::MemoryPool(size_t chunkSize)
 	: _chunkSize(adjustChunkSize(chunkSize)) {
 
-	_next = NULL;
+	_next = nullptr;
 
 	_chunksPerPage = INITIAL_CHUNKS_PER_PAGE;
 }
@@ -154,7 +154,7 @@ void MemoryPool::freeUnusedPages() {
 
 			::free(_pages[i].start);
 			++freedPagesCount;
-			_pages[i].start = NULL;
+			_pages[i].start = nullptr;
 		}
 	}
 
@@ -163,7 +163,7 @@ void MemoryPool::freeUnusedPages() {
 	// Remove all now unused pages
 	size_t newSize = 0;
 	for (size_t i = 0; i < _pages.size(); ++i) {
-		if (_pages[i].start != NULL) {
+		if (_pages[i].start != nullptr) {
 			if (newSize != i)
 				_pages[newSize] = _pages[i];
 			++newSize;
diff --git a/devtools/create_titanic/winexe_pe.cpp b/devtools/create_titanic/winexe_pe.cpp
index 6d38261787..34209ec4bc 100644
--- a/devtools/create_titanic/winexe_pe.cpp
+++ b/devtools/create_titanic/winexe_pe.cpp
@@ -31,7 +31,7 @@
 namespace Common {
 
 PEResources::PEResources() {
-	_exe = 0;
+	_exe = nullptr;
 }
 
 PEResources::~PEResources() {
@@ -41,7 +41,7 @@ PEResources::~PEResources() {
 void PEResources::clear() {
 	_sections.clear();
 	_resources.clear();
-	delete _exe; _exe = 0;
+	delete _exe; _exe = nullptr;
 }
 
 bool PEResources::loadFromEXE(File *stream) {
@@ -207,7 +207,7 @@ File *PEResources::getResource(const WinResourceID &type, const WinResourceID &i
 	Array<WinResourceID> langList = getLangList(type, id);
 
 	if (langList.empty())
-		return 0;
+		return nullptr;
 
 	const Resource &resource = _resources[type][id][langList[0]];
 	byte *data = (byte *)malloc(resource.size);
@@ -221,17 +221,17 @@ File *PEResources::getResource(const WinResourceID &type, const WinResourceID &i
 
 File *PEResources::getResource(const WinResourceID &type, const WinResourceID &id, const WinResourceID &lang) {
 	if (!_exe || !_resources.contains(type))
-		return 0;
+		return nullptr;
 
 	const IDMap &idMap = _resources[type];
 
 	if (!idMap.contains(id))
-		return 0;
+		return nullptr;
 
 	const LangMap &langMap = idMap[id];
 
 	if (!langMap.contains(lang))
-		return 0;
+		return nullptr;
 
 	const Resource &resource = langMap[lang];
 	byte *data = (byte *)malloc(resource.size);
diff --git a/devtools/create_titanic/zlib.cpp b/devtools/create_titanic/zlib.cpp
index 8cc916e8b0..eb44212e41 100644
--- a/devtools/create_titanic/zlib.cpp
+++ b/devtools/create_titanic/zlib.cpp
@@ -83,7 +83,7 @@ bool inflateZlibHeaderless(byte *dst, uint dstLen, const byte *src, uint srcLen,
 		return false;
 
 	// Set the dictionary, if provided
-	if (dict != 0) {
+	if (dict != nullptr) {
 		err = inflateSetDictionary(&stream, const_cast<byte *>(dict), dictLen);
 		if (err != Z_OK)
 			return false;
@@ -180,7 +180,7 @@ protected:
 public:
 
 	GZipReadStream(SeekableReadStream *w, uint32 knownSize = 0) : _wrapped(w), _stream() {
-		assert(w != 0);
+		assert(w != nullptr);
 
 		// Verify file header is correct
 		w->seek(0, SEEK_SET);
@@ -349,7 +349,7 @@ protected:
 
 public:
 	GZipWriteStream(WriteStream *w) : _wrapped(w), _stream(), _pos(0) {
-		assert(w != 0);
+		assert(w != nullptr);
 
 		// Adding 16 to windowBits indicates to zlib that it is supposed to
 		// write gzip headers. This feature was added in zlib 1.2.0.4,
@@ -366,7 +366,7 @@ public:
 		_stream.next_out = _buf;
 		_stream.avail_out = BUFSIZE;
 		_stream.avail_in = 0;
-		_stream.next_in = 0;
+		_stream.next_in = nullptr;
 	}
 
 	~GZipWriteStream() {
diff --git a/devtools/create_translations/create_translations.cpp b/devtools/create_translations/create_translations.cpp
index 44180313df..5b016c5999 100644
--- a/devtools/create_translations/create_translations.cpp
+++ b/devtools/create_translations/create_translations.cpp
@@ -72,7 +72,7 @@ void writeUint32BE(FILE *fp, uint32 value) {
 
 int stringSize(const char *string) {
 	// Each string is preceded by its size coded on 2 bytes
-	if (string == NULL)
+	if (string == nullptr)
 		return 2;
 	int len = strlen(string) + 1;
 	return 2 + len;
@@ -83,7 +83,7 @@ int stringSize(const char *string) {
 
 void writeString(FILE *fp, const char *string) {
 	// Each string is preceded by its size coded on 2 bytes
-	if (string == NULL) {
+	if (string == nullptr) {
 		writeUint16BE(fp, 0);
 		return;
 	}
@@ -109,7 +109,7 @@ int main(int argc, char *argv[]) {
 		int len = strlen(argv[i]);
 		if (scumm_stricmp(argv[i] + len - 2, "po") == 0) {
 			PoMessageEntryList *po = parsePoFile(argv[i], messageIds);
-			if (po != NULL) {
+			if (po != nullptr) {
 				translations.push_back(po);
 				++numLangs;
 			}
diff --git a/devtools/create_translations/po_parser.cpp b/devtools/create_translations/po_parser.cpp
index 982c45059f..d00614afb2 100644
--- a/devtools/create_translations/po_parser.cpp
+++ b/devtools/create_translations/po_parser.cpp
@@ -29,7 +29,7 @@
 
 #include "po_parser.h"
 
-PoMessageList::PoMessageList() : _messages(NULL), _size(0), _allocated(0) {
+PoMessageList::PoMessageList() : _messages(nullptr), _size(0), _allocated(0) {
 }
 
 PoMessageList::~PoMessageList() {
@@ -39,7 +39,7 @@ PoMessageList::~PoMessageList() {
 }
 
 void PoMessageList::insert(const char *msg) {
-	if (msg == NULL || *msg == '\0')
+	if (msg == nullptr || *msg == '\0')
 		return;
 
 	// binary-search for the insertion index
@@ -76,7 +76,7 @@ void PoMessageList::insert(const char *msg) {
 }
 
 int PoMessageList::findIndex(const char *msg) {
-	if (msg == NULL || *msg == '\0')
+	if (msg == nullptr || *msg == '\0')
 		return -1;
 
 	// binary-search for the message
@@ -103,13 +103,13 @@ int PoMessageList::size() const {
 
 const char *PoMessageList::operator[](int index) const {
 	if (index < 0 || index >= _size)
-		return NULL;
+		return nullptr;
 	return _messages[index];
 }
 
 PoMessageEntryList::PoMessageEntryList(const char *lang) :
-	_lang(NULL), _langName(NULL), _langNameAlt(NULL), _useUTF8(true),
-	_list(NULL), _size(0), _allocated(0)
+	_lang(nullptr), _langName(nullptr), _langNameAlt(nullptr), _useUTF8(true),
+	_list(nullptr), _size(0), _allocated(0)
 {
 	_lang = new char[1 + strlen(lang)];
 	strcpy(_lang, lang);
@@ -132,12 +132,12 @@ void PoMessageEntryList::addMessageEntry(const char *translation, const char *me
 		// This is the header.
 		// We get the charset and the language name from the translation string
 		char *str = parseLine(translation, "X-Language-name:");
-		if (str != NULL) {
+		if (str != nullptr) {
 			delete[] _langName;
 			_langName = str;
 		}
 		str = parseLine(translation, "Language:");
-		if (str != NULL) {
+		if (str != nullptr) {
 			delete[] _langNameAlt;
 			_langNameAlt = str;
 		}
@@ -155,12 +155,12 @@ void PoMessageEntryList::addMessageEntry(const char *translation, const char *me
 		int midIndex = (leftIndex + rightIndex) / 2;
 		int compareResult = strcmp(message, _list[midIndex]->msgid);
 		if (compareResult == 0) {
-			if (context == NULL) {
-				if (_list[midIndex]->msgctxt == NULL)
+			if (context == nullptr) {
+				if (_list[midIndex]->msgctxt == nullptr)
 					return;
 				compareResult = -1;
 			} else {
-				if (_list[midIndex]->msgctxt == NULL)
+				if (_list[midIndex]->msgctxt == nullptr)
 					compareResult = 1;
 				else {
 					compareResult = strcmp(context, _list[midIndex]->msgctxt);
@@ -180,14 +180,14 @@ void PoMessageEntryList::addMessageEntry(const char *translation, const char *me
 	// context if it is not present for a specific context, we can optimize the file
 	// size, memory used at run-time and performances (less strings to read from the file
 	// and less strings to look for) by avoiding duplicate.
-	if (context != NULL && *context != '\0') {
+	if (context != nullptr && *context != '\0') {
 		// Check if we have the same translation for no context
 		int contextIndex = leftIndex - 1;
 		while (contextIndex >= 0 && strcmp (message, _list[contextIndex]->msgid) == 0) {
 			--contextIndex;
 		}
 		++contextIndex;
-		if (contextIndex < leftIndex && _list[contextIndex]->msgctxt == NULL && strcmp(translation, _list[contextIndex]->msgstr) == 0)
+		if (contextIndex < leftIndex && _list[contextIndex]->msgctxt == nullptr && strcmp(translation, _list[contextIndex]->msgstr) == 0)
 			return;
 	}
 
@@ -208,7 +208,7 @@ void PoMessageEntryList::addMessageEntry(const char *translation, const char *me
 	_list[leftIndex] = new PoMessageEntry(translation, message, context);
 	++_size;
 
-	if (context == NULL || *context == '\0') {
+	if (context == nullptr || *context == '\0') {
 		// Remove identical translations for a specific context (see comment above)
 		int contextIndex = leftIndex + 1;
 		int removed = 0;
@@ -250,7 +250,7 @@ int PoMessageEntryList::size() const {
 
 const PoMessageEntry *PoMessageEntryList::entry(int index) const {
 	if (index < 0 || index >= _size)
-		return NULL;
+		return nullptr;
 	return _list[index];
 }
 
@@ -258,7 +258,7 @@ const PoMessageEntry *PoMessageEntryList::entry(int index) const {
 PoMessageEntryList *parsePoFile(const char *file, PoMessageList& messages) {
 	FILE *inFile = fopen(file, "r");
 	if (!inFile)
-		return NULL;
+		return nullptr;
 
 	char msgidBuf[2048], msgctxtBuf[2048], msgstrBuf[2048];
 	char line[2048], *currentBuf = msgstrBuf;
@@ -382,8 +382,8 @@ char *parseLine(const char *line, const char *field) {
 	// It is used to parse the header of the po files to find the language name
 	// and the charset.
 	const char *str = strstr(line, field);
-	if (str == NULL)
-		return NULL;
+	if (str == nullptr)
+		return nullptr;
 	str += strlen(field);
 	// Skip spaces
 	while (*str != '\0' && isspace(*str)) {
@@ -395,7 +395,7 @@ char *parseLine(const char *line, const char *field) {
 		++len;
 	}
 	if (len == 0)
-		return NULL;
+		return nullptr;
 	// Create result string
 	char *result = new char[len + 1];
 	strncpy(result, str, len);
diff --git a/devtools/create_xeen/memorypool.cpp b/devtools/create_xeen/memorypool.cpp
index 13c640b6ad..55715a810e 100644
--- a/devtools/create_xeen/memorypool.cpp
+++ b/devtools/create_xeen/memorypool.cpp
@@ -43,7 +43,7 @@ static size_t adjustChunkSize(size_t chunkSize) {
 MemoryPool::MemoryPool(size_t chunkSize)
 	: _chunkSize(adjustChunkSize(chunkSize)) {
 
-	_next = NULL;
+	_next = nullptr;
 
 	_chunksPerPage = INITIAL_CHUNKS_PER_PAGE;
 }
@@ -154,7 +154,7 @@ void MemoryPool::freeUnusedPages() {
 
 			::free(_pages[i].start);
 			++freedPagesCount;
-			_pages[i].start = NULL;
+			_pages[i].start = nullptr;
 		}
 	}
 
@@ -163,7 +163,7 @@ void MemoryPool::freeUnusedPages() {
 	// Remove all now unused pages
 	size_t newSize = 0;
 	for (size_t i = 0; i < _pages.size(); ++i) {
-		if (_pages[i].start != NULL) {
+		if (_pages[i].start != nullptr) {
 			if (newSize != i)
 				_pages[newSize] = _pages[i];
 			++newSize;
diff --git a/devtools/extract_mort/extract_mort.cpp b/devtools/extract_mort/extract_mort.cpp
index f3507ad59c..0400c4b311 100644
--- a/devtools/extract_mort/extract_mort.cpp
+++ b/devtools/extract_mort/extract_mort.cpp
@@ -44,11 +44,11 @@ private:
 public:
 	bool open(const char *filename, AccessMode mode = kFileReadMode) {
 		f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
-		return (f != NULL);
+		return (f != nullptr);
 	}
 	void close() {
 		fclose(f);
-		f = NULL;
+		f = nullptr;
 	}
 	int seek(int32 offset, int whence = SEEK_SET) {
 		return fseek(f, offset, whence);
diff --git a/devtools/make-scumm-fontdata.cpp b/devtools/make-scumm-fontdata.cpp
index 268d3339dd..b843eff756 100644
--- a/devtools/make-scumm-fontdata.cpp
+++ b/devtools/make-scumm-fontdata.cpp
@@ -816,7 +816,7 @@ static const unsigned char spanishCharsetDataV2[] = {
 	0x08, 0x0c, 0x0e, 0xff, 0xff, 0x0e, 0x0c, 0x08,
 };
 
-unsigned char *specialCharsetData = NULL;
+unsigned char *specialCharsetData = nullptr;
 int numSpecialChars = 0;
 
 void compressCharset(const unsigned char *data, const char *var, const char *name) {
@@ -884,7 +884,7 @@ int main(int /*argc*/, char ** /*argv*/) {
 	printf("};\n");
 
 	free(specialCharsetData);
-	specialCharsetData = NULL;
+	specialCharsetData = nullptr;
 
 	return 0;
 }
diff --git a/devtools/md5table.cpp b/devtools/md5table.cpp
index 48fed4706a..809ac4eca8 100644
--- a/devtools/md5table.cpp
+++ b/devtools/md5table.cpp
@@ -92,7 +92,7 @@ static const StringMap platformMap[] = {
 	{ "All?",		"kPlatformUnknown" },
 	{ "All",		"kPlatformUnknown" },
 
-	{ 0,			"kPlatformUnknown" }
+	{ nullptr,			"kPlatformUnknown" }
 };
 
 static const StringMap langMap[] = {
@@ -119,7 +119,7 @@ static const StringMap langMap[] = {
 	{ "All",	"UNK_LANG" },
 	{ "All?",	"UNK_LANG" },
 
-	{ 0,		"UNK_LANG" }
+	{ nullptr,		"UNK_LANG" }
 };
 
 static const char *php_header =
@@ -166,13 +166,13 @@ static void parseEntry(Entry *entry, char *line) {
 
 	/* Split at the tabs */
 	entry->md5 = strtok(line, "\t\n\r");
-	entry->size = strtok(NULL, "\t\n\r");
-	entry->language = strtok(NULL, "\t\n\r");
-	entry->platform = strtok(NULL, "\t\n\r");
-	entry->variant = strtok(NULL, "\t\n\r");
-	entry->extra = strtok(NULL, "\t\n\r");
-	entry->desc = strtok(NULL, "\t\n\r");
-	entry->infoSource = strtok(NULL, "\t\n\r");
+	entry->size = strtok(nullptr, "\t\n\r");
+	entry->language = strtok(nullptr, "\t\n\r");
+	entry->platform = strtok(nullptr, "\t\n\r");
+	entry->variant = strtok(nullptr, "\t\n\r");
+	entry->extra = strtok(nullptr, "\t\n\r");
+	entry->desc = strtok(nullptr, "\t\n\r");
+	entry->infoSource = strtok(nullptr, "\t\n\r");
 }
 
 static int isEmptyLine(const char *line) {
diff --git a/devtools/skycpt/TextFile.cpp b/devtools/skycpt/TextFile.cpp
index b03e66121f..e028c27529 100644
--- a/devtools/skycpt/TextFile.cpp
+++ b/devtools/skycpt/TextFile.cpp
@@ -25,7 +25,7 @@
 
 TextFile::TextFile(const char *name) {
 	FILE *inf = fopen(name, "r");
-	_lines = NULL;
+	_lines = nullptr;
 	if (!inf) {
 		printf("Unable to open file %s\n", name);
 		getchar();
@@ -54,7 +54,7 @@ uint32 crop(char *line) {
 
 char *TextFile::giveLine(uint32 num) {
 	if (num >= _numLines)
-		return NULL;
+		return nullptr;
 	else
 		return _lines[num];
 }
diff --git a/devtools/skycpt/cpthelp.cpp b/devtools/skycpt/cpthelp.cpp
index e2e4577a90..b2e10fd6bf 100644
--- a/devtools/skycpt/cpthelp.cpp
+++ b/devtools/skycpt/cpthelp.cpp
@@ -24,7 +24,7 @@
 #include "cpthelp.h"
 
 void assertEmpty(CptObj *cpt) {
-	assert((cpt->len == 0) && (cpt->data == NULL) && (cpt->dbgName == NULL) && (cpt->type == 0));
+	assert((cpt->len == 0) && (cpt->data == nullptr) && (cpt->dbgName == nullptr) && (cpt->type == 0));
 }
 
 uint16 getInfo(const char *line, const char *type, char *nameDest) {


Commit: c97917c8f50bbe419632424ee5e3db90cab3cad3
    https://github.com/scummvm/scummvm/commit/c97917c8f50bbe419632424ee5e3db90cab3cad3
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
ACCESS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/access/debugger.cpp
    engines/access/detection.cpp
    engines/access/video/movie_decoder.cpp


diff --git a/engines/access/debugger.cpp b/engines/access/debugger.cpp
index 1f563cc4b5..413e2024e8 100644
--- a/engines/access/debugger.cpp
+++ b/engines/access/debugger.cpp
@@ -134,7 +134,7 @@ bool Debugger::Cmd_PlayMovie(int argc, const char **argv) {
 	Common::String filename = argv[1];
 	_playMovieFile = filename;
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/access/detection.cpp b/engines/access/detection.cpp
index 53cce15170..ac3e823794 100644
--- a/engines/access/detection.cpp
+++ b/engines/access/detection.cpp
@@ -28,7 +28,7 @@
 static const PlainGameDescriptor AccessGames[] = {
 	{"amazon", "Amazon: Guardians of Eden"},
 	{"martian", "Martian Memorandum"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/access/video/movie_decoder.cpp b/engines/access/video/movie_decoder.cpp
index 2b64af6267..6714e512d7 100644
--- a/engines/access/video/movie_decoder.cpp
+++ b/engines/access/video/movie_decoder.cpp
@@ -43,7 +43,7 @@
 namespace Access {
 
 AccessVIDMovieDecoder::AccessVIDMovieDecoder()
-	: _stream(0), _videoTrack(0), _audioTrack(0) {
+	: _stream(nullptr), _videoTrack(nullptr), _audioTrack(nullptr) {
 	_streamSeekOffset = 0;
 	_streamVideoIndex = 0;
 	_streamAudioIndex = 0;
@@ -207,8 +207,8 @@ bool AccessVIDMovieDecoder::loadStream(Common::SeekableReadStream *stream) {
 void AccessVIDMovieDecoder::close() {
 	Video::VideoDecoder::close();
 
-	delete _stream; _stream = 0;
-	_videoTrack = 0;
+	delete _stream; _stream = nullptr;
+	_videoTrack = nullptr;
 
 	_indexCacheTable.clear();
 }
@@ -656,8 +656,8 @@ AccessVIDMovieDecoder::StreamAudioTrack::~StreamAudioTrack() {
 }
 
 void AccessVIDMovieDecoder::StreamAudioTrack::queueAudio(Common::SeekableReadStream *stream, byte chunkId) {
-	Common::SeekableReadStream *rawAudioStream = 0;
-	Audio::RewindableAudioStream *audioStream = 0;
+	Common::SeekableReadStream *rawAudioStream = nullptr;
+	Audio::RewindableAudioStream *audioStream = nullptr;
 	uint32 audioLengthMSecs = 0;
 
 	if (chunkId == kVIDMovieChunkId_AudioFirstChunk) {


Commit: b125faf954c96fcbb47027185c0d2f2e3f38f69a
    https://github.com/scummvm/scummvm/commit/b125faf954c96fcbb47027185c0d2f2e3f38f69a
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
ADL: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/adl/console.cpp
    engines/adl/detection.cpp


diff --git a/engines/adl/console.cpp b/engines/adl/console.cpp
index def444f55a..da557ecb02 100644
--- a/engines/adl/console.cpp
+++ b/engines/adl/console.cpp
@@ -199,7 +199,7 @@ bool Console::Cmd_Region(int argc, const char **argv) {
 		}
 
 		uint regionCount = _engine->_state.regions.size();
-		uint region = strtoul(argv[1], NULL, 0);
+		uint region = strtoul(argv[1], nullptr, 0);
 		if (region < 1 || region > regionCount) {
 			debugPrintf("Region %u out of valid range [1, %u]\n", region, regionCount);
 			return true;
@@ -227,7 +227,7 @@ bool Console::Cmd_Room(int argc, const char **argv) {
 		}
 
 		uint roomCount = _engine->_state.rooms.size();
-		uint room = strtoul(argv[1], NULL, 0);
+		uint room = strtoul(argv[1], nullptr, 0);
 		if (room < 1 || room > roomCount) {
 			debugPrintf("Room %u out of valid range [1, %u]\n", room, roomCount);
 			return true;
@@ -335,7 +335,7 @@ bool Console::Cmd_Var(int argc, const char **argv) {
 	}
 
 	uint varCount = _engine->_state.vars.size();
-	uint var = strtoul(argv[1], NULL, 0);
+	uint var = strtoul(argv[1], nullptr, 0);
 
 	if (var >= varCount) {
 		debugPrintf("Variable %u out of valid range [0, %u]\n", var, varCount - 1);
@@ -343,7 +343,7 @@ bool Console::Cmd_Var(int argc, const char **argv) {
 	}
 
 	if (argc == 3) {
-		uint value = strtoul(argv[2], NULL, 0);
+		uint value = strtoul(argv[2], nullptr, 0);
 		_engine->_state.vars[var] = value;
 	}
 
diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index 9465252ab5..43cf5c717f 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -112,7 +112,7 @@ static const PlainGameDescriptor adlGames[] = {
 	{ "hires4", "Hi-Res Adventure #4: Ulysses and the Golden Fleece" },
 	{ "hires5", "Hi-Res Adventure #5: Time Zone" },
 	{ "hires6", "Hi-Res Adventure #6: The Dark Crystal" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const AdlGameDescription gameFileDescriptions[] = {
@@ -514,7 +514,7 @@ ADDetectedGames AdlMetaEngineDetection::detectGame(const Common::FSNode &parent,
 
 	FilePropertiesMap filesProps;
 
-	for (uint g = 0; gameDiskDescriptions[g].desc.gameId != 0; ++g) {
+	for (uint g = 0; gameDiskDescriptions[g].desc.gameId != nullptr; ++g) {
 		ADDetectedGame game(&gameDiskDescriptions[g].desc);
 
 		// Skip games that don't meet the language/platform/extra criteria


Commit: f1f4657b1010f2420bea760e6c3c99995cc64509
    https://github.com/scummvm/scummvm/commit/f1f4657b1010f2420bea760e6c3c99995cc64509
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
AGI: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/agi/agi.cpp
    engines/agi/console.cpp
    engines/agi/cycle.cpp
    engines/agi/detection.cpp
    engines/agi/graphics.cpp
    engines/agi/loader_v1.cpp
    engines/agi/loader_v2.cpp
    engines/agi/loader_v3.cpp
    engines/agi/logic.cpp
    engines/agi/metaengine.cpp
    engines/agi/objects.cpp
    engines/agi/op_cmd.cpp
    engines/agi/op_test.cpp
    engines/agi/opcodes.cpp
    engines/agi/picture.cpp
    engines/agi/preagi_mickey.cpp
    engines/agi/preagi_winnie.cpp
    engines/agi/sound.cpp
    engines/agi/sound_2gs.cpp
    engines/agi/sound_midi.cpp
    engines/agi/sound_pcjr.cpp
    engines/agi/sprite.cpp
    engines/agi/text.cpp
    engines/agi/wagparser.cpp


diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 44f923a0b7..1050b16f77 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -256,7 +256,7 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys
 	_noSaveLoadAllowed = false;
 
 	_rnd = new Common::RandomSource("agi");
-	_sound = 0;
+	_sound = nullptr;
 
 	initFeatures();
 	initVersion();
@@ -362,7 +362,7 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
 
 	_allowSynthetic = false;
 
-	_intobj = NULL;
+	_intobj = nullptr;
 
 	memset(&_stringdata, 0, sizeof(struct StringData));
 
@@ -372,7 +372,7 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
 
 	resetControllers();
 
-	_game._curLogic = NULL;
+	_game._curLogic = nullptr;
 	_veryFirstInitialCycle = true;
 	_instructionCounter = 0;
 	resetGetVarSecondsHeuristic();
diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp
index 4e310a3aac..f227bc6183 100644
--- a/engines/agi/console.cpp
+++ b/engines/agi/console.cpp
@@ -108,11 +108,11 @@ bool Console::Cmd_RunOpcode(int argc, const char **argv) {
 				debugPrintf("AGI command wants %d arguments\n", opCodes[i].parameterSize);
 				return 0;
 			}
-			p[0] = argv[2] ? (char)strtoul(argv[2], NULL, 0) : 0;
-			p[1] = argv[3] ? (char)strtoul(argv[3], NULL, 0) : 0;
-			p[2] = argv[4] ? (char)strtoul(argv[4], NULL, 0) : 0;
-			p[3] = argv[5] ? (char)strtoul(argv[5], NULL, 0) : 0;
-			p[4] = argv[6] ? (char)strtoul(argv[6], NULL, 0) : 0;
+			p[0] = argv[2] ? (char)strtoul(argv[2], nullptr, 0) : 0;
+			p[1] = argv[3] ? (char)strtoul(argv[3], nullptr, 0) : 0;
+			p[2] = argv[4] ? (char)strtoul(argv[4], nullptr, 0) : 0;
+			p[3] = argv[5] ? (char)strtoul(argv[5], nullptr, 0) : 0;
+			p[4] = argv[6] ? (char)strtoul(argv[6], nullptr, 0) : 0;
 
 			debugC(5, kDebugLevelMain, "Opcode: %s %s %s %s", opCodes[i].name, argv[1], argv[2], argv[3]);
 
@@ -147,10 +147,10 @@ bool Console::Cmd_Version(int argc, const char **argv) {
 	int scriptNr = 0;
 	int scriptTextCount = 0;
 	int scriptTextNr = 0;
-	const char *scriptTextPtr = NULL;
-	const char *wordScanPtr = NULL;
-	const char *wordStartPtr = NULL;
-	const char *versionStartPtr = NULL;
+	const char *scriptTextPtr = nullptr;
+	const char *wordScanPtr = nullptr;
+	const char *wordStartPtr = nullptr;
+	const char *versionStartPtr = nullptr;
 	int wordLen = 0;
 	char curChar = 0;
 	int versionLen = 0;
@@ -364,7 +364,7 @@ bool Console::Cmd_Step(int argc, const char **argv) {
 		return true;
 	}
 
-	_vm->_debug.steps = strtoul(argv[1], NULL, 0);
+	_vm->_debug.steps = strtoul(argv[1], nullptr, 0);
 
 	return true;
 }
@@ -385,7 +385,7 @@ bool Console::Cmd_Cont(int argc, const char **argv) {
 
 bool Console::Cmd_Room(int argc, const char **argv) {
 	if (argc == 2) {
-		_vm->newRoom(strtoul(argv[1], NULL, 0));
+		_vm->newRoom(strtoul(argv[1], nullptr, 0));
 	}
 
 	debugPrintf("Current room: %d\n", _vm->getVar(0));
@@ -398,7 +398,7 @@ bool Console::Cmd_BT(int argc, const char **argv) {
 
 	debugPrintf("Current script: %d\nStack depth: %d\n", _vm->_game.curLogicNr, _vm->_game.execStack.size());
 
-	uint8 *code = NULL;
+	uint8 *code = nullptr;
 	uint8 op = 0;
 	uint8 p[CMD_BSIZE] = { 0 };
 	int parameterSize;
@@ -444,7 +444,7 @@ bool Console::Cmd_ShowMap(int argc, const char **argv) {
 		debugPrintf("Map %d is not available.\n", map);
 		return true;
 	}
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::Cmd_ScreenObj(int argc, const char **argv) {
@@ -630,7 +630,7 @@ bool Console::Cmd_DisableAutomaticSave(int argc, const char **argv) {
 }
 
 bool Console::parseInteger(const char *argument, int &result) {
-	char *endPtr = 0;
+	char *endPtr = nullptr;
 	int idxLen = strlen(argument);
 	const char *lastChar = argument + idxLen - (idxLen == 0 ? 0 : 1);
 
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 938cbb92ee..6065db7166 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -552,7 +552,7 @@ int AgiEngine::runGame() {
 	} while (_restartGame);
 
 	delete _menu;
-	_menu = NULL;
+	_menu = nullptr;
 
 	releaseImageStack();
 
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index bfff6b6fd2..bfd85c5ec4 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -75,7 +75,7 @@ static const PlainGameDescriptor agiGames[] = {
 	{"winnie", "Winnie the Pooh in the Hundred Acre Wood"},
 	{"xmascard", "Xmas Card"},
 
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #include "agi/detection_tables.h"
@@ -268,7 +268,7 @@ ADDetectedGame AgiMetaEngineDetection::fallbackDetect(const FileMap &allFilesXXX
 		const WagProperty *wagGameLastEdit = wagFileParser.getProperty(WagProperty::PC_GAMELAST);
 
 		// If there is an AGI version number in the *.wag file then let's use it
-		if (wagAgiVer != NULL && wagFileParser.checkAgiVersionProperty(*wagAgiVer)) {
+		if (wagAgiVer != nullptr && wagFileParser.checkAgiVersionProperty(*wagAgiVer)) {
 			// TODO/FIXME: Check that version number is something we support before trying to use it.
 			//     If the version number is unsupported then it'll get switched to 0x2917 later.
 			//     But there's the possibility that file based detection has detected something else
@@ -277,24 +277,24 @@ ADDetectedGame AgiMetaEngineDetection::fallbackDetect(const FileMap &allFilesXXX
 		}
 
 		// Set gameid according to *.wag file information if it's present and it doesn't contain whitespace.
-		if (wagGameID != NULL && !Common::String(wagGameID->getData()).contains(" ")) {
+		if (wagGameID != nullptr && !Common::String(wagGameID->getData()).contains(" ")) {
 			_gameid = wagGameID->getData();
 			debug(3, "Agi::fallbackDetector: Using game id (%s) from WAG file", _gameid.c_str());
 		}
 
 		// Set game description and extra according to *.wag file information if they're present
-		if (wagGameDesc != NULL) {
+		if (wagGameDesc != nullptr) {
 			description = wagGameDesc->getData();
 			debug(3, "Agi::fallbackDetector: Game description (%s) from WAG file", wagGameDesc->getData());
 
 			// If there's game version in the *.wag file, set extra to it
-			if (wagGameVer != NULL) {
+			if (wagGameVer != nullptr) {
 				_extra = wagGameVer->getData();
 				debug(3, "Agi::fallbackDetector: Game version (%s) from WAG file", wagGameVer->getData());
 			}
 
 			// If there's game last edit date in the *.wag file, add it to extra
-			if (wagGameLastEdit != NULL) {
+			if (wagGameLastEdit != nullptr) {
 				if (!_extra.empty())
 					_extra += " ";
 				_extra += wagGameLastEdit->getData();
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 3e1028352c..7c0f6c1b76 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -65,10 +65,10 @@ GfxMgr::GfxMgr(AgiBase *vm, GfxFont *font) : _vm(vm), _font(font) {
 	_pixels = 0;
 	_displayPixels = 0;
 
-	_activeScreen = NULL;
-	_gameScreen = NULL;
-	_priorityScreen = NULL;
-	_displayScreen = NULL;
+	_activeScreen = nullptr;
+	_gameScreen = nullptr;
+	_priorityScreen = nullptr;
+	_displayScreen = nullptr;
 }
 
 /**
@@ -1203,7 +1203,7 @@ void GfxMgr::shakeScreen(int16 repeatCount) {
 	int16 shakeHorizontalPixels = SHAKE_HORIZONTAL_PIXELS * (2 + _displayWidthMulAdjust);
 	int16 shakeVerticalPixels = SHAKE_VERTICAL_PIXELS * (1 + _displayHeightMulAdjust);
 
-	if ((blackSpace = (uint8 *)calloc(shakeHorizontalPixels * _displayScreenWidth, 1)) == NULL)
+	if ((blackSpace = (uint8 *)calloc(shakeHorizontalPixels * _displayScreenWidth, 1)) == nullptr)
 		return;
 
 	shakeCount = repeatCount * 8; // effectively 4 shakes per repeat
diff --git a/engines/agi/loader_v1.cpp b/engines/agi/loader_v1.cpp
index 77e38823a7..1308750992 100644
--- a/engines/agi/loader_v1.cpp
+++ b/engines/agi/loader_v1.cpp
@@ -171,12 +171,12 @@ int AgiLoader_v1::deinit() {
 }
 
 uint8 *AgiLoader_v1::loadVolRes(struct AgiDir *agid) {
-	uint8 *data = NULL;
+	uint8 *data = nullptr;
 	Common::File fp;
 	int offset = agid->offset;
 
 	if (offset == _EMPTY)
-		return NULL;
+		return nullptr;
 
 	if (offset > IMAGE_SIZE) {
 		fp.open(_filenameDisk1);
@@ -190,7 +190,7 @@ uint8 *AgiLoader_v1::loadVolRes(struct AgiDir *agid) {
 	int signature = fp.readUint16BE();
 	if (signature != 0x1234) {
 		warning("AgiLoader_v1::loadVolRes: bad signature %04x", signature);
-		return NULL;
+		return nullptr;
 	}
 
 	fp.readByte();
@@ -205,7 +205,7 @@ uint8 *AgiLoader_v1::loadVolRes(struct AgiDir *agid) {
 
 int AgiLoader_v1::loadResource(int16 resourceType, int16 resourceNr) {
 	int ec = errOK;
-	uint8 *data = NULL;
+	uint8 *data = nullptr;
 
 	debugC(3, kDebugLevelResources, "(t = %d, n = %d)", resourceType, resourceNr);
 	if (resourceNr >= MAX_DIRECTORY_ENTRIES)
@@ -244,7 +244,7 @@ int AgiLoader_v1::loadResource(int16 resourceType, int16 resourceNr) {
 		unloadResource(RESOURCETYPE_PICTURE, resourceNr);
 		data = loadVolRes(&_vm->_game.dirPic[resourceNr]);
 
-		if (data != NULL) {
+		if (data != nullptr) {
 			_vm->_game.pictures[resourceNr].rdata = data;
 			_vm->_game.dirPic[resourceNr].flags |= RES_LOADED;
 		} else {
@@ -258,7 +258,7 @@ int AgiLoader_v1::loadResource(int16 resourceType, int16 resourceNr) {
 
 		data = loadVolRes(&_vm->_game.dirSound[resourceNr]);
 
-		if (data != NULL) {
+		if (data != nullptr) {
 			// Freeing of the raw resource from memory is delegated to the createFromRawResource-function
 			_vm->_game.sounds[resourceNr] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[resourceNr].len, resourceNr, _vm->_soundemu);
 			_vm->_game.dirSound[resourceNr].flags |= RES_LOADED;
diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp
index f8351117ef..62b019b79b 100644
--- a/engines/agi/loader_v2.cpp
+++ b/engines/agi/loader_v2.cpp
@@ -58,7 +58,7 @@ int AgiLoader_v2::loadDir(AgiDir *agid, const char *fname) {
 	flen = fp.pos();
 	fp.seek(0, SEEK_SET);
 
-	if ((mem = (uint8 *)malloc(flen + 32)) == NULL) {
+	if ((mem = (uint8 *)malloc(flen + 32)) == nullptr) {
 		fp.close();
 		return errNotEnoughMemory;
 	}
@@ -142,7 +142,7 @@ int AgiLoader_v2::unloadResource(int16 resourceType, int16 resourceNr) {
  * routine. NULL is returned if unsucsessfull.
  */
 uint8 *AgiLoader_v2::loadVolRes(struct AgiDir *agid) {
-	uint8 *data = NULL;
+	uint8 *data = nullptr;
 	char x[6];
 	Common::File fp;
 	unsigned int sig;
@@ -158,14 +158,14 @@ uint8 *AgiLoader_v2::loadVolRes(struct AgiDir *agid) {
 		if ((sig = READ_BE_UINT16((uint8 *) x)) == 0x1234) {
 			agid->len = READ_LE_UINT16((uint8 *) x + 3);
 			data = (uint8 *)calloc(1, agid->len + 32);
-			if (data != NULL) {
+			if (data != nullptr) {
 				fp.read(data, agid->len);
 			} else {
 				error("AgiLoader_v2::loadVolRes out of memory");
 			}
 		} else {
 			warning("AgiLoader_v2::loadVolRes: bad signature %04x", sig);
-			return 0;
+			return nullptr;
 		}
 		fp.close();
 	} else {
@@ -183,7 +183,7 @@ uint8 *AgiLoader_v2::loadVolRes(struct AgiDir *agid) {
  */
 int AgiLoader_v2::loadResource(int16 resourceType, int16 resourceNr) {
 	int ec = errOK;
-	uint8 *data = NULL;
+	uint8 *data = nullptr;
 
 	debugC(3, kDebugLevelResources, "(t = %d, n = %d)", resourceType, resourceNr);
 	if (resourceNr >= MAX_DIRECTORY_ENTRIES)
@@ -222,7 +222,7 @@ int AgiLoader_v2::loadResource(int16 resourceType, int16 resourceNr) {
 		unloadResource(RESOURCETYPE_PICTURE, resourceNr);
 		data = loadVolRes(&_vm->_game.dirPic[resourceNr]);
 
-		if (data != NULL) {
+		if (data != nullptr) {
 			_vm->_game.pictures[resourceNr].rdata = data;
 			_vm->_game.dirPic[resourceNr].flags |= RES_LOADED;
 		} else {
@@ -236,7 +236,7 @@ int AgiLoader_v2::loadResource(int16 resourceType, int16 resourceNr) {
 
 		data = loadVolRes(&_vm->_game.dirSound[resourceNr]);
 
-		if (data != NULL) {
+		if (data != nullptr) {
 			// Freeing of the raw resource from memory is delegated to the createFromRawResource-function
 			_vm->_game.sounds[resourceNr] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[resourceNr].len, resourceNr, _vm->_soundemu);
 			_vm->_game.dirSound[resourceNr].flags |= RES_LOADED;
diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp
index 7eddb82fea..d73c4b0b10 100644
--- a/engines/agi/loader_v3.cpp
+++ b/engines/agi/loader_v3.cpp
@@ -73,7 +73,7 @@ int AgiLoader_v3::loadDir(struct AgiDir *agid, Common::File *fp,
 	unsigned int i;
 
 	fp->seek(offs, SEEK_SET);
-	if ((mem = (uint8 *)malloc(len + 32)) != NULL) {
+	if ((mem = (uint8 *)malloc(len + 32)) != nullptr) {
 		fp->read(mem, len);
 
 		// set all directory resources to gone
@@ -202,7 +202,7 @@ int AgiLoader_v3::unloadResource(int16 resourceType, int16 resourceNr) {
  */
 uint8 *AgiLoader_v3::loadVolRes(AgiDir *agid) {
 	char x[8];
-	uint8 *data = NULL, *compBuffer;
+	uint8 *data = nullptr, *compBuffer;
 	Common::File fp;
 	Common::String path;
 
@@ -261,7 +261,7 @@ uint8 *AgiLoader_v3::loadVolRes(AgiDir *agid) {
  */
 int AgiLoader_v3::loadResource(int16 resourceType, int16 resourceNr) {
 	int ec = errOK;
-	uint8 *data = NULL;
+	uint8 *data = nullptr;
 
 	if (resourceNr >= MAX_DIRECTORY_ENTRIES)
 		return errBadResource;
@@ -279,7 +279,7 @@ int AgiLoader_v3::loadResource(int16 resourceType, int16 resourceNr) {
 			_vm->_game.logics[resourceNr].data = data;
 
 			// uncompressed logic files need to be decrypted
-			if (data != NULL) {
+			if (data != nullptr) {
 				// resloaded flag gets set by decode logic
 				// needed to build string table
 				ec = _vm->decodeLogic(resourceNr);
@@ -305,7 +305,7 @@ int AgiLoader_v3::loadResource(int16 resourceType, int16 resourceNr) {
 		if (~_vm->_game.dirPic[resourceNr].flags & RES_LOADED) {
 			unloadResource(RESOURCETYPE_PICTURE, resourceNr);
 			data = loadVolRes(&_vm->_game.dirPic[resourceNr]);
-			if (data != NULL) {
+			if (data != nullptr) {
 				_vm->_game.pictures[resourceNr].rdata = data;
 				_vm->_game.dirPic[resourceNr].flags |= RES_LOADED;
 			} else {
@@ -318,7 +318,7 @@ int AgiLoader_v3::loadResource(int16 resourceType, int16 resourceNr) {
 			break;
 
 		data = loadVolRes(&_vm->_game.dirSound[resourceNr]);
-		if (data != NULL) {
+		if (data != nullptr) {
 			// Freeing of the raw resource from memory is delegated to the createFromRawResource-function
 			_vm->_game.sounds[resourceNr] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[resourceNr].len, resourceNr, _vm->_soundemu);
 			_vm->_game.dirSound[resourceNr].flags |= RES_LOADED;
@@ -337,7 +337,7 @@ int AgiLoader_v3::loadResource(int16 resourceType, int16 resourceNr) {
 
 		unloadResource(RESOURCETYPE_VIEW, resourceNr);
 		data = loadVolRes(&_vm->_game.dirView[resourceNr]);
-		if (data != NULL) {
+		if (data != nullptr) {
 			_vm->_game.dirView[resourceNr].flags |= RES_LOADED;
 			ec = _vm->decodeView(data, _vm->_game.dirView[resourceNr].len, resourceNr);
 			free(data);
diff --git a/engines/agi/logic.cpp b/engines/agi/logic.cpp
index c6dd04b814..334da9660e 100644
--- a/engines/agi/logic.cpp
+++ b/engines/agi/logic.cpp
@@ -69,7 +69,7 @@ int AgiEngine::decodeLogic(int16 logicNr) {
 	// cover header info
 	m0 += mstart + 3;
 
-	if (curLogic->texts != NULL) {
+	if (curLogic->texts != nullptr) {
 		// move list of strings into list to make real pointers
 		for (mc = 0; mc < curLogic->numTexts; mc++) {
 			mend = READ_LE_UINT16(m0 + mc * 2);
diff --git a/engines/agi/metaengine.cpp b/engines/agi/metaengine.cpp
index 9ffc73ad6e..13ddd7fb91 100644
--- a/engines/agi/metaengine.cpp
+++ b/engines/agi/metaengine.cpp
@@ -96,7 +96,7 @@ void AgiBase::initVersion() {
 }
 
 const char *AgiBase::getDiskName(uint16 id) {
-	for (int i = 0; _gameDescription->desc.filesDescriptions[i].fileName != NULL; i++)
+	for (int i = 0; _gameDescription->desc.filesDescriptions[i].fileName != nullptr; i++)
 		if (_gameDescription->desc.filesDescriptions[i].fileType == id)
 			return _gameDescription->desc.filesDescriptions[i].fileName;
 
@@ -359,7 +359,7 @@ bool AgiBase::canSaveGameStateCurrently() {
 int AgiEngine::agiDetectGame() {
 	int ec = errOK;
 
-	assert(_gameDescription != NULL);
+	assert(_gameDescription != nullptr);
 
 	if (getVersion() <= 0x2001) {
 		_loader = new AgiLoader_v1(this);
diff --git a/engines/agi/objects.cpp b/engines/agi/objects.cpp
index c4ecfb090b..c4335aed13 100644
--- a/engines/agi/objects.cpp
+++ b/engines/agi/objects.cpp
@@ -109,7 +109,7 @@ int AgiEngine::loadObjects(Common::File &fp) {
 int AgiEngine::readObjects(Common::File &fp, int flen) {
 	uint8 *mem;
 
-	if ((mem = (uint8 *)calloc(1, flen + 32)) == NULL) {
+	if ((mem = (uint8 *)calloc(1, flen + 32)) == nullptr) {
 		fp.close();
 		return errNotEnoughMemory;
 	}
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 1277cf844d..9c72bc3aa9 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -1750,7 +1750,7 @@ void cmdSetMenu(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
 
 	debugC(4, kDebugLevelScripts, "text %02x of %02x", textNr, state->_curLogic->numTexts);
 
-	if (state->_curLogic->texts != NULL && (textNr - 1) <= state->_curLogic->numTexts) {
+	if (state->_curLogic->texts != nullptr && (textNr - 1) <= state->_curLogic->numTexts) {
 		const char *menuText = state->_curLogic->texts[textNr - 1];
 
 		state->_vm->_menu->addMenu(menuText);
@@ -1763,7 +1763,7 @@ void cmdSetMenuItem(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
 
 	debugC(4, kDebugLevelScripts, "text %02x of %02x", textNr, state->_curLogic->numTexts);
 
-	if (state->_curLogic->texts != NULL && textNr <= state->_curLogic->numTexts) {
+	if (state->_curLogic->texts != nullptr && textNr <= state->_curLogic->numTexts) {
 		const char *menuItemText = state->_curLogic->texts[textNr];
 
 		state->_vm->_menu->addMenuItem(menuItemText, controllerSlot);
@@ -2065,7 +2065,7 @@ void cmdSetCursorChar(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
 	TextMgr *textMgr = state->_vm->_text;
 	uint16 textNr = parameter[0] - 1;
 
-	if (state->_curLogic->texts != NULL && textNr <= state->_curLogic->numTexts) {
+	if (state->_curLogic->texts != nullptr && textNr <= state->_curLogic->numTexts) {
 		textMgr->inputSetCursorChar(*state->_curLogic->texts[textNr]);
 	} else {
 		// default
diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp
index 688364a9a2..21717af711 100644
--- a/engines/agi/op_test.cpp
+++ b/engines/agi/op_test.cpp
@@ -388,7 +388,7 @@ bool AgiEngine::testIfCode(int16 logicNr) {
 
 	while (!(shouldQuit() || _restartGame) && !endTest) {
 		if (_debug.enabled && (_debug.logic0 || logicNr))
-			debugConsole(logicNr, lTEST_MODE, NULL);
+			debugConsole(logicNr, lTEST_MODE, nullptr);
 
 		op = *(code + ip++);
 		memmove(p, (code + ip), 16);
diff --git a/engines/agi/opcodes.cpp b/engines/agi/opcodes.cpp
index 3bb0bf3277..bfc3bcc849 100644
--- a/engines/agi/opcodes.cpp
+++ b/engines/agi/opcodes.cpp
@@ -46,7 +46,7 @@ const AgiOpCodeDefinitionEntry opCodesV1Cond[] = {
 };
 
 const AgiOpCodeDefinitionEntry opCodesV1[] = {
-	{ "return",             "",         NULL },                 // 00
+	{ "return",             "",         nullptr },              // 00
 	{ "increment",          "v",        &cmdIncrement },        // 01
 	{ "decrement",          "v",        &cmdDecrement },        // 02
 	{ "assignn",            "vn",       &cmdAssignN },          // 03
@@ -170,7 +170,7 @@ AgiOpCodeDefinitionEntry opCodesV2Cond[] = {
 };
 
 AgiOpCodeDefinitionEntry opCodesV2[] = {
-	{ "return",             "",         NULL },                 // 00
+	{ "return",             "",         nullptr },              // 00
 	{ "increment",          "v",        &cmdIncrement },        // 01
 	{ "decrement",          "v",        &cmdDecrement },        // 02
 	{ "assignn",            "vn",       &cmdAssignN },          // 03
diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp
index 8a43fe4aea..64db1192aa 100644
--- a/engines/agi/picture.cpp
+++ b/engines/agi/picture.cpp
@@ -32,7 +32,7 @@ PictureMgr::PictureMgr(AgiBase *agi, GfxMgr *gfx) {
 	_gfx = gfx;
 
 	_resourceNr = 0;
-	_data = NULL;
+	_data = nullptr;
 	_dataSize = 0;
 	_dataOffset = 0;
 	_dataOffsetNibble = false;
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index fa43633a14..27aec37896 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -288,7 +288,7 @@ void MickeyEngine::drawMenu(MSA_MENU &menu, int sel0, int sel1) {
 
 void MickeyEngine::getMouseMenuSelRow(MSA_MENU &menu, int *sel0, int *sel1, int iRow, int x, int y) {
 	int iWord;
-	int *sel = 0;
+	int *sel = nullptr;
 
 	switch (iRow) {
 	case 0:
@@ -315,7 +315,7 @@ void MickeyEngine::getMouseMenuSelRow(MSA_MENU &menu, int *sel0, int *sel1, int
 
 bool MickeyEngine::getMenuSelRow(MSA_MENU &menu, int *sel0, int *sel1, int iRow) {
 	Common::Event event;
-	int *sel = 0;
+	int *sel = nullptr;
 	int nWords;
 	int x, y;
 	int goIndex = -1, northIndex = -1, southIndex = -1, eastIndex = -1, westIndex = -1;
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp
index b4b8773226..8cf636131d 100644
--- a/engines/agi/preagi_winnie.cpp
+++ b/engines/agi/preagi_winnie.cpp
@@ -1172,7 +1172,7 @@ bool WinnieEngine::playSound(ENUM_WTP_SOUND iSound) {
 	}
 
 	delete _game.sounds[0];
-	_game.sounds[0] = 0;
+	_game.sounds[0] = nullptr;
 
 	return !shouldQuit() && !skippedSound;
 }
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index 0b2eff811a..ba052f348c 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -47,8 +47,8 @@ SoundGen::~SoundGen() {
 //
 
 AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, int soundemu) {
-	if (data == NULL || len < 2) // Check for too small resource or no resource at all
-		return NULL;
+	if (data == nullptr || len < 2) // Check for too small resource or no resource at all
+		return nullptr;
 	uint16 type = READ_LE_UINT16(data);
 
 	// For V1 sound resources
@@ -71,7 +71,7 @@ AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, i
 	}
 
 	warning("Sound resource (%d) has unknown type (0x%04x). Not using the sound", resnum, type);
-	return NULL;
+	return nullptr;
 }
 
 PCjrSound::PCjrSound(uint8 *data, uint32 len, int resnum) : AgiSound() {
@@ -83,7 +83,7 @@ PCjrSound::PCjrSound(uint8 *data, uint32 len, int resnum) : AgiSound() {
 	if ((_type & 0xFF) == 0x01)
 		_type = AGI_SOUND_4CHN;
 
-	_isValid = (_type == AGI_SOUND_4CHN) && (_data != NULL) && (_len >= 2);
+	_isValid = (_type == AGI_SOUND_4CHN) && (_data != nullptr) && (_len >= 2);
 
 	if (!_isValid) // Check for errors
 		warning("Error creating PCjr 4-channel sound from resource %d (Type %d, length %d)", resnum, _type, len);
@@ -115,7 +115,7 @@ void SoundMgr::unloadSound(int resnum) {
 
 		// Release the sound resource's data
 		delete _vm->_game.sounds[resnum];
-		_vm->_game.sounds[resnum] = NULL;
+		_vm->_game.sounds[resnum] = nullptr;
 		_vm->_game.dirSound[resnum].flags &= ~RES_LOADED;
 	}
 }
@@ -132,7 +132,7 @@ void SoundMgr::unloadSound(int resnum) {
 void SoundMgr::startSound(int resnum, int flag) {
 	debugC(3, kDebugLevelSound, "startSound(resnum = %d, flag = %d)", resnum, flag);
 
-	if (_vm->_game.sounds[resnum] == NULL) // Is this needed at all?
+	if (_vm->_game.sounds[resnum] == nullptr) // Is this needed at all?
 		return;
 
 	stopSound();
diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp
index 5154014713..64f62ed0a2 100644
--- a/engines/agi/sound_2gs.cpp
+++ b/engines/agi/sound_2gs.cpp
@@ -262,7 +262,7 @@ void SoundGen2GS::advanceMidiPlayer() {
 	uint8 parm1, parm2;
 	static uint8 cmd, chn;
 
-	if (_playingSound == -1 || _vm->_game.sounds[_playingSound] == NULL) {
+	if (_playingSound == -1 || _vm->_game.sounds[_playingSound] == nullptr) {
 		warning("Error playing Apple IIGS MIDI sound resource");
 		_playing = false;
 		return;
@@ -463,7 +463,7 @@ IIgsMidi::IIgsMidi(uint8 *data, uint32 len, int resnum) : AgiSound() {
 	_len = len;  // Save the resource's length
 	_type = READ_LE_UINT16(data); // Read sound resource's type
 	_ticks = 0;
-	_isValid = (_type == AGI_SOUND_MIDI) && (_data != NULL) && (_len >= 2);
+	_isValid = (_type == AGI_SOUND_MIDI) && (_data != nullptr) && (_len >= 2);
 
 	if (!_isValid) // Check for errors
 		warning("Error creating Apple IIGS midi sound from resource %d (Type %d, length %d)", resnum, _type, len);
@@ -511,7 +511,7 @@ IIgsSample::IIgsSample(uint8 *data, uint32 len, int16 resourceNr) : AgiSound() {
 		stream.seek(sampleStartPos);
 		_sample = new int8[_header.sampleSize];
 
-		if (_sample != NULL) {
+		if (_sample != nullptr) {
 			_isValid = convertWave(stream, _sample, _header.sampleSize);
 
 			if (_isValid) {
@@ -624,7 +624,7 @@ bool IIgsSampleHeader::finalize(int8 *sampleData) {
 bool SoundGen2GS::loadInstruments() {
 	// Get info on the particular Apple IIGS AGI game's executable
 	const IIgsExeInfo *exeInfo = getIIgsExeInfo((enum AgiGameID)_vm->getGameID());
-	if (exeInfo == NULL) {
+	if (exeInfo == nullptr) {
 		warning("Unsupported Apple IIGS game, not loading instruments");
 		return false;
 	}
@@ -740,7 +740,7 @@ const IIgsExeInfo *SoundGen2GS::getIIgsExeInfo(enum AgiGameID gameid) const {
 	for (int i = 0; i < ARRAYSIZE(IIgsExeInfos); i++)
 		if (IIgsExeInfos[i].gameid == gameid)
 			return &IIgsExeInfos[i];
-	return NULL;
+	return nullptr;
 }
 
 bool SoundGen2GS::loadInstrumentHeaders(Common::String &exePath, const IIgsExeInfo &exeInfo) {
diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp
index 20e79470db..2e22f0f72b 100644
--- a/engines/agi/sound_midi.cpp
+++ b/engines/agi/sound_midi.cpp
@@ -62,7 +62,7 @@ MIDISound::MIDISound(uint8 *data, uint32 len, int resnum) : AgiSound() {
 	_data = data; // Save the resource pointer
 	_len  = len;  // Save the resource's length
 	_type = READ_LE_UINT16(data); // Read sound resource's type
-	_isValid = (_type == AGI_SOUND_4CHN) && (_data != NULL) && (_len >= 2);
+	_isValid = (_type == AGI_SOUND_4CHN) && (_data != nullptr) && (_len >= 2);
 
 	if (!_isValid) // Check for errors
 		warning("Error creating MIDI sound from resource %d (Type %d, length %d)", resnum, _type, len);
diff --git a/engines/agi/sound_pcjr.cpp b/engines/agi/sound_pcjr.cpp
index d8592227fc..d7d67beab6 100644
--- a/engines/agi/sound_pcjr.cpp
+++ b/engines/agi/sound_pcjr.cpp
@@ -126,7 +126,7 @@ SoundGenPCJr::SoundGenPCJr(AgiBase *vm, Audio::Mixer *pMixer) : SoundGen(vm, pMi
 
 	_mixer->playStream(Audio::Mixer::kMusicSoundType, _soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
 
-	_v1data = NULL;
+	_v1data = nullptr;
 	_v1size = 0;
 }
 
@@ -297,7 +297,7 @@ int SoundGenPCJr::getNextNote_v1(int ch) {
 	byte *data = _v1data;
 	uint32 len = _v1size;
 
-	if (len <= 0 || data == NULL) {
+	if (len <= 0 || data == nullptr) {
 		_channel[ch].avail = 0;
 		_channel[ch].attenuation = 0x0F;
 		_channel[ch].attenuationCopy = 0x0F;
diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp
index 8263ea12ac..fd784cbaaa 100644
--- a/engines/agi/sprite.cpp
+++ b/engines/agi/sprite.cpp
@@ -47,7 +47,7 @@ static bool sortSpriteHelper(const Sprite &entry1, const Sprite &entry2) {
 }
 
 void SpritesMgr::buildRegularSpriteList() {
-	ScreenObjEntry *screenObj = NULL;
+	ScreenObjEntry *screenObj = nullptr;
 	uint16 givenOrderNr = 0;
 
 	freeList(_spriteRegularList);
@@ -64,7 +64,7 @@ void SpritesMgr::buildRegularSpriteList() {
 }
 
 void SpritesMgr::buildStaticSpriteList() {
-	ScreenObjEntry *screenObj = NULL;
+	ScreenObjEntry *screenObj = nullptr;
 	uint16 givenOrderNr = 0;
 
 	freeList(_spriteStaticList);
@@ -360,7 +360,7 @@ void SpritesMgr::showSprite(ScreenObjEntry *screenObj) {
 
 void SpritesMgr::showSprites(SpriteList &spriteList) {
 	SpriteList::iterator iter;
-	ScreenObjEntry *screenObjPtr = NULL;
+	ScreenObjEntry *screenObjPtr = nullptr;
 
 	for (iter = spriteList.begin(); iter != spriteList.end(); ++iter) {
 		Sprite &sprite = *iter;
@@ -405,7 +405,7 @@ void SpritesMgr::showAllSpriteLists() {
  */
 void SpritesMgr::showObject(int16 viewNr) {
 	ScreenObjEntry screenObj;
-	uint8 *backgroundBuffer = NULL;
+	uint8 *backgroundBuffer = nullptr;
 
 	_vm->agiLoadResource(RESOURCETYPE_VIEW, viewNr);
 	_vm->setView(&screenObj, viewNr);
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index 6e68d6fcc4..e86f7db73e 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -37,7 +37,7 @@ TextMgr::TextMgr(AgiEngine *vm, Words *words, GfxMgr *gfx) {
 	_words = words;
 	_gfx = gfx;
 
-	_systemUI = NULL;
+	_systemUI = nullptr;
 
 	memset(&_messageState, 0, sizeof(_messageState));
 	_textPos.row = 0;
@@ -239,8 +239,8 @@ byte TextMgr::calculateTextBackground(byte background) {
 }
 
 void TextMgr::display(int16 textNr, int16 textRow, int16 textColumn) {
-	const char *logicTextPtr = NULL;
-	char *processedTextPtr   = NULL;
+	const char *logicTextPtr = nullptr;
+	char *processedTextPtr   = nullptr;
 
 	charPos_Push();
 	charPos_Set(textRow, textColumn);
@@ -347,7 +347,7 @@ void TextMgr::displayCharacter(byte character, bool disabledLook) {
 }
 
 void TextMgr::print(int16 textNr) {
-	const char *logicTextPtr = NULL;
+	const char *logicTextPtr = nullptr;
 	if (textNr >= 1 && textNr <= _vm->_game._curLogic->numTexts) {
 		logicTextPtr = _vm->_game._curLogic->texts[textNr - 1];
 		messageBox(logicTextPtr);
@@ -575,7 +575,7 @@ bool TextMgr::statusEnabled() {
 }
 
 void TextMgr::statusDraw() {
-	char *statusTextPtr = NULL;
+	char *statusTextPtr = nullptr;
 
 	charAttrib_Push();
 	charPos_Push();
@@ -1182,7 +1182,7 @@ char *TextMgr::stringWordWrap(const char *originalText, int16 maxWidth, int16 *c
 // ===============================================================
 
 static void safeStrcat(Common::String &p, const char *t) {
-	if (t != NULL)
+	if (t != nullptr)
 		p += t;
 }
 
@@ -1207,7 +1207,7 @@ char *TextMgr::stringPrintf(const char *originalText) {
 			switch (*originalText++) {
 				int i;
 			case 'v':
-				i = strtoul(originalText, NULL, 10);
+				i = strtoul(originalText, nullptr, 10);
 				while (*originalText >= '0' && *originalText <= '9')
 					originalText++;
 				sprintf(z, "%015i", _vm->getVar(i));
@@ -1215,7 +1215,7 @@ char *TextMgr::stringPrintf(const char *originalText) {
 				i = 99;
 				if (*originalText == '|') {
 					originalText++;
-					i = strtoul(originalText, NULL, 10);
+					i = strtoul(originalText, nullptr, 10);
 					while (*originalText >= '0' && *originalText <= '9')
 						originalText++;
 				}
@@ -1231,23 +1231,23 @@ char *TextMgr::stringPrintf(const char *originalText) {
 				safeStrcat(resultString, z + i);
 				break;
 			case '0':
-				i = strtoul(originalText, NULL, 10) - 1;
+				i = strtoul(originalText, nullptr, 10) - 1;
 				safeStrcat(resultString, _vm->objectName(i));
 				break;
 			case 'g':
-				i = strtoul(originalText, NULL, 10) - 1;
+				i = strtoul(originalText, nullptr, 10) - 1;
 				safeStrcat(resultString, _vm->_game.logics[0].texts[i]);
 				break;
 			case 'w':
-				i = strtoul(originalText, NULL, 10) - 1;
+				i = strtoul(originalText, nullptr, 10) - 1;
 				safeStrcat(resultString, _vm->_words->getEgoWord(i));
 				break;
 			case 's':
-				i = strtoul(originalText, NULL, 10);
+				i = strtoul(originalText, nullptr, 10);
 				safeStrcat(resultString, stringPrintf(_vm->_game.strings[i]));
 				break;
 			case 'm':
-				i = strtoul(originalText, NULL, 10) - 1;
+				i = strtoul(originalText, nullptr, 10) - 1;
 				if (_vm->_game.logics[_vm->_game.curLogicNr].numTexts > i)
 					safeStrcat(resultString, stringPrintf(_vm->_game.logics[_vm->_game.curLogicNr].texts[i]));
 				break;
diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp
index 59837c9e9e..50ad4f9cbc 100644
--- a/engines/agi/wagparser.cpp
+++ b/engines/agi/wagparser.cpp
@@ -55,7 +55,7 @@ void WagProperty::deepCopy(const WagProperty &other) {
 	_propNum  = other._propNum;
 	_propSize = other._propSize;
 
-	if (other._propData != NULL) {
+	if (other._propData != nullptr) {
 		_propData = new char[other._propSize + 1UL]; // Allocate space for property's data plus trailing zero
 		memcpy(_propData, other._propData, other._propSize + 1UL); // Copy the whole thing
 	}
@@ -93,13 +93,13 @@ void WagProperty::setDefaults() {
 	_propType = PT_UNDEFINED;
 	_propNum  = 0;
 	_propSize = 0;
-	_propData = NULL;
+	_propData = nullptr;
 }
 
 void WagProperty::deleteData() {
 	if (_propData)
 		delete[] _propData;
-	_propData = NULL;
+	_propData = nullptr;
 }
 
 WagFileParser::WagFileParser() :
@@ -183,7 +183,7 @@ void WagFileParser::addPropFromIni(Common::INIFile *iniWagFile, Common::String s
 
 bool WagFileParser::parse(const Common::FSNode &node) {
 	WagProperty property; // Temporary property used for reading
-	Common::SeekableReadStream *stream = NULL; // The file stream
+	Common::SeekableReadStream *stream = nullptr; // The file stream
 
 	_parsedOk = false; // We haven't parsed the file yet
 
@@ -234,7 +234,7 @@ bool WagFileParser::parse(const Common::FSNode &node) {
 const WagProperty *WagFileParser::getProperty(const WagProperty::WagPropertyCode code) const {
 	for (PropertyList::const_iterator iter = _propList.begin(); iter != _propList.end(); ++iter)
 		if (iter->getCode() == code) return iter;
-	return NULL;
+	return nullptr;
 }
 
 bool WagFileParser::endOfProperties(const Common::SeekableReadStream &stream) const {


Commit: 8c81b5026a4d6ef71f6d7e8ce9293f9dc7e61dbb
    https://github.com/scummvm/scummvm/commit/8c81b5026a4d6ef71f6d7e8ce9293f9dc7e61dbb
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
AGOS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/agos/agos.cpp
    engines/agos/charset-fontdata.cpp
    engines/agos/charset.cpp
    engines/agos/contain.cpp
    engines/agos/cursor.cpp
    engines/agos/debug.cpp
    engines/agos/debugger.cpp
    engines/agos/detection.cpp
    engines/agos/draw.cpp
    engines/agos/drivers/accolade/adlib.cpp
    engines/agos/drivers/accolade/mt32.cpp
    engines/agos/drivers/accolade/pc98.cpp
    engines/agos/event.cpp
    engines/agos/gfx.cpp
    engines/agos/icons.cpp
    engines/agos/input.cpp
    engines/agos/input_pn.cpp
    engines/agos/items.cpp
    engines/agos/menus.cpp
    engines/agos/metaengine.cpp
    engines/agos/midi.cpp
    engines/agos/midiparser_s1d.cpp
    engines/agos/pn.cpp
    engines/agos/res.cpp
    engines/agos/res_snd.cpp
    engines/agos/rooms.cpp
    engines/agos/saveload.cpp
    engines/agos/script.cpp
    engines/agos/script_e1.cpp
    engines/agos/script_e2.cpp
    engines/agos/script_pn.cpp
    engines/agos/script_s1.cpp
    engines/agos/script_s2.cpp
    engines/agos/script_ww.cpp
    engines/agos/sound.cpp
    engines/agos/string.cpp
    engines/agos/string_pn.cpp
    engines/agos/subroutine.cpp
    engines/agos/verb.cpp
    engines/agos/verb_pn.cpp
    engines/agos/vga.cpp
    engines/agos/vga_s1.cpp
    engines/agos/window.cpp
    engines/agos/zones.cpp


diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index adbf8797b2..c54cb1f96e 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -127,12 +127,12 @@ AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescript
 	memset(_boxBuffer, 0, sizeof(_boxBuffer));
 	_boxBufferPtr = _boxBuffer;
 
-	_linePtrs[0] = 0;
-	_linePtrs[1] = 0;
-	_linePtrs[2] = 0;
-	_linePtrs[3] = 0;
-	_linePtrs[4] = 0;
-	_linePtrs[5] = 0;
+	_linePtrs[0] = nullptr;
+	_linePtrs[1] = nullptr;
+	_linePtrs[2] = nullptr;
+	_linePtrs[3] = nullptr;
+	_linePtrs[4] = nullptr;
+	_linePtrs[5] = nullptr;
 	memset(_lineCounts, 0, sizeof(_lineCounts));
 }
 
@@ -141,7 +141,7 @@ AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescriptio
 }
 
 AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd)
-	: AGOSEngine(system, gd), _sjisCurChar(0), _sjisFont(0) {
+	: AGOSEngine(system, gd), _sjisCurChar(0), _sjisFont(nullptr) {
 }
 
 AGOSEngine_Elvira1::~AGOSEngine_Elvira1() {
@@ -167,11 +167,11 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 #if 0
 	DebugMan.addDebugChannel(kDebugImageDump, "image_dump", "Enable dumping of images to files");
 #endif
-	_vcPtr = 0;
+	_vcPtr = nullptr;
 	_vcGetOutOfCode = 0;
-	_gameOffsetsPtr = 0;
+	_gameOffsetsPtr = nullptr;
 
-	_gameFile = 0;
+	_gameFile = nullptr;
 	_opcode = 0;
 
 	_itemMemSize = 0;
@@ -198,49 +198,49 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_vgaBaseDelay = 0;
 	_vgaPeriod = 0;
 
-	_strippedTxtMem = 0;
-	_textMem = 0;
+	_strippedTxtMem = nullptr;
+	_textMem = nullptr;
 	_textSize = 0;
 	_stringTabNum = 0;
 	_stringTabPos = 0;
 	_stringTabSize = 0;
-	_stringTabPtr = 0;
+	_stringTabPtr = nullptr;
 
-	_itemArrayPtr = 0;
+	_itemArrayPtr = nullptr;
 	_itemArraySize = 0;
 	_itemArrayInited = 0;
 
-	_iconFilePtr = 0;
+	_iconFilePtr = nullptr;
 
-	_codePtr = 0;
+	_codePtr = nullptr;
 
-	_localStringtable = 0;
+	_localStringtable = nullptr;
 	_stringIdLocalMin = 0;
 	_stringIdLocalMax = 0;
 
-	_roomStates = 0;
+	_roomStates = nullptr;
 	_numRoomStates = 0;
 
-	_menuBase = 0;
-	_roomsList = 0;
-	_roomsListPtr = 0;
+	_menuBase = nullptr;
+	_roomsList = nullptr;
+	_roomsListPtr = nullptr;
 
-	_xtblList = 0;
-	_xtablesHeapPtrOrg = 0;
+	_xtblList = nullptr;
+	_xtablesHeapPtrOrg = nullptr;
 	_xtablesHeapCurPosOrg = 0;
-	_xsubroutineListOrg = 0;
+	_xsubroutineListOrg = nullptr;
 
-	_tblList = 0;
-	_tablesHeapPtr = 0;
-	_tablesHeapPtrOrg = 0;
-	_tablesheapPtrNew = 0;
+	_tblList = nullptr;
+	_tablesHeapPtr = nullptr;
+	_tablesHeapPtrOrg = nullptr;
+	_tablesheapPtrNew = nullptr;
 	_tablesHeapSize = 0;
 	_tablesHeapCurPos = 0;
 	_tablesHeapCurPosOrg = 0;
 	_tablesHeapCurPosNew = 0;
-	_subroutineListOrg = 0;
+	_subroutineListOrg = nullptr;
 
-	_subroutineList = 0;
+	_subroutineList = nullptr;
 
 	_recursionDepth = 0;
 
@@ -275,7 +275,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_mouseAnim = 0;
 	_mouseAnimMax = 0;
 	_mouseCursor = 0;
-	_mouseData = 0;
+	_mouseData = nullptr;
 	_oldMouseCursor = 0;
 	_currentMouseCursor = 0;
 	_currentMouseAnim = 0;
@@ -292,7 +292,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_scrollFlag = 0;
 	_scrollHeight = 0;
 	_scrollWidth = 0;
-	_scrollImage = 0;
+	_scrollImage = nullptr;
 	_boxStarHeight = 0;
 
 	_scriptVerb = 0;
@@ -302,23 +302,23 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_scriptAdj2 = 0;
 
 	_curWindow = 0;
-	_textWindow = 0;
+	_textWindow = nullptr;
 
-	_subjectItem = 0;
-	_objectItem = 0;
-	_currentPlayer = 0;
+	_subjectItem = nullptr;
+	_objectItem = nullptr;
+	_currentPlayer = nullptr;
 
 	_iOverflow = false;
 	_nameLocked = false;
-	_hitAreaObjectItem = 0;
-	_lastHitArea = 0;
-	_lastNameOn = 0;
-	_lastHitArea3 = 0;
-	_hitAreaSubjectItem = 0;
-	_currentBox = 0;
+	_hitAreaObjectItem = nullptr;
+	_lastHitArea = nullptr;
+	_lastNameOn = nullptr;
+	_lastHitArea3 = nullptr;
+	_hitAreaSubjectItem = nullptr;
+	_currentBox = nullptr;
 	_currentBoxNum = 0;
-	_currentVerbBox = 0;
-	_lastVerbOn = 0;
+	_currentVerbBox = nullptr;
+	_lastVerbOn = nullptr;
 	_needHitAreaRecalc = 0;
 	_verbHitArea = 0;
 	_defaultVerb = 0;
@@ -329,7 +329,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_dragFlag = false;
 	_dragMode = false;
 	_dragCount = 0;
-	_lastClickRem = 0;
+	_lastClickRem = nullptr;
 
 	_windowNum = 0;
 
@@ -343,8 +343,8 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_lastTime = 0;
 	_lastMinute = 0;
 
-	_firstTimeStruct = 0;
-	_pendingDeleteTimeEvent = 0;
+	_firstTimeStruct = nullptr;
+	_pendingDeleteTimeEvent = nullptr;
 
 	_initMouse = 0;
 	_leftButtonDown = false;
@@ -392,18 +392,18 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_copyScnFlag = 0;
 	_vgaSpriteChanged = 0;
 
-	_block = 0;
-	_blockEnd = 0;
-	_vgaMemPtr = 0;
-	_vgaMemEnd = 0;
-	_vgaMemBase = 0;
-	_vgaFrozenBase = 0;
-	_vgaRealBase = 0;
-	_zoneBuffers = 0;
-
-	_curVgaFile1 = 0;
-	_curVgaFile2 = 0;
-	_curSfxFile = 0;
+	_block = nullptr;
+	_blockEnd = nullptr;
+	_vgaMemPtr = nullptr;
+	_vgaMemEnd = nullptr;
+	_vgaMemBase = nullptr;
+	_vgaFrozenBase = nullptr;
+	_vgaRealBase = nullptr;
+	_zoneBuffers = nullptr;
+
+	_curVgaFile1 = nullptr;
+	_curVgaFile2 = nullptr;
+	_curSfxFile = nullptr;
 	_curSfxFileSize = 0;
 
 	_syncCount = 0;
@@ -431,20 +431,20 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_scaleWidth = 0;
 	_scaleHeight = 0;
 
-	_nextVgaTimerToProcess = 0;
+	_nextVgaTimerToProcess = nullptr;
 
 	_opcode177Var1 = 1;
 	_opcode177Var2 = 0;
 	_opcode178Var1 = 1;
 	_opcode178Var2 = 0;
 
-	_classLine = 0;
+	_classLine = nullptr;
 	_classMask = 0;
 	_classMode1 = 0;
 	_classMode2 = 0;
-	_currentLine = 0;
-	_currentTable = 0;
-	_findNextPtr = 0;
+	_currentLine = nullptr;
+	_currentTable = nullptr;
+	_findNextPtr = nullptr;
 
 	_agosMenu = 0;
 	_currentRoom = 0;
@@ -465,9 +465,9 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	memset(_bitArrayTwo, 0, sizeof(_bitArrayTwo));
 	memset(_bitArrayThree, 0, sizeof(_bitArrayThree));
 
-	_variableArray = 0;
-	_variableArray2 = 0;
-	_variableArrayPtr = 0;
+	_variableArray = nullptr;
+	_variableArray2 = nullptr;
+	_variableArrayPtr = nullptr;
 
 	memset(_windowArray, 0, sizeof(_windowArray));
 
@@ -475,12 +475,12 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	memset(_fcsData2, 0, sizeof(_fcsData2));
 
 	_awaitTwoByteToken = 0;
-	_byteTokens = 0;
-	_byteTokenStrings = 0;
-	_twoByteTokens = 0;
-	_twoByteTokenStrings = 0;
-	_secondTwoByteTokenStrings = 0;
-	_thirdTwoByteTokenStrings = 0;
+	_byteTokens = nullptr;
+	_byteTokenStrings = nullptr;
+	_twoByteTokens = nullptr;
+	_twoByteTokenStrings = nullptr;
+	_secondTwoByteTokenStrings = nullptr;
+	_thirdTwoByteTokenStrings = nullptr;
 	memset(_textBuffer, 0, sizeof(_textBuffer));
 	_textCount = 0;
 
@@ -509,15 +509,15 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	memset(_lettersToPrintBuf, 0, sizeof(_lettersToPrintBuf));
 
-	_planarBuf = 0;
-	_pak98Buf = 0;
+	_planarBuf = nullptr;
+	_pak98Buf = nullptr;
 	_paletteModNext = 16;
 
 	_midiEnabled = false;
 
 	_vgaTickCounter = 0;
 
-	_sound = 0;
+	_sound = nullptr;
 
 	_effectsPaused = false;
 	_ambientPaused = false;
@@ -540,11 +540,11 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_oracleMaxScrollY = 0;
 	_noOracleScroll = 0;
 
-	_backGroundBuf = 0;
-	_backBuf = 0;
-	_scaleBuf = 0;
-	_window4BackScn = 0;
-	_window6BackScn = 0;
+	_backGroundBuf = nullptr;
+	_backBuf = nullptr;
+	_scaleBuf = nullptr;
+	_window4BackScn = nullptr;
+	_window6BackScn = nullptr;
 
 	_window3Flag = 0;
 	_window4Flag = 0;
@@ -557,7 +557,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	_forceAscii = false;
 
-	_vc10BasePtrOld = 0;
+	_vc10BasePtrOld = nullptr;
 	memcpy (_hebrewCharWidths,
 		"\x5\x5\x4\x6\x5\x3\x4\x5\x6\x3\x5\x5\x4\x6\x5\x3\x4\x6\x5\x6\x6\x6\x5\x5\x5\x6\x5\x6\x6\x6\x6\x6", 32);
 
@@ -1035,17 +1035,17 @@ Common::Error AGOSEngine::go() {
 
 	addTimeEvent(0, 1);
 
-	if (getFileName(GAME_GMEFILE) != NULL) {
+	if (getFileName(GAME_GMEFILE) != nullptr) {
 		openGameFile();
 	}
 
 	if (getGameType() == GType_FF) {
 		loadIconData();
-	} else if (getFileName(GAME_ICONFILE) != NULL) {
+	} else if (getFileName(GAME_ICONFILE) != nullptr) {
 		loadIconFile();
 	}
 
-	if (getFileName(GAME_MENUFILE) != NULL) {
+	if (getFileName(GAME_MENUFILE) != nullptr) {
 		loadMenuFile();
 	}
 
@@ -1053,7 +1053,7 @@ Common::Error AGOSEngine::go() {
 
 	if (getGameType() != GType_PP && getGameType() != GType_FF) {
 		uint16 count = (getGameType() == GType_SIMON2) ? 5 : _frameCount;
-		addVgaEvent(count, ANIMATE_INT, NULL, 0, 0);
+		addVgaEvent(count, ANIMATE_INT, nullptr, 0, 0);
 	}
 
 	if (getGameType() == GType_ELVIRA1 && getPlatform() == Common::kPlatformAtariST &&
diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp
index 5b30a76d4f..4a8c7b77b4 100644
--- a/engines/agos/charset-fontdata.cpp
+++ b/engines/agos/charset-fontdata.cpp
@@ -1122,7 +1122,7 @@ void AGOSEngine::renderStringAmiga(uint vgaSpriteId, uint color, uint width, uin
 
 	width /= 8;	// convert width from pixels to bytes
 
-	const byte *imgSrc = NULL;
+	const byte *imgSrc = nullptr;
 	switch (_language) {
 	case Common::IT_ITA:
 		imgSrc = italian_simon1AGAFontData;
diff --git a/engines/agos/charset.cpp b/engines/agos/charset.cpp
index 94efc8dd75..672d87f7df 100644
--- a/engines/agos/charset.cpp
+++ b/engines/agos/charset.cpp
@@ -65,11 +65,11 @@ void AGOSEngine_Feeble::doOutput(const byte *src, uint len) {
 void AGOSEngine::doOutput(const byte *src, uint len) {
 	uint idx;
 
-	if (_textWindow == NULL)
+	if (_textWindow == nullptr)
 		return;
 
 	while (len-- != 0) {
-		if (*src != 12 && _textWindow->iconPtr != NULL &&
+		if (*src != 12 && _textWindow->iconPtr != nullptr &&
 				_fcsData1[idx = getWindowNum(_textWindow)] != 2) {
 
 			_fcsData1[idx] = 2;
diff --git a/engines/agos/contain.cpp b/engines/agos/contain.cpp
index 0fab0a35f2..5e1de68df7 100644
--- a/engines/agos/contain.cpp
+++ b/engines/agos/contain.cpp
@@ -32,10 +32,10 @@ int AGOSEngine_Elvira2::canPlace(Item *x, Item *y) {
 	int ct;
 	int cap = 0;
 
-	if (o == NULL)
+	if (o == nullptr)
 		return 0;	/* Fits Fine */
 
-	xPlace(x,NULL);		/* Avoid disturbing figures */
+	xPlace(x,nullptr);		/* Avoid disturbing figures */
 	if (o)
 		cap = sizeContents(y);
 
@@ -59,10 +59,10 @@ int AGOSEngine::canPlace(Item *x, Item *y) {
 	int cap = 0;
 	int wt;
 
-	if ((c == NULL) && (p == NULL))
+	if ((c == nullptr) && (p == nullptr))
 		return 0;		/* Fits Fine */
 
-	xPlace(x, NULL);		/* Avoid disturbing figures */
+	xPlace(x, nullptr);		/* Avoid disturbing figures */
 	if (c)
 		cap = sizeContents(y);
 
diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp
index 5e05f14075..ba61a08bfc 100644
--- a/engines/agos/cursor.cpp
+++ b/engines/agos/cursor.cpp
@@ -418,7 +418,7 @@ void AGOSEngine_Simon1::handleMouseMoved() {
 
 		if (_rightButtonDown) {
 			_rightButtonDown = false;
-			setVerb(NULL);
+			setVerb(nullptr);
 		}
 	} else if (getGameType() == GType_SIMON2) {
 		if (getBitFlag(79)) {
@@ -451,7 +451,7 @@ void AGOSEngine_Simon1::handleMouseMoved() {
 	_leftButtonOld = _leftButton;
 
 	x = 0;
-	if (_lastHitArea3 == 0 && _leftButtonDown) {
+	if (_lastHitArea3 == nullptr && _leftButtonDown) {
 		_leftButtonDown = false;
 		x = 1;
 	} else {
@@ -461,7 +461,7 @@ void AGOSEngine_Simon1::handleMouseMoved() {
 
 	boxController(_mouse.x, _mouse.y, x);
 	_lastHitArea3 = _lastHitArea;
-	if (x == 1 && _lastHitArea == NULL)
+	if (x == 1 && _lastHitArea == nullptr)
 		_lastHitArea3 = (HitArea *) -1;
 
 get_out:
@@ -583,7 +583,7 @@ void AGOSEngine::handleMouseMoved() {
 		_needHitAreaRecalc++;
 
 	if (_leftButtonOld == 0 && _leftButton != 0) {
-		_lastClickRem = 0;
+		_lastClickRem = nullptr;
 		boxController(_mouse.x, _mouse.y, 3);
 	}
 	_leftButtonOld = _leftButton;
@@ -596,7 +596,7 @@ void AGOSEngine::handleMouseMoved() {
 			goto boxstuff;
 	}
 
-	if (_leftButton != 0 && _dragAccept && _lastClickRem != NULL) {
+	if (_leftButton != 0 && _dragAccept && _lastClickRem != nullptr) {
 		_dragCount++;
 		if (_dragCount == 20) {
 			_dragMode = true;
diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp
index 3bb13d16e8..e33927324d 100644
--- a/engines/agos/debug.cpp
+++ b/engines/agos/debug.cpp
@@ -40,11 +40,11 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) {
 		opcode = READ_BE_UINT16(p);
 		p += 2;
 		if (opcode == 10000)
-			return NULL;
+			return nullptr;
 	} else {
 		opcode = *p++;
 		if (opcode == 255)
-			return NULL;
+			return nullptr;
 	}
 
 	if (getGameType() == GType_PP) {
@@ -67,7 +67,7 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) {
 		st = s = elvira1_opcodeNameTable[opcode];
 	}
 
-	if (s == NULL) {
+	if (s == nullptr) {
 		error("dumpOpcode: INVALID OPCODE %d", opcode);
 	}
 
@@ -79,7 +79,7 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) {
 		switch (*s++) {
 		case 'x':
 			debugN("\n");
-			return NULL;
+			return nullptr;
 		case '|':
 			debugN("\n");
 			return p;
@@ -177,7 +177,7 @@ void AGOSEngine::dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub) {
 
 	for (;;) {
 		p = dumpOpcode(p);
-		if (p == NULL)
+		if (p == nullptr)
 			break;
 	}
 }
@@ -203,7 +203,7 @@ void AGOSEngine::dumpSubroutines() {
 void AGOSEngine::dumpAllSubroutines() {
 	for (int i = 0; i < 65536; i++) {
 		Subroutine *sub = getSubroutineByID(i);
-		if (sub != NULL) {
+		if (sub != nullptr) {
 			dumpSubroutine(sub);
 		}
 	}
@@ -243,7 +243,7 @@ void AGOSEngine::dumpVideoScript(const byte *src, bool singeOpcode) {
 			strn = str = pn_videoOpcodeNameTable[opcode];
 		}
 
-		if (strn == NULL) {
+		if (strn == nullptr) {
 			error("dumpVideoScript: Invalid Opcode %d", opcode);
 		}
 
@@ -335,7 +335,7 @@ void AGOSEngine::dumpAllVgaScriptFiles() {
 		loadZone(z, false);
 
 		VgaPointersEntry *vpe = &_vgaBufferPointers[zoneNum];
-		if (vpe->vgaFile1 != NULL) {
+		if (vpe->vgaFile1 != nullptr) {
 			_curVgaFile1 = vpe->vgaFile1;
 			dumpVgaFile(_curVgaFile1);
 		}
@@ -646,7 +646,7 @@ void AGOSEngine::dumpVgaBitmaps(uint16 zoneNum) {
 
 	uint16 zone = (getGameType() == GType_PN) ? 0 : zoneNum;
 	VgaPointersEntry *vpe = &_vgaBufferPointers[zone];
-	if (vpe->vgaFile1 == NULL || vpe->vgaFile2 == NULL)
+	if (vpe->vgaFile1 == nullptr || vpe->vgaFile2 == nullptr)
 		return;
 
 	const byte *vga1 = vpe->vgaFile1;
diff --git a/engines/agos/debugger.cpp b/engines/agos/debugger.cpp
index 365d84dd3f..18417115ed 100644
--- a/engines/agos/debugger.cpp
+++ b/engines/agos/debugger.cpp
@@ -189,7 +189,7 @@ bool Debugger::Cmd_SetObjectFlag(int argc, const char **argv) {
 
 		if (obj >= 1 && obj < _vm->_itemArraySize) {
 			SubObject *o = (SubObject *)_vm->findChildOfType(_vm->derefItem(obj), kObjectType);
-			if (o != NULL) {
+			if (o != nullptr) {
 				if (o->objectFlags & (1 << prop) && prop < 16) {
 					uint offs = _vm->getOffsetOfChild2Param(o, 1 << prop);
 					if (argc > 3) {
@@ -221,7 +221,7 @@ bool Debugger::Cmd_StartSubroutine(int argc, const char **argv) {
 		uint subroutine = atoi(argv[1]);
 		Subroutine *sub;
 		sub = _vm->getSubroutineByID(subroutine);
-		if (sub != NULL)
+		if (sub != nullptr)
 			_vm->startSubroutine(sub);
 	} else
 		debugPrintf("Subroutine %d\n", _vm->_currentTable->id);
@@ -234,7 +234,7 @@ bool Debugger::Cmd_dumpImage(int argc, const char **argv) {
 		uint16 zoneNum = atoi(argv[1]);
 		_vm->loadZone(zoneNum, false);
 		VgaPointersEntry *vpe = &_vm->_vgaBufferPointers[zoneNum];
-		if (vpe->vgaFile2 != NULL) {
+		if (vpe->vgaFile2 != nullptr) {
 			_vm->dumpVgaBitmaps(zoneNum);
 		} else {
 			debugPrintf("Invalid Zone Number %d\n", zoneNum);
@@ -251,7 +251,7 @@ bool Debugger::Cmd_dumpScript(int argc, const char **argv) {
 		uint16 zoneNum = atoi(argv[1]);
 		_vm->loadZone(zoneNum, false);
 		VgaPointersEntry *vpe = &_vm->_vgaBufferPointers[zoneNum];
-		if (vpe->vgaFile1 != NULL) {
+		if (vpe->vgaFile1 != nullptr) {
 			_vm->dumpVgaFile(vpe->vgaFile1);
 		} else {
 			debugPrintf("Invalid Zone Number %d\n", zoneNum);
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index c539ad4423..a51bd11562 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -60,14 +60,14 @@ static const PlainGameDescriptor agosGames[] = {
 	{"jumble", "Jumble"},
 	{"puzzle", "NoPatience"},
 	{"swampy", "Swampy Adventures"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #include "agos/detection_tables.h"
 
 static const char *const directoryGlobs[] = {
 	"execute", // Used by Simon1 Acorn CD
-	0
+	nullptr
 };
 
 using namespace AGOS;
diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp
index 53d5b9c0af..4bb19a26c0 100644
--- a/engines/agos/draw.cpp
+++ b/engines/agos/draw.cpp
@@ -324,7 +324,7 @@ restart:
 	}
 
 	AnimTable *animTable = _screenAnim1;
-	while (animTable->srcPtr != 0) {
+	while (animTable->srcPtr != nullptr) {
 		if (animTable->windowNum & 0x8000) {
 			x = animTable->x + _scrollX;
 			y = animTable->y;
@@ -384,7 +384,7 @@ void AGOSEngine::dirtyClipCheck(int16 x, int16 y, int16 w, int16 h) {
 	}
 
 	AnimTable *animTable = _screenAnim1;
-	for (; animTable->srcPtr != 0; animTable++) {
+	for (; animTable->srcPtr != nullptr; animTable++) {
 		if (animTable->windowNum & 0x8000)
 			continue;
 
@@ -452,7 +452,7 @@ void AGOSEngine::restoreBackGround() {
 		drawImage(&state);
 
 		if (getGameType() != GType_SIMON1 && getGameType() != GType_SIMON2) {
-			animTable->srcPtr = 0;
+			animTable->srcPtr = nullptr;
 		}
 	}
 	_backFlag = false;
@@ -468,7 +468,7 @@ void AGOSEngine::restoreBackGround() {
 			}
 			animTable++;
 		}
-		animTableTmp->srcPtr = 0;
+		animTableTmp->srcPtr = nullptr;
 	}
 }
 
@@ -512,7 +512,7 @@ void AGOSEngine::saveBackGround(VgaSprite *vsp) {
 	animTable->zoneNum = vsp->zoneNum;
 
 	animTable++;
-	animTable->srcPtr = 0;
+	animTable->srcPtr = nullptr;
 }
 
 void AGOSEngine::displayBoxStars() {
@@ -693,7 +693,7 @@ void AGOSEngine::scrollScreen() {
 	if (getGameType() == GType_SIMON2) {
 		AnimTable *animTable = _screenAnim1;
 		while (animTable->srcPtr) {
-			animTable->srcPtr = 0;
+			animTable->srcPtr = nullptr;
 			animTable++;
 		}
 
diff --git a/engines/agos/drivers/accolade/adlib.cpp b/engines/agos/drivers/accolade/adlib.cpp
index a3c2153044..4acaeb4d99 100644
--- a/engines/agos/drivers/accolade/adlib.cpp
+++ b/engines/agos/drivers/accolade/adlib.cpp
@@ -95,14 +95,14 @@ const uint16 frequencyLookUpTableMusicDrv[12] = {
 // I have currently not implemented dynamic channel allocation.
 
 MidiDriver_Accolade_AdLib::MidiDriver_Accolade_AdLib()
-		: _masterVolume(143), _opl(0),
-		  _adlibTimerProc(0), _adlibTimerParam(0), _isOpen(false) {
+		: _masterVolume(143), _opl(nullptr),
+		  _adlibTimerProc(nullptr), _adlibTimerParam(nullptr), _isOpen(false) {
 	memset(_channelMapping, 0, sizeof(_channelMapping));
 	memset(_instrumentMapping, 0, sizeof(_instrumentMapping));
 	memset(_instrumentVolumeAdjust, 0, sizeof(_instrumentVolumeAdjust));
 	memset(_percussionKeyNoteMapping, 0, sizeof(_percussionKeyNoteMapping));
 
-	_instrumentTable = NULL;
+	_instrumentTable = nullptr;
 	_instrumentCount = 0;
 	_musicDrvMode = false;
 	_percussionReg = 0x20;
@@ -428,7 +428,7 @@ void MidiDriver_Accolade_AdLib::noteOn(byte FMvoiceChannel, byte note, byte velo
 void MidiDriver_Accolade_AdLib::noteOnSetVolume(byte FMvoiceChannel, byte operatorNr, byte velocity) {
 	byte operatorReg = 0;
 	byte regValue40h = 0;
-	const InstrumentEntry *curInstrument = NULL;
+	const InstrumentEntry *curInstrument = nullptr;
 
 	// Adjust velocity with the master volume
 	uint16 adjustedVelocity = CLIP<uint16>((velocity * _masterVolume) / 255, 0, 0x3F);
@@ -769,7 +769,7 @@ bool MidiDriver_Accolade_AdLib::setupInstruments(byte *driverData, uint16 driver
 }
 
 MidiDriver *MidiDriver_Accolade_AdLib_create(Common::String driverFilename) {
-	byte  *driverData = NULL;
+	byte  *driverData = nullptr;
 	uint16 driverDataSize = 0;
 	bool   isMusicDrvFile = false;
 
diff --git a/engines/agos/drivers/accolade/mt32.cpp b/engines/agos/drivers/accolade/mt32.cpp
index 0b4ca35fca..b3c0f9bb38 100644
--- a/engines/agos/drivers/accolade/mt32.cpp
+++ b/engines/agos/drivers/accolade/mt32.cpp
@@ -30,7 +30,7 @@
 namespace AGOS {
 
 MidiDriver_Accolade_MT32::MidiDriver_Accolade_MT32() {
-	_driver = NULL;
+	_driver = nullptr;
 	_isOpen = false;
 	_nativeMT32 = false;
 	_baseFreq = 250;
@@ -42,11 +42,11 @@ MidiDriver_Accolade_MT32::MidiDriver_Accolade_MT32() {
 MidiDriver_Accolade_MT32::~MidiDriver_Accolade_MT32() {
 	Common::StackLock lock(_mutex);
 	if (_driver) {
-		_driver->setTimerCallback(0, 0);
+		_driver->setTimerCallback(nullptr, nullptr);
 		_driver->close();
 		delete _driver;
 	}
-	_driver = NULL;
+	_driver = nullptr;
 }
 
 int MidiDriver_Accolade_MT32::open() {
@@ -198,7 +198,7 @@ bool MidiDriver_Accolade_MT32::setupInstruments(byte *driverData, uint16 driverD
 }
 
 MidiDriver *MidiDriver_Accolade_MT32_create(Common::String driverFilename) {
-	byte  *driverData = NULL;
+	byte  *driverData = nullptr;
 	uint16 driverDataSize = 0;
 	bool   isMusicDrvFile = false;
 
diff --git a/engines/agos/drivers/accolade/pc98.cpp b/engines/agos/drivers/accolade/pc98.cpp
index d960dac4cc..73d988cef7 100644
--- a/engines/agos/drivers/accolade/pc98.cpp
+++ b/engines/agos/drivers/accolade/pc98.cpp
@@ -44,8 +44,8 @@ public:
 	void setTimerCallback(void *timerParam, Common::TimerManager::TimerProc timerProc) override;
 	uint32 property(int prop, uint32 param) override;
 	uint32 getBaseTempo() override { return _baseTempo; }
-	MidiChannel *allocateChannel() override { return 0; }
-	MidiChannel *getPercussionChannel() override { return 0; }
+	MidiChannel *allocateChannel() override { return nullptr; }
+	MidiChannel *getPercussionChannel() override { return nullptr; }
 
 protected:
 	void updateSounds();
@@ -166,7 +166,7 @@ private:
 	static const uint8 _sysexMsg[3][9];
 };
 
-PC98CommonDriver::PC98CommonDriver() : _mixer(g_engine->_mixer), _baseTempo(0), _fadeVolumeAdjust(0), _allNotes(false), _programLock(false), _isOpen(false), _noFadeRemap(false), _delayedProgramChange(false), _ngDelay(0), _timerCb(0), _musicVolume(0xff), _sfxVolume(0xff), _internalUpdateTimer(0) {
+PC98CommonDriver::PC98CommonDriver() : _mixer(g_engine->_mixer), _baseTempo(0), _fadeVolumeAdjust(0), _allNotes(false), _programLock(false), _isOpen(false), _noFadeRemap(false), _delayedProgramChange(false), _ngDelay(0), _timerCb(nullptr), _musicVolume(0xff), _sfxVolume(0xff), _internalUpdateTimer(0) {
 	memset(_partPrograms, 0, sizeof(_partPrograms));
 	memset(_chanUse, 0, sizeof(_chanUse));
 }
@@ -208,7 +208,7 @@ void PC98CommonDriver::send(uint32 b) {
 
 void PC98CommonDriver::setTimerCallback(void *timerParam, Common::TimerManager::TimerProc timerProc) {
 	delete _timerCb;
-	_timerCb = (_isOpen && timerParam && timerProc) ? new TimerCb(timerProc, timerParam) : 0;
+	_timerCb = (_isOpen && timerParam && timerProc) ? new TimerCb(timerProc, timerParam) : nullptr;
 }
 
 uint32 PC98CommonDriver::property(int prop, uint32 param) {
@@ -269,7 +269,7 @@ void PC98CommonDriver::reset() {
 	_ngDelay = 0;
 }
 
-PC98FMDriver::PC98FMDriver() : PC98CommonDriver(), _pc98a(0) {
+PC98FMDriver::PC98FMDriver() : PC98CommonDriver(), _pc98a(nullptr) {
 	_baseTempo = 10080;
 	_instrumentsRemap = _instrumentsRemapFM;
 	_instrumentLevelAdjust = (const int8*)_instrumentLevelAdjustFM;
@@ -317,8 +317,8 @@ int PC98FMDriver::open() {
 void PC98FMDriver::close() {
 	_isOpen = false;
 	delete _pc98a;
-	_pc98a = 0;
-	setTimerCallback(0, 0);
+	_pc98a = nullptr;
+	setTimerCallback(nullptr, nullptr);
 }
 
 void PC98FMDriver::noteOn(uint8 part, uint8 note, uint8 velo) {
@@ -530,8 +530,8 @@ const uint16 PC98FMDriver::_frequency[12] = {
 
 #define MIDIMSG32(s, p1, p2) (p2 << 16 | p1 << 8 | s)
 
-PC98MidiDriver::PC98MidiDriver(MidiDriver::DeviceHandle dev) : _dev(dev), _drv(0) {
-	_instrumentsRemap = (getMusicType(dev) == MT_MT32) ? _instrumentsRemapMT32 : (getMusicType(dev) == MT_GM ? _instrumentsRemapGM : 0);
+PC98MidiDriver::PC98MidiDriver(MidiDriver::DeviceHandle dev) : _dev(dev), _drv(nullptr) {
+	_instrumentsRemap = (getMusicType(dev) == MT_MT32) ? _instrumentsRemapMT32 : (getMusicType(dev) == MT_GM ? _instrumentsRemapGM : nullptr);
 	int8 *tbl2 = new int8[128]();
 	_instrumentLevelAdjust = tbl2;
 	_partsRemap = _partsRemapMidi;
@@ -612,14 +612,14 @@ void PC98MidiDriver::close() {
 	_isOpen = false;
 
 	if (_drv) {
-		_drv->setTimerCallback(0, 0);
+		_drv->setTimerCallback(nullptr, nullptr);
 		_mixer->stopAll();
 		_drv->close();
 		delete _drv;
-		_drv = 0;
+		_drv = nullptr;
 	}
 
-	setTimerCallback(0, 0);
+	setTimerCallback(nullptr, nullptr);
 }
 
 void PC98MidiDriver::timerCallback(void *obj) {
@@ -713,7 +713,7 @@ MidiDriver *MidiDriverPC98_create(MidiDriver::DeviceHandle dev) {
 		return new PC98FMDriver();
 	else if (type == MT_GM || type == MT_MT32)
 		return new PC98MidiDriver(dev);
-	return 0;
+	return nullptr;
 }
 
 #undef MIDIMSG32
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index 4a8f52a44d..d390a1aeba 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -40,7 +40,7 @@
 namespace AGOS {
 
 void AGOSEngine::addTimeEvent(uint16 timeout, uint16 subroutine_id) {
-	TimeEvent *te = (TimeEvent *)malloc(sizeof(TimeEvent)), *first, *last = NULL;
+	TimeEvent *te = (TimeEvent *)malloc(sizeof(TimeEvent)), *first, *last = nullptr;
 	uint32 cur_time = getTime();
 
 	if (getGameId() == GID_DIMP) {
@@ -71,10 +71,10 @@ void AGOSEngine::addTimeEvent(uint16 timeout, uint16 subroutine_id) {
 
 	if (last) {
 		last->next = te;
-		te->next = NULL;
+		te->next = nullptr;
 	} else {
 		_firstTimeStruct = te;
-		te->next = NULL;
+		te->next = nullptr;
 	}
 }
 
@@ -82,7 +82,7 @@ void AGOSEngine::delTimeEvent(TimeEvent *te) {
 	TimeEvent *cur;
 
 	if (te == _pendingDeleteTimeEvent)
-		_pendingDeleteTimeEvent = NULL;
+		_pendingDeleteTimeEvent = nullptr;
 
 	if (te == _firstTimeStruct) {
 		_firstTimeStruct = te->next;
@@ -91,11 +91,11 @@ void AGOSEngine::delTimeEvent(TimeEvent *te) {
 	}
 
 	cur = _firstTimeStruct;
-	if (cur == NULL)
+	if (cur == nullptr)
 		error("delTimeEvent: none available");
 
 	for (;;) {
-		if (cur->next == NULL)
+		if (cur->next == nullptr)
 			error("delTimeEvent: no such te");
 		if (te == cur->next) {
 			cur->next = te->next;
@@ -115,7 +115,7 @@ void AGOSEngine::invokeTimeEvent(TimeEvent *te) {
 		return;
 
 	sub = getSubroutineByID(te->subroutine_id);
-	if (sub != NULL)
+	if (sub != nullptr)
 		startSubroutineEx(sub);
 
 	_runScriptReturn1 = false;
@@ -141,12 +141,12 @@ bool AGOSEngine::kickoffTimeEvents() {
 
 	cur_time = getTime() - _gameStoppedClock;
 
-	while ((te = _firstTimeStruct) != NULL && te->time <= cur_time && !shouldQuit()) {
+	while ((te = _firstTimeStruct) != nullptr && te->time <= cur_time && !shouldQuit()) {
 		result = true;
 		_pendingDeleteTimeEvent = te;
 		invokeTimeEvent(te);
 		if (_pendingDeleteTimeEvent) {
-			_pendingDeleteTimeEvent = NULL;
+			_pendingDeleteTimeEvent = nullptr;
 			delTimeEvent(te);
 		}
 	}
@@ -322,7 +322,7 @@ void AGOSEngine::scrollEvent() {
 			}
 		}
 
-		addVgaEvent(6, SCROLL_EVENT, NULL, 0, 0);
+		addVgaEvent(6, SCROLL_EVENT, nullptr, 0, 0);
 	}
 }
 
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp
index 3c82b075cc..941e4e3200 100644
--- a/engines/agos/gfx.cpp
+++ b/engines/agos/gfx.cpp
@@ -1143,7 +1143,7 @@ void AGOSEngine::animate(uint16 windowNum, uint16 zoneNum, uint16 vgaSpriteId, i
 		vpe = &_vgaBufferPointers[zoneNum];
 		_curVgaFile1 = vpe->vgaFile1;
 		if (vgaScript) {
-			if (vpe->vgaFile1 != NULL)
+			if (vpe->vgaFile1 != nullptr)
 				break;
 			if (_zoneNumber != zoneNum)
 				_noOverWrite = _zoneNumber;
@@ -1152,7 +1152,7 @@ void AGOSEngine::animate(uint16 windowNum, uint16 zoneNum, uint16 vgaSpriteId, i
 			_noOverWrite = 0xFFFF;
 		} else {
 			_zoneNumber = zoneNum;
-			if (vpe->vgaFile1 != NULL)
+			if (vpe->vgaFile1 != nullptr)
 				break;
 			loadZone(zoneNum);
 		}
@@ -1231,7 +1231,7 @@ void AGOSEngine::setImage(uint16 vgaSpriteId, bool vgaScript) {
 		_curVgaFile2 = vpe->vgaFile2;
 
 		if (vgaScript) {
-			if (vpe->vgaFile1 != NULL)
+			if (vpe->vgaFile1 != nullptr)
 				break;
 			if (_zoneNumber != zoneNum)
 				_noOverWrite = _zoneNumber;
@@ -1243,7 +1243,7 @@ void AGOSEngine::setImage(uint16 vgaSpriteId, bool vgaScript) {
 			_curSfxFileSize = vpe->sfxFileEnd - vpe->sfxFile;
 			_zoneNumber = zoneNum;
 
-			if (vpe->vgaFile1 != NULL)
+			if (vpe->vgaFile1 != nullptr)
 				break;
 
 			loadZone(zoneNum);
@@ -1398,7 +1398,7 @@ void AGOSEngine::setWindowImage(uint16 mode, uint16 vgaSpriteId, bool specialCas
 	if (getGameType() == GType_PN) {
 		AnimTable *animTable = _screenAnim1;
 		while (animTable->srcPtr) {
-			animTable->srcPtr = 0;
+			animTable->srcPtr = nullptr;
 			animTable++;
 		}
 	}
@@ -1441,7 +1441,7 @@ void AGOSEngine::setWindowImage(uint16 mode, uint16 vgaSpriteId, bool specialCas
 
 		Graphics::Surface *screen = getBackendSurface();
 		byte *dst = (byte *)_backGroundBuf->getBasePtr(xoffs, yoffs);
-		byte *src = 0;
+		byte *src = nullptr;
 		uint srcWidth = 0;
 
 		if (getGameType() == GType_SIMON2) {
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index 7664a4182b..269379007a 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -47,7 +47,7 @@ void AGOSEngine::loadIconFile() {
 
 		uint32 dstSize = READ_BE_UINT32(srcBuf + srcSize - 4);
 		_iconFilePtr = (byte *)malloc(dstSize);
-		if (_iconFilePtr == NULL)
+		if (_iconFilePtr == nullptr)
 			error("Out of icon memory");
 
 		decrunchFile(srcBuf, _iconFilePtr, srcSize);
@@ -55,14 +55,14 @@ void AGOSEngine::loadIconFile() {
 	} else if (getGameType() == GType_PN && getPlatform() == Common::kPlatformAtariST) {
 		// The icon data is hard coded in the program file.
 		_iconFilePtr = (byte *)malloc(15038);
-		if (_iconFilePtr == NULL)
+		if (_iconFilePtr == nullptr)
 			error("Out of icon memory");
 
 		in.seek(48414);
 		in.read(_iconFilePtr, 15038);
 	} else {
 		_iconFilePtr = (byte *)malloc(srcSize);
-		if (_iconFilePtr == NULL)
+		if (_iconFilePtr == nullptr)
 			error("Out of icon memory");
 
 		in.read(_iconFilePtr, srcSize);
@@ -77,7 +77,7 @@ void AGOSEngine::loadIconData() {
 	byte *src = vpe->vgaFile2 + READ_LE_UINT32(vpe->vgaFile2 + 8);
 
 	_iconFilePtr = (byte *)malloc(43 * 336);
-	if (_iconFilePtr == NULL)
+	if (_iconFilePtr == nullptr)
 		error("Out of icon memory");
 
 	memcpy(_iconFilePtr, src, 43 * 336);
@@ -90,7 +90,7 @@ static void decompressIconPlanar(byte *dst, byte *src, uint width, uint height,
 	byte *i, *icon_pln, *o, *srcPtr;
 	byte x, y;
 
-	icon_pln = 0;
+	icon_pln = nullptr;
 	srcPtr = src;
 
 	if (decompress) {
@@ -500,7 +500,7 @@ void AGOSEngine::drawIconArray(uint num, Item *itemRef, int line, int classMask)
 		height = window->height / 3;
 	}
 
-	if (window == NULL)
+	if (window == nullptr)
 		return;
 
 	if (window->iconPtr)
@@ -524,7 +524,7 @@ void AGOSEngine::drawIconArray(uint num, Item *itemRef, int line, int classMask)
 		}
 	}
 
-	if (itemRef == NULL) {
+	if (itemRef == nullptr) {
 		window->iconPtr->line = 0;
 		itemRef = derefItem(item_ptr_org->child);
 	}
@@ -554,7 +554,7 @@ void AGOSEngine::drawIconArray(uint num, Item *itemRef, int line, int classMask)
 				}
 				k++;
 			} else {
-				window->iconPtr->iconArray[k].item = NULL;
+				window->iconPtr->iconArray[k].item = nullptr;
 				showArrows = 1;
 			}
 
@@ -569,7 +569,7 @@ void AGOSEngine::drawIconArray(uint num, Item *itemRef, int line, int classMask)
 		itemRef = derefItem(itemRef->next);
 	}
 
-	window->iconPtr->iconArray[k].item = NULL;
+	window->iconPtr->iconArray[k].item = nullptr;
 
 	if (showArrows != 0 || window->iconPtr->line != 0) {
 		/* Plot arrows and add their boxes */
@@ -1004,7 +1004,7 @@ void AGOSEngine::removeIconArray(uint num) {
 	window = _windowArray[num & 7];
 	curWindow = _curWindow;
 
-	if (window == NULL || window->iconPtr == NULL)
+	if (window == nullptr || window->iconPtr == nullptr)
 		return;
 
 	if (getGameType() != GType_FF && getGameType() != GType_PP) {
@@ -1013,7 +1013,7 @@ void AGOSEngine::removeIconArray(uint num) {
 		changeWindow(curWindow);
 	}
 
-	for (i = 0; window->iconPtr->iconArray[i].item != NULL; i++) {
+	for (i = 0; window->iconPtr->iconArray[i].item != nullptr; i++) {
 		freeBox(window->iconPtr->iconArray[i].boxCode);
 	}
 
@@ -1027,7 +1027,7 @@ void AGOSEngine::removeIconArray(uint num) {
 	}
 
 	free(window->iconPtr);
-	window->iconPtr = NULL;
+	window->iconPtr = nullptr;
 
 	_fcsData1[num] = 0;
 	_fcsData2[num] = 0;
@@ -1075,7 +1075,7 @@ void AGOSEngine_PN::iconPage() {
 	uint8 objRoom = getptr(_quickptr[12] + _variableArray[210] * _quickshort[5] + 20);
 	uint8 iconNum = getptr(_quickptr[0] + objRoom * _quickshort[0] + 4);
 
-	drawIcon(NULL, iconNum, 6, 12);
+	drawIcon(nullptr, iconNum, 6, 12);
 
 	HitArea *ha = _invHitAreas + 5;
 	for (uint8 r = 0; r < 5; r++) {
@@ -1107,7 +1107,7 @@ bool AGOSEngine_PN::testSeen(uint16 a) {
 void AGOSEngine_PN::printIcon(HitArea *ha, uint8 i, uint8 r) {
 	 if (_objects == _objectCountS) {
 		ha->flags |= kOBFBoxDisabled;
-		drawIcon(NULL, 0xFF, 12 + i * 3, 12 + 24 * r);
+		drawIcon(nullptr, 0xFF, 12 + i * 3, 12 + 24 * r);
 	} else {
 		_objectCountS++;
 		if (!ifObjectInInv(_objectCountS) || !testObvious(_objectCountS)) {
@@ -1115,7 +1115,7 @@ void AGOSEngine_PN::printIcon(HitArea *ha, uint8 i, uint8 r) {
 		} else {
 
 			uint8 iconNum = getptr(_quickptr[0] + _objectCountS * _quickshort[0] + 4);
-			drawIcon(NULL, iconNum, 12 + i * 3, 12 + 24 * r);
+			drawIcon(nullptr, iconNum, 12 + i * 3, 12 + 24 * r);
 
 			ha->msg1 = _objectCountS | 0x8000;
 			ha->flags &= ~kOBFBoxDisabled;
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index cc0acac2d0..283c55a5e5 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -113,8 +113,8 @@ void AGOSEngine::setup_cond_c_helper() {
 		}
 	}
 
-	_lastHitArea = 0;
-	_hitAreaObjectItem = NULL;
+	_lastHitArea = nullptr;
+	_hitAreaObjectItem = nullptr;
 	_nameLocked = false;
 
 	last = _lastNameOn;
@@ -122,8 +122,8 @@ void AGOSEngine::setup_cond_c_helper() {
 	_lastNameOn = last;
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = 0;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 		_leftButtonDown = false;
 
 		do {
@@ -143,14 +143,14 @@ void AGOSEngine::setup_cond_c_helper() {
 			}
 
 			delay(100);
-		} while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == 0) && !shouldQuit());
+		} while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == nullptr) && !shouldQuit());
 
-		if (_lastHitArea == NULL) {
+		if (_lastHitArea == nullptr) {
 		} else if (_lastHitArea->id == 0x7FFB) {
 			inventoryUp(_lastHitArea->window);
 		} else if (_lastHitArea->id == 0x7FFC) {
 			inventoryDown(_lastHitArea->window);
-		} else if (_lastHitArea->itemPtr != NULL) {
+		} else if (_lastHitArea->itemPtr != nullptr) {
 			_hitAreaObjectItem = _lastHitArea->itemPtr;
 			setVerbText(_lastHitArea);
 			break;
@@ -158,9 +158,9 @@ void AGOSEngine::setup_cond_c_helper() {
 	}
 
 out_of_here:
-	_lastHitArea3 = 0;
-	_lastHitArea = 0;
-	_lastNameOn = NULL;
+	_lastHitArea3 = nullptr;
+	_lastHitArea = nullptr;
+	_lastNameOn = nullptr;
 
 	_mouseCursor = 0;
 	_noRightClick = 0;
@@ -171,11 +171,11 @@ void AGOSEngine::waitForInput() {
 	uint id;
 
 	_leftButtonDown = false;
-	_lastHitArea = 0;
+	_lastHitArea = nullptr;
 	//_lastClickRem = 0;
 	_verbHitArea = 0;
-	_hitAreaSubjectItem = NULL;
-	_hitAreaObjectItem = NULL;
+	_hitAreaSubjectItem = nullptr;
+	_hitAreaObjectItem = nullptr;
 	_clickOnly = false;
 	_nameLocked = false;
 
@@ -188,8 +188,8 @@ void AGOSEngine::waitForInput() {
 	}
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = NULL;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 		_dragAccept = true;
 
 		while (!shouldQuit()) {
@@ -201,8 +201,8 @@ void AGOSEngine::waitForInput() {
 					goto out_of_here;
 			}
 			if (_lastHitArea3 == (HitArea *) -1) {
-				_lastHitArea = NULL;
-				_lastHitArea3 = NULL;
+				_lastHitArea = nullptr;
+				_lastHitArea3 = nullptr;
 				_dragAccept = true;
 			} else {
 				if (_lastHitArea3 || _dragMode)
@@ -215,7 +215,7 @@ void AGOSEngine::waitForInput() {
 		if (!_lastHitArea3 && _dragMode) {
 			ha = _lastClickRem;
 
-			if (ha == 0 || ha->itemPtr == NULL || !(ha->flags & kBFDragBox)) {
+			if (ha == nullptr || ha->itemPtr == nullptr || !(ha->flags & kBFDragBox)) {
 				_dragFlag = false;
 				_dragMode = false;
 				_dragCount = 0;
@@ -246,7 +246,7 @@ void AGOSEngine::waitForInput() {
 
 			boxController(_mouse.x, _mouse.y, 1);
 
-			if (_currentBox != NULL) {
+			if (_currentBox != nullptr) {
 				_hitAreaObjectItem = _currentBox->itemPtr;
 				setVerbText(_currentBox);
 			}
@@ -255,7 +255,7 @@ void AGOSEngine::waitForInput() {
 		}
 
 		ha = _lastHitArea;
-		if (ha == NULL) {
+		if (ha == nullptr) {
 		} else if (ha->id == 0x7FFB) {
 			inventoryUp(ha->window);
 		} else if (ha->id == 0x7FFC) {
@@ -327,7 +327,7 @@ void AGOSEngine::waitForInput() {
 						_hitAreaSubjectItem = ha->itemPtr;
 						break;
 					}
-					if (_hitAreaSubjectItem != NULL)
+					if (_hitAreaSubjectItem != nullptr)
 						break;
 
 					if (getGameType() == GType_WW) {
@@ -369,7 +369,7 @@ void AGOSEngine::hitarea_stuff_helper() {
 		uint subr_id = (uint16)_variableArray[254];
 		if (subr_id) {
 			Subroutine *sub = getSubroutineByID(subr_id);
-			if (sub != NULL) {
+			if (sub != nullptr) {
 				startSubroutineEx(sub);
 				permitInput();
 			}
@@ -396,7 +396,7 @@ void AGOSEngine::hitarea_stuff_helper_2() {
 	subr_id = (uint16)_variableArray[249];
 	if (subr_id) {
 		sub = getSubroutineByID(subr_id);
-		if (sub != NULL) {
+		if (sub != nullptr) {
 			_variableArray[249] = 0;
 			startSubroutineEx(sub);
 			permitInput();
@@ -407,7 +407,7 @@ void AGOSEngine::hitarea_stuff_helper_2() {
 	subr_id = (uint16)_variableArray[254];
 	if (subr_id) {
 		sub = getSubroutineByID(subr_id);
-		if (sub != NULL) {
+		if (sub != nullptr) {
 			_variableArray[254] = 0;
 			startSubroutineEx(sub);
 			permitInput();
@@ -452,7 +452,7 @@ void AGOSEngine_Feeble::handleMouseWheelDown() {
 
 void AGOSEngine_Simon1::handleMouseWheelUp() {
 	HitArea *ha = findBox(206);
-	if (ha != NULL && (ha->flags & kBFBoxInUse) && !(ha->flags & kBFBoxDead)) {
+	if (ha != nullptr && (ha->flags & kBFBoxInUse) && !(ha->flags & kBFBoxDead)) {
 			if (_saveLoadRowCurPos != 1) {
 				if (_saveLoadRowCurPos < 7)
 					_saveLoadRowCurPos = 1;
@@ -469,7 +469,7 @@ void AGOSEngine_Simon1::handleMouseWheelUp() {
 
 void AGOSEngine_Simon1::handleMouseWheelDown() {
 	HitArea *ha = findBox(207);
-	if (ha != NULL && (ha->flags & kBFBoxInUse) && !(ha->flags & kBFBoxDead)) {
+	if (ha != nullptr && (ha->flags & kBFBoxInUse) && !(ha->flags & kBFBoxDead)) {
 			if (_saveDialogFlag) {
 				_saveLoadRowCurPos += 1;
 				if (_saveLoadRowCurPos >= _numSaveGameRows)
@@ -485,7 +485,7 @@ void AGOSEngine_Simon1::handleMouseWheelDown() {
 
 void AGOSEngine_Elvira2::handleMouseWheelUp() {
 	HitArea *ha = findBox(224);
-	if (ha != NULL && (ha->flags & kBFBoxInUse)) {
+	if (ha != nullptr && (ha->flags & kBFBoxInUse)) {
 			_saveGameNameLen = 0;
 
 			if (_saveLoadRowCurPos < 3)
@@ -501,7 +501,7 @@ void AGOSEngine_Elvira2::handleMouseWheelUp() {
 
 void AGOSEngine_Elvira2::handleMouseWheelDown() {
 	HitArea *ha =  findBox(224);
-	if (ha != NULL && (ha->flags & kBFBoxInUse)) {
+	if (ha != nullptr && (ha->flags & kBFBoxInUse)) {
 			_saveGameNameLen = 0;
 			_saveLoadRowCurPos += 3;
 			if (_saveLoadRowCurPos >= _numSaveGameRows)
@@ -515,14 +515,14 @@ void AGOSEngine_Elvira2::handleMouseWheelDown() {
 
 void AGOSEngine::handleMouseWheelUp() {
 	HitArea *ha = findBox(0x7FFB);
-	if (ha != NULL && (ha->flags & kBFBoxInUse) && !(getGameId() == GID_ELVIRA1 && _windowNum == 3)) {
+	if (ha != nullptr && (ha->flags & kBFBoxInUse) && !(getGameId() == GID_ELVIRA1 && _windowNum == 3)) {
 		inventoryUp(ha->window);
 	}
 }
 
 void AGOSEngine::handleMouseWheelDown() {
 	HitArea *ha = findBox(0x7FFC);
-	if (ha != NULL && (ha->flags & kBFBoxInUse) && !(getGameId() == GID_ELVIRA1 && _windowNum == 3)) {
+	if (ha != nullptr && (ha->flags & kBFBoxInUse) && !(getGameId() == GID_ELVIRA1 && _windowNum == 3)) {
 		inventoryDown(ha->window);
 	}
 }
diff --git a/engines/agos/input_pn.cpp b/engines/agos/input_pn.cpp
index a852ef320b..a829e846ac 100644
--- a/engines/agos/input_pn.cpp
+++ b/engines/agos/input_pn.cpp
@@ -44,7 +44,7 @@ void AGOSEngine_PN::handleKeyboard() {
 		const char *strPtr = _mouseString;
 		while (*strPtr != 0 && *strPtr != 13)
 			addChar(*strPtr++);
-		_mouseString = 0;
+		_mouseString = nullptr;
 
 		chr = *strPtr;
 		if (chr == 13) {
@@ -55,7 +55,7 @@ void AGOSEngine_PN::handleKeyboard() {
 		const char *strPtr = _mouseString1;
 		while (*strPtr != 13)
 			addChar(*strPtr++);
-		_mouseString1 = 0;
+		_mouseString1 = nullptr;
 
 		chr = *strPtr;
 		if (chr == 13) {
@@ -74,8 +74,8 @@ void AGOSEngine_PN::handleKeyboard() {
 	}
 
 	if (chr == 13) {
-		_mouseString = 0;
-		_mouseString1 = 0;
+		_mouseString = nullptr;
+		_mouseString1 = nullptr;
 		_mousePrintFG = 0;
 		_inputReady = false;
 	}
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 094b97fac6..bf1a685d43 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -60,7 +60,7 @@ uint AGOSEngine_Elvira2::itemGetIconNumber(Item *item) {
 	SubObject *child = (SubObject *)findChildOfType(item, kObjectType);
 	uint offs;
 
-	if (child == NULL || !(child->objectFlags & kOFIcon))
+	if (child == nullptr || !(child->objectFlags & kOFIcon))
 		return 0;
 
 	offs = getOffsetOfChild2Param(child, 0x10);
@@ -83,7 +83,7 @@ void AGOSEngine::createPlayer() {
 	_currentPlayer->noun = 10000;
 
 	p = (SubPlayer *)allocateChildBlock(_currentPlayer, kPlayerType, sizeof(SubPlayer));
-	if (p == NULL)
+	if (p == nullptr)
 		error("createPlayer: player create failure");
 
 	p->size = 0;
@@ -97,7 +97,7 @@ void AGOSEngine::createPlayer() {
 }
 
 Child *AGOSEngine::findChildOfType(Item *i, uint type) {
-	Item *b = NULL;
+	Item *b = nullptr;
 	Child *child = i->children;
 
 	for (; child; child = child->next) {
@@ -114,14 +114,14 @@ Child *AGOSEngine::findChildOfType(Item *i, uint type) {
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 int AGOSEngine::getUserFlag(Item *item, int a) {
 	SubUserFlag *subUserFlag;
 
 	subUserFlag = (SubUserFlag *)findChildOfType(item, kUserFlagType);
-	if (subUserFlag == NULL)
+	if (subUserFlag == nullptr)
 		return 0;
 
 	int max = (getGameType() == GType_ELVIRA1) ? 7 : 3;
@@ -134,11 +134,11 @@ int AGOSEngine::getUserFlag(Item *item, int a) {
 int AGOSEngine::getUserFlag1(Item *item, int a) {
 	SubUserFlag *subUserFlag;
 
-	if (item == NULL || item == _dummyItem2 || item == _dummyItem3)
+	if (item == nullptr || item == _dummyItem2 || item == _dummyItem3)
 		return -1;
 
 	subUserFlag = (SubUserFlag *)findChildOfType(item, kUserFlagType);
-	if (subUserFlag == NULL)
+	if (subUserFlag == nullptr)
 		return 0;
 
 	if (a < 0 || a > 7)
@@ -151,7 +151,7 @@ void AGOSEngine::setUserFlag(Item *item, int a, int b) {
 	SubUserFlag *subUserFlag;
 
 	subUserFlag = (SubUserFlag *)findChildOfType(item, kUserFlagType);
-	if (subUserFlag == NULL) {
+	if (subUserFlag == nullptr) {
 		subUserFlag = (SubUserFlag *)allocateChildBlock(item, kUserFlagType, sizeof(SubUserFlag));
 	}
 
@@ -165,7 +165,7 @@ int AGOSEngine::getUserItem(Item *item, int n) {
 	SubUserFlag *subUserFlag;
 
 	subUserFlag = (SubUserFlag *)findChildOfType(item, kUserFlagType);
-	if (subUserFlag == NULL)
+	if (subUserFlag == nullptr)
 		return 0;
 
 	if (n < 0 || n > 0)
@@ -178,7 +178,7 @@ void AGOSEngine::setUserItem(Item *item, int n, int m) {
 	SubUserFlag *subUserFlag;
 
 	subUserFlag = (SubUserFlag *)findChildOfType(item, kUserFlagType);
-	if (subUserFlag == NULL) {
+	if (subUserFlag == nullptr) {
 		subUserFlag = (SubUserFlag *)allocateChildBlock(item, kUserFlagType, sizeof(SubUserFlag));
 	}
 
@@ -187,15 +187,15 @@ void AGOSEngine::setUserItem(Item *item, int n, int m) {
 }
 
 bool AGOSEngine::isRoom(Item *item) {
-	return findChildOfType(item, kRoomType) != NULL;
+	return findChildOfType(item, kRoomType) != nullptr;
 }
 
 bool AGOSEngine::isObject(Item *item) {
-	return findChildOfType(item, kObjectType) != NULL;
+	return findChildOfType(item, kObjectType) != nullptr;
 }
 
 bool AGOSEngine::isPlayer(Item *item) {
-	return findChildOfType(item, kPlayerType) != NULL;
+	return findChildOfType(item, kPlayerType) != nullptr;
 }
 
 uint AGOSEngine::getOffsetOfChild2Param(SubObject *child, uint prop) {
@@ -250,7 +250,7 @@ Item *AGOSEngine::getNextItemPtrStrange() {
 	case -5:
 		return _dummyItem2;
 	case -7:
-		return NULL;
+		return nullptr;
 	case -9:
 		return _dummyItem3;
 	default:
@@ -359,7 +359,7 @@ void AGOSEngine::linkItem(Item *item, Item *parent) {
 	id = itemPtrToID(parent);
 	item->parent = id;
 
-	if (parent != 0) {
+	if (parent != nullptr) {
 		item->next = parent->child;
 		parent->child = itemPtrToID(item);
 	} else {
@@ -399,7 +399,7 @@ Item *AGOSEngine::findInByClass(Item *i, int16 m) {
 		}
 		i = derefItem(i->next);
 	}
-	return NULL;
+	return nullptr;
 }
 
 Item *AGOSEngine::nextInByClass(Item *i, int16 m) {
@@ -415,7 +415,7 @@ Item *AGOSEngine::nextInByClass(Item *i, int16 m) {
 		}
 		i = derefItem(i->next);
 	}
-	return NULL;
+	return nullptr;
 }
 
 Item *AGOSEngine::findMaster(int16 a, int16 n) {
@@ -423,14 +423,14 @@ Item *AGOSEngine::findMaster(int16 a, int16 n) {
 
 	for (j = 1; j < _itemArraySize; j++) {
 		Item *item = derefItem(j);
-		if (item == NULL)
+		if (item == nullptr)
 			continue;
 
 		if (wordMatch(item, a, n))
 			return item;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 Item *AGOSEngine::nextMaster(Item *i, int16 a, int16 n) {
@@ -439,14 +439,14 @@ Item *AGOSEngine::nextMaster(Item *i, int16 a, int16 n) {
 
 	for (j = first; j < _itemArraySize; j++) {
 		Item *item = derefItem(j);
-		if (item == NULL)
+		if (item == nullptr)
 			continue;
 
 		if (wordMatch(item, a, n))
 			return item;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 uint AGOSEngine::itemPtrToID(Item *id) {
diff --git a/engines/agos/menus.cpp b/engines/agos/menus.cpp
index 7617c11681..2cb28ad0a4 100644
--- a/engines/agos/menus.cpp
+++ b/engines/agos/menus.cpp
@@ -41,7 +41,7 @@ void AGOSEngine::loadMenuFile() {
 
 	uint fileSize = in.size();
 	_menuBase = (byte *)malloc(fileSize);
-	if (_menuBase == NULL)
+	if (_menuBase == nullptr)
 		error("loadMenuFile: Out of memory for menu data");
 	in.read(_menuBase, fileSize);
 	in.close();
@@ -213,11 +213,11 @@ void AGOSEngine::lightMenuBox(uint hitarea) {
 
 // Elvira 2 specific
 uint AGOSEngine::menuFor_e2(Item *item) {
-	if (item == NULL || item == _dummyItem2 || item == _dummyItem3)
+	if (item == nullptr || item == _dummyItem2 || item == _dummyItem3)
 		return 0xFFFF;
 
 	SubObject *subObject = (SubObject *)findChildOfType(item, kObjectType);
-	if (subObject != NULL && subObject->objectFlags & kOFMenu) {
+	if (subObject != nullptr && subObject->objectFlags & kOFMenu) {
 		uint offs = getOffsetOfChild2Param(subObject, kOFMenu);
 		return subObject->objectFlagValue[offs];
 	}
@@ -230,11 +230,11 @@ uint AGOSEngine::menuFor_ww(Item *item, uint id) {
 	if (id != 0xFFFF && id < 10 && _textMenu[id] != 0)
 		return _textMenu[id];
 
-	if (item == NULL || item == _dummyItem2 || item == _dummyItem3)
+	if (item == nullptr || item == _dummyItem2 || item == _dummyItem3)
 		return _agosMenu;
 
 	SubObject *subObject = (SubObject *)findChildOfType(item, kObjectType);
-	if (subObject != NULL && subObject->objectFlags & kOFMenu) {
+	if (subObject != nullptr && subObject->objectFlags & kOFMenu) {
 		uint offs = getOffsetOfChild2Param(subObject, kOFMenu);
 		return subObject->objectFlagValue[offs];
 	}
@@ -281,7 +281,7 @@ void AGOSEngine::doMenuStrip(uint menuNum) {
 		_variableArray[v] = verb;
 
 		HitArea *ha = findBox(id);
-		if (ha != NULL) {
+		if (ha != nullptr) {
 			ha->flags &= ~kBFBoxDead;
 			ha->verb = verb;
 		}
diff --git a/engines/agos/metaengine.cpp b/engines/agos/metaengine.cpp
index 40bd94d268..d131083fb8 100644
--- a/engines/agos/metaengine.cpp
+++ b/engines/agos/metaengine.cpp
@@ -194,7 +194,7 @@ const char *AGOSEngine::getFileName(int type) const {
 		if (_gameDescription->desc.filesDescriptions[i].fileType == type)
 			return _gameDescription->desc.filesDescriptions[i].fileName;
 	}
-	return NULL;
+	return nullptr;
 }
 
 #ifdef ENABLE_AGOS2
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 3ae0f4fd33..8441c6277e 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -53,12 +53,12 @@ MidiPlayer::MidiPlayer() {
 	// Since initialize() is called every time the music changes,
 	// this is where we'll initialize stuff that must persist
 	// between songs.
-	_driver = 0;
+	_driver = nullptr;
 	_map_mt32_to_gm = false;
 
 	_adLibMusic = false;
 	_enable_sfx = true;
-	_current = 0;
+	_current = nullptr;
 
 	_musicVolume = 255;
 	_sfxVolume = 255;
@@ -78,11 +78,11 @@ MidiPlayer::~MidiPlayer() {
 	stop();
 
 	if (_driver) {
-		_driver->setTimerCallback(0, 0);
+		_driver->setTimerCallback(nullptr, nullptr);
 		_driver->close();
 		delete _driver;
 	}
-	_driver = NULL;
+	_driver = nullptr;
 
 	Common::StackLock lock(_mutex);
 	clearConstructs();
@@ -431,7 +431,7 @@ void MidiPlayer::onTimer(void *data) {
 		p->_current = &p->_sfx;
 		p->_sfx.parser->onTimer();
 	}
-	p->_current = 0;
+	p->_current = nullptr;
 }
 
 void MidiPlayer::startTrack(int track) {
@@ -447,8 +447,8 @@ void MidiPlayer::startTrack(int track) {
 		if (_music.parser) {
 			_current = &_music;
 			delete _music.parser;
-			_current = 0;
-			_music.parser = 0;
+			_current = nullptr;
+			_music.parser = nullptr;
 		}
 
 		MidiParser *parser = MidiParser::createParser_SMF();
@@ -458,7 +458,7 @@ void MidiPlayer::startTrack(int track) {
 		if (!parser->loadMusic(_music.songs[track], _music.song_sizes[track])) {
 			warning("Error reading track %d", track);
 			delete parser;
-			parser = 0;
+			parser = nullptr;
 		}
 
 		_currentTrack = (byte)track;
@@ -470,7 +470,7 @@ void MidiPlayer::startTrack(int track) {
 		_currentTrack = (byte)track;
 		_current = &_music;
 		_music.parser->jumpToTick(0);
-		_current = 0;
+		_current = nullptr;
 	}
 }
 
@@ -481,7 +481,7 @@ void MidiPlayer::stop() {
 		_current = &_music;
 		_music.parser->jumpToTick(0);
 	}
-	_current = 0;
+	_current = nullptr;
 	_currentTrack = 255;
 }
 
@@ -568,10 +568,10 @@ void MidiPlayer::clearConstructs(MusicInfo &info) {
 	}
 
 	free(info.data);
-	info.data = 0;
+	info.data = nullptr;
 
 	delete info.parser;
-	info.parser = 0;
+	info.parser = nullptr;
 
 	if (_driver) {
 		for (i = 0; i < 16; ++i) {
@@ -679,7 +679,7 @@ void MidiPlayer::loadSMF(Common::SeekableReadStream *in, int song, bool sfx) {
 	if (!parser->loadMusic(p->data, size)) {
 		warning("Error reading track");
 		delete parser;
-		parser = 0;
+		parser = nullptr;
 	}
 
 	if (!sfx) {
@@ -778,7 +778,7 @@ void MidiPlayer::loadXMIDI(Common::SeekableReadStream *in, bool sfx) {
 	// of XMIDI callback controller events. As far as we know, they aren't
 	// actually used, so we disable the callback handler explicitly.
 
-	MidiParser *parser = MidiParser::createParser_XMIDI(NULL);
+	MidiParser *parser = MidiParser::createParser_XMIDI(nullptr);
 	parser->setMidiDriver(this);
 	parser->setTimerRate(_driver->getBaseTempo());
 	if (!parser->loadMusic(p->data, size))
diff --git a/engines/agos/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp
index 557c4f8937..2e30368c39 100644
--- a/engines/agos/midiparser_s1d.cpp
+++ b/engines/agos/midiparser_s1d.cpp
@@ -49,7 +49,7 @@ protected:
 	void resetTracking() override;
 
 public:
-	MidiParser_S1D() : _data(0), _noDelta(false) {}
+	MidiParser_S1D() : _data(nullptr), _noDelta(false) {}
 
 	bool loadMusic(byte *data, uint32 size) override;
 };
diff --git a/engines/agos/pn.cpp b/engines/agos/pn.cpp
index d94f180b00..d7a13b20d7 100644
--- a/engines/agos/pn.cpp
+++ b/engines/agos/pn.cpp
@@ -30,13 +30,13 @@ namespace AGOS {
 AGOSEngine_PN::AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd)
 	: AGOSEngine(system, gd) {
 
-	_stackbase = 0;
+	_stackbase = nullptr;
 	_tagOfActiveDoline = 0;
 	_dolineReturnVal = 0;
 
-	_dataBase = 0;
+	_dataBase = nullptr;
 	_dataBaseSize = 0;
-	_textBase = 0;
+	_textBase = nullptr;
 	_textBaseSize = 0;
 
 	memset(_buffer, 0, sizeof(_buffer));
@@ -48,15 +48,15 @@ AGOSEngine_PN::AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd)
 	memset(_objectName1, 0, sizeof(_objectName1));
 	memset(_objectName2, 0, sizeof(_objectName2));
 
-	_dragStore = 0;
+	_dragStore = nullptr;
 	_hitCalled = 0;
 	_inputReady = false;
 	_inputting = false;
 	_intputCounter = 0;
 	_inputMax = 0;
 	_mousePrintFG = 0;
-	_mouseString = 0;
-	_mouseString1 = 0;
+	_mouseString = nullptr;
+	_mouseString1 = nullptr;
 	memset(_inMessage, 0, sizeof(_inMessage));
 	memset(_placeMessage, 0, sizeof(_placeMessage));
 
@@ -74,15 +74,15 @@ AGOSEngine_PN::AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd)
 	_havinit = 0;
 	_seed = 0;
 
-	_curwrdptr = 0;
-	_inpp = 0;
+	_curwrdptr = nullptr;
+	_inpp = nullptr;
 	_fnst = 0;
 	_linembr = 0;
 	_linct = 0;
 	_procnum = 0;
 
-	_linebase = 0;
-	_workptr = 0;
+	_linebase = nullptr;
+	_workptr = nullptr;
 }
 
 AGOSEngine_PN::~AGOSEngine_PN() {
@@ -113,7 +113,7 @@ const byte egaPalette[48] = {
 Common::Error AGOSEngine_PN::go() {
 	loadGamePcFile();
 
-	if (getFileName(GAME_ICONFILE) != NULL) {
+	if (getFileName(GAME_ICONFILE) != nullptr) {
 		loadIconFile();
 	}
 
@@ -121,7 +121,7 @@ Common::Error AGOSEngine_PN::go() {
 
 	vc34_setMouseOff();
 
-	addVgaEvent(_frameCount, ANIMATE_INT, NULL, 0, 0);
+	addVgaEvent(_frameCount, ANIMATE_INT, nullptr, 0, 0);
 
 	if (getFeatures() & GF_EGA) {
 		// Set EGA Palette
diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp
index 048cb963e3..353f894f1f 100644
--- a/engines/agos/res.cpp
+++ b/engines/agos/res.cpp
@@ -132,7 +132,7 @@ int AGOSEngine::allocGamePcVars(Common::SeekableReadStream *in) {
 		error("allocGamePcVars: Not a runtime database");
 
 	_itemArrayPtr = (Item **)calloc(itemArraySize, sizeof(Item *));
-	if (_itemArrayPtr == NULL)
+	if (_itemArrayPtr == nullptr)
 		error("allocGamePcVars: Out of memory for Item array");
 
 	_itemArraySize = itemArraySize;
@@ -150,7 +150,7 @@ int AGOSEngine::allocGamePcVars(Common::SeekableReadStream *in) {
 }
 
 void AGOSEngine_PN::loadGamePcFile() {
-	if (getFileName(GAME_BASEFILE) != NULL) {
+	if (getFileName(GAME_BASEFILE) != nullptr) {
 		Common::File in;
 		// Read dataBase
 		if (!in.open(getFileName(GAME_BASEFILE))) {
@@ -159,7 +159,7 @@ void AGOSEngine_PN::loadGamePcFile() {
 
 		_dataBaseSize = in.size();
 		_dataBase = (byte *)malloc(_dataBaseSize);
-		if (_dataBase == NULL)
+		if (_dataBase == nullptr)
 			error("loadGamePcFile: Out of memory for dataBase");
 		in.read(_dataBase, _dataBaseSize);
 
@@ -167,7 +167,7 @@ void AGOSEngine_PN::loadGamePcFile() {
 			error("Later version of system requested");
 	}
 
-	if (getFileName(GAME_TEXTFILE) != NULL) {
+	if (getFileName(GAME_TEXTFILE) != nullptr) {
 		Common::File in;
 		// Read textBase
 		if (!in.open(getFileName(GAME_TEXTFILE))) {
@@ -176,7 +176,7 @@ void AGOSEngine_PN::loadGamePcFile() {
 
 		_textBaseSize = in.size();
 		_textBase = (byte *)malloc(_textBaseSize);
-		if (_textBase == NULL)
+		if (_textBase == nullptr)
 			error("loadGamePcFile: Out of memory for textBase");
 		in.read(_textBase, _textBaseSize);
 
@@ -188,7 +188,7 @@ void AGOSEngine_PN::loadGamePcFile() {
 void AGOSEngine::loadGamePcFile() {
 	int fileSize;
 
-	if (getFileName(GAME_BASEFILE) != NULL) {
+	if (getFileName(GAME_BASEFILE) != nullptr) {
 		/* Read main gamexx file */
 		Common::File in;
 		if (!in.open(getFileName(GAME_BASEFILE))) {
@@ -213,7 +213,7 @@ void AGOSEngine::loadGamePcFile() {
 		}
 	}
 
-	if (getFileName(GAME_TBLFILE) != NULL) {
+	if (getFileName(GAME_TBLFILE) != nullptr) {
 		/* Read list of TABLE resources */
 		Common::File in;
 		if (!in.open(getFileName(GAME_TBLFILE))) {
@@ -223,7 +223,7 @@ void AGOSEngine::loadGamePcFile() {
 		fileSize = in.size();
 
 		_tblList = (byte *)malloc(fileSize);
-		if (_tblList == NULL)
+		if (_tblList == nullptr)
 			error("loadGamePcFile: Out of memory for strip table list");
 		in.read(_tblList, fileSize);
 
@@ -233,7 +233,7 @@ void AGOSEngine::loadGamePcFile() {
 		_tablesHeapCurPosOrg = _tablesHeapCurPos;
 	}
 
-	if (getFileName(GAME_STRFILE) != NULL) {
+	if (getFileName(GAME_STRFILE) != nullptr) {
 		/* Read list of TEXT resources */
 		Common::File in;
 		if (!in.open(getFileName(GAME_STRFILE)))
@@ -241,12 +241,12 @@ void AGOSEngine::loadGamePcFile() {
 
 		fileSize = in.size();
 		_strippedTxtMem = (byte *)malloc(fileSize);
-		if (_strippedTxtMem == NULL)
+		if (_strippedTxtMem == nullptr)
 			error("loadGamePcFile: Out of memory for strip text list");
 		in.read(_strippedTxtMem, fileSize);
 	}
 
-	if (getFileName(GAME_STATFILE) != NULL) {
+	if (getFileName(GAME_STATFILE) != nullptr) {
 		/* Read list of ROOM STATE resources */
 		Common::File in;
 		if (!in.open(getFileName(GAME_STATFILE))) {
@@ -256,7 +256,7 @@ void AGOSEngine::loadGamePcFile() {
 		_numRoomStates = in.size() / 8;
 
 		_roomStates = (RoomState *)calloc(_numRoomStates, sizeof(RoomState));
-		if (_roomStates == NULL)
+		if (_roomStates == nullptr)
 			error("loadGamePcFile: Out of memory for room state list");
 
 		for (uint s = 0; s < _numRoomStates; s++) {
@@ -268,7 +268,7 @@ void AGOSEngine::loadGamePcFile() {
 		}
 	}
 
-	if (getFileName(GAME_RMSLFILE) != NULL) {
+	if (getFileName(GAME_RMSLFILE) != nullptr) {
 		/* Read list of ROOM ITEMS resources */
 		Common::File in;
 		if (!in.open(getFileName(GAME_RMSLFILE))) {
@@ -278,12 +278,12 @@ void AGOSEngine::loadGamePcFile() {
 		fileSize = in.size();
 
 		_roomsList = (byte *)malloc(fileSize);
-		if (_roomsList == NULL)
+		if (_roomsList == nullptr)
 			error("loadGamePcFile: Out of memory for room items list");
 		in.read(_roomsList, fileSize);
 	}
 
-	if (getFileName(GAME_XTBLFILE) != NULL) {
+	if (getFileName(GAME_XTBLFILE) != nullptr) {
 		/* Read list of XTABLE resources */
 		Common::File in;
 		if (!in.open(getFileName(GAME_XTBLFILE))) {
@@ -293,7 +293,7 @@ void AGOSEngine::loadGamePcFile() {
 		fileSize = in.size();
 
 		_xtblList = (byte *)malloc(fileSize);
-		if (_xtblList == NULL)
+		if (_xtblList == nullptr)
 			error("loadGamePcFile: Out of memory for strip xtable list");
 		in.read(_xtblList, fileSize);
 
@@ -323,7 +323,7 @@ void AGOSEngine::readGamePcFile(Common::SeekableReadStream *in) {
 void AGOSEngine::readGamePcText(Common::SeekableReadStream *in) {
 	_textSize = in->readUint32BE();
 	_textMem = (byte *)malloc(_textSize);
-	if (_textMem == NULL)
+	if (_textMem == nullptr)
 		error("readGamePcText: Out of text memory");
 
 	in->read(_textMem, _textSize);
@@ -347,7 +347,7 @@ void AGOSEngine::readItemFromGamePc(Common::SeekableReadStream *in, Item *item)
 		in->readUint16BE();
 		in->readUint16BE();
 		item->classFlags = in->readUint16BE();
-		item->children = NULL;
+		item->children = nullptr;
 	} else if (getGameType() == GType_ELVIRA2) {
 		item->itemName = (uint16)in->readUint32BE();
 		item->adjective = in->readUint16BE();
@@ -358,7 +358,7 @@ void AGOSEngine::readItemFromGamePc(Common::SeekableReadStream *in, Item *item)
 		item->parent = (uint16)fileReadItemID(in);
 		in->readUint16BE();
 		item->classFlags = in->readUint16BE();
-		item->children = NULL;
+		item->children = nullptr;
 	} else {
 		item->adjective = in->readUint16BE();
 		item->noun = in->readUint16BE();
@@ -368,7 +368,7 @@ void AGOSEngine::readItemFromGamePc(Common::SeekableReadStream *in, Item *item)
 		item->parent = (uint16)fileReadItemID(in);
 		in->readUint16BE();
 		item->classFlags = in->readUint16BE();
-		item->children = NULL;
+		item->children = nullptr;
 	}
 
 
@@ -543,7 +543,7 @@ void AGOSEngine::openGameFile() {
 	uint32 size = _gameFile->readUint32LE();
 
 	_gameOffsetsPtr = (uint32 *)malloc(size);
-	if (_gameOffsetsPtr == NULL)
+	if (_gameOffsetsPtr == nullptr)
 		error("openGameFile: Out of memory, game offsets");
 
 	_gameFile->seek(0, SEEK_SET);
@@ -965,7 +965,7 @@ void AGOSEngine::loadVGAVideoFile(uint16 id, uint8 type, bool useError) {
 			if (useError)
 				error("loadVGAVideoFile: Can't load %s", filename);
 
-			_block = _blockEnd = NULL;
+			_block = _blockEnd = nullptr;
 			return;
 		}
 
@@ -977,7 +977,7 @@ void AGOSEngine::loadVGAVideoFile(uint16 id, uint8 type, bool useError) {
 				error("loadVGAVideoFile: Read failed");
 		} else if (getGameType() == GType_PN && (getFeatures() & GF_CRUNCHED)) {
 			Common::Stack<uint32> data;
-			byte *dataOut = 0;
+			byte *dataOut = nullptr;
 			int dataOutSize = 0;
 
 			for (uint i = 0; i < srcSize / 4; ++i) {
@@ -1050,7 +1050,7 @@ void AGOSEngine::loadVGAVideoFile(uint16 id, uint8 type, bool useError) {
 			if (useError)
 				error("loadVGAVideoFile: Can't load id %d type %d", id, type);
 
-			_block = _blockEnd = NULL;
+			_block = _blockEnd = nullptr;
 			return;
 		}
 
@@ -1062,7 +1062,7 @@ void AGOSEngine::loadVGAVideoFile(uint16 id, uint8 type, bool useError) {
 Common::SeekableReadStream *AGOSEngine::createPak98FileStream(const char *filename) {
 	Common::File in;
 	if (!in.open(filename))
-		return 0;
+		return nullptr;
 
 	/*uint16 cmpType = */in.readUint16LE();
 	uint32 outSize = in.readUint32LE();
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index 441a820016..4fb6de9806 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -290,7 +290,7 @@ void AGOSEngine::playMusic(uint16 music, uint16 track) {
 	} else {
 		_midi->setLoop(true); // Must do this BEFORE loading music.
 
-		Common::SeekableReadStream *str = 0;
+		Common::SeekableReadStream *str = nullptr;
 		if (getPlatform() == Common::kPlatformPC98) {
 			str = createPak98FileStream(Common::String::format("MOD%d.PAK", music).c_str());
 			if (!str)
@@ -394,7 +394,7 @@ bool AGOSEngine::loadVGASoundFile(uint16 id, uint8 type) {
 	dstSize = srcSize = in.size();
 	if (getGameType() == GType_PN && (getFeatures() & GF_CRUNCHED)) {
 		Common::Stack<uint32> data;
-		byte *dataOut = 0;
+		byte *dataOut = nullptr;
 		int dataOutSize = 0;
 
 		for (uint i = 0; i < srcSize / 4; ++i)
@@ -507,7 +507,7 @@ void AGOSEngine::loadSound(uint16 sound, int16 pan, int16 vol, uint16 type) {
 		dst = (byte *)malloc(dstSize);
 		decompressData(filename, dst, offset, srcSize, dstSize);
 	} else {
-		if (_curSfxFile == NULL)
+		if (_curSfxFile == nullptr)
 			return;
 
 		dst = _curSfxFile + READ_LE_UINT32(_curSfxFile + sound * 4);
@@ -526,7 +526,7 @@ void AGOSEngine::loadSound(uint16 sound, uint16 freq, uint16 flags) {
 	uint32 offs, size = 0;
 	uint32 rate = 8000;
 
-	if (_curSfxFile == NULL)
+	if (_curSfxFile == nullptr)
 		return;
 
 	dst = _curSfxFile;
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index 6ffaf51da5..4e7a7f5b3b 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -56,7 +56,7 @@ uint16 AGOSEngine::getDoorState(Item *item, uint16 d) {
 	uint16 n;
 
 	SubRoom *subRoom = (SubRoom *)findChildOfType(item, kRoomType);
-	if (subRoom == NULL)
+	if (subRoom == nullptr)
 		return 0;
 
 	d <<= 1;
@@ -73,7 +73,7 @@ uint16 AGOSEngine::getExitOf(Item *item, uint16 d) {
 	uint16 y = 0;
 
 	subRoom = (SubRoom *)findChildOfType(item, kRoomType);
-	if (subRoom == NULL)
+	if (subRoom == nullptr)
 		return 0;
 	x = d;
 	while (x > y) {
@@ -100,7 +100,7 @@ void AGOSEngine::setDoorState(Item *i, uint16 d, uint16 n) {
 	uint16 y = 0;
 
 	r = (SubRoom *)findChildOfType(i, kRoomType);
-	if (r == NULL)
+	if (r == nullptr)
 		return;
 	d1 = d;
 	while (d > y) {
@@ -111,10 +111,10 @@ void AGOSEngine::setDoorState(Item *i, uint16 d, uint16 n) {
 	changeDoorState(r, d, n);
 
 	j = derefItem(r->roomExit[d1]);
-	if (j == NULL)
+	if (j == nullptr)
 		return;
 	r1 = (SubRoom *)findChildOfType(j, kRoomType);
-	if (r1 == NULL)
+	if (r1 == nullptr)
 		return;
 	d = getBackExit(d);
 	d1 = d;
@@ -137,14 +137,14 @@ Item *AGOSEngine::getDoorOf(Item *i, uint16 d) {
 	Item *x;
 
 	g = (SubGenExit *)findChildOfType(i, kGenExitType);
-	if (g == NULL)
-		return 0;
+	if (g == nullptr)
+		return nullptr;
 
 	x = derefItem(g->dest[d]);
-	if (x == NULL)
-		return 0;
+	if (x == nullptr)
+		return nullptr;
 	if (isRoom(x))
-		return 0;
+		return nullptr;
 	return x;
 }
 
@@ -153,16 +153,16 @@ Item *AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
 	Item *x;
 
 	g = (SubGenExit *)findChildOfType(item, kGenExitType);
-	if (g == NULL)
-		return 0;
+	if (g == nullptr)
+		return nullptr;
 
 	x = derefItem(g->dest[d]);
-	if (x == NULL)
-		return 0;
+	if (x == nullptr)
+		return nullptr;
 	if (isRoom(x))
 		return x;
 	if (x->state != 0)
-		return 0;
+		return nullptr;
 	return derefItem(x->parent);
 }
 
@@ -174,7 +174,7 @@ void AGOSEngine_Waxworks::moveDirn(Item *i, uint x) {
 		return;
 
 	n = getExitOf(derefItem(i->parent), x);
-	if (derefItem(n) == NULL) {
+	if (derefItem(n) == nullptr) {
 		loadRoomItems(n);
 		n = getExitOf(derefItem(i->parent), x);
 	}
@@ -232,7 +232,7 @@ void AGOSEngine::moveDirn(Item *i, uint x) {
 	Item *d, *p;
 
 	p = derefItem(i->parent);
-	if (p == 0)
+	if (p == nullptr)
 		return;
 
 
@@ -329,7 +329,7 @@ uint16 AGOSEngine_Elvira2::getExitState(Item *i, uint16 x, uint16 d) {
 	uint16 n;
 
 	sr = (SubSuperRoom *)findChildOfType(i, kSuperRoomType);
-	if (sr == NULL)
+	if (sr == nullptr)
 		return 0;
 
 	d <<= 1;
@@ -367,7 +367,7 @@ bool AGOSEngine::loadRoomItems(uint16 room) {
 	Common::File in;
 	Item *item, *itemTmp;
 
-	if (_roomsList == NULL)
+	if (_roomsList == nullptr)
 		return 0;
 
 	_currentRoom = room;
@@ -385,7 +385,7 @@ bool AGOSEngine::loadRoomItems(uint16 room) {
 			 for (uint16 z = minNum; z <= maxNum; z++) {
 				uint16 itemNum = z + 2;
 				item = derefItem(itemNum);
-				_itemArrayPtr[itemNum] = 0;
+				_itemArrayPtr[itemNum] = nullptr;
 
 				uint16 num = (itemNum - _itemArrayInited);
 				_roomStates[num].state = item->state;
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index 2e9140116c..24e384698f 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -213,7 +213,7 @@ void AGOSEngine::quickLoadOrSave() {
 
 bool AGOSEngine_Waxworks::confirmOverWrite(WindowBlock *window) {
 	Subroutine *sub = getSubroutineByID(80);
-	if (sub != NULL)
+	if (sub != nullptr)
 		startSubroutineEx(sub);
 
 	if (_variableArray[253] == 0)
@@ -577,8 +577,8 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, uint maxChar) {
 	_keyPressed.reset();
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = NULL;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 
 		do {
 			if (_saveLoadEdit && _keyPressed.ascii && _keyPressed.ascii < maxChar) {
@@ -586,10 +586,10 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, uint maxChar) {
 				return _keyPressed.ascii;
 			}
 			delay(10);
-		} while (_lastHitArea3 == 0 && !shouldQuit());
+		} while (_lastHitArea3 == nullptr && !shouldQuit());
 
 		ha = _lastHitArea;
-		if (ha == NULL || ha->id < 200) {
+		if (ha == nullptr || ha->id < 200) {
 		} else if (ha->id == 225) {
 			return ha->id;
 		} else if (ha->id == 224) {
@@ -849,8 +849,8 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, uint maxChar) {
 	_keyPressed.reset();
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = NULL;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 
 		do {
 			if (_saveLoadEdit && _keyPressed.ascii && _keyPressed.ascii < maxChar) {
@@ -858,10 +858,10 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, uint maxChar) {
 				return _keyPressed.ascii;
 			}
 			delay(10);
-		} while (_lastHitArea3 == 0 && !shouldQuit());
+		} while (_lastHitArea3 == nullptr && !shouldQuit());
 
 		ha = _lastHitArea;
-		if (ha == NULL || ha->id < 205) {
+		if (ha == nullptr || ha->id < 205) {
 		} else if (ha->id == 205) {
 			return ha->id;
 		} else if (ha->id == 206) {
@@ -1043,7 +1043,7 @@ void writeItemID(Common::WriteStream *f, uint16 val) {
 
 bool AGOSEngine::loadGame(const Common::String &filename, bool restartMode) {
 	char ident[100];
-	Common::SeekableReadStream *f = NULL;
+	Common::SeekableReadStream *f = nullptr;
 	uint num, item_index, i;
 
 	_videoLockOut |= 0x100;
@@ -1064,7 +1064,7 @@ bool AGOSEngine::loadGame(const Common::String &filename, bool restartMode) {
 		f = _saveFileMan->openForLoading(filename);
 	}
 
-	if (f == NULL) {
+	if (f == nullptr) {
 		_videoLockOut &= ~0x100;
 		return false;
 	}
@@ -1155,7 +1155,7 @@ bool AGOSEngine::saveGame(uint slot, const char *caption) {
 	_videoLockOut |= 0x100;
 
 	f = _saveFileMan->openForSaving(genSaveName(slot));
-	if (f == NULL) {
+	if (f == nullptr) {
 		_videoLockOut &= ~0x100;
 		return false;
 	}
@@ -1226,7 +1226,7 @@ bool AGOSEngine::saveGame(uint slot, const char *caption) {
 
 bool AGOSEngine_Elvira2::loadGame(const Common::String &filename, bool restartMode) {
 	char ident[100];
-	Common::SeekableReadStream *f = NULL;
+	Common::SeekableReadStream *f = nullptr;
 	uint num, item_index, i, j;
 
 	_videoLockOut |= 0x100;
@@ -1243,7 +1243,7 @@ bool AGOSEngine_Elvira2::loadGame(const Common::String &filename, bool restartMo
 		f = _saveFileMan->openForLoading(filename);
 	}
 
-	if (f == NULL) {
+	if (f == nullptr) {
 		_videoLockOut &= ~0x100;
 		return false;
 	}
@@ -1319,14 +1319,14 @@ bool AGOSEngine_Elvira2::loadGame(const Common::String &filename, bool restartMo
 
 					 for (uint16 z = minNum; z <= maxNum; z++) {
 						uint16 itemNum = z + 2;
-						_itemArrayPtr[itemNum] = 0;
+						_itemArrayPtr[itemNum] = nullptr;
 					}
 				}
 			}
 		}
 
 		if (room != _currentRoom) {
-			_roomsListPtr = 0;
+			_roomsListPtr = nullptr;
 			loadRoomItems(_currentRoom);
 		}
 	}
@@ -1343,13 +1343,13 @@ bool AGOSEngine_Elvira2::loadGame(const Common::String &filename, bool restartMo
 			uint parent = f->readUint16BE();
 			uint next = f->readUint16BE();
 
-			if (getGameType() == GType_WW && getPlatform() == Common::kPlatformDOS && derefItem(item->parent) == NULL)
+			if (getGameType() == GType_WW && getPlatform() == Common::kPlatformDOS && derefItem(item->parent) == nullptr)
 				item->parent = 0;
 
 			parent_item = derefItem(parent);
 			setItemParent(item, parent_item);
 
-			if (parent_item == NULL) {
+			if (parent_item == nullptr) {
 				item->parent = parent;
 				item->next = next;
 			}
@@ -1458,7 +1458,7 @@ bool AGOSEngine_Elvira2::saveGame(uint slot, const char *caption) {
 	_videoLockOut |= 0x100;
 
 	f = _saveFileMan->openForSaving(genSaveName(slot));
-	if (f == NULL) {
+	if (f == nullptr) {
 		_videoLockOut &= ~0x100;
 		return false;
 	}
@@ -1621,7 +1621,7 @@ bool AGOSEngine_PN::badload(int8 errorNum) {
 	// Load error recovery routine
 
 	// Clear any stack
-	while (_stackbase != NULL) {
+	while (_stackbase != nullptr) {
 		dumpstack();
 	}
 
@@ -1653,7 +1653,7 @@ int AGOSEngine_PN::loadFile(const Common::String &name) {
 	haltAnimation();
 
 	f = _saveFileMan->openForLoading(name);
-	if (f == NULL) {
+	if (f == nullptr) {
 		restartAnimation();
 		return -2;
 	}
@@ -1687,7 +1687,7 @@ int AGOSEngine_PN::saveFile(const Common::String &name) {
 	haltAnimation();
 
 	f = _saveFileMan->openForSaving(name);
-	if (f == NULL) {
+	if (f == nullptr) {
 		restartAnimation();
 
 		const char *msg = "Couldn't save. ";
diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp
index 0c392e4ab3..f61576bceb 100644
--- a/engines/agos/script.cpp
+++ b/engines/agos/script.cpp
@@ -215,12 +215,12 @@ void AGOSEngine::o_oflag() {
 	// 28: item has prop
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 	uint num = getVarOrByte();
-	setScriptCondition(subObject != NULL && (subObject->objectFlags & (1 << num)) != 0);
+	setScriptCondition(subObject != nullptr && (subObject->objectFlags & (1 << num)) != 0);
 }
 
 void AGOSEngine::o_destroy() {
 	// 31: set no parent
-	setItemParent(getNextItemPtr(), NULL);
+	setItemParent(getNextItemPtr(), nullptr);
 }
 
 void AGOSEngine::o_place() {
@@ -350,7 +350,7 @@ void AGOSEngine::o_oset() {
 	// 56: set child2 fr bit
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 	int value = getVarOrByte();
-	if (subObject != NULL && value >= 16)
+	if (subObject != nullptr && value >= 16)
 		subObject->objectFlags |= (1 << value);
 }
 
@@ -358,7 +358,7 @@ void AGOSEngine::o_oclear() {
 	// 57: clear child2 fr bit
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 	int value = getVarOrByte();
-	if (subObject != NULL && value >= 16)
+	if (subObject != nullptr && value >= 16)
 		subObject->objectFlags &= ~(1 << value);
 }
 
@@ -435,7 +435,7 @@ void AGOSEngine::o_process() {
 	}
 
 	Subroutine *sub = getSubroutineByID(id);
-	if (sub != NULL) {
+	if (sub != nullptr) {
 #ifdef __DS__
 		// HACK: Skip scene of Simon reading letter from Calypso
 		// due to speech segment been too large to fit into memory
@@ -469,19 +469,19 @@ void AGOSEngine::o_when() {
 
 void AGOSEngine::o_if1() {
 	// 77: has item minus 1
-	setScriptCondition(_subjectItem != NULL);
+	setScriptCondition(_subjectItem != nullptr);
 }
 
 void AGOSEngine::o_if2() {
 	// 78: has item minus 3
-	setScriptCondition(_objectItem != NULL);
+	setScriptCondition(_objectItem != nullptr);
 }
 
 void AGOSEngine::o_isCalled() {
 	// 79: childstruct fr2 is
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 	uint stringId = getNextStringID();
-	setScriptCondition((subObject != NULL) && subObject->objectName == stringId);
+	setScriptCondition((subObject != nullptr) && subObject->objectName == stringId);
 }
 
 void AGOSEngine::o_is() {
@@ -1037,7 +1037,7 @@ Child *nextSub(Child *sub, int16 key) {
 			return a;
 		a = a->next;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void AGOSEngine::synchChain(Item *i) {
diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp
index d86bfb1d3d..42cfa34818 100644
--- a/engines/agos/script_e1.cpp
+++ b/engines/agos/script_e1.cpp
@@ -418,7 +418,7 @@ void AGOSEngine_Elvira1::oe1_worn() {
 	Item *item = getNextItemPtr();
 	SubObject *subObject = (SubObject *)findChildOfType(item, kObjectType);
 
-	if (item->parent != getItem1ID() || subObject == NULL)
+	if (item->parent != getItem1ID() || subObject == nullptr)
 		setScriptCondition(false);
 	else
 		setScriptCondition((subObject->objectFlags & kOFWorn) != 0);
@@ -429,7 +429,7 @@ void AGOSEngine_Elvira1::oe1_notWorn() {
 	Item *item = getNextItemPtr();
 	SubObject *subObject = (SubObject *)findChildOfType(item, kObjectType);
 
-	if (item->parent != getItem1ID() || subObject == NULL)
+	if (item->parent != getItem1ID() || subObject == nullptr)
 		setScriptCondition(false);
 	else
 		setScriptCondition((subObject->objectFlags & kOFWorn) == 0);
@@ -536,13 +536,13 @@ void AGOSEngine_Elvira1::oe1_score() {
 void AGOSEngine_Elvira1::oe1_look() {
 	// 96: look
 	Item *i = derefItem(me()->parent);
-	if (i == NULL)
+	if (i == nullptr)
 		return;
 
 	SubRoom *r = (SubRoom *)findChildOfType(i, kRoomType);
 	SubObject *o = (SubObject *)findChildOfType(i, kObjectType);
 	SubPlayer *p = (SubPlayer *)findChildOfType(i, kPlayerType);
-	if (p == NULL)
+	if (p == nullptr)
 		return;
 
 	if ((o) && (!r)) {
@@ -591,7 +591,7 @@ void AGOSEngine_Elvira1::oe1_pObj() {
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 	getVarOrWord();
 
-	if (subObject != NULL)
+	if (subObject != nullptr)
 		showMessageFormat("%s", (const char *)getStringPtrByID(subObject->objectName));
 }
 
@@ -619,7 +619,7 @@ void AGOSEngine_Elvira1::oe1_cFlag() {
 	SubContainer *c = (SubContainer *)findChildOfType(getNextItemPtr(), kContainerType);
 	uint bit = getVarOrWord();
 
-	if (c == NULL)
+	if (c == nullptr)
 		setScriptCondition(false);
 	else
 		setScriptCondition((c->flags & (1 << bit)) != 0);
@@ -819,16 +819,16 @@ void AGOSEngine_Elvira1::oe1_enableInput() {
 		disableBox(i);
 
 	_verbHitArea = 0;
-	_hitAreaSubjectItem = 0;
-	_hitAreaObjectItem = 0;
+	_hitAreaSubjectItem = nullptr;
+	_hitAreaObjectItem = nullptr;
 
 	_dragFlag = false;
 	_dragAccept = false;
 	_dragCount = 0;
 	_dragMode = false;
 
-	_lastHitArea3 = 0;
-	_lastHitArea = 0;
+	_lastHitArea3 = nullptr;
+	_lastHitArea = nullptr;
 
 	_clickOnly = true;
 }
@@ -1070,7 +1070,7 @@ uint AGOSEngine::confirmYesOrNo(uint16 x, uint16 y) {
 	ha->flags = kBFBoxInUse;
 	ha->id = 0x7FFF;
 	ha->priority = 999;
-	ha->window = 0;
+	ha->window = nullptr;
 
 	ha = findEmptyHitArea();
 	ha->x = x + 60;
@@ -1080,21 +1080,21 @@ uint AGOSEngine::confirmYesOrNo(uint16 x, uint16 y) {
 	ha->flags = kBFBoxInUse;
 	ha->id = 0x7FFE;
 	ha->priority = 999;
-	ha->window = 0;
+	ha->window = nullptr;
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = NULL;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 
 		while (!shouldQuit()) {
-			if (_lastHitArea3 != 0)
+			if (_lastHitArea3 != nullptr)
 				break;
 			delay(1);
 		}
 
 		ha = _lastHitArea;
 
-		if (ha == NULL) {
+		if (ha == nullptr) {
 		} else if (ha->id == 0x7FFE) {
 			break;
 		} else if (ha->id == 0x7FFF) {
@@ -1119,7 +1119,7 @@ uint AGOSEngine::continueOrQuit() {
 	ha->flags = kBFBoxInUse;
 	ha->id = 0x7FFF;
 	ha->priority = 999;
-	ha->window = 0;
+	ha->window = nullptr;
 
 	ha = findEmptyHitArea();
 	ha->x = 180;
@@ -1129,21 +1129,21 @@ uint AGOSEngine::continueOrQuit() {
 	ha->flags = kBFBoxInUse;
 	ha->id = 0x7FFE;
 	ha->priority = 999;
-	ha->window = 0;
+	ha->window = nullptr;
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = NULL;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 
 		while (!shouldQuit()) {
-			if (_lastHitArea3 != 0)
+			if (_lastHitArea3 != nullptr)
 				break;
 			delay(1);
 		}
 
 		ha = _lastHitArea;
 
-		if (ha == NULL) {
+		if (ha == nullptr) {
 		} else if (ha->id == 0x7FFE) {
 			break;
 		} else if (ha->id == 0x7FFF) {
diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp
index a4d4ac54d7..cf97ccaa8b 100644
--- a/engines/agos/script_e2.cpp
+++ b/engines/agos/script_e2.cpp
@@ -309,7 +309,7 @@ void AGOSEngine_Elvira2::oe2_pObj() {
 	// 73: print object
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 
-	if (subObject != NULL && subObject->objectFlags & kOFText)
+	if (subObject != nullptr && subObject->objectFlags & kOFText)
 		showMessageFormat("%s", (const char *)getStringPtrByID(subObject->objectFlagValue[0]));
 }
 
@@ -341,7 +341,7 @@ void AGOSEngine_Elvira2::oe2_doTable() {
 	Item *i = getNextItemPtr();
 
 	SubRoom *r = (SubRoom *)findChildOfType(i, kRoomType);
-	if (r != NULL) {
+	if (r != nullptr) {
 		Subroutine *sub = getSubroutineByID(r->subroutine_id);
 		if (sub) {
 			startSubroutine(sub);
@@ -351,7 +351,7 @@ void AGOSEngine_Elvira2::oe2_doTable() {
 
 	if (getGameType() == GType_ELVIRA2) {
 		SubSuperRoom *sr = (SubSuperRoom *)findChildOfType(i, kSuperRoomType);
-		if (sr != NULL) {
+		if (sr != nullptr) {
 			Subroutine *sub = getSubroutineByID(sr->subroutine_id);
 			if (sub) {
 				startSubroutine(sub);
@@ -369,18 +369,18 @@ void AGOSEngine_Elvira2::oe2_pauseGame() {
 	haltAnimation();
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = NULL;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 
 		while (!shouldQuit()) {
-			if (processSpecialKeys() != 0 || _lastHitArea3 != 0)
+			if (processSpecialKeys() != 0 || _lastHitArea3 != nullptr)
 				break;
 			delay(1);
 		}
 
 		ha = _lastHitArea;
 
-		if (ha == NULL) {
+		if (ha == nullptr) {
 		} else if (ha->id == 201) {
 			break;
 		}
@@ -416,7 +416,7 @@ void AGOSEngine_Elvira2::oe2_ifDoorOpen() {
 	if (getGameType() == GType_WW) {
 		// WORKAROUND bug #4229: A NULL item can occur when
 		// walking through Jack the Ripper scene
-		if (i == NULL) {
+		if (i == nullptr) {
 			setScriptCondition(false);
 			return;
 		}
@@ -490,7 +490,7 @@ void AGOSEngine_Elvira2::oe2_getOValue() {
 	SubObject *subObject = (SubObject *)findChildOfType(item, kObjectType);
 	uint prop = getVarOrByte();
 
-	if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) {
+	if (subObject != nullptr && subObject->objectFlags & (1 << prop) && prop < 16) {
 		uint offs = getOffsetOfChild2Param(subObject, 1 << prop);
 		writeNextVarContents(subObject->objectFlagValue[offs]);
 	} else {
@@ -505,7 +505,7 @@ void AGOSEngine_Elvira2::oe2_setOValue() {
 	uint prop = getVarOrByte();
 	int value = getVarOrWord();
 
-	if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) {
+	if (subObject != nullptr && subObject->objectFlags & (1 << prop) && prop < 16) {
 		uint offs = getOffsetOfChild2Param(subObject, 1 << prop);
 		subObject->objectFlagValue[offs] = value;
 	}
@@ -599,7 +599,7 @@ void AGOSEngine_Elvira2::oe2_getDollar2() {
 	if (_objectItem == _dummyItem3)
 		_objectItem = derefItem(me()->parent);
 
-	if (_objectItem != NULL) {
+	if (_objectItem != nullptr) {
 		_scriptNoun2 = _objectItem->noun;
 		_scriptAdj2 = _objectItem->adjective;
 	} else {
@@ -623,7 +623,7 @@ void AGOSEngine_Elvira2::oe2_printPlayerDamage() {
 	// 177: set player damage event
 	uint a = getVarOrByte();
 	if (_opcode177Var1 && !_opcode177Var2 && a != 0 && a <= 10) {
-		addVgaEvent(_vgaBaseDelay, PLAYER_DAMAGE_EVENT, NULL, 0, a);
+		addVgaEvent(_vgaBaseDelay, PLAYER_DAMAGE_EVENT, nullptr, 0, a);
 		_opcode177Var2 = 0;
 		_opcode177Var1 = 0;
 	}
@@ -633,7 +633,7 @@ void AGOSEngine_Elvira2::oe2_printMonsterDamage() {
 	// 178: set monster damage event
 	uint a = getVarOrByte();
 	if (_opcode178Var1 && !_opcode178Var2 && a != 0 && a <= 10) {
-		addVgaEvent(_vgaBaseDelay, MONSTER_DAMAGE_EVENT, NULL, 0, a);
+		addVgaEvent(_vgaBaseDelay, MONSTER_DAMAGE_EVENT, nullptr, 0, a);
 		_opcode178Var2 = 0;
 		_opcode178Var1 = 0;
 	}
@@ -645,7 +645,7 @@ void AGOSEngine_Elvira2::oe2_isAdjNoun() {
 	int16 a = getNextWord();
 	int16 n = getNextWord();
 
-	if (getGameType() == GType_ELVIRA2 && item == NULL) {
+	if (getGameType() == GType_ELVIRA2 && item == nullptr) {
 		// WORKAROUND bug #3281: A NULL item can occur when
 		// interacting with items in the dinning room
 		setScriptCondition(false);
diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp
index 508681ce92..1154fb826f 100644
--- a/engines/agos/script_pn.cpp
+++ b/engines/agos/script_pn.cpp
@@ -338,7 +338,7 @@ void AGOSEngine_PN::opn_opcode25() {
 }
 
 void AGOSEngine_PN::opn_opcode26() {
-	while ((_stackbase != NULL) && (_stackbase->classnum != kJmpClassNum))
+	while ((_stackbase != nullptr) && (_stackbase->classnum != kJmpClassNum))
 		dumpstack();
 	dumpstack();
 	setScriptReturn(true);
@@ -496,12 +496,12 @@ void AGOSEngine_PN::opn_opcode36() {
 }
 
 void AGOSEngine_PN::opn_opcode37() {
-	_curwrdptr = NULL;
+	_curwrdptr = nullptr;
 
 	_inputReady = true;
 	interact(_inputline, 49);
 
-	if ((_inpp = strchr(_inputline,'\n')) != NULL)
+	if ((_inpp = strchr(_inputline,'\n')) != nullptr)
 		*_inpp = '\0';
 	_inpp = _inputline;
 	setScriptReturn(true);
@@ -576,7 +576,7 @@ void AGOSEngine_PN::opn_opcode45() {
 
 void AGOSEngine_PN::opn_opcode46() {
 	char *x = _curwrdptr;
-	if (x == NULL) {
+	if (x == nullptr) {
 		setScriptReturn(true);
 		return;
 	}
@@ -1069,7 +1069,7 @@ void AGOSEngine_PN::addstack(int type) {
 	int i;
 
 	a = (StackFrame *)calloc(1, sizeof(StackFrame));
-	if (a == NULL)
+	if (a == nullptr)
 		error("addstack: Out of memory - stack overflow");
 
 	a->nextframe = _stackbase;
@@ -1090,7 +1090,7 @@ void AGOSEngine_PN::addstack(int type) {
 void AGOSEngine_PN::dumpstack() {
 	StackFrame *a;
 
-	if (_stackbase == NULL)
+	if (_stackbase == nullptr)
 		error("dumpstack: Stack underflow or unknown longjmp");
 
 	a = _stackbase->nextframe;
@@ -1101,12 +1101,12 @@ void AGOSEngine_PN::dumpstack() {
 void AGOSEngine_PN::popstack(int type) {
 	int i = 0;
 
-	while ((_stackbase != NULL) && (_stackbase->classnum != type)) {
+	while ((_stackbase != nullptr) && (_stackbase->classnum != type)) {
 		dumpstack();
 		++i;
 	}
 
-	if (_stackbase == NULL)
+	if (_stackbase == nullptr)
 		error("popstack: Stack underflow or unknown longjmp");
 
 	_linct = _stackbase->ll;
diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp
index 5f75c26a70..7646605cdb 100644
--- a/engines/agos/script_s1.cpp
+++ b/engines/agos/script_s1.cpp
@@ -335,7 +335,7 @@ void AGOSEngine_Simon1::os1_screenTextMsg() {
 	uint vgaSpriteId = getVarOrByte();
 	uint color = getVarOrByte();
 	uint stringId = getNextStringID();
-	const byte *stringPtr = NULL;
+	const byte *stringPtr = nullptr;
 	uint speechId = 0;
 	TextLocation *tl;
 
@@ -369,7 +369,7 @@ void AGOSEngine_Simon1::os1_screenTextMsg() {
 			tl->width = 96;
 	}
 
-	if (stringPtr != NULL && stringPtr[0] != 0 && (speechId == 0 || _subtitles))
+	if (stringPtr != nullptr && stringPtr[0] != 0 && (speechId == 0 || _subtitles))
 		printScreenText(vgaSpriteId, color, (const char *)stringPtr, tl->x, tl->y, tl->width);
 
 }
@@ -391,16 +391,16 @@ void AGOSEngine_Simon1::os1_screenTextPObj() {
 
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 	if (getFeatures() & GF_TALKIE) {
-		if (subObject != NULL && subObject->objectFlags & kOFVoice) {
+		if (subObject != nullptr && subObject->objectFlags & kOFVoice) {
 			uint offs = getOffsetOfChild2Param(subObject, kOFVoice);
 			playSpeech(subObject->objectFlagValue[offs], vgaSpriteId);
-		} else if (subObject != NULL && subObject->objectFlags & kOFNumber) {
+		} else if (subObject != nullptr && subObject->objectFlags & kOFNumber) {
 			uint offs = getOffsetOfChild2Param(subObject, kOFNumber);
 			playSpeech(subObject->objectFlagValue[offs] + 3550, vgaSpriteId);
 		}
 	}
 
-	if (subObject != NULL && subObject->objectFlags & kOFText && _subtitles) {
+	if (subObject != nullptr && subObject->objectFlags & kOFText && _subtitles) {
 		const char *stringPtr = (const char *)getStringPtrByID(subObject->objectFlagValue[0]);
 		TextLocation *tl = getTextLocation(vgaSpriteId);
 		char buf[256];
@@ -420,7 +420,7 @@ void AGOSEngine_Simon1::os1_screenTextPObj() {
 			}
 			stringPtr = buf;
 		}
-		if (stringPtr != NULL && stringPtr[0] != 0)
+		if (stringPtr != nullptr && stringPtr[0] != 0)
 			printScreenText(vgaSpriteId, color, stringPtr, tl->x, tl->y, tl->width);
 	}
 }
@@ -492,7 +492,7 @@ void AGOSEngine_Simon1::os1_scnTxtLongText() {
 
 	if (_speech && speechId != 0)
 		playSpeech(speechId, vgaSpriteId);
-	if (stringPtr != NULL && stringPtr[0] != 0 && _subtitles)
+	if (stringPtr != nullptr && stringPtr[0] != 0 && _subtitles)
 		printScreenText(vgaSpriteId, color, stringPtr, tl->x, tl->y, tl->width);
 }
 
@@ -531,9 +531,9 @@ void AGOSEngine_Simon1::os1_unloadZone() {
 	uint a = getVarOrWord();
 	VgaPointersEntry *vpe = &_vgaBufferPointers[a];
 
-	vpe->sfxFile = NULL;
-	vpe->vgaFile1 = NULL;
-	vpe->vgaFile2 = NULL;
+	vpe->sfxFile = nullptr;
+	vpe->vgaFile1 = nullptr;
+	vpe->vgaFile2 = nullptr;
 }
 
 void AGOSEngine_Simon1::os1_loadStrings() {
diff --git a/engines/agos/script_s2.cpp b/engines/agos/script_s2.cpp
index 7b1f369d68..7ddf5fb1e0 100644
--- a/engines/agos/script_s2.cpp
+++ b/engines/agos/script_s2.cpp
@@ -358,7 +358,7 @@ void AGOSEngine_Simon2::os2_screenTextPObj() {
 
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 	if (getFeatures() & GF_TALKIE) {
-		if (subObject != NULL && subObject->objectFlags & kOFVoice) {
+		if (subObject != nullptr && subObject->objectFlags & kOFVoice) {
 			uint speechId = subObject->objectFlagValue[getOffsetOfChild2Param(subObject, kOFVoice)];
 
 			if (subObject->objectFlags & kOFNumber) {
@@ -411,7 +411,7 @@ void AGOSEngine_Simon2::os2_screenTextPObj() {
 
 	}
 
-	if (subObject != NULL && subObject->objectFlags & kOFText && _subtitles) {
+	if (subObject != nullptr && subObject->objectFlags & kOFText && _subtitles) {
 		const char *stringPtr = (const char *)getStringPtrByID(subObject->objectFlagValue[0]);
 		TextLocation *tl = getTextLocation(vgaSpriteId);
 		char buf[256];
@@ -431,7 +431,7 @@ void AGOSEngine_Simon2::os2_screenTextPObj() {
 			}
 			stringPtr = buf;
 		}
-		if (stringPtr != NULL)
+		if (stringPtr != nullptr)
 			printScreenText(vgaSpriteId, color, stringPtr, tl->x, tl->y, tl->width);
 	}
 }
diff --git a/engines/agos/script_ww.cpp b/engines/agos/script_ww.cpp
index 9394311001..88a06b6d1e 100644
--- a/engines/agos/script_ww.cpp
+++ b/engines/agos/script_ww.cpp
@@ -288,8 +288,8 @@ void AGOSEngine_Waxworks::executeOpcode(int opcode) {
 void AGOSEngine_Waxworks::oww_goto() {
 	// 55: set itemA parent
 	uint item = getNextItemID();
-	if (derefItem(item) == NULL) {
-		setItemParent(me(), NULL);
+	if (derefItem(item) == nullptr) {
+		setItemParent(me(), nullptr);
 		loadRoomItems(item);
 	}
 	setItemParent(me(), derefItem(item));
@@ -365,18 +365,18 @@ void AGOSEngine_Waxworks::oww_pauseGame() {
 	haltAnimation();
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = NULL;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 
 		while (!shouldQuit()) {
-			if (_lastHitArea3 != 0)
+			if (_lastHitArea3 != nullptr)
 				break;
 			delay(1);
 		}
 
 		ha = _lastHitArea;
 
-		if (ha == NULL) {
+		if (ha == nullptr) {
 		} else if (ha->id == 200) {
 			break;
 		} else if (ha->id == 201) {
@@ -412,7 +412,7 @@ void AGOSEngine_Waxworks::oww_boxPObj() {
 	// 188: print object name to box
 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
 
-	if (subObject != NULL && subObject->objectFlags & kOFText)
+	if (subObject != nullptr && subObject->objectFlags & kOFText)
 		boxTextMsg((const char *)getStringPtrByID(subObject->objectFlagValue[0]));
 }
 
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp
index 713dcf8efd..d9bb4900ed 100644
--- a/engines/agos/sound.cpp
+++ b/engines/agos/sound.cpp
@@ -63,7 +63,7 @@ public:
 };
 
 BaseSound::BaseSound(Audio::Mixer *mixer, const Common::String &filename, uint32 base, bool bigEndian)
-	: _mixer(mixer), _filename(filename), _offsets(NULL) {
+	: _mixer(mixer), _filename(filename), _offsets(nullptr) {
 
 	uint res = 0;
 	uint32 size;
@@ -109,13 +109,13 @@ BaseSound::~BaseSound() {
 }
 
 Common::SeekableReadStream *BaseSound::getSoundStream(uint sound) const {
-	if (_offsets == NULL)
-		return NULL;
+	if (_offsets == nullptr)
+		return nullptr;
 
 	Common::File *file = new Common::File();
 	if (!file->open(_filename)) {
 		warning("BaseSound::getSoundStream: Could not open file \"%s\"", _filename.c_str());
-		return NULL;
+		return nullptr;
 	}
 
 	int i = 1;
@@ -259,7 +259,7 @@ public:
 Audio::AudioStream *WavSound::makeAudioStream(uint sound) {
 	Common::SeekableReadStream *tmp = getSoundStream(sound);
 	if (!tmp)
-		return NULL;
+		return nullptr;
 	return Audio::makeWAVStream(tmp, DisposeAfterUse::YES);
 }
 
@@ -277,7 +277,7 @@ public:
 Audio::AudioStream *VocSound::makeAudioStream(uint sound) {
 	Common::SeekableReadStream *tmp = getSoundStream(sound);
 	if (!tmp)
-		return NULL;
+		return nullptr;
 	return Audio::makeVOCStream(tmp, _flags, DisposeAfterUse::YES);
 }
 
@@ -295,13 +295,13 @@ public:
 };
 
 Audio::AudioStream *RawSound::makeAudioStream(uint sound) {
-	if (_offsets == NULL)
-		return NULL;
+	if (_offsets == nullptr)
+		return nullptr;
 
 	Common::File *file = new Common::File();
 	if (!file->open(_filename)) {
 		warning("RawSound::makeAudioStream: Could not open file \"%s\"", _filename.c_str());
-		return NULL;
+		return nullptr;
 	}
 
 	file->seek(_offsets[sound], SEEK_SET);
@@ -327,7 +327,7 @@ public:
 	Audio::AudioStream *makeAudioStream(uint sound) override {
 		Common::SeekableReadStream *tmp = getSoundStream(sound);
 		if (!tmp)
-			return NULL;
+			return nullptr;
 		return Audio::makeMP3Stream(tmp, DisposeAfterUse::YES);
 	}
 };
@@ -343,7 +343,7 @@ public:
 	Audio::AudioStream *makeAudioStream(uint sound) override {
 		Common::SeekableReadStream *tmp = getSoundStream(sound);
 		if (!tmp)
-			return NULL;
+			return nullptr;
 		return Audio::makeVorbisStream(tmp, DisposeAfterUse::YES);
 	}
 };
@@ -359,7 +359,7 @@ public:
 	Audio::AudioStream *makeAudioStream(uint sound) override {
 		Common::SeekableReadStream *tmp = getSoundStream(sound);
 		if (!tmp)
-			return NULL;
+			return nullptr;
 		return Audio::makeFLACStream(tmp, DisposeAfterUse::YES);
 	}
 };
@@ -385,7 +385,7 @@ static BaseSound *makeSound(Audio::Mixer *mixer, const Common::String &basename)
 		return new WavSound(mixer, basename + ".wav");
 	if (Common::File::exists(basename + ".voc"))
 		return new VocSound(mixer, basename + ".voc", true);
-	return 0;
+	return nullptr;
 }
 
 
@@ -394,23 +394,23 @@ static BaseSound *makeSound(Audio::Mixer *mixer, const Common::String &basename)
 
 Sound::Sound(AGOSEngine *vm, const GameSpecificSettings *gss, Audio::Mixer *mixer)
 	: _vm(vm), _mixer(mixer) {
-	_voice = 0;
-	_effects = 0;
+	_voice = nullptr;
+	_effects = nullptr;
 
 	_effectsPaused = false;
 	_ambientPaused = false;
 	_sfx5Paused = false;
 
-	_filenums = 0;
+	_filenums = nullptr;
 	_lastVoiceFile = 0;
-	_offsets = 0;
+	_offsets = nullptr;
 
 	_hasEffectsFile = false;
 	_hasVoiceFile = false;
 
 	_ambientPlaying = 0;
 
-	_soundQueuePtr = 0;
+	_soundQueuePtr = nullptr;
 	_soundQueueNum = 0;
 	_soundQueueSize = 0;
 	_soundQueueFreq = 0;
@@ -437,7 +437,7 @@ void Sound::loadVoiceFile(const GameSpecificSettings *gss) {
 		return;
 
 	_voice = makeSound(_mixer, gss->speech_filename);
-	_hasVoiceFile = (_voice != 0);
+	_hasVoiceFile = (_voice != nullptr);
 
 	if (_hasVoiceFile)
 		return;
@@ -480,7 +480,7 @@ void Sound::loadSfxFile(const GameSpecificSettings *gss) {
 		return;
 
 	_effects = makeSound(_mixer, gss->effects_filename);
-	_hasEffectsFile = (_effects != 0);
+	_hasEffectsFile = (_effects != nullptr);
 
 	if (_hasEffectsFile)
 		return;
@@ -657,7 +657,7 @@ void Sound::handleSoundQueue() {
 
 		_vm->_sampleWait = 1;
 		_vm->_sampleEnd = 0;
-		_soundQueuePtr = 0;
+		_soundQueuePtr = nullptr;
 		_soundQueueNum = 0;
 		_soundQueueSize = 0;
 		_soundQueueFreq = 0;
@@ -754,7 +754,7 @@ void Sound::switchVoiceFile(const GameSpecificSettings *gss, uint disc) {
 
 	sprintf(filename, "%s%u", gss->speech_filename, disc);
 	_voice = makeSound(_mixer, filename);
-	_hasVoiceFile = (_voice != 0);
+	_hasVoiceFile = (_voice != nullptr);
 
 	if (!_hasVoiceFile)
 		error("switchVoiceFile: Can't load voice file %s", filename);
diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp
index 2685fa1752..958d649072 100644
--- a/engines/agos/string.cpp
+++ b/engines/agos/string.cpp
@@ -42,14 +42,14 @@ void AGOSEngine::uncompressText(byte *ptr) {
 		if (a == 0)
 			return;
 		ptr = uncompressToken(a, ptr);
-		if (ptr == 0)
+		if (ptr == nullptr)
 			return;
 	}
 }
 
 byte *AGOSEngine::uncompressToken(byte a, byte *ptr) {
-	byte *ptr1 = 0;
-	byte *ptr2 = 0;
+	byte *ptr1 = nullptr;
+	byte *ptr2 = nullptr;
 	byte b;
 	int count1 = 0;
 
@@ -64,7 +64,7 @@ byte *AGOSEngine::uncompressToken(byte a, byte *ptr) {
 		b = a;
 		a = *ptr++;
 		if (a == 0)		/* Need to return such that next byte   */
-			return 0;	/* is used as two byte token		*/
+			return nullptr;	/* is used as two byte token		*/
 
 		_awaitTwoByteToken = 0;
 		ptr1 = _twoByteTokens;
@@ -178,7 +178,7 @@ TextLocation *AGOSEngine::getTextLocation(uint a) {
 	default:
 		error("getTextLocation: Invalid text location %d", a);
 	}
-	return NULL;	// for compilers that don't support NORETURN
+	return nullptr;	// for compilers that don't support NORETURN
 }
 
 void AGOSEngine::allocateStringTable(int num) {
@@ -422,7 +422,7 @@ bool AGOSEngine::printTextOf(uint a, uint x, uint y) {
 			Subroutine *sub;
 			_variableArray[84] = a;
 			sub = getSubroutineByID(5003);
-			if (sub != NULL)
+			if (sub != nullptr)
 				startSubroutineEx(sub);
 			return true;
 		}
@@ -450,11 +450,11 @@ bool AGOSEngine::printNameOf(Item *item, uint x, uint y) {
 	const byte *stringPtr;
 	uint16 pixels, w;
 
-	if (item == 0 || item == _dummyItem2 || item == _dummyItem3)
+	if (item == nullptr || item == _dummyItem2 || item == _dummyItem3)
 		return false;
 
 	subObject = (SubObject *)findChildOfType(item, kObjectType);
-	if (subObject == NULL)
+	if (subObject == nullptr)
 		return false;
 
 	stringPtr = getStringPtrByID(subObject->objectName);
@@ -997,7 +997,7 @@ uint16 AGOSEngine_Waxworks::getBoxSize() {
 uint16 AGOSEngine_Waxworks::checkFit(char *ptr, int width, int lines) {
 	int countw = 0;
 	int countl = 0;
-	char *x = NULL;
+	char *x = nullptr;
 	while (*ptr) {
 		if (*ptr == '\n')
 			return 1;
diff --git a/engines/agos/string_pn.cpp b/engines/agos/string_pn.cpp
index 06c8bbd98e..35cf977f41 100644
--- a/engines/agos/string_pn.cpp
+++ b/engines/agos/string_pn.cpp
@@ -115,7 +115,7 @@ void AGOSEngine_PN::getObjectName(char *v, uint16 x) {
 
 void AGOSEngine_PN::pcl(const char *s) {
 	Common::strlcat(_sb, s, 80);
-	if (strchr(s, '\n') == 0) {
+	if (strchr(s, '\n') == nullptr) {
 		for (char *str = _sb; *str; str++)
 			windowPutChar(_windowArray[_curWindow], *str);
 		strcpy(_sb, "");
diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp
index 906fa856d5..e30c6a5a84 100644
--- a/engines/agos/subroutine.cpp
+++ b/engines/agos/subroutine.cpp
@@ -215,7 +215,7 @@ Subroutine *AGOSEngine::getSubroutineByID(uint subroutineId) {
 	}
 
 	debug(0,"getSubroutineByID: subroutine %d not found", subroutineId);
-	return NULL;
+	return nullptr;
 }
 
 void AGOSEngine::alignTableMem() {
@@ -253,7 +253,7 @@ void AGOSEngine::endCutscene() {
 	_sound->stopVoice();
 
 	sub = getSubroutineByID(170);
-	if (sub != NULL)
+	if (sub != nullptr)
 		startSubroutineEx(sub);
 
 	_runScriptReturn1 = true;
@@ -298,7 +298,7 @@ bool AGOSEngine::loadTablesIntoMem(uint16 subrId) {
 	uint16 min_num, max_num, file_num;
 	Common::SeekableReadStream *in;
 
-	if (_tblList == NULL)
+	if (_tblList == nullptr)
 		return 0;
 
 	p = _tblList + 32;
@@ -346,7 +346,7 @@ bool AGOSEngine_Waxworks::loadTablesIntoMem(uint16 subrId) {
 	Common::SeekableReadStream *in;
 
 	p = _tblList;
-	if (p == NULL)
+	if (p == nullptr)
 		return 0;
 
 	while (*p) {
@@ -413,7 +413,7 @@ bool AGOSEngine::loadXTablesIntoMem(uint16 subrId) {
 	Common::SeekableReadStream *in;
 
 	p = _xtblList;
-	if (p == NULL)
+	if (p == nullptr)
 		return 0;
 
 	while (*p) {
@@ -480,7 +480,7 @@ Subroutine *AGOSEngine::createSubroutine(uint16 id) {
 }
 
 SubroutineLine *AGOSEngine::createSubroutineLine(Subroutine *sub, int where) {
-	SubroutineLine *sl, *cur_sl = NULL, *last_sl = NULL;
+	SubroutineLine *sl, *cur_sl = nullptr, *last_sl = nullptr;
 
 	if (sub->id == 0)
 		sl = (SubroutineLine *)allocateTable(SUBROUTINE_LINE_BIG_SIZE);
@@ -499,7 +499,7 @@ SubroutineLine *AGOSEngine::createSubroutineLine(Subroutine *sub, int where) {
 		}
 	}
 
-	if (last_sl != NULL) {
+	if (last_sl != nullptr) {
 		// Insert the subroutine line in the middle of the link
 		last_sl->next = (byte *)sl - (byte *)sub;
 		sl->next = (byte *)cur_sl - (byte *)sub;
@@ -516,7 +516,7 @@ void AGOSEngine::runSubroutine101() {
 	Subroutine *sub;
 
 	sub = getSubroutineByID(101);
-	if (sub != NULL)
+	if (sub != nullptr)
 		startSubroutineEx(sub);
 
 	permitInput();
@@ -534,7 +534,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
 	int16 old_classMode1 = _classMode1;
 	int16 old_classMode2 = _classMode2;
 
-	_classLine = 0;
+	_classLine = nullptr;
 	_classMask = 0;
 	_classMode1 = 0;
 	_classMode2 = 0;
@@ -591,7 +591,7 @@ restart:
 		}
 		if (sub->id == 39126 && readVariable(84) == 2) {
 			Subroutine *tmpSub = getSubroutineByID(80);
-			if (tmpSub != NULL) {
+			if (tmpSub != nullptr) {
 				startSubroutine(tmpSub);
 			}
 		}
@@ -632,7 +632,7 @@ restart:
 	_classMask = old_classMask;
 	_classMode1 = old_classMode2;
 	_classMode2 = old_classMode1;
-	_findNextPtr = 0;
+	_findNextPtr = nullptr;
 
 	_recursionDepth--;
 	return result;
diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp
index 75c40d9899..05e4987197 100644
--- a/engines/agos/verb.cpp
+++ b/engines/agos/verb.cpp
@@ -212,7 +212,7 @@ void AGOSEngine_Feeble::clearName() {
 void AGOSEngine_Simon2::clearName() {
 	if (getBitFlag(79)) {
 		sendSync(202);
-		_lastNameOn = NULL;
+		_lastNameOn = nullptr;
 		return;
 	}
 
@@ -222,7 +222,7 @@ void AGOSEngine_Simon2::clearName() {
 	resetNameWindow();
 	_lastVerbOn = _currentVerbBox;
 
-	if (_currentVerbBox != NULL && !(_currentVerbBox->flags & kBFBoxDead))
+	if (_currentVerbBox != nullptr && !(_currentVerbBox->flags & kBFBoxDead))
 		printVerbOf(_currentVerbBox->id);
 }
 
@@ -235,7 +235,7 @@ void AGOSEngine_Simon1::clearName() {
 	resetNameWindow();
 	_lastVerbOn = _currentVerbBox;
 
-	if (_currentVerbBox != NULL && (ha = findBox(200)) && (ha->flags & kBFBoxDead) && !(_currentVerbBox->flags & kBFBoxDead))
+	if (_currentVerbBox != nullptr && (ha = findBox(200)) && (ha->flags & kBFBoxDead) && !(_currentVerbBox->flags & kBFBoxDead))
 		printVerbOf(_currentVerbBox->id);
 }
 
@@ -330,7 +330,7 @@ void AGOSEngine::showActionString(const byte *string) {
 	const uint len = (getGameType() == GType_WW) ? 29 : 53;
 
 	window = _windowArray[1];
-	if (window == NULL || window->textColor == 0)
+	if (window == nullptr || window->textColor == 0)
 		return;
 
 	// Arisme : hack for long strings in the French version
@@ -392,7 +392,7 @@ void AGOSEngine::handleVerbClicked(uint verb) {
 	_scriptVerb = _verbHitArea;
 
 	sub = getSubroutineByID(0);
-	if (sub == NULL)
+	if (sub == nullptr)
 		return;
 
 	result = startSubroutine(sub);
@@ -418,11 +418,11 @@ void AGOSEngine::resetNameWindow() {
 		return;
 
 	window = _windowArray[1];
-	if (window != NULL && window->textColor != 0)
+	if (window != nullptr && window->textColor != 0)
 		clearWindow(window);
 
-	_lastNameOn = NULL;
-	_lastVerbOn = NULL;
+	_lastNameOn = nullptr;
+	_lastVerbOn = nullptr;
 }
 
 HitArea *AGOSEngine::findBox(uint hitarea_id) {
@@ -438,7 +438,7 @@ HitArea *AGOSEngine::findBox(uint hitarea_id) {
 				return ha;
 		}
 	} while (ha++, --count);
-	return NULL;
+	return nullptr;
 }
 
 HitArea *AGOSEngine::findEmptyHitArea() {
@@ -461,13 +461,13 @@ void AGOSEngine::freeBox(uint index) {
 
 void AGOSEngine::enableBox(uint hitarea) {
 	HitArea *ha = findBox(hitarea);
-	if (ha != NULL)
+	if (ha != nullptr)
 		ha->flags &= ~kBFBoxDead;
 }
 
 void AGOSEngine::disableBox(uint hitarea) {
 	HitArea *ha = findBox(hitarea);
-	if (ha != NULL) {
+	if (ha != nullptr) {
 		ha->flags |= kBFBoxDead;
 		ha->flags &= ~kBFBoxSelected;
 		if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&
@@ -479,7 +479,7 @@ void AGOSEngine::disableBox(uint hitarea) {
 
 void AGOSEngine::moveBox(uint hitarea, int x, int y) {
 	HitArea *ha = findBox(hitarea);
-	if (ha != NULL) {
+	if (ha != nullptr) {
 		if (getGameType() == GType_FF || getGameType() == GType_PP) {
 			ha->x += x;
 			ha->y += y;
@@ -492,7 +492,7 @@ void AGOSEngine::moveBox(uint hitarea, int x, int y) {
 
 void AGOSEngine::undefineBox(uint hitarea) {
 	HitArea *ha = findBox(hitarea);
-	if (ha != NULL) {
+	if (ha != nullptr) {
 		ha->flags = 0;
 		if (ha == _lastNameOn)
 			clearName();
@@ -502,7 +502,7 @@ void AGOSEngine::undefineBox(uint hitarea) {
 
 bool AGOSEngine::isBoxDead(uint hitarea) {
 	HitArea *ha = findBox(hitarea);
-	if (ha == NULL)
+	if (ha == nullptr)
 		return false;
 	return (ha->flags & kBFBoxDead) == 0;
 }
@@ -591,12 +591,12 @@ void AGOSEngine::resetVerbs() {
 	_defaultVerb = id;
 
 	ha = findBox(id);
-	if (ha == NULL)
+	if (ha == nullptr)
 		return;
 
 	if (ha->flags & kBFBoxDead) {
 		_defaultVerb = 999;
-		_currentVerbBox = NULL;
+		_currentVerbBox = nullptr;
 	} else {
 		_verbHitArea = ha->verb;
 		setVerb(ha);
@@ -639,7 +639,7 @@ void AGOSEngine::setVerb(HitArea *ha) {
 		return;
 
 	if (getGameType() == GType_SIMON1) {
-		if (tmp != NULL) {
+		if (tmp != nullptr) {
 			tmp->flags |= kBFInvertTouch;
 			if (getFeatures() & GF_32COLOR)
 				invertBox(tmp, 212, 208, 212, 8);
@@ -715,7 +715,7 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) {
 	uint count = ARRAYSIZE(_hitAreas);
 	uint16 priority = 0;
 
-	best_ha = NULL;
+	best_ha = nullptr;
 
 	do {
 		if (ha->flags & kBFBoxInUse) {
@@ -739,7 +739,7 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) {
 	_currentBoxNum = 0;
 	_currentBox = best_ha;
 
-	if (best_ha == NULL)
+	if (best_ha == nullptr)
 		return;
 
 	_currentBoxNum = best_ha->id;
@@ -811,7 +811,7 @@ void AGOSEngine_Waxworks::boxController(uint x, uint y, uint mode) {
 		}
 	}
 
-	best_ha = NULL;
+	best_ha = nullptr;
 
 	do {
 		if (ha->flags & kBFBoxInUse) {
@@ -835,7 +835,7 @@ void AGOSEngine_Waxworks::boxController(uint x, uint y, uint mode) {
 	_currentBoxNum = 0;
 	_currentBox = best_ha;
 
-	if (best_ha == NULL) {
+	if (best_ha == nullptr) {
 		clearName();
 		if (getGameType() == GType_WW && _mouseCursor >= 4) {
 			_mouseCursor = 0;
diff --git a/engines/agos/verb_pn.cpp b/engines/agos/verb_pn.cpp
index 53025822ba..ea74ae67e6 100644
--- a/engines/agos/verb_pn.cpp
+++ b/engines/agos/verb_pn.cpp
@@ -32,12 +32,12 @@ void AGOSEngine_PN::boxController(uint x, uint y, uint mode) {
 	HitArea *best_ha;
 	HitArea *ha = _hitAreaList;
 
-	best_ha = NULL;
+	best_ha = nullptr;
 
 	do {
 		if (!(ha->flags & kOBFBoxDisabled)) {
 			if (x >= ha->x && y >= ha->y && x - ha->x < ha->width && y - ha->y < ha->height &&
-				best_ha == NULL) {
+				best_ha == nullptr) {
 				best_ha = ha;
 			} else {
 				if (ha->flags & kOBFBoxSelected) {
@@ -54,7 +54,7 @@ void AGOSEngine_PN::boxController(uint x, uint y, uint mode) {
 		_lastHitArea = best_ha;
 	}
 
-	if (best_ha == NULL) {
+	if (best_ha == nullptr) {
 		return;
 	}
 
@@ -66,10 +66,10 @@ void AGOSEngine_PN::boxController(uint x, uint y, uint mode) {
 
 void AGOSEngine_PN::mouseHit() {
 	if (_hitCalled == 5) {
-		execMouseHit(NULL);
+		execMouseHit(nullptr);
 	} else {
 		boxController(_mouse.x, _mouse.y, 1);
-		if (_hitCalled == 4 || _lastHitArea != 0) {
+		if (_hitCalled == 4 || _lastHitArea != nullptr) {
 			execMouseHit(_lastHitArea);
 		}
 	}
@@ -114,7 +114,7 @@ void AGOSEngine_PN::execMouseHit(HitArea *ha) {
 		_oneClick = 0;
 		_dragCount = 0;
 		_needHitAreaRecalc++;
-		if (ha != 0) {
+		if (ha != nullptr) {
 			if (ha->flags & kOBFInventoryBox)
 				hitBox5(ha);
 			else if (ha->flags & kOBFRoomBox)
@@ -124,7 +124,7 @@ void AGOSEngine_PN::execMouseHit(HitArea *ha) {
 		}
 	} else {
 		_hitCalled = 0;
-		if (_mouseString == 0) {
+		if (_mouseString == nullptr) {
 			_mouseString = (const char *)"\r";
 		}
 	}
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index c3790de402..7bd35fa77b 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -184,7 +184,7 @@ bool AGOSEngine::ifObjectHere(uint16 a) {
 	CHECK_BOUNDS(a, _objectArray);
 
 	item = _objectArray[a];
-	if (item == NULL)
+	if (item == nullptr)
 		return true;
 
 	return me()->parent == item->parent;
@@ -199,7 +199,7 @@ bool AGOSEngine::ifObjectAt(uint16 a, uint16 b) {
 	item_a = _objectArray[a];
 	item_b = _objectArray[b];
 
-	if (item_a == NULL || item_b == NULL)
+	if (item_a == nullptr || item_b == nullptr)
 		return true;
 
 	return derefItem(item_a->parent) == item_b;
@@ -211,7 +211,7 @@ bool AGOSEngine::ifObjectState(uint16 a, int16 b) {
 	CHECK_BOUNDS(a, _objectArray);
 
 	item = _objectArray[a];
-	if (item == NULL)
+	if (item == nullptr)
 		return true;
 	return item->state == b;
 }
@@ -1140,7 +1140,7 @@ void AGOSEngine::vc27_resetSprite() {
 	if (_videoLockOut & 0x20) {
 		AnimTable *animTable = _screenAnim1;
 		while (animTable->srcPtr) {
-			animTable->srcPtr = 0;
+			animTable->srcPtr = nullptr;
 			animTable++;
 		}
 	}
@@ -1359,7 +1359,7 @@ void AGOSEngine::vc40_scrollRight() {
 			_scrollCount = 0;
 			if (value - _scrollX >= 30) {
 				_scrollCount = MIN(20, _scrollXMax - _scrollX);
-				addVgaEvent(6, SCROLL_EVENT, NULL, 0, 0);
+				addVgaEvent(6, SCROLL_EVENT, nullptr, 0, 0);
 			}
 		}
 	}
@@ -1376,7 +1376,7 @@ void AGOSEngine::vc41_scrollLeft() {
 			_scrollCount = 0;
 			if ((uint16)(value - _scrollX) < 11) {
 				_scrollCount = -MIN(20, (int)_scrollX);
-				addVgaEvent(6, SCROLL_EVENT, NULL, 0, 0);
+				addVgaEvent(6, SCROLL_EVENT, nullptr, 0, 0);
 			}
 		}
 	}
diff --git a/engines/agos/vga_s1.cpp b/engines/agos/vga_s1.cpp
index 9b7e529e4b..e63a6a7026 100644
--- a/engines/agos/vga_s1.cpp
+++ b/engines/agos/vga_s1.cpp
@@ -95,7 +95,7 @@ static const uint8 customPalette[96] = {
 };
 
 void AGOSEngine_Simon1::vc22_setPalette() {
-	byte *offs, *palptr = 0, *src;
+	byte *offs, *palptr = nullptr, *src;
 	uint16 a = 0, b, num, palSize = 0;
 
 	a = vcReadNextWord();
diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp
index db519e4495..04f00ec877 100644
--- a/engines/agos/window.cpp
+++ b/engines/agos/window.cpp
@@ -87,7 +87,7 @@ WindowBlock *AGOSEngine::openWindow(uint x, uint y, uint w, uint h, uint flags,
 void AGOSEngine::changeWindow(uint a) {
 	a &= 7;
 
-	if (_windowArray[a] == NULL || _curWindow == a)
+	if (_windowArray[a] == nullptr || _curWindow == a)
 		return;
 
 	_curWindow = a;
@@ -97,13 +97,13 @@ void AGOSEngine::changeWindow(uint a) {
 }
 
 void AGOSEngine::closeWindow(uint a) {
-	if (_windowArray[a] == NULL)
+	if (_windowArray[a] == nullptr)
 		return;
 	removeIconArray(a);
 	resetWindow(_windowArray[a]);
-	_windowArray[a] = NULL;
+	_windowArray[a] = nullptr;
 	if (_curWindow == a) {
-		_textWindow = NULL;
+		_textWindow = nullptr;
 		changeWindow(0);
 	}
 }
@@ -308,17 +308,17 @@ void AGOSEngine::waitWindow(WindowBlock *window) {
 	ha->priority = 999;
 
 	while (!shouldQuit()) {
-		_lastHitArea = NULL;
-		_lastHitArea3 = NULL;
+		_lastHitArea = nullptr;
+		_lastHitArea3 = nullptr;
 
 		while (!shouldQuit()) {
-			if (_lastHitArea3 != 0)
+			if (_lastHitArea3 != nullptr)
 				break;
 			delay(1);
 		}
 
 		ha = _lastHitArea;
-		if (ha == NULL) {
+		if (ha == nullptr) {
 		} else if (ha->id == 0x7FFF) {
 			break;
 		}
diff --git a/engines/agos/zones.cpp b/engines/agos/zones.cpp
index 5a753d9b4b..9513cdf94e 100644
--- a/engines/agos/zones.cpp
+++ b/engines/agos/zones.cpp
@@ -72,7 +72,7 @@ void AGOSEngine::loadZone(uint16 zoneNum, bool useError) {
 		_vgaMemPtr = _vgaMemBase;
 	} else {
 		vpe = _vgaBufferPointers + zoneNum;
-		if (vpe->vgaFile1 != NULL)
+		if (vpe->vgaFile1 != nullptr)
 			return;
 	}
 
@@ -92,7 +92,7 @@ void AGOSEngine::loadZone(uint16 zoneNum, bool useError) {
 	vpe->vgaFile1 = _block;
 	vpe->vgaFile1End = _blockEnd;
 
-	vpe->sfxFile = NULL;
+	vpe->sfxFile = nullptr;
 
 	if (getGameType() == GType_ELVIRA2) {
 		// A singe sound file is used for Amiga and AtariST versions
@@ -202,12 +202,12 @@ void AGOSEngine::checkZonePtrs() {
 		if (((vpe->vgaFile1 < _blockEnd) && (vpe->vgaFile1End > _block)) ||
 			((vpe->vgaFile2 < _blockEnd) && (vpe->vgaFile2End > _block)) ||
 			((vpe->sfxFile < _blockEnd) && (vpe->sfxFileEnd > _block))) {
-			vpe->vgaFile1 = NULL;
-			vpe->vgaFile1End = NULL;
-			vpe->vgaFile2 = NULL;
-			vpe->vgaFile2End = NULL;
-			vpe->sfxFile = NULL;
-			vpe->sfxFileEnd = NULL;
+			vpe->vgaFile1 = nullptr;
+			vpe->vgaFile1End = nullptr;
+			vpe->vgaFile2 = nullptr;
+			vpe->vgaFile2End = nullptr;
+			vpe->sfxFile = nullptr;
+			vpe->sfxFileEnd = nullptr;
 		}
 	} while (++vpe, --count);
 }


Commit: a38607521790a937142e18d6d4c48f60d68fa415
    https://github.com/scummvm/scummvm/commit/a38607521790a937142e18d6d4c48f60d68fa415
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
AGS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/ags/engine/ac/game_state.cpp
    engines/ags/engine/ac/global_audio.cpp
    engines/ags/engine/ac/viewport_script.cpp
    engines/ags/engine/main/game_run.cpp
    engines/ags/lib/allegro/unicode.cpp
    engines/ags/plugins/ags_waves/ags_waves.cpp
    engines/ags/plugins/ags_waves/data.cpp


diff --git a/engines/ags/engine/ac/game_state.cpp b/engines/ags/engine/ac/game_state.cpp
index ed84c5e33a..dfe3ca9a1e 100644
--- a/engines/ags/engine/ac/game_state.cpp
+++ b/engines/ags/engine/ac/game_state.cpp
@@ -347,13 +347,13 @@ int GameState::GetRoomCameraCount() const {
 
 ScriptViewport *GameState::GetScriptViewport(int index) {
 	if (index < 0 || (size_t)index >= _roomViewports.size())
-		return NULL;
+		return nullptr;
 	return _scViewportRefs[index].first;
 }
 
 ScriptCamera *GameState::GetScriptCamera(int index) {
 	if (index < 0 || (size_t)index >= _roomCameras.size())
-		return NULL;
+		return nullptr;
 	return _scCameraRefs[index].first;
 }
 
diff --git a/engines/ags/engine/ac/global_audio.cpp b/engines/ags/engine/ac/global_audio.cpp
index df21e65f2f..baddb82598 100644
--- a/engines/ags/engine/ac/global_audio.cpp
+++ b/engines/ags/engine/ac/global_audio.cpp
@@ -500,7 +500,7 @@ int IsMusicVoxAvailable() {
 
 ScriptAudioChannel *PlayVoiceClip(CharacterInfo *ch, int sndid, bool as_speech) {
 	if (!play_voice_nonblocking(ch->index_id, sndid, as_speech))
-		return NULL;
+		return nullptr;
 	return &_G(scrAudioChannel)[SCHAN_SPEECH];
 }
 
diff --git a/engines/ags/engine/ac/viewport_script.cpp b/engines/ags/engine/ac/viewport_script.cpp
index 4d4076a9b8..d7b6aa1663 100644
--- a/engines/ags/engine/ac/viewport_script.cpp
+++ b/engines/ags/engine/ac/viewport_script.cpp
@@ -49,7 +49,7 @@ using namespace AGS::Shared;
 ScriptCamera *Camera_Create() {
 	auto cam = _GP(play).CreateRoomCamera();
 	if (!cam)
-		return NULL;
+		return nullptr;
 	return _GP(play).RegisterRoomCamera(cam->GetID());
 }
 
@@ -237,7 +237,7 @@ RuntimeScriptValue Sc_Camera_SetSize(void *self, const RuntimeScriptValue *param
 ScriptViewport *Viewport_Create() {
 	auto view = _GP(play).CreateRoomViewport();
 	if (!view)
-		return NULL;
+		return nullptr;
 	return _GP(play).RegisterRoomViewport(view->GetID());
 }
 
diff --git a/engines/ags/engine/main/game_run.cpp b/engines/ags/engine/main/game_run.cpp
index c328845623..ed7114fb1b 100644
--- a/engines/ags/engine/main/game_run.cpp
+++ b/engines/ags/engine/main/game_run.cpp
@@ -972,7 +972,7 @@ void GameLoopUntilNotMoving(const short *move) {
 }
 
 void GameLoopUntilNoOverlay() {
-	GameLoopUntilEvent(UNTIL_NOOVERLAY, 0);
+	GameLoopUntilEvent(UNTIL_NOOVERLAY, nullptr);
 }
 
 
diff --git a/engines/ags/lib/allegro/unicode.cpp b/engines/ags/lib/allegro/unicode.cpp
index 645e0d957e..1b2178345a 100644
--- a/engines/ags/lib/allegro/unicode.cpp
+++ b/engines/ags/lib/allegro/unicode.cpp
@@ -72,7 +72,7 @@ static UTYPE_INFO *find_utype(int type) {
 		if (utypes[i].id == type)
 			return &utypes[i];
 
-	return NULL;
+	return nullptr;
 }
 
 void set_uformat(int type) {
@@ -1254,7 +1254,7 @@ const char *ustrstr(const char *s1, const char *s2) {
 		s1 += uwidth(s1);
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 int usetat(char *s, int index, int c) {
diff --git a/engines/ags/plugins/ags_waves/ags_waves.cpp b/engines/ags/plugins/ags_waves/ags_waves.cpp
index da068c8cef..7f14b0a159 100644
--- a/engines/ags/plugins/ags_waves/ags_waves.cpp
+++ b/engines/ags/plugins/ags_waves/ags_waves.cpp
@@ -180,10 +180,10 @@ void AGSWaves::StartingValues() {
 
 	int j = 0;
 	while (j < 2) {
-		globalStream[j].Filename = NULL;
+		globalStream[j].Filename = nullptr;
 		globalStream[j].repeat = 0;
 		globalStream[j].volume = 0;
-		globalStream[j].Vorbis = NULL;
+		globalStream[j].Vorbis = nullptr;
 		globalStream[j].fix_click = false;
 		j++;
 	}
diff --git a/engines/ags/plugins/ags_waves/data.cpp b/engines/ags/plugins/ags_waves/data.cpp
index 8c2eb6d5b0..0602b85e48 100644
--- a/engines/ags/plugins/ags_waves/data.cpp
+++ b/engines/ags/plugins/ags_waves/data.cpp
@@ -43,7 +43,7 @@ void AGSWaves::SaveVariable(ScriptMethodParams &params) {
 void AGSWaves::ReadVariable(ScriptMethodParams &params) {
 	PARAMS1(int, id);
 
-	if (GameDatavalue[id] == NULL) {
+	if (GameDatavalue[id] == nullptr) {
 		params._result = _engine->CreateScriptString("");
 	} else {
 		params._result = _engine->CreateScriptString(GameDatavalue[id]);
@@ -111,9 +111,9 @@ void AGSWaves::GetGDState(ScriptMethodParams &params) {
 
 void AGSWaves::ResetAllGD(ScriptMethodParams &params) {
 	for (int i = 0; i <= usedTokens; i++) {
-		if (Token[i] != NULL)
+		if (Token[i] != nullptr)
 			free(Token[i]);
-		Token[i] = NULL;
+		Token[i] = nullptr;
 		TokenUnUsed[i] = true;
 	}
 	usedTokens = 0;


Commit: 57cdbc9072e5a5eeb5c7ab41d98e956134e3add7
    https://github.com/scummvm/scummvm/commit/57cdbc9072e5a5eeb5c7ab41d98e956134e3add7
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
ASYLUM: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/asylum/asylum.cpp
    engines/asylum/console.cpp
    engines/asylum/puzzles/pipes.cpp
    engines/asylum/puzzles/puzzles.cpp
    engines/asylum/puzzles/vcr.cpp
    engines/asylum/resources/actor.cpp
    engines/asylum/resources/script.cpp
    engines/asylum/resources/special.cpp
    engines/asylum/resources/worldstats.cpp
    engines/asylum/respack.cpp
    engines/asylum/system/cursor.cpp
    engines/asylum/system/savegame.cpp
    engines/asylum/system/screen.cpp
    engines/asylum/system/sound.cpp
    engines/asylum/system/speech.cpp
    engines/asylum/system/text.cpp
    engines/asylum/views/insertdisc.cpp
    engines/asylum/views/menu.cpp
    engines/asylum/views/resviewer.cpp
    engines/asylum/views/scene.cpp
    engines/asylum/views/video.cpp


diff --git a/engines/asylum/asylum.cpp b/engines/asylum/asylum.cpp
index 955d233743..378ef2ff05 100644
--- a/engines/asylum/asylum.cpp
+++ b/engines/asylum/asylum.cpp
@@ -56,9 +56,9 @@
 namespace Asylum {
 
 AsylumEngine::AsylumEngine(OSystem *system, const ADGameDescription *gd) : Engine(system), _gameDescription(gd),
-	_console(NULL), _cursor(NULL), _encounter(NULL), _menu(NULL), _resource(NULL), _savegame(NULL),
-	_scene(NULL), _screen(NULL), _script(NULL), _special(NULL), _speech(NULL), _sound(NULL), _text(NULL),
-	_video(NULL), _handler(NULL), _puzzles(NULL) {
+	_console(nullptr), _cursor(nullptr), _encounter(nullptr), _menu(nullptr), _resource(nullptr), _savegame(nullptr),
+	_scene(nullptr), _screen(nullptr), _script(nullptr), _special(nullptr), _speech(nullptr), _sound(nullptr), _text(nullptr),
+	_video(nullptr), _handler(nullptr), _puzzles(nullptr) {
 
 	// Init data
 	resetFlags();
@@ -71,7 +71,7 @@ AsylumEngine::AsylumEngine(OSystem *system, const ADGameDescription *gd) : Engin
 	// Debug
 	_delayedSceneIndex = kResourcePackInvalid;
 	_delayedVideoIndex = -1;
-	_previousScene = NULL;
+	_previousScene = nullptr;
 
 	// Add default search directories
 	const Common::FSNode gamePath(ConfMan.get("path"));
@@ -83,7 +83,7 @@ AsylumEngine::AsylumEngine(OSystem *system, const ADGameDescription *gd) : Engin
 }
 
 AsylumEngine::~AsylumEngine() {
-	_handler = NULL;
+	_handler = nullptr;
 
 	delete _cursor;
 	delete _scene;
@@ -100,12 +100,12 @@ AsylumEngine::~AsylumEngine() {
 	delete _menu;
 	delete _resource;
 
-	_previousScene = NULL;
+	_previousScene = nullptr;
 
 	delete _rnd;
 
 	// Zero passed pointers
-	_gameDescription = NULL;
+	_gameDescription = nullptr;
 }
 
 Common::Error AsylumEngine::run() {
@@ -137,7 +137,7 @@ Common::Error AsylumEngine::run() {
 	_menu  = new Menu(this);
 	if (checkGameVersion("Demo")) {
 		if (!isAltDemo())
-			_video->play(0, NULL);
+			_video->play(0, nullptr);
 		restart();
 	} else {
 		int saveSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1;
@@ -288,7 +288,7 @@ void AsylumEngine::restart() {
 	// Cleanup
 	resetFlags();
 	delete _scene;
-	_scene = NULL;
+	_scene = nullptr;
 	delete _encounter;
 	_encounter = new Encounter(this);
 	_script->resetQueue();
@@ -337,7 +337,7 @@ void AsylumEngine::playIntro() {
 		} else {
 			_sound->playMusic(kResourceNone, 0);
 
-			_video->play(1, checkGameVersion("Demo") ? NULL : _menu);
+			_video->play(1, checkGameVersion("Demo") ? nullptr : _menu);
 
 			if (_scene->worldstats()->musicCurrentResourceIndex != kMusicStopped)
 				_sound->playMusic(MAKE_RESOURCE(kResourcePackMusic, _scene->worldstats()->musicCurrentResourceIndex));
@@ -501,11 +501,11 @@ void AsylumEngine::processDelayedEvents() {
 // Message handlers
 //////////////////////////////////////////////////////////////////////////
 void AsylumEngine::switchEventHandler(EventHandler *handler) {
-	if (handler == NULL && !checkGameVersion("Demo"))
+	if (handler == nullptr && !checkGameVersion("Demo"))
 		warning("[AsylumEngine::switchMessageHandler] NULL handler parameter (shouldn't happen outside of debug commands)!");
 
 	// De-init previous handler
-	if (_handler != NULL) {
+	if (_handler != nullptr) {
 		AsylumEvent deinit(EVENT_ASYLUM_DEINIT);
 		_handler->handleEvent(deinit);
 	}
@@ -517,7 +517,7 @@ void AsylumEngine::switchEventHandler(EventHandler *handler) {
 			delete _scene;
 			_scene = _previousScene;
 			handler = _scene;
-			_previousScene = NULL;
+			_previousScene = nullptr;
 		}
 	}
 	//////////////////////////////////////////////////////////////////////////
@@ -532,7 +532,7 @@ void AsylumEngine::switchEventHandler(EventHandler *handler) {
 }
 
 void AsylumEngine::notify(AsylumEventType type, int32 param1, int32 param2) {
-	if (_handler == NULL)
+	if (_handler == nullptr)
 		error("[AsylumEngine::notify] Invalid handler parameter (cannot be NULL)!");
 
 	AsylumEvent evt(type, param1, param2);
diff --git a/engines/asylum/console.cpp b/engines/asylum/console.cpp
index b799488dd9..e60ade7a6b 100644
--- a/engines/asylum/console.cpp
+++ b/engines/asylum/console.cpp
@@ -919,7 +919,7 @@ bool Console::cmdRunPuzzle(int argc, const char **argv) {
 	}
 
 	EventHandler *puzzle = getPuzzles()->getPuzzle((uint32)index);
-	if (puzzle == NULL) {
+	if (puzzle == nullptr) {
 		debugPrintf("[Error] This puzzle does not exists (%d)", index);
 		return true;
 	}
diff --git a/engines/asylum/puzzles/pipes.cpp b/engines/asylum/puzzles/pipes.cpp
index 4e51ff6beb..d3f387381e 100644
--- a/engines/asylum/puzzles/pipes.cpp
+++ b/engines/asylum/puzzles/pipes.cpp
@@ -101,10 +101,10 @@ void Peephole::startUpWater(bool flag) {
 //////////////////////////////////////////////////////////////////////////
 Connector::Connector() :
 	_id(0),
-	_position(NULL),
+	_position(nullptr),
 	_state(kBinNum0000),
 	_isConnected(false),
-	_nextConnector(NULL),
+	_nextConnector(nullptr),
 	_type(kConnectorTypeI),
 	_nextConnectorPosition(kDirectionNowhere) {
 	memset(_nodes, 0, sizeof(_nodes));
@@ -293,7 +293,7 @@ PuzzlePipes::PuzzlePipes(AsylumEngine *engine) : Puzzle(engine) {
 	_isLeverReady = false;
 	memset(&_sinks, 0, sizeof(_sinks));
 	memset(&_sources, 0, sizeof(_sources));
-	_frameIndexSpider = NULL;
+	_frameIndexSpider = nullptr;
 
 	initResources();
 	setup();
@@ -504,27 +504,27 @@ void PuzzlePipes::setup() {
 		_sources[i]->_flowValues[i] = 1;
 	}
 
-	_connectors[ 0].init(           NULL,  _peepholes + 4,  _peepholes + 6,  _peepholes + 0, 1, kConnectorTypeL);
-	_connectors[ 1].init(_peepholes +  6, _peepholes + 15, _peepholes + 23,            NULL, 1, kConnectorTypeL);
-	_connectors[ 2].init(_peepholes + 23, _peepholes + 24, _peepholes + 33,            NULL, 2, kConnectorTypeL);
-	_connectors[ 3].init(           NULL,  _peepholes + 5,  _peepholes + 7,  _peepholes + 4, 1, kConnectorTypeL);
-	_connectors[ 4].init(_peepholes +  7, _peepholes + 11,            NULL,            NULL, 2, kConnectorTypeL,  _connectors + 5, kDirectionSh);
-	_connectors[ 5].init(           NULL, _peepholes + 18, _peepholes + 24, _peepholes + 15, 1, kConnectorTypeT,  _connectors + 4, kDirectionNh);
-	_connectors[ 6].init(           NULL,  _peepholes + 1,  _peepholes + 8,  _peepholes + 5, 1, kConnectorTypeL);
+	_connectors[ 0].init(        nullptr,  _peepholes + 4,  _peepholes + 6,  _peepholes + 0, 1, kConnectorTypeL);
+	_connectors[ 1].init(_peepholes +  6, _peepholes + 15, _peepholes + 23,         nullptr, 1, kConnectorTypeL);
+	_connectors[ 2].init(_peepholes + 23, _peepholes + 24, _peepholes + 33,         nullptr, 2, kConnectorTypeL);
+	_connectors[ 3].init(        nullptr,  _peepholes + 5,  _peepholes + 7,  _peepholes + 4, 1, kConnectorTypeL);
+	_connectors[ 4].init(_peepholes +  7, _peepholes + 11,         nullptr,         nullptr, 2, kConnectorTypeL,  _connectors + 5, kDirectionSh);
+	_connectors[ 5].init(        nullptr, _peepholes + 18, _peepholes + 24, _peepholes + 15, 1, kConnectorTypeT,  _connectors + 4, kDirectionNh);
+	_connectors[ 6].init(        nullptr,  _peepholes + 1,  _peepholes + 8,  _peepholes + 5, 1, kConnectorTypeL);
 	_connectors[ 7].init(_peepholes +  8, _peepholes + 12, _peepholes + 25, _peepholes + 11, 1, kConnectorTypeT);
 	_connectors[ 8].init(_peepholes + 25, _peepholes + 29, _peepholes + 34, _peepholes + 18, 2, kConnectorTypeT);
 	_connectors[ 9].init(_peepholes +  9, _peepholes + 16, _peepholes + 19, _peepholes + 12, 8, kConnectorTypeT);
-	_connectors[10].init(_peepholes + 19, _peepholes + 20, _peepholes + 26,            NULL, 2, kConnectorTypeL);
+	_connectors[10].init(_peepholes + 19, _peepholes + 20, _peepholes + 26,         nullptr, 2, kConnectorTypeL);
 	_connectors[11].init(_peepholes + 26, _peepholes + 31, _peepholes + 35, _peepholes + 29, 2, kConnectorTypeT);
-	_connectors[12].init(_peepholes +  2, _peepholes + 10,            NULL,  _peepholes + 9, 2, kConnectorTypeL);
-	_connectors[13].init(_peepholes + 13, _peepholes + 17,            NULL, _peepholes + 16, 1, kConnectorTypeT, _connectors + 14, kDirectionSh);
-	_connectors[14].init(           NULL, _peepholes + 21, _peepholes + 27, _peepholes + 20, 8, kConnectorTypeT, _connectors + 13, kDirectionNh);
-	_connectors[15].init(_peepholes + 10,            NULL, _peepholes + 22, _peepholes + 17, 1, kConnectorTypeI, _connectors + 19, kDirectionEt);
+	_connectors[12].init(_peepholes +  2, _peepholes + 10,         nullptr,  _peepholes + 9, 2, kConnectorTypeL);
+	_connectors[13].init(_peepholes + 13, _peepholes + 17,         nullptr, _peepholes + 16, 1, kConnectorTypeT, _connectors + 14, kDirectionSh);
+	_connectors[14].init(        nullptr, _peepholes + 21, _peepholes + 27, _peepholes + 20, 8, kConnectorTypeT, _connectors + 13, kDirectionNh);
+	_connectors[15].init(_peepholes + 10,         nullptr, _peepholes + 22, _peepholes + 17, 1, kConnectorTypeI, _connectors + 19, kDirectionEt);
 	_connectors[16].init(_peepholes + 21, _peepholes + 22, _peepholes + 30, _peepholes + 27, 2, kConnectorTypeT);
-	_connectors[17].init(_peepholes + 30, _peepholes + 32,            NULL, _peepholes + 31, 2, kConnectorTypeL);
-	_connectors[18].init(_peepholes +  3,            NULL, _peepholes + 14, _peepholes + 13, 8, kConnectorTypeL);
-	_connectors[19].init(_peepholes + 14,            NULL, _peepholes + 28,            NULL, 4, kConnectorTypeL, _connectors + 15, kDirectionWt);
-	_connectors[20].init(_peepholes + 28,            NULL, _peepholes + 36, _peepholes + 32, 4, kConnectorTypeL);
+	_connectors[17].init(_peepholes + 30, _peepholes + 32,         nullptr, _peepholes + 31, 2, kConnectorTypeL);
+	_connectors[18].init(_peepholes +  3,         nullptr, _peepholes + 14, _peepholes + 13, 8, kConnectorTypeL);
+	_connectors[19].init(_peepholes + 14,         nullptr, _peepholes + 28,         nullptr, 4, kConnectorTypeL, _connectors + 15, kDirectionWt);
+	_connectors[20].init(_peepholes + 28,         nullptr, _peepholes + 36, _peepholes + 32, 4, kConnectorTypeL);
 
 	_connectors[ 4].initGroup();
 	_connectors[13].initGroup();
diff --git a/engines/asylum/puzzles/puzzles.cpp b/engines/asylum/puzzles/puzzles.cpp
index 379b151c2e..3ea61d5c60 100644
--- a/engines/asylum/puzzles/puzzles.cpp
+++ b/engines/asylum/puzzles/puzzles.cpp
@@ -63,7 +63,7 @@ EventHandler *Puzzles::getPuzzle(uint32 index) const {
 	if (index >= ARRAYSIZE(_puzzles))
 		error("[AsylumEngine::getPuzzleEventHandler] Invalid index (was: %d - max: %d)", index, ARRAYSIZE(_puzzles));
 
-	if (_puzzles[index] == NULL)
+	if (_puzzles[index] == nullptr)
 		error("[AsylumEngine::getPuzzleEventHandler] This puzzle doesn't have an event handler! (index: %d)", index);
 
 	return (EventHandler *)_puzzles[index];
@@ -74,13 +74,13 @@ void Puzzles::initPuzzles() {
 	_puzzles[kPuzzlePipes]           = new PuzzlePipes(_vm);
 	_puzzles[kPuzzleTicTacToe]       = new PuzzleTicTacToe(_vm);
 	_puzzles[kPuzzleLock]            = new PuzzleLock(_vm);
-	_puzzles[kPuzzle4]               = NULL;    // No event handler for Puzzle 5
+	_puzzles[kPuzzle4]               = nullptr;    // No event handler for Puzzle 5
 	_puzzles[kPuzzleWheel]           = new PuzzleWheel(_vm);
 	_puzzles[kPuzzleBoardSalvation]  = new PuzzleBoardSalvation(_vm);
 	_puzzles[kPuzzleBoardYouth]      = new PuzzleBoardYouth(_vm);
 	_puzzles[kPuzzleBoardKeyHidesTo] = new PuzzleBoardKeyHidesTo(_vm);
 	_puzzles[kPuzzleWritings]        = new PuzzleWritings(_vm);
-	_puzzles[kPuzzle11]              = NULL;
+	_puzzles[kPuzzle11]              = nullptr;
 	_puzzles[kPuzzleMorgueDoor]      = new PuzzleMorgueDoor(_vm);
 	_puzzles[kPuzzleClock]           = new PuzzleClock(_vm);
 	_puzzles[kPuzzleTimeMachine]     = new PuzzleTimeMachine(_vm);
diff --git a/engines/asylum/puzzles/vcr.cpp b/engines/asylum/puzzles/vcr.cpp
index e4f14b26e1..114e325998 100644
--- a/engines/asylum/puzzles/vcr.cpp
+++ b/engines/asylum/puzzles/vcr.cpp
@@ -325,7 +325,7 @@ void PuzzleVCR::updateScreen() {
 		getScreen()->clear();
 
 		// setupPalette();
-		getScreen()->setupPalette(NULL, 0, 0);
+		getScreen()->setupPalette(nullptr, 0, 0);
 
 		int paletteId = _vm->checkGameVersion("Demo") ? 20 : 28;
 		getScreen()->setPalette(MAKE_RESOURCE(kResourcePackTowerCells, paletteId));
diff --git a/engines/asylum/resources/actor.cpp b/engines/asylum/resources/actor.cpp
index a602f82728..1c5b8800b7 100644
--- a/engines/asylum/resources/actor.cpp
+++ b/engines/asylum/resources/actor.cpp
@@ -507,7 +507,7 @@ void Actor::update() {
 				break;
 
 			case 1:
-				getSpecial()->run(NULL, _index);
+				getSpecial()->run(nullptr, _index);
 				return;
 
 			case 10:
@@ -554,7 +554,7 @@ void Actor::update() {
 			setVolume();
 
 		if (_index != getSharedData()->getPlayerIndex() && getWorld()->chapter != kChapter9)
-			getSpecial()->run(NULL, _index);
+			getSpecial()->run(nullptr, _index);
 
 		updateReflectionData();
 
@@ -614,7 +614,7 @@ void Actor::update() {
 			setVolume();
 
 		if (_index != getSharedData()->getPlayerIndex() && getWorld()->chapter != kChapter9)
-			getSpecial()->run(NULL, _index);
+			getSpecial()->run(nullptr, _index);
 
 		updateReflectionData();
 
@@ -674,7 +674,7 @@ void Actor::update() {
 		setVolume();
 
 	if (_index != getSharedData()->getPlayerIndex() && getWorld()->chapter != kChapter9)
-		getSpecial()->run(NULL, _index);
+		getSpecial()->run(nullptr, _index);
 
 	updateReflectionData();
 
diff --git a/engines/asylum/resources/script.cpp b/engines/asylum/resources/script.cpp
index 40f913aff1..de5508e951 100644
--- a/engines/asylum/resources/script.cpp
+++ b/engines/asylum/resources/script.cpp
@@ -298,9 +298,9 @@ void ScriptManager::reset(uint32 count) {
 	_exit = false;
 	_processNextEntry = false;
 
-	_lastProcessedCmd = NULL;
-	_currentScript = NULL;
-	_currentQueueEntry = NULL;
+	_lastProcessedCmd = nullptr;
+	_currentScript = nullptr;
+	_currentQueueEntry = nullptr;
 }
 
 void ScriptManager::resetQueue() {
@@ -392,7 +392,7 @@ bool ScriptManager::process() {
 
 				// Run script
 				for (;;) {
-					ScriptEntry *cmd = NULL;
+					ScriptEntry *cmd = nullptr;
 					uint32 cmdIndex = 0;
 
 					if (_processNextEntry)
@@ -1986,7 +1986,7 @@ void ScriptManager::enableObject(ScriptEntry *cmd, ObjectTransparency type) {
 	int32 *param = &cmd->param4;
 	for (int i = 0; i < 6; i++) {
 		Object *object = getWorld()->getObjectById((ObjectId)*param);
-		if (object != NULL)
+		if (object != nullptr)
 			object->setTransparency(transparency);
 
 		++param;
diff --git a/engines/asylum/resources/special.cpp b/engines/asylum/resources/special.cpp
index 3ac45c1e6e..7cf140c340 100644
--- a/engines/asylum/resources/special.cpp
+++ b/engines/asylum/resources/special.cpp
@@ -1949,7 +1949,7 @@ void Special::checkFlags(ObjectId id, GameFlag flag1, GameFlag flag2, GameFlag f
 // Helpers
 //////////////////////////////////////////////////////////////////////////
 ResourceId Special::getResourceId(Object *object, ActorIndex actorIndex) {
-	if (actorIndex == kActorInvalid && object == NULL)
+	if (actorIndex == kActorInvalid && object == nullptr)
 		error("[Special::getResourceId] Both arguments cannot be NULL/empty!");
 
 	return (actorIndex == kActorInvalid) ? object->getSoundResourceId() : getScene()->getActor(actorIndex)->getSoundResourceId();
diff --git a/engines/asylum/resources/worldstats.cpp b/engines/asylum/resources/worldstats.cpp
index f63f56c69e..c6d8bdcec7 100644
--- a/engines/asylum/resources/worldstats.cpp
+++ b/engines/asylum/resources/worldstats.cpp
@@ -310,7 +310,7 @@ load_inventory:
 		ObjectId id = (ObjectId)stream->readUint32LE();
 
 		if (id == 0)
-			wheels[i] = NULL;
+			wheels[i] = nullptr;
 		else
 			wheels[i] = getObjectById(id);
 	}
@@ -489,7 +489,7 @@ void WorldStats::saveLoadWithSerializer(Common::Serializer &s) {
 
 		if (s.isLoading()) {
 			if (id == kObjectNone)
-				wheels[i] = NULL;
+				wheels[i] = nullptr;
 			else
 				wheels[i] = getObjectById(id);
 		}
@@ -544,7 +544,7 @@ Object *WorldStats::getObjectById(ObjectId id) {
 		if (objects[i]->getId() == id)
 			return objects[i];
 
-	return NULL;
+	return nullptr;
 }
 
 void WorldStats::setWheelObjects() {
diff --git a/engines/asylum/respack.cpp b/engines/asylum/respack.cpp
index 79fce333e0..99ef4116d2 100644
--- a/engines/asylum/respack.cpp
+++ b/engines/asylum/respack.cpp
@@ -149,7 +149,7 @@ void ResourcePack::init(const Common::String &filename) {
 		// Read the offset of the next entry to determine the size of this one
 		nextOffset = (i < entryCount - 1) ? _packFile.readUint32LE() : (uint32)_packFile.size();
 		entry.size = (nextOffset > 0) ? nextOffset - prevOffset : (uint32)_packFile.size() - prevOffset;
-		entry.data = NULL;
+		entry.data = nullptr;
 
 		_resources[i] = entry;
 
@@ -159,7 +159,7 @@ void ResourcePack::init(const Common::String &filename) {
 
 ResourceEntry *ResourcePack::get(uint16 index) {
 	if (index > _resources.size() - 1)
-		return NULL;
+		return nullptr;
 
 	if (!_resources[index].data) {
 		// Load the requested resource if it's not loaded already
diff --git a/engines/asylum/system/cursor.cpp b/engines/asylum/system/cursor.cpp
index 683c64964d..d8ff7cb90b 100644
--- a/engines/asylum/system/cursor.cpp
+++ b/engines/asylum/system/cursor.cpp
@@ -33,7 +33,7 @@ namespace Asylum {
 const uint32 CURSOR_UPDATE_TICKS = 100;
 
 Cursor::Cursor(AsylumEngine *engine) : _vm(engine),
-	_state(0), _cursorRes(NULL), _nextTick(0), _frameStep(0),
+	_state(0), _cursorRes(nullptr), _nextTick(0), _frameStep(0),
 	_graphicResourceId(kResourceNone), _currentFrame(0), _lastFrameIndex(0), _counter(0), _animation(kCursorAnimationNone),
 	_forceHide(false) {
 }
diff --git a/engines/asylum/system/savegame.cpp b/engines/asylum/system/savegame.cpp
index 4cc74e57d6..77dc2d9e35 100644
--- a/engines/asylum/system/savegame.cpp
+++ b/engines/asylum/system/savegame.cpp
@@ -336,7 +336,7 @@ void Savegame::read(Common::InSaveFile *file, Common::Serializable *data, uint32
 	if (fileCount * fileSize == 0)
 		return;
 
-	Common::Serializer ser(file, NULL);
+	Common::Serializer ser(file, nullptr);
 	data->saveLoadWithSerializer(ser);
 }
 
@@ -376,7 +376,7 @@ void Savegame::write(Common::OutSaveFile *file, Common::Serializable *data, uint
 	if (size * count == 0)
 		return;
 
-	Common::Serializer ser(NULL, file);
+	Common::Serializer ser(nullptr, file);
 	uint before = ser.bytesSynced();
 
 	// Save the data
diff --git a/engines/asylum/system/screen.cpp b/engines/asylum/system/screen.cpp
index 00ea83d728..7fc718fb49 100644
--- a/engines/asylum/system/screen.cpp
+++ b/engines/asylum/system/screen.cpp
@@ -43,7 +43,7 @@ int g_debugDrawRects;
 #define TRANSPARENCY_TABLE_SIZE (256 * 256)
 
 Screen::Screen(AsylumEngine *vm) : _vm(vm) ,
-	_useColorKey(false), _transTableCount(0), _transTable(NULL), _transTableBuffer(NULL) {
+	_useColorKey(false), _transTableCount(0), _transTable(nullptr), _transTableBuffer(nullptr) {
 	_backBuffer.create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
 
 	_flag = -1;
@@ -116,7 +116,7 @@ void Screen::drawTransparent(GraphicResource *resource, uint32 frameIndex, const
 
 void Screen::draw(GraphicResource *resource, uint32 frameIndex, const Common::Point &source, DrawFlags flags, ResourceId resourceIdDestination, const Common::Point &destination, bool colorKey) {
 	GraphicFrame *frame = resource->getFrame(frameIndex);
-	ResourceEntry *resourceMask = NULL;
+	ResourceEntry *resourceMask = nullptr;
 
 	// Compute coordinates
 	Common::Rect src;
@@ -330,7 +330,7 @@ void Screen::updatePalette(int32 param) {
 			_mainPalette[j + 2] = _currentPalette[j + 2];
 		}
 
-		setupPalette(NULL, 0, 0);
+		setupPalette(nullptr, 0, 0);
 		paletteFade(0, 25, 10);
 	} else {
 		// Get the current action palette
@@ -349,7 +349,7 @@ void Screen::updatePalette(int32 param) {
 			_mainPalette[j + 2] = (byte)((1.0 - fParam) * 4 * paletteData[j + 2] + fParam * _currentPalette[j + 2]);
 		}
 
-		setupPalette(NULL, 0, 0);
+		setupPalette(nullptr, 0, 0);
 	}
 }
 
@@ -397,7 +397,7 @@ void Screen::stopPaletteFade(char red, char green, char blue) {
 	}
 
 	stopPaletteFadeTimer();
-	setupPalette(NULL, 0, 0);
+	setupPalette(nullptr, 0, 0);
 }
 
 void Screen::stopPaletteFadeAndSet(ResourceId id, int32 ticksWait, int32 delta) {
@@ -425,7 +425,7 @@ void Screen::paletteFade(uint32 start, int32 ticksWait, int32 delta) {
 			_mainPalette[j + 2] = (byte)(palette[j + 2] + i * (blue  - palette[j + 2]) / colorDelta);
 		}
 
-		setupPalette(NULL, 0, 0);
+		setupPalette(nullptr, 0, 0);
 
 		g_system->delayMillis((uint32)ticksWait);
 
@@ -478,7 +478,7 @@ void Screen::paletteFadeWorker(ResourceId id, int32 ticksWait, int32 delta) {
 			_mainPalette[j + 2] = (byte)(original[j + 2] + i * (palette[j + 2] - original[j + 2]) / colorDelta);
 		}
 
-		setupPalette(NULL, 0, 0);
+		setupPalette(nullptr, 0, 0);
 
 		// Original waits for event and so can be interrupted in the middle of the wait
 		g_system->delayMillis((uint32)ticksWait);
@@ -506,7 +506,7 @@ void Screen::setPaletteGamma(ResourceId id) {
 }
 
 void Screen::setPaletteGamma(byte *data, byte *target) {
-	if (target == NULL)
+	if (target == nullptr)
 		target = (byte *)&_mainPalette;
 
 	// Skip first entry
@@ -546,7 +546,7 @@ void Screen::setGammaLevel(ResourceId id) {
 		error("[Screen::setGammaLevel] Resource Id is invalid");
 
 	setPaletteGamma(getPaletteData(id));
-	setupPalette(NULL, 0, 0);
+	setupPalette(nullptr, 0, 0);
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -595,8 +595,8 @@ void Screen::setupTransTables(uint32 count, ...) {
 
 void Screen::clearTransTables() {
 	free(_transTableBuffer);
-	_transTableBuffer = NULL;
-	_transTable = NULL;
+	_transTableBuffer = nullptr;
+	_transTable = nullptr;
 	_transTableCount = 0;
 }
 
@@ -915,7 +915,7 @@ void Screen::blitRawColorKey(byte *dstBuffer, byte *srcBuffer, int16 height, int
 
 void Screen::blitMasked(GraphicFrame *frame, Common::Rect *source, byte *maskData, Common::Rect *sourceMask, Common::Rect *destMask, uint16 maskWidth, Common::Rect *destination, int32 flags) {
 	byte *frameBuffer = (byte *)frame->surface.getPixels();
-	byte *mirroredBuffer = NULL;
+	byte *mirroredBuffer = nullptr;
 	int16 frameRight = frame->surface.pitch;
 	uint16 maskHeight = (uint16)sourceMask->height(); // for debugging only
 	byte nSkippedBits = ABS(sourceMask->left) % 8;
diff --git a/engines/asylum/system/sound.cpp b/engines/asylum/system/sound.cpp
index f60c53c76d..303e2d1095 100644
--- a/engines/asylum/system/sound.cpp
+++ b/engines/asylum/system/sound.cpp
@@ -111,7 +111,7 @@ void Sound::changeMusic(int32 index, int32 musicStatusExt) {
 }
 
 bool Sound::isPlaying(ResourceId resourceId) {
-	return (getPlayingItem(resourceId) != NULL);
+	return (getPlayingItem(resourceId) != nullptr);
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -246,7 +246,7 @@ int32 Sound::calculatePanningAtPoint(const Common::Point &point) {
 void Sound::stop(ResourceId resourceId) {
 	SoundQueueItem *item = getPlayingItem(resourceId);
 
-	if (item != NULL)
+	if (item != nullptr)
 		_mixer->stopHandle(item->handle);
 }
 
@@ -289,7 +289,7 @@ SoundQueueItem *Sound::getItem(ResourceId resourceId) {
 		if (resourceId == _soundQueue[i].resourceId)
 			return &_soundQueue[i];
 
-	return NULL;
+	return nullptr;
 }
 
 SoundQueueItem *Sound::getPlayingItem(ResourceId resourceId) {
@@ -298,7 +298,7 @@ SoundQueueItem *Sound::getPlayingItem(ResourceId resourceId) {
 			&& _mixer->isSoundHandleActive(_soundQueue[i].handle))
 			return &_soundQueue[i];
 
-	return NULL;
+	return nullptr;
 }
 
 SoundQueueItem *Sound::addToQueue(ResourceId resourceId) {
diff --git a/engines/asylum/system/speech.cpp b/engines/asylum/system/speech.cpp
index f106c69411..09a726643d 100644
--- a/engines/asylum/system/speech.cpp
+++ b/engines/asylum/system/speech.cpp
@@ -34,7 +34,7 @@
 
 namespace Asylum {
 
-Speech::Speech(AsylumEngine *engine): _vm(engine), _textData(0), _textDataPos(0) {
+Speech::Speech(AsylumEngine *engine): _vm(engine), _textData(nullptr), _textDataPos(nullptr) {
 	_tick            = _vm->getTick();
 	_soundResourceId = kResourceNone;
 	_textResourceId  = kResourceNone;
@@ -228,8 +228,8 @@ void Speech::resetResourceIds() {
 }
 
 void Speech::resetTextData() {
-	_textData = NULL;
-	_textDataPos = NULL;
+	_textData = nullptr;
+	_textDataPos = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -264,16 +264,16 @@ void Speech::process() {
 
 	if (*(txt + strlen((const char *)txt) - 2) == 1) {
 		_textResourceId = kResourceNone;
-		_textData = 0;
-		_textDataPos = 0;
+		_textData = nullptr;
+		_textDataPos = nullptr;
 	} else if (*txt == '{') {
 		_textData = txt + 3;
-		_textDataPos = 0;
+		_textDataPos = nullptr;
 
 		getText()->loadFont(getWorld()->font1);
 		getSound()->playSound(_soundResourceId, false, Config.voiceVolume, 0);
 	} else {
-		_textData = 0;
+		_textData = nullptr;
 		_textDataPos = txt;
 
 		if (*txt == '/') {
diff --git a/engines/asylum/system/text.cpp b/engines/asylum/system/text.cpp
index cba691d1a8..5e8d85ca98 100644
--- a/engines/asylum/system/text.cpp
+++ b/engines/asylum/system/text.cpp
@@ -34,7 +34,7 @@ namespace Asylum {
 
 Text::Text(AsylumEngine *engine) : _vm(engine) {
 	_curFontFlags = 0;
-	_fontResource = 0;
+	_fontResource = nullptr;
 	_transTableNum = 0;
 }
 
@@ -49,7 +49,7 @@ ResourceId Text::loadFont(ResourceId resourceId) {
 	ResourceId previousFont = _fontResource ? _fontResource->getResourceId() : kResourceNone;
 
 	delete _fontResource;
-	_fontResource = NULL;
+	_fontResource = nullptr;
 
 	if (resourceId != kResourceNone) {
 		_fontResource = new GraphicResource(_vm, resourceId);
diff --git a/engines/asylum/views/insertdisc.cpp b/engines/asylum/views/insertdisc.cpp
index 1a210f2d75..6a9ea36830 100644
--- a/engines/asylum/views/insertdisc.cpp
+++ b/engines/asylum/views/insertdisc.cpp
@@ -32,7 +32,7 @@
 namespace Asylum {
 
 InsertDisc::InsertDisc(AsylumEngine *engine) : _vm(engine) {
-	_handler = NULL;
+	_handler = nullptr;
 	_cdNumber = -1;
 	_frameIndex = _frameCount = 0;
 }
diff --git a/engines/asylum/views/menu.cpp b/engines/asylum/views/menu.cpp
index c2fc518532..8147bfbbba 100644
--- a/engines/asylum/views/menu.cpp
+++ b/engines/asylum/views/menu.cpp
@@ -203,7 +203,7 @@ void Menu::stopTestSounds() {
 }
 
 void Menu::adjustMasterVolume(int32 delta) const {
-	int32 *volume = NULL;
+	int32 *volume = nullptr;
 	int32 volumeIndex = 1;
 
 	do {
diff --git a/engines/asylum/views/resviewer.cpp b/engines/asylum/views/resviewer.cpp
index 0b79b7e3e9..512f0335d3 100644
--- a/engines/asylum/views/resviewer.cpp
+++ b/engines/asylum/views/resviewer.cpp
@@ -61,7 +61,7 @@ static const int resPackSizes[] = {
 };
 
 ResourceViewer::ResourceViewer(AsylumEngine *engine) : _vm(engine), _resource(_vm) {
-	_handler = NULL;
+	_handler = nullptr;
 	_resourceId = kResourceNone;
 	_frameIndex = _frameCount = 0;
 	_frameIncrement = 1;
diff --git a/engines/asylum/views/scene.cpp b/engines/asylum/views/scene.cpp
index 8b62d63e8e..b8bad08a16 100644
--- a/engines/asylum/views/scene.cpp
+++ b/engines/asylum/views/scene.cpp
@@ -57,7 +57,7 @@ int g_debugSceneRects;
 int g_debugScrolling;
 
 Scene::Scene(AsylumEngine *engine): _vm(engine),
-	_polygons(NULL), _ws(NULL) {
+	_polygons(nullptr), _ws(nullptr) {
 
 	// Initialize data
 	_packId = kResourcePackInvalid;
@@ -2155,7 +2155,7 @@ bool Scene::updateSceneCoordinates(int32 tX, int32 tY, int32 A0, bool checkScene
 		if (diffY)
 			getSharedData()->setSceneOffsetAdd((int16)Common::Rational(*coord3 * diffX, diffY).toInt());
 
-		if (param != NULL && abs(diffY) <= abs(*coord3)) {
+		if (param != nullptr && abs(diffY) <= abs(*coord3)) {
 			*targetX = -1;
 			*param = 0;
 			return true;
@@ -2166,7 +2166,7 @@ bool Scene::updateSceneCoordinates(int32 tX, int32 tY, int32 A0, bool checkScene
 
 		getSharedData()->setSceneOffsetAdd((int16)Common::Rational(*coord3 * diffY, diffX).toInt());
 
-		if (param != NULL && abs(diffX) <= abs(*coord3)) {
+		if (param != nullptr && abs(diffX) <= abs(*coord3)) {
 			*targetX = -1;
 			return true;
 		}
diff --git a/engines/asylum/views/video.cpp b/engines/asylum/views/video.cpp
index 4df557fb51..14c4b7f50c 100644
--- a/engines/asylum/views/video.cpp
+++ b/engines/asylum/views/video.cpp
@@ -252,7 +252,7 @@ void VideoPlayer::play(const Common::String &filename, bool showSubtitles) {
 
 void VideoPlayer::setupPalette() {
 	getScreen()->setMainPalette(_decoder->getPalette());
-	getScreen()->setupPalette(NULL, 0, 0);
+	getScreen()->setupPalette(nullptr, 0, 0);
 }
 
 void VideoPlayer::loadSubtitles() {
@@ -268,7 +268,7 @@ void VideoPlayer::loadSubtitles() {
 	buffer[fileSize] = 0;
 
 	char *start = strstr(buffer, movieToken);
-	char *line = 0;
+	char *line = nullptr;
 
 	if (start) {
 		start += 20; // skip token, newline and "CAPTION = "
@@ -285,19 +285,19 @@ void VideoPlayer::loadSubtitles() {
 			VideoSubtitle newSubtitle;
 			newSubtitle.frameStart = atoi(tok);
 
-			tok = strtok(NULL, " ");
+			tok = strtok(nullptr, " ");
 			if (!tok)
 				error("[Video::loadSubtitles] Invalid subtitle (frame end missing)!");
 
 			newSubtitle.frameEnd = atoi(tok);
 
-			tok = strtok(NULL, " ");
+			tok = strtok(nullptr, " ");
 			if (!tok)
 				error("[Video::loadSubtitles] Invalid subtitle (resource id missing)!");
 
 			newSubtitle.resourceId = (ResourceId)(atoi(tok) + video_subtitle_resourceIds[_currentMovie]);
 
-			tok = strtok(NULL, " ");
+			tok = strtok(nullptr, " ");
 
 			_subtitles.push_back(newSubtitle);
 		}


Commit: 91e321d334c8f86729fdce4e3ce614a05e8cdada
    https://github.com/scummvm/scummvm/commit/91e321d334c8f86729fdce4e3ce614a05e8cdada
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
AVALANCHE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/detection.cpp
    engines/avalanche/highscore.cpp


diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 95506caa9d..59712d4540 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -360,7 +360,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 
 	_totalTime += getTimeInSeconds() - _startTime;
 
-	Common::Serializer sz(NULL, f);
+	Common::Serializer sz(nullptr, f);
 	synchronize(sz);
 	f->finalize();
 	delete f;
@@ -413,7 +413,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	resetAllVariables();
 
-	Common::Serializer sz(f, NULL);
+	Common::Serializer sz(f, nullptr);
 	synchronize(sz);
 	delete f;
 
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 30f954d875..a894a841a0 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -36,12 +36,12 @@ namespace Avalanche {
 
 static const PlainGameDescriptor avalancheGames[] = {
 	{"avalanche", "Lord Avalot d'Argent"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const ADGameDescription gameDescriptions[] = {
 	{
-		"avalanche", 0,
+		"avalanche", nullptr,
 		AD_ENTRY2s("avalot.sez",	"de10eb353228013da3d3297784f81ff9", 48763,
 				   "mainmenu.avd",	"89f31211af579a872045b175cc264298", 18880),
 		Common::EN_ANY,
diff --git a/engines/avalanche/highscore.cpp b/engines/avalanche/highscore.cpp
index 17f8b4f00c..404e75ab5f 100644
--- a/engines/avalanche/highscore.cpp
+++ b/engines/avalanche/highscore.cpp
@@ -61,7 +61,7 @@ void HighScore::saveHighScores() {
 		warning("Can't create file 'scores.avd', high scores are not saved.");
 		return;
 	}
-	Common::Serializer sz(NULL, f);
+	Common::Serializer sz(nullptr, f);
 	syncHighScores(sz);
 	f->finalize();
 	delete f;
@@ -75,7 +75,7 @@ void HighScore::loadHighScroes() {
 		Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading("scores.avd");
 		if (!f)
 			return;
-		Common::Serializer sz(f, NULL);
+		Common::Serializer sz(f, nullptr);
 		syncHighScores(sz);
 		delete f;
 	}


Commit: bb4f811b1271cfc01607929697353ced9e6bf3a2
    https://github.com/scummvm/scummvm/commit/bb4f811b1271cfc01607929697353ced9e6bf3a2
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
BBVS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/bbvs/bbvs.cpp
    engines/bbvs/detection.cpp
    engines/bbvs/gamemodule.cpp
    engines/bbvs/minigames/bbairguitar.cpp
    engines/bbvs/minigames/bbant.cpp
    engines/bbvs/minigames/bbant_anims.cpp
    engines/bbvs/minigames/bbloogie.cpp
    engines/bbvs/minigames/bbtennis.cpp
    engines/bbvs/saveload.cpp
    engines/bbvs/scene.cpp
    engines/bbvs/sound.cpp
    engines/bbvs/spritemodule.cpp
    engines/bbvs/walk.cpp


diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp
index e0d9f36787..bed7c13985 100644
--- a/engines/bbvs/bbvs.cpp
+++ b/engines/bbvs/bbvs.cpp
@@ -976,7 +976,7 @@ bool BbvsEngine::performActionCommand(ActionCommand *actionCommand) {
 		{
 			SceneObject *sceneObject = &_sceneObjects[actionCommand->sceneObjectIndex];
 			if (actionCommand->param == 0) {
-				sceneObject->anim = 0;
+				sceneObject->anim = nullptr;
 				sceneObject->animIndex = 0;
 				sceneObject->frameTicks = 0;
 				sceneObject->frameIndex = 0;
@@ -1039,7 +1039,7 @@ bool BbvsEngine::processCurrAction() {
 				break;
 
 			if (actionCommand->cmd == kActionCmdMoveObject || actionCommand->cmd == kActionCmdAnimObject) {
-				SceneObjectAction *sceneObjectAction = 0;
+				SceneObjectAction *sceneObjectAction = nullptr;
 				// See if there's already an entry for the SceneObject
 				for (uint j = 0; j < _sceneObjectActions.size(); ++j)
 					if (_sceneObjectActions[j].sceneObjectIndex == actionCommand->sceneObjectIndex) {
@@ -1147,7 +1147,7 @@ void BbvsEngine::updateCommon() {
 					evalActionResults(_currAction->results);
 					if (_gameState == kGSDialog)
 						updateDialogConditions();
-					_currAction = 0;
+					_currAction = nullptr;
 					_currActionCommandTimeStamp = 0;
 					_currActionCommandIndex = -1;
 					updateSceneObjectsTurnValue();
@@ -1351,7 +1351,7 @@ bool BbvsEngine::runMinigame(int minigameNum) {
 
 	_sound->unloadSounds();
 
-	Minigame *minigame = 0;
+	Minigame *minigame = nullptr;
 
 	switch (minigameNum) {
 	case kMinigameBbLoogie:
diff --git a/engines/bbvs/detection.cpp b/engines/bbvs/detection.cpp
index 92c40ffcd6..1ad18829bb 100644
--- a/engines/bbvs/detection.cpp
+++ b/engines/bbvs/detection.cpp
@@ -27,7 +27,7 @@
 
 static const PlainGameDescriptor bbvsGames[] = {
 	{ "bbvs", "Beavis and Butt-head in Virtual Stupidity" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 namespace Bbvs {
@@ -35,7 +35,7 @@ namespace Bbvs {
 static const ADGameDescription gameDescriptions[] = {
 	{
 		"bbvs",
-		0,
+		nullptr,
 		AD_ENTRY1s("vspr0001.vnm", "7ffe9b9e7ca322db1d48e86f5130578e", 1166628),
 		Common::EN_ANY,
 		Common::kPlatformWindows,
@@ -75,7 +75,7 @@ static const ADGameDescription gameDescriptions[] = {
 
 	{
 		"bbvs",
-		0,
+		nullptr,
 		AD_ENTRY1s("vspr0001.vnm", "91c76b1048f93208cd7b1a05ebccb408", 1176976),
 		Common::RU_RUS,
 		Common::kPlatformWindows,
@@ -90,7 +90,7 @@ static const ADGameDescription gameDescriptions[] = {
 
 static const char * const directoryGlobs[] = {
 	"vnm",
-	0
+	nullptr
 };
 
 class BbvsMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/bbvs/gamemodule.cpp b/engines/bbvs/gamemodule.cpp
index b9dd2a0581..bb2e6d19b1 100644
--- a/engines/bbvs/gamemodule.cpp
+++ b/engines/bbvs/gamemodule.cpp
@@ -26,11 +26,11 @@
 namespace Bbvs {
 
 GameModule::GameModule()
-	: _bgSpriteCount(0), _bgSpriteIndices(0), _bgSpritePriorities(0), _walkRectsCount(0),
-	_walkRects(0), _sceneExitsCount(0), _sceneExits(0), _bgObjectsCount(0), _bgObjects(0),
-	_animationsCount(0), _animations(0), _sceneObjectDefsCount(0), _sceneObjectDefs(0),
-	_sceneObjectInitsCount(0), _sceneObjectInits(0), _actionsCount(0), _actions(0),
-	_sceneSoundsCount(0), _sceneSounds(0), _preloadSoundsCount(0), _preloadSounds(0) {
+	: _bgSpriteCount(0), _bgSpriteIndices(nullptr), _bgSpritePriorities(nullptr), _walkRectsCount(0),
+	_walkRects(nullptr), _sceneExitsCount(0), _sceneExits(nullptr), _bgObjectsCount(0), _bgObjects(nullptr),
+	_animationsCount(0), _animations(nullptr), _sceneObjectDefsCount(0), _sceneObjectDefs(nullptr),
+	_sceneObjectInitsCount(0), _sceneObjectInits(nullptr), _actionsCount(0), _actions(nullptr),
+	_sceneSoundsCount(0), _sceneSounds(nullptr), _preloadSoundsCount(0), _preloadSounds(nullptr) {
 }
 
 GameModule::~GameModule() {
@@ -242,17 +242,17 @@ void GameModule::unload() {
 	delete[] _actions;
 	delete[] _sceneSounds;
 	delete[] _preloadSounds;
-	_bgSpriteIndices = 0;
-	_bgSpritePriorities = 0;
-	_walkRects = 0;
-	_sceneExits = 0;
-	_bgObjects = 0;
-	_animations = 0;
-	_sceneObjectDefs = 0;
-	_sceneObjectInits = 0;
-	_actions = 0;
-	_sceneSounds = 0;
-	_preloadSounds = 0;
+	_bgSpriteIndices = nullptr;
+	_bgSpritePriorities = nullptr;
+	_walkRects = nullptr;
+	_sceneExits = nullptr;
+	_bgObjects = nullptr;
+	_animations = nullptr;
+	_sceneObjectDefs = nullptr;
+	_sceneObjectInits = nullptr;
+	_actions = nullptr;
+	_sceneSounds = nullptr;
+	_preloadSounds = nullptr;
 }
 
 void GameModule::loadBgSprites(Common::SeekableReadStream &s) {
diff --git a/engines/bbvs/minigames/bbairguitar.cpp b/engines/bbvs/minigames/bbairguitar.cpp
index 1ef427586f..28bd1e69ae 100644
--- a/engines/bbvs/minigames/bbairguitar.cpp
+++ b/engines/bbvs/minigames/bbairguitar.cpp
@@ -257,7 +257,7 @@ MinigameBbAirGuitar::Obj *MinigameBbAirGuitar::getFreeObject() {
 	for (int i = 0; i < kMaxObjectsCount; ++i)
 		if (_objects[i].kind == 0)
 			return &_objects[i];
-	return 0;
+	return nullptr;
 }
 
 void MinigameBbAirGuitar::initObjects() {
@@ -756,9 +756,9 @@ bool MinigameBbAirGuitar::run(bool fromMainGame) {
 	_btn3KindToggle = 0;
 	_currButtonNum = 27;
 	_actionStartTime = 0;
-	_currFrameIndex = 0;
-	_currPlayerButtonRect = 0;
-	_currPianoKeyArea = 0;
+	_currFrameIndex = nullptr;
+	_currPlayerButtonRect = nullptr;
+	_currPianoKeyArea = nullptr;
 	_trackCount = 0;
 	_trackIndex = 0;
 	_totalTrackLength = 0;
@@ -995,8 +995,8 @@ void MinigameBbAirGuitar::afterButtonReleased() {
 	}
 
 	_objects->frameIndex = 0;
-	_currPlayerButtonRect = 0;
-	_currPianoKeyArea = 0;
+	_currPlayerButtonRect = nullptr;
+	_currPianoKeyArea = nullptr;
 	_currButtonNum = 27;
 }
 
@@ -1217,7 +1217,7 @@ void MinigameBbAirGuitar::stopNote(int noteNum) {
 }
 
 bool MinigameBbAirGuitar::getLoadFilename(Common::String &filename) {
-	GUI::FileBrowserDialog browser(0, "air", GUI::kFBModeLoad);
+	GUI::FileBrowserDialog browser(nullptr, "air", GUI::kFBModeLoad);
 
 	if (browser.runModal() > 0) {
 		filename = browser.getResult();
@@ -1228,7 +1228,7 @@ bool MinigameBbAirGuitar::getLoadFilename(Common::String &filename) {
 }
 
 bool MinigameBbAirGuitar::getSaveFilename(Common::String &filename) {
-	GUI::FileBrowserDialog browser(0, "air", GUI::kFBModeSave);
+	GUI::FileBrowserDialog browser(nullptr, "air", GUI::kFBModeSave);
 
 	if (browser.runModal() > 0) {
 		filename = browser.getResult();
diff --git a/engines/bbvs/minigames/bbant.cpp b/engines/bbvs/minigames/bbant.cpp
index f335de8e2f..be90a3078f 100644
--- a/engines/bbvs/minigames/bbant.cpp
+++ b/engines/bbvs/minigames/bbant.cpp
@@ -179,7 +179,7 @@ MinigameBbAnt::Obj *MinigameBbAnt::getFreeObject() {
 	for (int i = 12; i < kMaxObjectsCount; ++i)
 		if (_objects[i].kind == 0)
 			return &_objects[i];
-	return 0;
+	return nullptr;
 }
 
 void MinigameBbAnt::initObjects() {
diff --git a/engines/bbvs/minigames/bbant_anims.cpp b/engines/bbvs/minigames/bbant_anims.cpp
index 09a52c76fe..9f072901d3 100644
--- a/engines/bbvs/minigames/bbant_anims.cpp
+++ b/engines/bbvs/minigames/bbant_anims.cpp
@@ -733,7 +733,7 @@ static const MinigameBbAnt::ObjInit kObjInits[] = {
 static const ObjAnimation * const kAnimationsTbl[] = {&kAnimations[0], &kAnimations[1], &kAnimations[2], &kAnimations[3], &kAnimations[4], &kAnimations[5], &kAnimations[6], &kAnimations[7], &kAnimations[16], &kAnimations[17], &kAnimations[18], &kAnimations[19], &kAnimations[20], &kAnimations[21], &kAnimations[22], &kAnimations[23], &kAnimations[24], &kAnimations[25], &kAnimations[26], &kAnimations[27], &kAnimations[28], &kAnimations[29], &kAnimations[30], &kAnimations[31], &kAnimations[32], &kAnimations[33], &kAnimations[42], &kAnimations[43], &kAnimations[44], &kAnimations[45], &kAnimations[46], &kAnimations[47], &kAnimations[48], &kAnimations[49], &kAnimations[50], &kAnimations[51], &kAnimations[52], &kAnimations[53], &kAnimations[54], &kAnimations[55], &kAnimations[56], &kAnimations[57], &kAnimations[58], &kAnimations[59], &kAnimations[68], &kAnimations[69], &kAnimations[70], &kAnimations[71], &kAnimations[72], &kAnimations[73], &kAnimations[74], &kAnimations[75], &kAnimations[76], &kAnimations[77], &kAnimations[78], &kAnimations[79], &kAnimations[80], &kAnimations[81], &kAnimations[82], &kAnimations[83], &kAnimations[84], &kAnimations[85], &kAnimations[94], &kAnimations[95], &kAnimations[96], &kAnimations[97], &kAnimations[98], &kAnimations[99], &kAnimations[100], &kAnimations[101], &kAnimations[102], &kAnimations[103], &kAnimations[104], &kAnimations[105], &kAnimations[106], &kAnimations[107], &kAnimations[108], &kAnimations[109], &kAnimations[110], &kAnimations[111], &kAnimations[120], &kAnimations[121], &kAnimations[122], &kAnimations[123], &kAnimations[124], &kAnimations[125], &kAnimations[126], &kAnimations[127], &kAnimations[128], &kAnimations[129]};
 
 static const ObjAnimation * const * const kObjKindAnimTables[] = {
-	0, &kAnimationsTbl[0],
+	nullptr, &kAnimationsTbl[0],
 	&kAnimationsTbl[18], &kAnimationsTbl[36],
 	&kAnimationsTbl[54], &kAnimationsTbl[72]
 };
diff --git a/engines/bbvs/minigames/bbloogie.cpp b/engines/bbvs/minigames/bbloogie.cpp
index e23d2b6c1c..f65813a483 100644
--- a/engines/bbvs/minigames/bbloogie.cpp
+++ b/engines/bbvs/minigames/bbloogie.cpp
@@ -241,14 +241,14 @@ MinigameBbLoogie::Obj *MinigameBbLoogie::getFreeObject() {
 	for (int i = 0; i < kMaxObjectsCount; ++i)
 		if (_objects[i].kind == 0)
 			return &_objects[i];
-	return 0;
+	return nullptr;
 }
 
 MinigameBbLoogie::Obj *MinigameBbLoogie::findLoogieObj(int startObjIndex) {
 	for (int i = startObjIndex; i < kMaxObjectsCount; ++i)
 		if (_objects[i].kind == 3)
 			return &_objects[i];
-	return 0;
+	return nullptr;
 }
 
 bool MinigameBbLoogie::isHit(Obj *obj1, Obj *obj2) {
diff --git a/engines/bbvs/minigames/bbtennis.cpp b/engines/bbvs/minigames/bbtennis.cpp
index ed4c95c794..1881f1a3f7 100644
--- a/engines/bbvs/minigames/bbtennis.cpp
+++ b/engines/bbvs/minigames/bbtennis.cpp
@@ -224,14 +224,14 @@ MinigameBbTennis::Obj *MinigameBbTennis::getFreeObject() {
 	for (int i = 0; i < kMaxObjectsCount; ++i)
 		if (_objects[i].kind == 0)
 			return &_objects[i];
-	return 0;
+	return nullptr;
 }
 
 MinigameBbTennis::Obj *MinigameBbTennis::findTennisBall(int startObjIndex) {
 	for (int i = startObjIndex; i < kMaxObjectsCount; ++i)
 		if (_objects[i].kind == 2)
 			return &_objects[i];
-	return 0;
+	return nullptr;
 }
 
 bool MinigameBbTennis::isHit(Obj *obj1, Obj *obj2) {
diff --git a/engines/bbvs/saveload.cpp b/engines/bbvs/saveload.cpp
index ab52e567a5..d36d6b2035 100644
--- a/engines/bbvs/saveload.cpp
+++ b/engines/bbvs/saveload.cpp
@@ -161,7 +161,7 @@ void BbvsEngine::loadgame(const char *filename) {
 		obj->turnTicks = in->readUint32LE();
 		obj->walkDestPt.x = in->readUint16LE();
 		obj->walkDestPt.y = in->readUint16LE();
-		obj->anim = obj->animIndex > 0 ? _gameModule->getAnimation(obj->animIndex) : 0;
+		obj->anim = obj->animIndex > 0 ? _gameModule->getAnimation(obj->animIndex) : nullptr;
 	}
 
 	updateWalkableRects();
@@ -174,7 +174,7 @@ void BbvsEngine::loadgame(const char *filename) {
 		}
 	}
 
-	_currAction = 0;
+	_currAction = nullptr;
 	_currActionCommandIndex = -1;
 
 	delete in;
diff --git a/engines/bbvs/scene.cpp b/engines/bbvs/scene.cpp
index 9dac5c55a6..4d5b52438c 100644
--- a/engines/bbvs/scene.cpp
+++ b/engines/bbvs/scene.cpp
@@ -91,12 +91,12 @@ void BbvsEngine::initScene(bool sounds) {
 	_currCameraNum = 0;
 	_walkMousePos.x = -1;
 	_walkMousePos.y = -1;
-	_currAction = 0;
+	_currAction = nullptr;
 	_currActionCommandIndex = -1;
 	_currActionCommandTimeStamp = 0;
 	_dialogSlotCount = 0;
-	_buttheadObject = 0;
-	_beavisObject = 0;
+	_buttheadObject = nullptr;
+	_beavisObject = nullptr;
 
 	memset(_backgroundSoundsActive, 0, sizeof(_backgroundSoundsActive));
 
diff --git a/engines/bbvs/sound.cpp b/engines/bbvs/sound.cpp
index a470623b7f..0cb6344b6d 100644
--- a/engines/bbvs/sound.cpp
+++ b/engines/bbvs/sound.cpp
@@ -29,7 +29,7 @@
 
 namespace Bbvs {
 
-Sound::Sound() : _stream(0) {
+Sound::Sound() : _stream(nullptr) {
 }
 
 Sound::~Sound() {
diff --git a/engines/bbvs/spritemodule.cpp b/engines/bbvs/spritemodule.cpp
index c88f905c25..22e4cd7b81 100644
--- a/engines/bbvs/spritemodule.cpp
+++ b/engines/bbvs/spritemodule.cpp
@@ -32,7 +32,7 @@ byte *Sprite::getRow(int y) {
 }
 
 SpriteModule::SpriteModule()
-	: _spritesCount(0), _paletteStart(0), _paletteCount(0), _spriteData(0), _spriteDataSize(0),
+	: _spritesCount(0), _paletteStart(0), _paletteCount(0), _spriteData(nullptr), _spriteDataSize(0),
 	_spriteTblOffs(0), _paletteOffs(0) {
 }
 
@@ -107,7 +107,7 @@ void SpriteModule::unload() {
 	_paletteStart = 0;
 	_paletteCount = 0;
 	delete[] _spriteData;
-	_spriteData = 0;
+	_spriteData = nullptr;
 }
 
 } // End of namespace Bbvs
diff --git a/engines/bbvs/walk.cpp b/engines/bbvs/walk.cpp
index ea47c24080..4adb4fcd99 100644
--- a/engines/bbvs/walk.cpp
+++ b/engines/bbvs/walk.cpp
@@ -86,7 +86,7 @@ void BbvsEngine::updateWalkObject(SceneObject *sceneObject) {
 		animIndex = sceneObject->sceneObjectDef->animIndices[kWalkTurnTbl[sceneObject->turnValue]];
 	}
 
-	Animation *anim = 0;
+	Animation *anim = nullptr;
 	if (animIndex > 0)
 		anim = _gameModule->getAnimation(animIndex);
 
@@ -97,7 +97,7 @@ void BbvsEngine::updateWalkObject(SceneObject *sceneObject) {
 			sceneObject->frameTicks = 1;
 			sceneObject->frameIndex = anim->frameCount - 1;
 		} else {
-			sceneObject->anim = 0;
+			sceneObject->anim = nullptr;
 			sceneObject->animIndex = 0;
 			sceneObject->frameTicks = 0;
 			sceneObject->frameIndex = 0;
@@ -285,7 +285,7 @@ WalkArea *BbvsEngine::getWalkAreaAtPos(const Common::Point &pt) {
 		if (walkArea->contains(pt))
 			return walkArea;
 	}
-	return 0;
+	return nullptr;
 }
 
 bool BbvsEngine::canButtheadWalkToDest(const Common::Point &destPt) {


Commit: 6965dd663e7179f9bb8b5c89ce668ff6769478a1
    https://github.com/scummvm/scummvm/commit/6965dd663e7179f9bb8b5c89ce668ff6769478a1
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
BLADERUNNER: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/bladerunner/debugger.cpp
    engines/bladerunner/detection.cpp
    engines/bladerunner/ui/kia_log.cpp


diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp
index c695d3d3ba..62df180180 100644
--- a/engines/bladerunner/debugger.cpp
+++ b/engines/bladerunner/debugger.cpp
@@ -748,7 +748,7 @@ const struct SceneList {
 	{ 4, "UG12", 84, 96 },   { 4, "UG13", 85, 97 },  { 4, "UG14", 86, 98 },   { 4, "UG15", 87, 99 },
 	{ 4, "UG16", 16, 100 },  { 4, "UG17", 88, 101 }, { 4, "UG18", 89, 102 },  { 4, "UG19", 90, 103 },
 
-	{ 0, NULL, 0, 0 }
+	{ 0, nullptr, 0, 0 }
 };
 
 // Auxialliary method to validate chapter, set and scene combination
@@ -1136,7 +1136,7 @@ const struct OverlayAndScenesVQAsList {
 	{ 6, "VKKASH", true },   { 6, "PS02ELEV", false },{ 6, "ESPER", false },   { 6, "VKDEKT", true },   { 6, "MA06ELEV", false },
 	{ 6, "VKBOB", true },    { 6, "SCORE", false },
 
-	{ 0, NULL, false }
+	{ 0, nullptr, false }
 };
 
 /**
diff --git a/engines/bladerunner/detection.cpp b/engines/bladerunner/detection.cpp
index 4f0230cf55..f09c6116df 100644
--- a/engines/bladerunner/detection.cpp
+++ b/engines/bladerunner/detection.cpp
@@ -43,7 +43,7 @@ namespace BladeRunner {
 static const PlainGameDescriptor bladeRunnerGames[] = {
 	{"bladerunner", "Blade Runner"},
 	{"bladerunner-final", "Blade Runner with restored content"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const ADExtraGuiOptionsMap optionsList[] = {
diff --git a/engines/bladerunner/ui/kia_log.cpp b/engines/bladerunner/ui/kia_log.cpp
index 7f75f2e944..31c01961d2 100644
--- a/engines/bladerunner/ui/kia_log.cpp
+++ b/engines/bladerunner/ui/kia_log.cpp
@@ -94,7 +94,7 @@ void KIALog::clearFuture() {
 	while (currentIndex != _firstIndex) {
 		if (_entries[currentIndex].data) {
 			delete[] _entries[currentIndex].data;
-			_entries[currentIndex].data = 0;
+			_entries[currentIndex].data = nullptr;
 			_entries[currentIndex].dataSize = 0;
 		}
 		currentIndex = (currentIndex + 1) % kSize;


Commit: 369eae5f3558eab86019493fd13eb353a14ec361
    https://github.com/scummvm/scummvm/commit/369eae5f3558eab86019493fd13eb353a14ec361
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
BURIED: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/buried/biochip_right.cpp
    engines/buried/biochip_view.cpp
    engines/buried/buried.cpp
    engines/buried/complete.cpp
    engines/buried/console.cpp
    engines/buried/demo/movie_scene.cpp
    engines/buried/detection.cpp
    engines/buried/frame_window.cpp
    engines/buried/gameui.cpp
    engines/buried/graphics.cpp
    engines/buried/inventory_info.cpp
    engines/buried/inventory_window.cpp
    engines/buried/main_menu.cpp
    engines/buried/saveload.cpp
    engines/buried/scene_view.cpp
    engines/buried/sound.cpp
    engines/buried/title_sequence.cpp
    engines/buried/video_window.cpp


diff --git a/engines/buried/biochip_right.cpp b/engines/buried/biochip_right.cpp
index ac096359df..3d47f52190 100644
--- a/engines/buried/biochip_right.cpp
+++ b/engines/buried/biochip_right.cpp
@@ -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");
 				}
diff --git a/engines/buried/biochip_view.cpp b/engines/buried/biochip_view.cpp
index dcd8cf1b0c..0fd503df44 100644
--- a/engines/buried/biochip_view.cpp
+++ b/engines/buried/biochip_view.cpp
@@ -784,7 +784,7 @@ Window *BioChipMainViewWindow::createBioChipSpecificViewWindow(int bioChipID) {
 	}
 
 	// No entry for this BioChip
-	return 0;
+	return nullptr;
 }
 
 } // End of namespace Buried
diff --git a/engines/buried/buried.cpp b/engines/buried/buried.cpp
index ab23ae2f73..d950986321 100644
--- a/engines/buried/buried.cpp
+++ b/engines/buried/buried.cpp
@@ -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;
diff --git a/engines/buried/complete.cpp b/engines/buried/complete.cpp
index 07f46d0cd7..15efbdc24a 100644
--- a/engines/buried/complete.cpp
+++ b/engines/buried/complete.cpp
@@ -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();
diff --git a/engines/buried/console.cpp b/engines/buried/console.cpp
index 7f9bb574d4..6b2ca04adb 100644
--- a/engines/buried/console.cpp
+++ b/engines/buried/console.cpp
@@ -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;
diff --git a/engines/buried/demo/movie_scene.cpp b/engines/buried/demo/movie_scene.cpp
index e6e60a90f6..1f16fc568f 100644
--- a/engines/buried/demo/movie_scene.cpp
+++ b/engines/buried/demo/movie_scene.cpp
@@ -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;
diff --git a/engines/buried/detection.cpp b/engines/buried/detection.cpp
index 3fa7bab801..99845a42a1 100644
--- a/engines/buried/detection.cpp
+++ b/engines/buried/detection.cpp
@@ -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
diff --git a/engines/buried/frame_window.cpp b/engines/buried/frame_window.cpp
index 5914bc1fd5..c4d6cdb125 100644
--- a/engines/buried/frame_window.cpp
+++ b/engines/buried/frame_window.cpp
@@ -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);
 
diff --git a/engines/buried/gameui.cpp b/engines/buried/gameui.cpp
index 6a35abf325..b52f73c14f 100644
--- a/engines/buried/gameui.cpp
+++ b/engines/buried/gameui.cpp
@@ -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();
diff --git a/engines/buried/graphics.cpp b/engines/buried/graphics.cpp
index 34776dcc10..833befb03a 100644
--- a/engines/buried/graphics.cpp
+++ b/engines/buried/graphics.cpp
@@ -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;
diff --git a/engines/buried/inventory_info.cpp b/engines/buried/inventory_info.cpp
index ef142b9939..f561ab7296 100644
--- a/engines/buried/inventory_info.cpp
+++ b/engines/buried/inventory_info.cpp
@@ -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);
diff --git a/engines/buried/inventory_window.cpp b/engines/buried/inventory_window.cpp
index 1b131e656b..2c665e5372 100644
--- a/engines/buried/inventory_window.cpp
+++ b/engines/buried/inventory_window.cpp
@@ -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;
 	}
 }
 
diff --git a/engines/buried/main_menu.cpp b/engines/buried/main_menu.cpp
index fa2bcf5c45..b736967d64 100644
--- a/engines/buried/main_menu.cpp
+++ b/engines/buried/main_menu.cpp
@@ -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();
diff --git a/engines/buried/saveload.cpp b/engines/buried/saveload.cpp
index 1c5304b238..15a7bfad4b 100644
--- a/engines/buried/saveload.cpp
+++ b/engines/buried/saveload.cpp
@@ -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;
diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index 8e19415d59..e45ab6fb7a 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -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;
 	}
diff --git a/engines/buried/sound.cpp b/engines/buried/sound.cpp
index fa5b593e86..9ac4b7f96a 100644
--- a/engines/buried/sound.cpp
+++ b/engines/buried/sound.cpp
@@ -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() {
diff --git a/engines/buried/title_sequence.cpp b/engines/buried/title_sequence.cpp
index b67e8a5479..6043038995 100644
--- a/engines/buried/title_sequence.cpp
+++ b/engines/buried/title_sequence.cpp
@@ -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();
diff --git a/engines/buried/video_window.cpp b/engines/buried/video_window.cpp
index 2054f718bc..1e1cde0998 100644
--- a/engines/buried/video_window.cpp
+++ b/engines/buried/video_window.cpp
@@ -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;


Commit: 69f45d92584b626a6f0fb487d8623cf44e85dfc8
    https://github.com/scummvm/scummvm/commit/69f45d92584b626a6f0fb487d8623cf44e85dfc8
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
CGE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/cge/bitmap.cpp
    engines/cge/cge_main.cpp
    engines/cge/detection.cpp
    engines/cge/events.cpp
    engines/cge/snail.cpp
    engines/cge/sound.cpp
    engines/cge/talk.cpp
    engines/cge/text.cpp
    engines/cge/vga13h.cpp
    engines/cge/vmenu.cpp
    engines/cge/walk.cpp


diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp
index 3b700613c9..bff536dd51 100644
--- a/engines/cge/bitmap.cpp
+++ b/engines/cge/bitmap.cpp
@@ -34,7 +34,7 @@
 
 namespace CGE {
 
-Bitmap::Bitmap(CGEEngine *vm, const char *fname) : _m(NULL), _v(NULL), _map(0), _vm(vm) {
+Bitmap::Bitmap(CGEEngine *vm, const char *fname) : _m(nullptr), _v(nullptr), _map(0), _vm(vm) {
 	debugC(1, kCGEDebugBitmap, "Bitmap::Bitmap(%s)", fname);
 
 	char pat[kMaxPath];
@@ -51,7 +51,7 @@ Bitmap::Bitmap(CGEEngine *vm, const char *fname) : _m(NULL), _v(NULL), _map(0),
 	}
 }
 
-Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 *map) : _w(w), _h(h), _m(map), _v(NULL), _map(0), _b(NULL), _vm(vm) {
+Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 *map) : _w(w), _h(h), _m(map), _v(nullptr), _map(0), _b(nullptr), _vm(vm) {
 	debugC(1, kCGEDebugBitmap, "Bitmap::Bitmap(%d, %d, map)", w, h);
 	if (map)
 		code();
@@ -62,7 +62,7 @@ Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 *map) : _w(w), _h(h), _m
 // especially for text line real time display
 Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 fill)
 	: _w((w + 3) & ~3),                              // only full uint32 allowed!
-	  _h(h), _m(NULL), _map(0), _b(NULL), _vm(vm) {
+	  _h(h), _m(nullptr), _map(0), _b(nullptr), _vm(vm) {
 	debugC(1, kCGEDebugBitmap, "Bitmap::Bitmap(%d, %d, %d)", w, h, fill);
 
 	uint16 dsiz = _w >> 2;                           // data size (1 plane line size)
@@ -70,7 +70,7 @@ Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 fill)
 	uint16 psiz = _h * lsiz;                         // - last gape, but + plane trailer
 	uint8 *v = new uint8[4 * psiz + _h * sizeof(*_b)];// the same for 4 planes
 	                                                // + room for wash table
-	assert(v != NULL);
+	assert(v != nullptr);
 
 	WRITE_LE_UINT16(v, (kBmpCPY | dsiz));                 // data chunk hader
 	memset(v + 2, fill, dsiz);                      // data bytes
@@ -100,7 +100,7 @@ Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 fill)
 	_b = b;
 }
 
-Bitmap::Bitmap(CGEEngine *vm, const Bitmap &bmp) : _w(bmp._w), _h(bmp._h), _m(NULL), _v(NULL), _map(0), _b(NULL), _vm(vm) {
+Bitmap::Bitmap(CGEEngine *vm, const Bitmap &bmp) : _w(bmp._w), _h(bmp._h), _m(nullptr), _v(nullptr), _map(0), _b(nullptr), _vm(vm) {
 	debugC(1, kCGEDebugBitmap, "Bitmap::Bitmap(bmp)");
 	uint8 *v0 = bmp._v;
 	if (!v0)
@@ -109,7 +109,7 @@ Bitmap::Bitmap(CGEEngine *vm, const Bitmap &bmp) : _w(bmp._w), _h(bmp._h), _m(NU
 	uint16 vsiz = (uint8 *)(bmp._b) - (uint8 *)(v0);
 	uint16 siz = vsiz + _h * sizeof(HideDesc);
 	uint8 *v1 = new uint8[siz];
-	assert(v1 != NULL);
+	assert(v1 != nullptr);
 	memcpy(v1, v0, siz);
 	_b = (HideDesc *)((_v = v1) + vsiz);
 }
@@ -129,18 +129,18 @@ Bitmap &Bitmap::operator=(const Bitmap &bmp) {
 	uint8 *v0 = bmp._v;
 	_w = bmp._w;
 	_h = bmp._h;
-	_m = NULL;
+	_m = nullptr;
 	_map = 0;
 	_vm = bmp._vm;
 	delete[] _v;
 
-	if (v0 == NULL) {
-		_v = NULL;
+	if (v0 == nullptr) {
+		_v = nullptr;
 	} else {
 		uint16 vsiz = (uint8 *)bmp._b - (uint8 *)v0;
 		uint16 siz = vsiz + _h * sizeof(HideDesc);
 		uint8 *v1 = new uint8[siz];
-		assert(v1 != NULL);
+		assert(v1 != nullptr);
 		memcpy(v1, v0, siz);
 		_b = (HideDesc *)((_v = v1) + vsiz);
 	}
@@ -161,13 +161,13 @@ BitmapPtr Bitmap::code() {
 	debugC(1, kCGEDebugBitmap, "Bitmap::code()");
 
 	if (!_m)
-		return NULL;
+		return nullptr;
 
 	uint16 cnt;
 
 	if (_v) {                                        // old X-map exists, so remove it
 		delete[] _v;
-		_v = NULL;
+		_v = nullptr;
 	}
 
 	while (true) {                                  // at most 2 times: for (V == NULL) & for allocated block;
@@ -250,7 +250,7 @@ BitmapPtr Bitmap::code() {
 
 		uint16 sizV = (uint16)(im - 2 - _v);
 		_v = new uint8[sizV + _h * sizeof(*_b)];
-		assert(_v != NULL);
+		assert(_v != nullptr);
 
 		_b = (HideDesc *)(_v + sizV);
 	}
@@ -373,7 +373,7 @@ bool Bitmap::loadVBM(EncryptedStream *f) {
 				f->seek(f->pos() + kPalSize);
 		}
 	}
-	if ((_v = new uint8[n]) == NULL)
+	if ((_v = new uint8[n]) == nullptr)
 		return false;
 
 	if (!f->err())
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index f065234f84..9e7b90600c 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -247,7 +247,7 @@ bool CGEEngine::loadGame(int slotNumber, SavegameHeader *header, bool tiny) {
 	}
 
 	// Get in the savegame
-	syncGame(readStream, NULL, tiny);
+	syncGame(readStream, nullptr, tiny);
 
 	delete readStream;
 	return true;
@@ -260,7 +260,7 @@ bool CGEEngine::savegameExists(int slotNumber) {
 	Common::String slotName = getSaveStateName(slotNumber);
 
 	Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(slotName);
-	bool result = saveFile != NULL;
+	bool result = saveFile != nullptr;
 	delete saveFile;
 	return result;
 }
@@ -276,7 +276,7 @@ Common::Error CGEEngine::loadGameState(int slot) {
 		_midiPlayer->killMidi();
 
 	// Load the game
-	loadGame(slot, NULL);
+	loadGame(slot, nullptr);
 	_commandHandler->addCommand(kCmdLevel, -1, _oldLev, &_sceneLight);
 	_sceneLight->gotoxy(kSceneX + ((_now - 1) % kSceneNx) * kSceneDx + kSceneSX,
 	                  kSceneY + ((_now - 1) / kSceneNx) * kSceneDy + kSceneSY);
@@ -325,7 +325,7 @@ void CGEEngine::saveGame(int slotNumber, const Common::String &desc) {
 	writeSavegameHeader(saveFile, header);
 
 	// Write out the data of the savegame
-	syncGame(NULL, saveFile, false);
+	syncGame(nullptr, saveFile, false);
 
 	// Finish writing out game data
 	saveFile->finalize();
@@ -397,20 +397,20 @@ void CGEEngine::syncGame(Common::SeekableReadStream *readStream, Common::WriteSt
 
 		if (!tiny) { // load sprites & pocket
 			while (readStream->pos() < readStream->size()) {
-				Sprite S(this, NULL);
+				Sprite S(this, nullptr);
 				S.sync(s);
 
-				S._prev = S._next = NULL;
-				Sprite *spr = (scumm_stricmp(S._file + 2, "MUCHA") == 0) ? new Fly(this, NULL)
-					  : new Sprite(this, NULL);
-				assert(spr != NULL);
+				S._prev = S._next = nullptr;
+				Sprite *spr = (scumm_stricmp(S._file + 2, "MUCHA") == 0) ? new Fly(this, nullptr)
+					  : new Sprite(this, nullptr);
+				assert(spr != nullptr);
 				*spr = S;
 				_vga->_spareQ->append(spr);
 			}
 
 			for (int i = 0; i < kPocketNX; i++) {
 				int r = _pocref[i];
-				_pocket[i] = (r < 0) ? NULL : _vga->_spareQ->locate(r);
+				_pocket[i] = (r < 0) ? nullptr : _vga->_spareQ->locate(r);
 			}
 		}
 	}
@@ -459,7 +459,7 @@ WARN_UNUSED_RESULT bool CGEEngine::readSavegameHeader(Common::InSaveFile *in, Sa
 void CGEEngine::heroCover(int cvr) {
 	debugC(1, kCGEDebugEngine, "CGEEngine::heroCover(%d)", cvr);
 
-	_commandHandler->addCommand(kCmdCover, 1, cvr, NULL);
+	_commandHandler->addCommand(kCmdCover, 1, cvr, nullptr);
 }
 
 void CGEEngine::trouble(int seq, int text) {
@@ -524,13 +524,13 @@ void CGEEngine::loadMapping() {
 	}
 }
 
-Square::Square(CGEEngine *vm) : Sprite(vm, NULL), _vm(vm) {
+Square::Square(CGEEngine *vm) : Sprite(vm, nullptr), _vm(vm) {
 	_flags._kill = true;
 	_flags._bDel = false;
 
 	BitmapPtr *MB = new BitmapPtr[2];
 	MB[0] = new Bitmap(_vm, "BRICK");
-	MB[1] = NULL;
+	MB[1] = nullptr;
 	setShapeList(MB);
 }
 
@@ -557,13 +557,13 @@ void CGEEngine::setMapBrick(int x, int z) {
 void CGEEngine::keyClick() {
 	debugC(1, kCGEDebugEngine, "CGEEngine::keyClick()");
 
-	_commandHandlerTurbo->addCommand(kCmdSound, -1, 5, NULL);
+	_commandHandlerTurbo->addCommand(kCmdSound, -1, 5, nullptr);
 }
 
 void CGEEngine::resetQSwitch() {
 	debugC(1, kCGEDebugEngine, "CGEEngine::resetQSwitch()");
 
-	_commandHandlerTurbo->addCommand(kCmdSeq, 123,  0, NULL);
+	_commandHandlerTurbo->addCommand(kCmdSeq, 123,  0, nullptr);
 	keyClick();
 }
 
@@ -571,9 +571,9 @@ void CGEEngine::quit() {
 	debugC(1, kCGEDebugEngine, "CGEEngine::quit()");
 
 	static Choice QuitMenu[] = {
-		{ NULL, &CGEEngine::startCountDown },
-		{ NULL, &CGEEngine::resetQSwitch   },
-		{ NULL, &CGEEngine::dummy          }
+		{ nullptr, &CGEEngine::startCountDown },
+		{ nullptr, &CGEEngine::resetQSwitch   },
+		{ nullptr, &CGEEngine::dummy          }
 	};
 
 	if (_commandHandler->idle() && !_hero->_flags._hide) {
@@ -584,7 +584,7 @@ void CGEEngine::quit() {
 			QuitMenu[0]._text = _text->getText(kQuit);
 			QuitMenu[1]._text = _text->getText(kNoQuit);
 			(new Vmenu(this, QuitMenu, -1, -1))->setName(_text->getText(kQuitTitle));
-			_commandHandlerTurbo->addCommand(kCmdSeq, 123, 1, NULL);
+			_commandHandlerTurbo->addCommand(kCmdSeq, 123, 1, nullptr);
 			keyClick();
 		}
 	}
@@ -617,7 +617,7 @@ void CGEEngine::showBak(int ref) {
 
 	_bitmapPalette = _vga->_sysPal;
 	spr->expand();
-	_bitmapPalette = NULL;
+	_bitmapPalette = nullptr;
 	spr->show(2);
 	_vga->copyPage(1, 2);
 	_sys->setPal();
@@ -731,7 +731,7 @@ void CGEEngine::switchScene(int newScene) {
 		return;
 
 	if (newScene < 0) {
-		_commandHandler->addCommand(kCmdLabel, -1, 0, NULL);  // wait for repaint
+		_commandHandler->addCommand(kCmdLabel, -1, 0, nullptr);  // wait for repaint
 		_commandHandler->addCallback(kCmdExec,  -1, 0, kQGame); // quit game
 	} else {
 		_now = newScene;
@@ -746,13 +746,13 @@ void CGEEngine::switchScene(int newScene) {
 		killText();
 		if (!_startupMode)
 			keyClick();
-		_commandHandler->addCommand(kCmdLabel, -1, 0, NULL);  // wait for repaint
+		_commandHandler->addCommand(kCmdLabel, -1, 0, nullptr);  // wait for repaint
 		_commandHandler->addCallback(kCmdExec,  0, 0, kXScene); // switch scene
 
 	}
 }
 
-System::System(CGEEngine *vm) : Sprite(vm, NULL), _vm(vm) {
+System::System(CGEEngine *vm) : Sprite(vm, nullptr), _vm(vm) {
 	_funDel = kHeroFun0;
 	setPal();
 	tick();
@@ -769,7 +769,7 @@ void System::setPal() {
 
 void System::funTouch() {
 	uint16 n = (_vm->_flag[0]) ? kHeroFun1 : kHeroFun0; // PAIN flag
-	if (_vm->_talk == NULL || n > _funDel)
+	if (_vm->_talk == nullptr || n > _funDel)
 		_funDel = n;
 }
 
@@ -782,7 +782,7 @@ void System::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) {
 			// The sound is uselessly annoying and noisy, so it has been removed
 			_vm->killText();
 			if (_vm->_startupMode == 1) {
-				_vm->_commandHandler->addCommand(kCmdClear, -1, 0, NULL);
+				_vm->_commandHandler->addCommand(kCmdClear, -1, 0, nullptr);
 				return;
 			}
 		}
@@ -790,7 +790,7 @@ void System::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) {
 		if (_vm->_startupMode)
 			return;
 		int selectedScene = 0;
-		_vm->_infoLine->update(NULL);
+		_vm->_infoLine->update(nullptr);
 		if (y >= kWorldHeight ) {
 			if (x < kButtonX) {                           // select scene?
 				if (y >= kSceneY && y < kSceneY + kSceneNy * kSceneDy &&
@@ -864,7 +864,7 @@ void System::tick() {
 void CGEEngine::switchColorMode() {
 	debugC(1, kCGEDebugEngine, "CGEEngine::switchColorMode()");
 
-	_commandHandlerTurbo->addCommand(kCmdSeq, 121, _vga->_mono = !_vga->_mono, NULL);
+	_commandHandlerTurbo->addCommand(kCmdSeq, 121, _vga->_mono = !_vga->_mono, nullptr);
 	keyClick();
 	_vga->setColors(_vga->_sysPal, 64);
 }
@@ -875,7 +875,7 @@ void CGEEngine::switchColorMode() {
 void CGEEngine::switchMusic() {
 	debugC(1, kCGEDebugEngine, "CGEEngine::switchMusic()");
 
-	_commandHandlerTurbo->addCommand(kCmdSeq, 122, (_music = !_music), NULL);
+	_commandHandlerTurbo->addCommand(kCmdSeq, 122, (_music = !_music), nullptr);
 	keyClick();
 
 	if (_music)
@@ -918,7 +918,7 @@ void CGEEngine::killSprite() {
 	_sprite->_flags._kill = true;
 	_sprite->_flags._bDel = true;
 	_commandHandlerTurbo->addCommand(kCmdKill, -1, 0, _sprite);
-	_sprite = NULL;
+	_sprite = nullptr;
 }
 
 void CGEEngine::optionTouch(int opt, uint16 mask) {
@@ -969,7 +969,7 @@ void Sprite::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) {
 		}
 
 	if ((mask & kMouseRightUp) && _vm->_commandHandler->idle()) {
-		Sprite *ps = (_vm->_pocLight->_seqPtr) ? _vm->_pocket[_vm->_pocPtr] : NULL;
+		Sprite *ps = (_vm->_pocLight->_seqPtr) ? _vm->_pocket[_vm->_pocPtr] : nullptr;
 		if (ps) {
 			if (_flags._kept || _vm->_hero->distance(this) < kDistMax) {
 				if (works(ps)) {
@@ -985,7 +985,7 @@ void Sprite::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) {
 			} else {
 				if (_vm->_hero->distance(this) < kDistMax) {
 					if (_flags._port) {
-						if (_vm->findPocket(NULL) < 0) {
+						if (_vm->findPocket(nullptr) < 0) {
 							_vm->pocFul();
 						} else {
 							_vm->_commandHandler->addCommand(kCmdReach, -1, -1, this);
@@ -1028,10 +1028,10 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i
 	                              "Left", "Right", "Top", "Bottom",
 	                              "Seq", "Near", "Take",
 	                              "Portable", "Transparent",
-	                              NULL
+	                              nullptr
 	                            };
 	static const char *Type[] = { "DEAD", "AUTO", "WALK", "NEWTON", "LISSAJOUS",
-	                              "FLY", NULL
+	                              "FLY", nullptr
 	                            };
 
 	int shpcnt = 0;
@@ -1067,20 +1067,20 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i
 			case 0: // Name - will be taken in Expand routine
 				break;
 			case 1: // Type
-				if ((type = takeEnum(Type, strtok(NULL, " \t,;/"))) < 0)
+				if ((type = takeEnum(Type, strtok(nullptr, " \t,;/"))) < 0)
 					error("Bad line %d [%s]", lcnt, fname);
 				break;
 			case 2: // Phase
 				shpcnt++;
 				break;
 			case 3: // East
-				east = (atoi(strtok(NULL, " \t,;/")) != 0);
+				east = (atoi(strtok(nullptr, " \t,;/")) != 0);
 				break;
 			case 11: // Portable
-				port = (atoi(strtok(NULL, " \t,;/")) != 0);
+				port = (atoi(strtok(nullptr, " \t,;/")) != 0);
 				break;
 			case 12: // Transparent
-				tran = (atoi(strtok(NULL, " \t,;/")) != 0);
+				tran = (atoi(strtok(nullptr, " \t,;/")) != 0);
 				break;
 			}
 		}
@@ -1095,14 +1095,14 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i
 	switch (type) {
 	case 1:
 		// AUTO
-		_sprite = new Sprite(this, NULL);
+		_sprite = new Sprite(this, nullptr);
 		if (_sprite) {
 			_sprite->gotoxy(col, row);
 		}
 		break;
 	case 2:
 		{ // WALK
-		Walk *w = new Walk(this, NULL);
+		Walk *w = new Walk(this, nullptr);
 		if (w && ref == 1) {
 			w->gotoxy(col, row);
 			if (_hero)
@@ -1118,13 +1118,13 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i
 		break;
 	case 5:
 		{ // FLY
-		Fly *f = new Fly(this, NULL);
+		Fly *f = new Fly(this, nullptr);
 		_sprite = f;
 		break;
 		}
 	default:
 		// DEAD
-		_sprite = new Sprite(this, NULL);
+		_sprite = new Sprite(this, nullptr);
 		if (_sprite)
 			_sprite->gotoxy(col, row);
 		break;
@@ -1174,43 +1174,43 @@ void CGEEngine::loadScript(const char *fname) {
 		ok = false;   // not OK if break
 
 		// sprite ident number
-		if ((p = strtok(tmpStr, " \t\n")) == NULL)
+		if ((p = strtok(tmpStr, " \t\n")) == nullptr)
 			break;
 		int SpI = atoi(p);
 
 		// sprite file name
 		char *SpN;
-		if ((SpN = strtok(NULL, " ,;/\t\n")) == NULL)
+		if ((SpN = strtok(nullptr, " ,;/\t\n")) == nullptr)
 			break;
 
 		// sprite scene
-		if ((p = strtok(NULL, " ,;/\t\n")) == NULL)
+		if ((p = strtok(nullptr, " ,;/\t\n")) == nullptr)
 			break;
 		int SpA = atoi(p);
 
 		// sprite column
-		if ((p = strtok(NULL, " ,;/\t\n")) == NULL)
+		if ((p = strtok(nullptr, " ,;/\t\n")) == nullptr)
 			break;
 		int SpX = atoi(p);
 
 		// sprite row
-		if ((p = strtok(NULL, " ,;/\t\n")) == NULL)
+		if ((p = strtok(nullptr, " ,;/\t\n")) == nullptr)
 			break;
 		int SpY = atoi(p);
 
 		// sprite Z pos
-		if ((p = strtok(NULL, " ,;/\t\n")) == NULL)
+		if ((p = strtok(nullptr, " ,;/\t\n")) == nullptr)
 			break;
 		int SpZ = atoi(p);
 
 		// sprite life
-		if ((p = strtok(NULL, " ,;/\t\n")) == NULL)
+		if ((p = strtok(nullptr, " ,;/\t\n")) == nullptr)
 			break;
 		bool BkG = atoi(p) == 0;
 
 		ok = true;    // no break: OK
 
-		_sprite = NULL;
+		_sprite = nullptr;
 		loadSprite(SpN, SpI, SpA, SpX, SpY, SpZ);
 		if (_sprite && BkG)
 			_sprite->_flags._back = true;
@@ -1226,7 +1226,7 @@ Sprite *CGEEngine::locate(int ref) {
 }
 
 Sprite *CGEEngine::spriteAt(int x, int y) {
-	Sprite *spr = NULL, * tail = _vga->_showQ->last();
+	Sprite *spr = nullptr, * tail = _vga->_showQ->last();
 	if (tail) {
 		for (spr = tail->_prev; spr; spr = spr->_prev) {
 			if (! spr->_flags._hide && ! spr->_flags._tran) {
@@ -1253,7 +1253,7 @@ void CGEEngine::killText() {
 		return;
 
 	_commandHandlerTurbo->addCommand(kCmdKill, -1, 0, _talk);
-	_talk = NULL;
+	_talk = nullptr;
 }
 
 void CGEEngine::mainLoop() {
@@ -1312,10 +1312,10 @@ void CGEEngine::loadUser() {
 	// set scene
 	if (_mode == 0) {
 		// user .SVG file found - load it from slot 0
-		loadGame(0, NULL);
+		loadGame(0, nullptr);
 	} else if (_mode == 1) {
 		// Load either initial game state savegame or launcher specified savegame
-		loadGame(_startGameSlot, NULL);
+		loadGame(_startGameSlot, nullptr);
 	} else {
 		error("Creating setup savegames not supported");
 	}
@@ -1355,9 +1355,9 @@ void CGEEngine::runGame() {
 
 	loadUser();
 
-	if ((_sprite = _vga->_spareQ->locate(121)) != NULL)
+	if ((_sprite = _vga->_spareQ->locate(121)) != nullptr)
 		_commandHandlerTurbo->addCommand(kCmdSeq, -1, _vga->_mono, _sprite);
-	if ((_sprite = _vga->_spareQ->locate(122)) != NULL)
+	if ((_sprite = _vga->_spareQ->locate(122)) != nullptr)
 		_sprite->step(_music);
 	_commandHandlerTurbo->addCommand(kCmdSeq, -1, _music, _sprite);
 	if (!_music)
@@ -1365,7 +1365,7 @@ void CGEEngine::runGame() {
 
 	if (_resman->exist("MINI.SPR")) {
 		_miniShp = new BitmapPtr[2];
-		_miniShp[0] = _miniShp[1] = NULL;
+		_miniShp[0] = _miniShp[1] = nullptr;
 
 		loadSprite("MINI", -1, 0, kMiniX, kMiniY);
 		expandSprite(_miniScene = _sprite);  // NULL is ok
@@ -1384,7 +1384,7 @@ void CGEEngine::runGame() {
 		if (_resman->exist("00SHADOW.SPR")) {
 			loadSprite("00SHADOW", -1, 0, _hero->_x + 14, _hero->_y + 51);
 			delete _shadow;
-			if ((_shadow = _sprite) != NULL) {
+			if ((_shadow = _sprite) != nullptr) {
 				_shadow->_ref = 2;
 				_shadow->_flags._tran = true;
 				_shadow->_flags._kill = false;
@@ -1396,7 +1396,7 @@ void CGEEngine::runGame() {
 
 	_infoLine->gotoxy(kInfoX, kInfoY);
 	_infoLine->_flags._tran = true;
-	_infoLine->update(NULL);
+	_infoLine->update(nullptr);
 	_vga->_showQ->insert(_infoLine);
 
 	_debugLine->_z = 126;
@@ -1431,14 +1431,14 @@ void CGEEngine::runGame() {
 	if (!_endGame && canSaveGameStateCurrently())
 		qGame();
 
-	_keyboard->setClient(NULL);
-	_commandHandler->addCommand(kCmdClear, -1, 0, NULL);
-	_commandHandlerTurbo->addCommand(kCmdClear, -1, 0, NULL);
+	_keyboard->setClient(nullptr);
+	_commandHandler->addCommand(kCmdClear, -1, 0, nullptr);
+	_commandHandlerTurbo->addCommand(kCmdClear, -1, 0, nullptr);
 	_mouse->off();
 	_vga->_showQ->clear();
 	_vga->_spareQ->clear();
-	_hero = NULL;
-	_shadow = NULL;
+	_hero = nullptr;
+	_shadow = nullptr;
 }
 
 void CGEEngine::movie(const char *ext) {
@@ -1459,9 +1459,9 @@ void CGEEngine::movie(const char *ext) {
 		while (!_commandHandler->idle() && !_quitFlag)
 			mainLoop();
 
-		_keyboard->setClient(NULL);
-		_commandHandler->addCommand(kCmdClear, -1, 0, NULL);
-		_commandHandlerTurbo->addCommand(kCmdClear, -1, 0, NULL);
+		_keyboard->setClient(nullptr);
+		_commandHandler->addCommand(kCmdClear, -1, 0, nullptr);
+		_commandHandlerTurbo->addCommand(kCmdClear, -1, 0, nullptr);
 		_vga->_showQ->clear();
 		_vga->_spareQ->clear();
 	}
@@ -1474,8 +1474,8 @@ bool CGEEngine::showTitle(const char *name) {
 	_bitmapPalette = _vga->_sysPal;
 	BitmapPtr *LB = new BitmapPtr[2];
 	LB[0] = new Bitmap(this, name);
-	LB[1] = NULL;
-	_bitmapPalette = NULL;
+	LB[1] = nullptr;
+	_bitmapPalette = nullptr;
 
 	Sprite D(this, LB);
 	D._flags._kill = true;
diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp
index c144308a29..5c27c2a8b2 100644
--- a/engines/cge/detection.cpp
+++ b/engines/cge/detection.cpp
@@ -43,7 +43,7 @@ namespace CGE {
 
 static const PlainGameDescriptor CGEGames[] = {
 	{ "soltys", "Soltys" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const ADGameDescription gameDescriptions[] = {
@@ -160,7 +160,7 @@ public:
 static ADGameDescription s_fallbackDesc = {
 	"soltys",
 	"Unknown version",
-	AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
+	AD_ENTRY1(nullptr, nullptr), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
 	Common::UNK_LANG,
 	Common::kPlatformDOS,
 	ADGF_NO_FLAGS,
@@ -168,8 +168,8 @@ static ADGameDescription s_fallbackDesc = {
 };
 
 static const ADFileBasedFallback fileBasedFallback[] = {
-	{ &s_fallbackDesc, { "vol.cat", "vol.dat", 0 } },
-	{ 0, { 0 } }
+	{ &s_fallbackDesc, { "vol.cat", "vol.dat", nullptr } },
+	{ nullptr, { nullptr } }
 };
 
 ADDetectedGame CGEMetaEngineDetection::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist, ADDetectedGameExtraInfo **extra) const {
diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp
index c0dce73070..e6c5123edb 100644
--- a/engines/cge/events.cpp
+++ b/engines/cge/events.cpp
@@ -38,7 +38,7 @@ namespace CGE {
 
 /*----------------- KEYBOARD interface -----------------*/
 
-Keyboard::Keyboard(CGEEngine *vm) : _client(NULL), _vm(vm) {
+Keyboard::Keyboard(CGEEngine *vm) : _client(nullptr), _vm(vm) {
 	_keyAlt = false;
 }
 
@@ -64,7 +64,7 @@ bool Keyboard::getKey(Common::Event &event) {
 			return false;
 		// Display ScummVM version and translation strings
 		for (int i = 0; i < 5; i++)
-			_vm->_commandHandler->addCommand(kCmdInf, 1, kShowScummVMVersion + i, NULL);
+			_vm->_commandHandler->addCommand(kCmdInf, 1, kShowScummVMVersion + i, nullptr);
 		return false;
 	case Common::KEYCODE_F5:
 		_vm->saveGameDialog();
@@ -84,7 +84,7 @@ bool Keyboard::getKey(Common::Event &event) {
 	case Common::KEYCODE_3:
 	case Common::KEYCODE_4:
 		if (event.kbd.flags & Common::KBD_ALT) {
-			_vm->_commandHandler->addCommand(kCmdLevel, -1, keycode - Common::KEYCODE_0, NULL);
+			_vm->_commandHandler->addCommand(kCmdLevel, -1, keycode - Common::KEYCODE_0, nullptr);
 			return false;
 		}
 		// fall through
@@ -120,13 +120,13 @@ void Keyboard::newKeyboard(Common::Event &event) {
 
 /*----------------- MOUSE interface -----------------*/
 
-Mouse::Mouse(CGEEngine *vm) : Sprite(vm, NULL), _busy(NULL), _hold(NULL), _hx(0), _vm(vm) {
-	_hold = NULL;
+Mouse::Mouse(CGEEngine *vm) : Sprite(vm, nullptr), _busy(nullptr), _hold(nullptr), _hx(0), _vm(vm) {
+	_hold = nullptr;
 	_hx = 0;
 	_hy = 0;
 	_exist = true;
 	_buttons = 0;
-	_busy = NULL;
+	_busy = nullptr;
 	_active = false;
 	_flags._kill = false;
 
@@ -141,7 +141,7 @@ Mouse::Mouse(CGEEngine *vm) : Sprite(vm, NULL), _busy(NULL), _hold(NULL), _hx(0)
 	BitmapPtr *MC = new BitmapPtr[3];
 	MC[0] = new Bitmap(_vm, "MOUSE");
 	MC[1] = new Bitmap(_vm, "DUMMY");
-	MC[2] = NULL;
+	MC[2] = nullptr;
 	setShapeList(MC);
 
 	gotoxy(kScrWidth / 2, kScrHeight / 2);
@@ -284,7 +284,7 @@ void EventManager::handleEvents() {
 			if (e._mask & kMouseLeftUp) {
 				if (_vm->_mouse->_hold) {
 					_vm->_mouse->_hold->_flags._hold = false;
-					_vm->_mouse->_hold = NULL;
+					_vm->_mouse->_hold = nullptr;
 				}
 			}
 			///Touched = e.Ptr;
diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp
index 18d94f4c2b..0925ee284c 100644
--- a/engines/cge/snail.cpp
+++ b/engines/cge/snail.cpp
@@ -47,7 +47,7 @@ const char *CommandHandler::_commandText[] = {
 	"RMNEAR", "RMTAKE", "FLAG",    "SETREF",  "BACKPT",
 	"FLASH",  "LIGHT",  "SETHB",   "SETVB",   "WALK",
 	"REACH",  "COVER",  "UNCOVER", "CLEAR",   "TALK",
-	"MOUSE",  "SOUND",  "COUNT",   NULL
+	"MOUSE",  "SOUND",  "COUNT",   nullptr
 };
 
 CommandHandler::CommandHandler(CGEEngine *vm, bool turbo)
@@ -93,7 +93,7 @@ void CommandHandler::addCallback(CommandType com, int ref, int val, CallbackType
 	headCmd->_commandType = com;
 	headCmd->_ref = ref;
 	headCmd->_val = val;
-	headCmd->_spritePtr = NULL;
+	headCmd->_spritePtr = nullptr;
 	headCmd->_cbType = cbType;
 	if (headCmd->_commandType == kCmdClear) {
 		_tail = _head;
@@ -389,7 +389,7 @@ void CGEEngine::snGame(Sprite *spr, int num) {
 
 	switch (num) {
 	case 1: {
-		static Sprite *dup[3] = { NULL, NULL, NULL };
+		static Sprite *dup[3] = { nullptr, nullptr, nullptr };
 		int buref = 0;
 		int Stage = 0;
 
@@ -400,7 +400,7 @@ void CGEEngine::snGame(Sprite *spr, int num) {
 				break;
 			}
 		}
-		if (dup[1] == NULL) {
+		if (dup[1] == nullptr) {
 			dup[1] = _vga->_showQ->locate(16003);    // pan
 			dup[2] = _vga->_showQ->locate(16004);    // pani
 		}
@@ -418,29 +418,29 @@ void CGEEngine::snGame(Sprite *spr, int num) {
 				_commandHandler->addCommand(kCmdTNext, -1, 0, dup[1]);             // Reset Take
 				_commandHandler->addCommand(kCmdTNext, -1, 0, dup[2]);             // Reset Take
 				_commandHandler->addCommand(kCmdNNext, -1, 0, dup[0]);             // Reset Near
-				_commandHandler->addCommand(kCmdPause, -1, 72, NULL);              // Pause the game for 72/80 second
-				_commandHandler->addCommand(kCmdSay, 1, 16009, NULL);              // Say "I win.."
-				_commandHandler->addCommand(kCmdSay, buref, 16010, NULL);          // Say "Go Sit..."
-				_commandHandler->addCommand(kCmdSay, 1, 16011, NULL);              // Say "I prefer not"
+				_commandHandler->addCommand(kCmdPause, -1, 72, nullptr);              // Pause the game for 72/80 second
+				_commandHandler->addCommand(kCmdSay, 1, 16009, nullptr);              // Say "I win.."
+				_commandHandler->addCommand(kCmdSay, buref, 16010, nullptr);          // Say "Go Sit..."
+				_commandHandler->addCommand(kCmdSay, 1, 16011, nullptr);              // Say "I prefer not"
 
 				if (hand) {
-					_commandHandler->addCommand(kCmdSend, 16060 + hand, 16, NULL);   // Give hand
-					_commandHandler->addCommand(kCmdSeq, buref, 4, NULL);            // Take off
-					_commandHandler->addCommand(kCmdSeq, 16060 + hand, 1, NULL);     // start one of the Bartender animations
-					_commandHandler->addCommand(kCmdSound, 16060 + hand, 16002, NULL); // Play tear sound
-					_commandHandler->addCommand(kCmdWait, 16060 + hand, 3, NULL);    // Take up
-					_commandHandler->addCommand(kCmdSwap, buref, buref + 100, NULL); // Open hand
-					_commandHandler->addCommand(kCmdSeq, 16016, Stage, NULL);        // Start Belongings animation
-					_commandHandler->addCommand(kCmdSend, 16060 + hand, -1, NULL);   // Hide hand
-					_commandHandler->addCommand(kCmdWait, 16060 + hand, -1, NULL);   // Stop moving hand
+					_commandHandler->addCommand(kCmdSend, 16060 + hand, 16, nullptr);   // Give hand
+					_commandHandler->addCommand(kCmdSeq, buref, 4, nullptr);            // Take off
+					_commandHandler->addCommand(kCmdSeq, 16060 + hand, 1, nullptr);     // start one of the Bartender animations
+					_commandHandler->addCommand(kCmdSound, 16060 + hand, 16002, nullptr); // Play tear sound
+					_commandHandler->addCommand(kCmdWait, 16060 + hand, 3, nullptr);    // Take up
+					_commandHandler->addCommand(kCmdSwap, buref, buref + 100, nullptr); // Open hand
+					_commandHandler->addCommand(kCmdSeq, 16016, Stage, nullptr);        // Start Belongings animation
+					_commandHandler->addCommand(kCmdSend, 16060 + hand, -1, nullptr);   // Hide hand
+					_commandHandler->addCommand(kCmdWait, 16060 + hand, -1, nullptr);   // Stop moving hand
 				} else {
-					_commandHandler->addCommand(kCmdSeq, buref, 4, NULL);            // Take off
-					_commandHandler->addCommand(kCmdSound, 16060 + hand, 16002, NULL); // Play tear sound
-					_commandHandler->addCommand(kCmdWait, buref, -1, NULL);          // Will take off
-					_commandHandler->addCommand(kCmdSwap, buref, buref + 100, NULL); // Open hand
-					_commandHandler->addCommand(kCmdSeq, 16016, Stage, NULL);        // Start Belongings animation
+					_commandHandler->addCommand(kCmdSeq, buref, 4, nullptr);            // Take off
+					_commandHandler->addCommand(kCmdSound, 16060 + hand, 16002, nullptr); // Play tear sound
+					_commandHandler->addCommand(kCmdWait, buref, -1, nullptr);          // Will take off
+					_commandHandler->addCommand(kCmdSwap, buref, buref + 100, nullptr); // Open hand
+					_commandHandler->addCommand(kCmdSeq, 16016, Stage, nullptr);        // Start Belongings animation
 				}
-				_commandHandler->addCommand(kCmdPause, -1, 72, NULL);              // Pause the game for 72/80 second
+				_commandHandler->addCommand(kCmdPause, -1, 72, nullptr);              // Pause the game for 72/80 second
 				_commandHandler->addCommand(kCmdSeq, -1, 0, dup[1]);               // Get away (Him)
 				_commandHandler->addCommand(kCmdSetXY, -1, 203 + kScrWidth * 49, dup[1]);
 				_commandHandler->addCommand(kCmdSetZ, -1, 7, dup[1]);
@@ -453,29 +453,29 @@ void CGEEngine::snGame(Sprite *spr, int num) {
 				_commandHandler->addCommand(kCmdSeq, -1, 2, dup[0]);               // reset animation sequence
 				_commandHandler->addCommand(kCmdSeq, -1, 2, dup[1]);               // reset animation sequence
 				_commandHandler->addCommand(kCmdSeq, -1, 2, dup[2]);               // reset animation sequence
-				_commandHandler->addCommand(kCmdPause, -1, 72, NULL);              // Pause the game for 72/80 second
+				_commandHandler->addCommand(kCmdPause, -1, 72, nullptr);              // Pause the game for 72/80 second
 			}
 		}
-		_commandHandler->addCommand(kCmdWalk, 198, 134, NULL);                 // Go to place
-		_commandHandler->addCommand(kCmdWait, 1, -1, NULL);                    // Stop moving
-		_commandHandler->addCommand(kCmdCover, 1, 16101, NULL);                // Man to beat
-		_commandHandler->addCommand(kCmdSeq, 16101, 1, NULL);                  // Start Chief animation (16dupnia)
-		_commandHandler->addCommand(kCmdWait, 16101, 5, NULL);                 // wait
-		_commandHandler->addCommand(kCmdPause, 16101, 24, NULL);               // Pause the game for 24/80 second
-		_commandHandler->addCommand(kCmdSeq, 16040, 1, NULL);                  // Start Slap animation (16plask)
-		_commandHandler->addCommand(kCmdSound, 16101, 16001, NULL);            // Play "Slap" sound
-		_commandHandler->addCommand(kCmdPause, 16101, 24, NULL);               // Pause the game for 24/80 second
-		_commandHandler->addCommand(kCmdSeq, 16040, 0, NULL);                  // Reset animation sequence
-		_commandHandler->addCommand(kCmdWait, 16101, -1, NULL);                // stay
-		_commandHandler->addCommand(kCmdUncover, 1, 16101, NULL);              // SDS
+		_commandHandler->addCommand(kCmdWalk, 198, 134, nullptr);                 // Go to place
+		_commandHandler->addCommand(kCmdWait, 1, -1, nullptr);                    // Stop moving
+		_commandHandler->addCommand(kCmdCover, 1, 16101, nullptr);                // Man to beat
+		_commandHandler->addCommand(kCmdSeq, 16101, 1, nullptr);                  // Start Chief animation (16dupnia)
+		_commandHandler->addCommand(kCmdWait, 16101, 5, nullptr);                 // wait
+		_commandHandler->addCommand(kCmdPause, 16101, 24, nullptr);               // Pause the game for 24/80 second
+		_commandHandler->addCommand(kCmdSeq, 16040, 1, nullptr);                  // Start Slap animation (16plask)
+		_commandHandler->addCommand(kCmdSound, 16101, 16001, nullptr);            // Play "Slap" sound
+		_commandHandler->addCommand(kCmdPause, 16101, 24, nullptr);               // Pause the game for 24/80 second
+		_commandHandler->addCommand(kCmdSeq, 16040, 0, nullptr);                  // Reset animation sequence
+		_commandHandler->addCommand(kCmdWait, 16101, -1, nullptr);                // stay
+		_commandHandler->addCommand(kCmdUncover, 1, 16101, nullptr);              // SDS
 		if (!_game) {
-			_commandHandler->addCommand(kCmdSay, buref, 16008, NULL);            // say "Guess!"
+			_commandHandler->addCommand(kCmdSay, buref, 16008, nullptr);            // say "Guess!"
 			_game = true;
 		}
 		}
 		break;
 	case 2:
-		if (_sprTv == NULL) {
+		if (_sprTv == nullptr) {
 			_sprTv = _vga->_showQ->locate(20700);
 			_sprK1 = _vga->_showQ->locate(20701);
 			_sprK2 = _vga->_showQ->locate(20702);
@@ -483,7 +483,7 @@ void CGEEngine::snGame(Sprite *spr, int num) {
 		}
 
 		if (!_game) { // init
-			_commandHandler->addCommand(kCmdGame, 20002, 2, NULL);
+			_commandHandler->addCommand(kCmdGame, 20002, 2, nullptr);
 			_game = true;
 			break;
 		}
@@ -507,24 +507,24 @@ void CGEEngine::snGame(Sprite *spr, int num) {
 			_sprK3->step(5);
 		}
 
-		_commandHandler->addCommand(kCmdSetZ, 20700, 0, NULL);
+		_commandHandler->addCommand(kCmdSetZ, 20700, 0, nullptr);
 		{
 			bool hit = (_sprK1->_seqPtr + _sprK2->_seqPtr + _sprK3->_seqPtr == 15);
 			if (hit) {
 				if (spr->_ref == 1) {
-					_commandHandler->addCommand(kCmdSay,       1, 20003, NULL);       // hurray!
-					_commandHandler->addCommand(kCmdSeq,   20011,     2, NULL);       // Camera away
-					_commandHandler->addCommand(kCmdSend,  20701,    -1, NULL);       // move dice1 to scene -1
-					_commandHandler->addCommand(kCmdSend,  20702,    -1, NULL);       // move dice2 to scene -1
-					_commandHandler->addCommand(kCmdSend,  20703,    -1, NULL);       // move dice3 to scene -1
-					_commandHandler->addCommand(kCmdSend,  20700,    -1, NULL);       // move TV to scene -1
-					_commandHandler->addCommand(kCmdKeep,  20007,     0, NULL);       // to pocket
-					_commandHandler->addCommand(kCmdSend,  20006,    20, NULL);       // Move Coin to scene 20
-					_commandHandler->addCommand(kCmdSound, 20006, 20002, NULL);       // Play Coin sound
-					_commandHandler->addCommand(kCmdSay,   20002, 20004, NULL);	      // Say "Luck guy..."
-					_commandHandler->addCommand(kCmdSend,  20010,    20, NULL);       // Move Paper to scene 20
-					_commandHandler->addCommand(kCmdSound, 20010, 20003, NULL);       // Play "ksh" sound! (fx20003.wav)
-					_commandHandler->addCommand(kCmdSay,   20001, 20005, NULL);       // Say "Congratulations"
+					_commandHandler->addCommand(kCmdSay,       1, 20003, nullptr);       // hurray!
+					_commandHandler->addCommand(kCmdSeq,   20011,     2, nullptr);       // Camera away
+					_commandHandler->addCommand(kCmdSend,  20701,    -1, nullptr);       // move dice1 to scene -1
+					_commandHandler->addCommand(kCmdSend,  20702,    -1, nullptr);       // move dice2 to scene -1
+					_commandHandler->addCommand(kCmdSend,  20703,    -1, nullptr);       // move dice3 to scene -1
+					_commandHandler->addCommand(kCmdSend,  20700,    -1, nullptr);       // move TV to scene -1
+					_commandHandler->addCommand(kCmdKeep,  20007,     0, nullptr);       // to pocket
+					_commandHandler->addCommand(kCmdSend,  20006,    20, nullptr);       // Move Coin to scene 20
+					_commandHandler->addCommand(kCmdSound, 20006, 20002, nullptr);       // Play Coin sound
+					_commandHandler->addCommand(kCmdSay,   20002, 20004, nullptr);	      // Say "Luck guy..."
+					_commandHandler->addCommand(kCmdSend,  20010,    20, nullptr);       // Move Paper to scene 20
+					_commandHandler->addCommand(kCmdSound, 20010, 20003, nullptr);       // Play "ksh" sound! (fx20003.wav)
+					_commandHandler->addCommand(kCmdSay,   20001, 20005, nullptr);       // Say "Congratulations"
 					_game = false;
 					return;
 				} else {
@@ -537,14 +537,14 @@ void CGEEngine::snGame(Sprite *spr, int num) {
 			switch (_gameCase2Cpt) {
 			case 15:
 				// Give hint about ALTered dice
-				_commandHandler->addCommand(kCmdSay, 20003, 20021, NULL);
+				_commandHandler->addCommand(kCmdSay, 20003, 20021, nullptr);
 				break;
 			case 30:
 			case 45:
 			case 60:
 			case 75:
 				// Tell to use ALT key
-				_commandHandler->addCommand(kCmdSay, 20003, 20022, NULL);
+				_commandHandler->addCommand(kCmdSay, 20003, 20022, nullptr);
 				break;
 			default:
 				break;
@@ -554,49 +554,49 @@ void CGEEngine::snGame(Sprite *spr, int num) {
 
 		switch (spr->_ref) {
 		case 1:
-			_commandHandler->addCommand(kCmdSay,   20001, 20011, NULL);        // Say "It'a my turn"
-			_commandHandler->addCommand(kCmdSeq,   20001,     1, NULL);        // Throw dice
-			_commandHandler->addCommand(kCmdWait,  20001,     1, NULL);        // wait
-			_commandHandler->addCommand(kCmdSetZ,  20700,     2, NULL);        // hide dice
-			_commandHandler->addCommand(kCmdHide,  20007,     1, NULL);        // hide dice
-			_commandHandler->addCommand(kCmdWait,  20001,    16, NULL);        // wait
-			_commandHandler->addCommand(kCmdSeq,   20007,     1, NULL);        // Start dice animation (20kosci)
-			_commandHandler->addCommand(kCmdHide,  20007,     0, NULL);        // unhide
-			_commandHandler->addCommand(kCmdSound, 20007, 20001, NULL);        // Play Dice sound
-			_commandHandler->addCommand(kCmdWait,  20007,    -1, NULL);        // the end
-			_commandHandler->addCommand(kCmdGame,  20001,     2, NULL);        // again!
+			_commandHandler->addCommand(kCmdSay,   20001, 20011, nullptr);        // Say "It'a my turn"
+			_commandHandler->addCommand(kCmdSeq,   20001,     1, nullptr);        // Throw dice
+			_commandHandler->addCommand(kCmdWait,  20001,     1, nullptr);        // wait
+			_commandHandler->addCommand(kCmdSetZ,  20700,     2, nullptr);        // hide dice
+			_commandHandler->addCommand(kCmdHide,  20007,     1, nullptr);        // hide dice
+			_commandHandler->addCommand(kCmdWait,  20001,    16, nullptr);        // wait
+			_commandHandler->addCommand(kCmdSeq,   20007,     1, nullptr);        // Start dice animation (20kosci)
+			_commandHandler->addCommand(kCmdHide,  20007,     0, nullptr);        // unhide
+			_commandHandler->addCommand(kCmdSound, 20007, 20001, nullptr);        // Play Dice sound
+			_commandHandler->addCommand(kCmdWait,  20007,    -1, nullptr);        // the end
+			_commandHandler->addCommand(kCmdGame,  20001,     2, nullptr);        // again!
 			break;
 
 		case 20001:
-			_commandHandler->addCommand(kCmdSay,   20002, 20012, NULL);        // Say "Now it's mine"
-			_commandHandler->addCommand(kCmdSeq,   20002,     1, NULL);        // Throw dice
-			_commandHandler->addCommand(kCmdWait,  20002,     3, NULL);        // wait
-			_commandHandler->addCommand(kCmdSetZ,  20700,     2, NULL);        // hide dice
-			_commandHandler->addCommand(kCmdHide,  20007,     1, NULL);        // hide dice
-			_commandHandler->addCommand(kCmdWait,  20002,    10, NULL);        // wait
-			_commandHandler->addCommand(kCmdSeq,   20007,     2, NULL);        // Start dice animation (20kosci)
-			_commandHandler->addCommand(kCmdHide,  20007,     0, NULL);        // unhide
-			_commandHandler->addCommand(kCmdSound, 20007, 20001, NULL);        // Play Dice sound
-			_commandHandler->addCommand(kCmdWait,  20007,    -1, NULL);        // the end
-			_commandHandler->addCommand(kCmdGame,  20002,     2, NULL);        // again!
+			_commandHandler->addCommand(kCmdSay,   20002, 20012, nullptr);        // Say "Now it's mine"
+			_commandHandler->addCommand(kCmdSeq,   20002,     1, nullptr);        // Throw dice
+			_commandHandler->addCommand(kCmdWait,  20002,     3, nullptr);        // wait
+			_commandHandler->addCommand(kCmdSetZ,  20700,     2, nullptr);        // hide dice
+			_commandHandler->addCommand(kCmdHide,  20007,     1, nullptr);        // hide dice
+			_commandHandler->addCommand(kCmdWait,  20002,    10, nullptr);        // wait
+			_commandHandler->addCommand(kCmdSeq,   20007,     2, nullptr);        // Start dice animation (20kosci)
+			_commandHandler->addCommand(kCmdHide,  20007,     0, nullptr);        // unhide
+			_commandHandler->addCommand(kCmdSound, 20007, 20001, nullptr);        // Play Dice sound
+			_commandHandler->addCommand(kCmdWait,  20007,    -1, nullptr);        // the end
+			_commandHandler->addCommand(kCmdGame,  20002,     2, nullptr);        // again!
 			break;
 
 		case 20002:
-			_commandHandler->addCommand(kCmdSay,   20002, 20010, NULL);        // "Roll the bones!"
-			_commandHandler->addCommand(kCmdWalk,  20005,    -1, NULL);        // Walk to table
-			_commandHandler->addCommand(kCmdWait,      1,    -1, NULL);        // Wait
-			_commandHandler->addCommand(kCmdCover,     1, 20101, NULL);        // grasol ??
-			_commandHandler->addCommand(kCmdSeq,   20101,     1, NULL);        // Start Chief animation (20solgra)
-			_commandHandler->addCommand(kCmdWait,  20101,     5, NULL);        // Wait
-			_commandHandler->addCommand(kCmdSetZ,  20700,     2, NULL);        // Hide dice
-			_commandHandler->addCommand(kCmdHide,  20007,     1, NULL);        // Hide dice
-			_commandHandler->addCommand(kCmdWait,  20101,    15, NULL);        // wait
-			_commandHandler->addCommand(kCmdSeq,   20007,     1, NULL);        // Start dice animation (20kosci)
-			_commandHandler->addCommand(kCmdHide,  20007,     0, NULL);        // Unhide
-			_commandHandler->addCommand(kCmdSound, 20007, 20001, NULL);        // Play Dice sound
-			_commandHandler->addCommand(kCmdWait,  20101,    -1, NULL);        // the end
-			_commandHandler->addCommand(kCmdUncover,   1, 20101, NULL);        // SDS ??
-			_commandHandler->addCommand(kCmdGame,      1,     2, NULL);        // again!
+			_commandHandler->addCommand(kCmdSay,   20002, 20010, nullptr);        // "Roll the bones!"
+			_commandHandler->addCommand(kCmdWalk,  20005,    -1, nullptr);        // Walk to table
+			_commandHandler->addCommand(kCmdWait,      1,    -1, nullptr);        // Wait
+			_commandHandler->addCommand(kCmdCover,     1, 20101, nullptr);        // grasol ??
+			_commandHandler->addCommand(kCmdSeq,   20101,     1, nullptr);        // Start Chief animation (20solgra)
+			_commandHandler->addCommand(kCmdWait,  20101,     5, nullptr);        // Wait
+			_commandHandler->addCommand(kCmdSetZ,  20700,     2, nullptr);        // Hide dice
+			_commandHandler->addCommand(kCmdHide,  20007,     1, nullptr);        // Hide dice
+			_commandHandler->addCommand(kCmdWait,  20101,    15, nullptr);        // wait
+			_commandHandler->addCommand(kCmdSeq,   20007,     1, nullptr);        // Start dice animation (20kosci)
+			_commandHandler->addCommand(kCmdHide,  20007,     0, nullptr);        // Unhide
+			_commandHandler->addCommand(kCmdSound, 20007, 20001, nullptr);        // Play Dice sound
+			_commandHandler->addCommand(kCmdWait,  20101,    -1, nullptr);        // the end
+			_commandHandler->addCommand(kCmdUncover,   1, 20101, nullptr);        // SDS ??
+			_commandHandler->addCommand(kCmdGame,      1,     2, nullptr);        // again!
 			break;
 
 		default:
@@ -647,13 +647,13 @@ void CGEEngine::selectPocket(int n) {
 		// If no slot specified, or another slot already selected
 		// stop the blinking animation
 		_pocLight->step(0);
-		n = findPocket(NULL);
+		n = findPocket(nullptr);
 		if (n >= 0)
 			_pocPtr = n;
 	} else {
 		// If slot specified, check if the slot if used.
 		// Is so, start the blinking animation
-		if (_pocket[n] != NULL) {
+		if (_pocket[n] != nullptr) {
 			_pocPtr = n;
 			_pocLight->step(1);
 		}
@@ -690,7 +690,7 @@ void CGEEngine::snGhost(Bitmap *bmp) {
 	debugC(1, kCGEDebugEngine, "CGEEngine::snGhost(bmp)");
 
 	bmp->hide(bmp->_map & 0xFFFF, bmp->_map >> 16);
-	bmp->_m = NULL;
+	bmp->_m = nullptr;
 	bmp->_map = 0;
 	delete bmp;
 }
@@ -709,7 +709,7 @@ void CGEEngine::feedSnail(Sprite *spr, SnList snq) {
 	CommandHandler::Command *comtab = spr->snList(snq);
 	CommandHandler::Command *c = comtab + ptr;
 
-	if (findPocket(NULL) < 0) {                 // no empty pockets?
+	if (findPocket(nullptr) < 0) {                 // no empty pockets?
 		CommandHandler::Command *p;
 		for (p = c; p->_commandType != kCmdNext; p++) {     // find KEEP command
 			if (p->_commandType == kCmdKeep) {
@@ -810,7 +810,7 @@ void CGEEngine::snZTrim(Sprite *spr) {
 	if (!spr || !spr->active())
 		return;
 
-	Sprite *s = (spr->_flags._shad) ? spr->_prev : NULL;
+	Sprite *s = (spr->_flags._shad) ? spr->_prev : nullptr;
 	_vga->_showQ->insert(_vga->_showQ->remove(spr));
 	if (s) {
 		s->_z = spr->_z;
@@ -875,7 +875,7 @@ void CGEEngine::snSend(Sprite *spr, int val) {
 			if (spr->_flags._kept) {
 				int n = findPocket(spr);
 				if (n >= 0)
-					_pocket[n] = NULL;
+					_pocket[n] = nullptr;
 			}
 			hide1(spr);
 			contractSprite(spr);
@@ -887,7 +887,7 @@ void CGEEngine::snSend(Sprite *spr, int val) {
 				spr->backShow(true);
 			else
 				expandSprite(spr);
-			_bitmapPalette = NULL;
+			_bitmapPalette = nullptr;
 		}
 	}
 }
@@ -1069,7 +1069,7 @@ void CGEEngine::snKill(Sprite *spr) {
 	if (spr->_flags._kept) {
 		int n = findPocket(spr);
 		if (n >= 0)
-			_pocket[n] = NULL;
+			_pocket[n] = nullptr;
 	}
 	Sprite *nx = spr->_next;
 	hide1(spr);
@@ -1107,7 +1107,7 @@ void CGEEngine::snKeep(Sprite *spr, int stp) {
 	debugC(1, kCGEDebugEngine, "CGEEngine::snKeep(spr, %d)", stp);
 
 	selectPocket(-1);
-	if (spr && ! spr->_flags._kept && _pocket[_pocPtr] == NULL) {
+	if (spr && ! spr->_flags._kept && _pocket[_pocPtr] == nullptr) {
 		int16 oldRepeat = _sound->getRepeat();
 		_sound->setRepeat(1);
 		snSound(spr, 3);
@@ -1134,7 +1134,7 @@ void CGEEngine::snGive(Sprite *spr, int stp) {
 	if (spr) {
 		int p = findPocket(spr);
 		if (p >= 0) {
-			_pocket[p] = NULL;
+			_pocket[p] = nullptr;
 			spr->_scene = _now;
 			spr->_flags._kept = false;
 			if (stp >= 0)
diff --git a/engines/cge/sound.cpp b/engines/cge/sound.cpp
index 93f628dca6..20f649361f 100644
--- a/engines/cge/sound.cpp
+++ b/engines/cge/sound.cpp
@@ -47,7 +47,7 @@ DataCk::~DataCk() {
 }
 
 Sound::Sound(CGEEngine *vm) : _vm(vm) {
-	_audioStream = NULL;
+	_audioStream = nullptr;
 	_soundRepeatCount = 1;
 	open();
 }
@@ -109,14 +109,14 @@ void Sound::stop() {
 void Sound::sndDigiStop(SmpInfo *PSmpInfo) {
 	if (_vm->_mixer->isSoundHandleActive(_soundHandle))
 		_vm->_mixer->stopHandle(_soundHandle);
-	_audioStream = NULL;
+	_audioStream = nullptr;
 }
 
-Fx::Fx(CGEEngine *vm, int size) : _current(NULL), _vm(vm) {
+Fx::Fx(CGEEngine *vm, int size) : _current(nullptr), _vm(vm) {
 	_cache = new Handler[size];
 	for (_size = 0; _size < size; _size++) {
 		_cache[_size]._ref = 0;
-		_cache[_size]._wav = NULL;
+		_cache[_size]._wav = nullptr;
 	}
 }
 
@@ -130,10 +130,10 @@ void Fx::clear() {
 		if (p->_ref) {
 			p->_ref = 0;
 			delete p->_wav;
-			p->_wav = NULL;
+			p->_wav = nullptr;
 		}
 	}
-	_current = NULL;
+	_current = nullptr;
 }
 
 int Fx::find(int ref) {
@@ -191,7 +191,7 @@ DataCk *Fx::loadWave(EncryptedStream *file) {
 	byte *data = (byte *)malloc(file->size());
 
 	if (!data)
-		return 0;
+		return nullptr;
 
 	file->read(data, file->size());
 
@@ -213,7 +213,7 @@ DataCk *Fx::operator[](int ref) {
 }
 
 MusicPlayer::MusicPlayer(CGEEngine *vm) : _vm(vm) {
-	_data = NULL;
+	_data = nullptr;
 	_isGM = false;
 
 	MidiPlayer::createDriver();
@@ -242,7 +242,7 @@ void MusicPlayer::killMidi() {
 	Audio::MidiPlayer::stop();
 
 	free(_data);
-	_data = NULL;
+	_data = nullptr;
 }
 
 void MusicPlayer::loadMidi(int ref) {
diff --git a/engines/cge/talk.cpp b/engines/cge/talk.cpp
index 78b1901f57..1a4e626a5b 100644
--- a/engines/cge/talk.cpp
+++ b/engines/cge/talk.cpp
@@ -40,7 +40,7 @@ Font::Font(CGEEngine *vm, const char *name) : _vm(vm) {
 	_pos = (uint16 *)malloc(kPosSize * sizeof(uint16));
 	_widthArr = (uint8 *)malloc(kWidSize);
 
-	assert((_map != NULL) && (_pos != NULL) && (_widthArr != NULL));
+	assert((_map != nullptr) && (_pos != nullptr) && (_widthArr != nullptr));
 	_vm->mergeExt(_path, name, kFontExt);
 	load();
 }
@@ -76,16 +76,16 @@ uint16 Font::width(const char *text) {
 }
 
 Talk::Talk(CGEEngine *vm, const char *text, TextBoxStyle mode, bool wideSpace)
-	: Sprite(vm, NULL), _mode(mode), _wideSpace(wideSpace), _vm(vm) {
-	_ts = NULL;
+	: Sprite(vm, nullptr), _mode(mode), _wideSpace(wideSpace), _vm(vm) {
+	_ts = nullptr;
 	_flags._syst = true;
 	update(text);
 }
 
 
 Talk::Talk(CGEEngine *vm)
-	: Sprite(vm, NULL), _mode(kTBPure), _vm(vm) {
-	_ts = NULL;
+	: Sprite(vm, nullptr), _mode(kTBPure), _vm(vm) {
+	_ts = nullptr;
 	_flags._syst = true;
 	_wideSpace = false;
 }
@@ -124,7 +124,7 @@ void Talk::update(const char *text) {
 
 		_ts = new BitmapPtr[2];
 		_ts[0] = box(mw, mh);
-		_ts[1] = NULL;
+		_ts[1] = nullptr;
 	}
 
 	m = _ts[0]->_m + ln * mw + hmarg;
@@ -168,7 +168,7 @@ Bitmap *Talk::box(uint16 w, uint16 h) {
 		h = 8;
 	uint16 n = w * h;
 	uint8 *b = (uint8 *)malloc(n);
-	assert(b != NULL);
+	assert(b != nullptr);
 	memset(b, kTextColBG, n);
 
 	if (_mode) {
@@ -202,10 +202,10 @@ Bitmap *Talk::box(uint16 w, uint16 h) {
 	return new Bitmap(_vm, w, h, b);
 }
 
-InfoLine::InfoLine(CGEEngine *vm, uint16 w) : Talk(vm), _oldText(NULL), _vm(vm) {
+InfoLine::InfoLine(CGEEngine *vm, uint16 w) : Talk(vm), _oldText(nullptr), _vm(vm) {
 	if (!_ts) {
 		_ts = new BitmapPtr[2];
-		_ts[1] = NULL;
+		_ts[1] = nullptr;
 	}
 
 	_ts[0] = new Bitmap(_vm, w, kFontHigh, kTextColBG);
diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp
index 3ba44d9073..7562ffc80a 100644
--- a/engines/cge/text.cpp
+++ b/engines/cge/text.cpp
@@ -46,7 +46,7 @@ Text::Text(CGEEngine *vm, const char *fname) : _vm(vm) {
 	_cache = new Handler[txtCount];
 	for (_size = 0; _size < txtCount; _size++) {
 		_cache[_size]._ref = 0;
-		_cache[_size]._text = NULL;
+		_cache[_size]._text = nullptr;
 	}
 	load();
 }
@@ -70,7 +70,7 @@ int16 Text::count() {
 		char *s;
 		assert(line.size() <= 513);
 		Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr));
-		if ((s = strtok(tmpStr, " =,;/\t\n")) == NULL)
+		if ((s = strtok(tmpStr, " =,;/\t\n")) == nullptr)
 			continue;
 		if (!Common::isDigit(*s))
 			continue;
@@ -85,7 +85,7 @@ void Text::clear() {
 		if (p->_ref) {
 			p->_ref = 0;
 			delete[] p->_text;
-			p->_text = NULL;
+			p->_text = nullptr;
 		}
 	}
 }
@@ -102,7 +102,7 @@ void Text::load() {
 		int n = line.size();
 		char *s;
 		Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr));
-		if ((s = strtok(tmpStr, " =,;/\t\n")) == NULL)
+		if ((s = strtok(tmpStr, " =,;/\t\n")) == nullptr)
 			continue;
 		if (!Common::isDigit(*s))
 			continue;
@@ -129,7 +129,7 @@ char *Text::getText(int ref) {
 		return _cache[i]._text;
 
 	warning("getText: Unable to find ref %d", ref);
-	return NULL;
+	return nullptr;
 }
 
 void Text::say(const char *text, Sprite *spr) {
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index 4c8983778c..9c72f9ddb4 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -57,8 +57,8 @@ Seq *getConstantSeq(bool seqFlag) {
 
 Sprite::Sprite(CGEEngine *vm, BitmapPtr *shpP)
 	: _x(0), _y(0), _z(0), _nearPtr(0), _takePtr(0),
-	  _next(NULL), _prev(NULL), _seqPtr(kNoSeq), _time(0),
-	  _ext(NULL), _ref(-1), _scene(0), _vm(vm) {
+	  _next(nullptr), _prev(nullptr), _seqPtr(kNoSeq), _time(0),
+	  _ext(nullptr), _ref(-1), _scene(0), _vm(vm) {
 	memset(_file, 0, sizeof(_file));
 	memset(&_flags, 0, sizeof(_flags));
 	_ref = 0;
@@ -67,14 +67,14 @@ Sprite::Sprite(CGEEngine *vm, BitmapPtr *shpP)
 	_time = 0;
 	_seqPtr = 0;
 	_shpCnt = 0;
-	_prev = _next = NULL;
+	_prev = _next = nullptr;
 
 	setShapeList(shpP);
 }
 
 Sprite::~Sprite() {
 	if (_vm->_sprite == this)
-		_vm->_sprite = NULL;
+		_vm->_sprite = nullptr;
 
 	contract();
 }
@@ -82,7 +82,7 @@ Sprite::~Sprite() {
 BitmapPtr Sprite::shp() {
 	SprExt *e = _ext;
 	if (!e || !e->_seq)
-		return NULL;
+		return nullptr;
 
 	int i = e->_seq[_seqPtr]._now;
 	if (i >= _shpCnt)
@@ -91,7 +91,7 @@ BitmapPtr Sprite::shp() {
 }
 
 BitmapPtr *Sprite::setShapeList(BitmapPtr *shpP) {
-	BitmapPtr *r = (_ext) ? _ext->_shpList : NULL;
+	BitmapPtr *r = (_ext) ? _ext->_shpList : nullptr;
 
 	_shpCnt = 0;
 	_w = 0;
@@ -121,7 +121,7 @@ bool Sprite::works(Sprite *spr) {
 		return false;
 
 	CommandHandler::Command *c = spr->_ext->_take;
-	if (c != NULL) {
+	if (c != nullptr) {
 		c += spr->_takePtr;
 		if (c->_ref == _ref)
 			if (c->_commandType != kCmdLabel || (c->_val == 0 || c->_val == _vm->_now))
@@ -134,7 +134,7 @@ bool Sprite::works(Sprite *spr) {
 Seq *Sprite::setSeq(Seq *seq) {
 	if (_ext) {
 		free(_ext->_seq);
-		_ext->_seq = NULL;
+		_ext->_seq = nullptr;
 	}
 
 	expand();
@@ -160,7 +160,7 @@ CommandHandler::Command *Sprite::snList(SnList type) {
 	SprExt *e = _ext;
 	if (e)
 		return (type == kNear) ? e->_near : e->_take;
-	return NULL;
+	return nullptr;
 }
 
 void Sprite::setName(char *newName) {
@@ -169,11 +169,11 @@ void Sprite::setName(char *newName) {
 
 	if (_ext->_name) {
 		delete[] _ext->_name;
-		_ext->_name = NULL;
+		_ext->_name = nullptr;
 	}
 	if (newName) {
 		_ext->_name = new char[strlen(newName) + 1];
-		assert(_ext->_name != NULL);
+		assert(_ext->_name != nullptr);
 		strcpy(_ext->_name, newName);
 	}
 }
@@ -183,18 +183,18 @@ Sprite *Sprite::expand() {
 		return this;
 
 	_ext = new SprExt;
-	assert(_ext != NULL);
+	assert(_ext != nullptr);
 	if (!*_file)
 		return this;
 
-	static const char *Comd[] = { "Name", "Phase", "Seq", "Near", "Take", NULL };
+	static const char *Comd[] = { "Name", "Phase", "Seq", "Near", "Take", nullptr };
 	char fname[kPathMax];
 
 	Common::Array<BitmapPtr> shplist;
 	for (int i = 0; i < _shpCnt + 1; ++i)
 		shplist.push_back(NULL);
 
-	Seq *seq = NULL;
+	Seq *seq = nullptr;
 	int shapeCount = 0,
 	    seqCount = 0,
 	    nearCount = 0,
@@ -202,8 +202,8 @@ Sprite *Sprite::expand() {
 	    maxnow = 0,
 	    maxnxt = 0;
 
-	CommandHandler::Command *nearList = NULL;
-	CommandHandler::Command *takeList = NULL;
+	CommandHandler::Command *nearList = nullptr;
+	CommandHandler::Command *takeList = nullptr;
 	_vm->mergeExt(fname, _file, kSprExt);
 	if (_vm->_resman->exist(fname)) { // sprite description file exist
 		EncryptedStream sprf(_vm, fname);
@@ -224,7 +224,7 @@ Sprite *Sprite::expand() {
 			switch (_vm->takeEnum(Comd, strtok(tmpStr, " =\t"))) {
 			case 0:
 				// Name
-				setName(strtok(NULL, ""));
+				setName(strtok(nullptr, ""));
 				break;
 			case 1:
 				// Phase
@@ -233,18 +233,18 @@ Sprite *Sprite::expand() {
 					shplist.push_back(NULL);
 					++_shpCnt;
 				}
-				shplist[shapeCount++] = new Bitmap(_vm, strtok(NULL, " \t,;/"));
+				shplist[shapeCount++] = new Bitmap(_vm, strtok(nullptr, " \t,;/"));
 				break;
 			case 2:
 				// Seq
 				seq = (Seq *)realloc(seq, (seqCount + 1) * sizeof(*seq));
-				assert(seq != NULL);
+				assert(seq != nullptr);
 				Seq *s;
 				s = &seq[seqCount++];
-				s->_now = atoi(strtok(NULL, " \t,;/"));
+				s->_now = atoi(strtok(nullptr, " \t,;/"));
 				if (s->_now > maxnow)
 					maxnow = s->_now;
-				s->_next = atoi(strtok(NULL, " \t,;/"));
+				s->_next = atoi(strtok(nullptr, " \t,;/"));
 				switch (s->_next) {
 				case 0xFF:
 					s->_next = seqCount;
@@ -257,35 +257,35 @@ Sprite *Sprite::expand() {
 				}
 				if (s->_next > maxnxt)
 					maxnxt = s->_next;
-				s->_dx = atoi(strtok(NULL, " \t,;/"));
-				s->_dy = atoi(strtok(NULL, " \t,;/"));
-				s->_dly = atoi(strtok(NULL, " \t,;/"));
+				s->_dx = atoi(strtok(nullptr, " \t,;/"));
+				s->_dy = atoi(strtok(nullptr, " \t,;/"));
+				s->_dly = atoi(strtok(nullptr, " \t,;/"));
 				break;
 			case 3:
 				// Near
 				if (_nearPtr == kNoPtr)
 					break;
 				nearList = (CommandHandler::Command *)realloc(nearList, (nearCount + 1) * sizeof(*nearList));
-				assert(nearList != NULL);
+				assert(nearList != nullptr);
 				c = &nearList[nearCount++];
-				if ((c->_commandType = (CommandType)_vm->takeEnum(CommandHandler::_commandText, strtok(NULL, " \t,;/"))) < 0)
+				if ((c->_commandType = (CommandType)_vm->takeEnum(CommandHandler::_commandText, strtok(nullptr, " \t,;/"))) < 0)
 					error("Bad NEAR in %d [%s]", lcnt, fname);
-				c->_ref = atoi(strtok(NULL, " \t,;/"));
-				c->_val = atoi(strtok(NULL, " \t,;/"));
-				c->_spritePtr = NULL;
+				c->_ref = atoi(strtok(nullptr, " \t,;/"));
+				c->_val = atoi(strtok(nullptr, " \t,;/"));
+				c->_spritePtr = nullptr;
 				break;
 			case 4:
 				// Take
 				if (_takePtr == kNoPtr)
 					break;
 				takeList = (CommandHandler::Command *)realloc(takeList, (takeCount + 1) * sizeof(*takeList));
-				assert(takeList != NULL);
+				assert(takeList != nullptr);
 				c = &takeList[takeCount++];
-				if ((c->_commandType = (CommandType)_vm->takeEnum(CommandHandler::_commandText, strtok(NULL, " \t,;/"))) < 0)
+				if ((c->_commandType = (CommandType)_vm->takeEnum(CommandHandler::_commandText, strtok(nullptr, " \t,;/"))) < 0)
 					error("Bad NEAR in %d [%s]", lcnt, fname);
-				c->_ref = atoi(strtok(NULL, " \t,;/"));
-				c->_val = atoi(strtok(NULL, " \t,;/"));
-				c->_spritePtr = NULL;
+				c->_ref = atoi(strtok(nullptr, " \t,;/"));
+				c->_val = atoi(strtok(nullptr, " \t,;/"));
+				c->_spritePtr = nullptr;
 				break;
 			default:
 				break;
@@ -343,7 +343,7 @@ Sprite *Sprite::contract() {
 	free(e->_take);
 
 	delete e;
-	_ext = NULL;
+	_ext = nullptr;
 
 	return this;
 }
@@ -396,7 +396,7 @@ void Sprite::killXlat() {
 	free(m);
 
 	for (BitmapPtr *b = _ext->_shpList; *b; b++)
-		(*b)->_m = NULL;
+		(*b)->_m = nullptr;
 	_flags._xlat = false;
 }
 
@@ -460,14 +460,14 @@ void Sprite::hide() {
 BitmapPtr Sprite::ghost() {
 	SprExt *e = _ext;
 	if (!e->_b1)
-		return NULL;
+		return nullptr;
 
-	BitmapPtr bmp = new Bitmap(_vm, 0, 0, (uint8 *)NULL);
-	assert(bmp != NULL);
+	BitmapPtr bmp = new Bitmap(_vm, 0, 0, (uint8 *)nullptr);
+	assert(bmp != nullptr);
 	bmp->_w = e->_b1->_w;
 	bmp->_h = e->_b1->_h;
 	bmp->_b = new HideDesc[bmp->_h];
-	assert(bmp->_b != NULL);
+	assert(bmp->_b != nullptr);
 	bmp->_v = (uint8 *) memcpy(bmp->_b, e->_b1->_b, sizeof(HideDesc) * bmp->_h);
 	bmp->_map = (e->_y1 << 16) + e->_x1;
 	return bmp;
@@ -539,7 +539,7 @@ void Sprite::sync(Common::Serializer &s) {
 	s.syncAsUint16LE(unused);	// _next
 }
 
-Queue::Queue(bool show) : _head(NULL), _tail(NULL), _show(show) {
+Queue::Queue(bool show) : _head(nullptr), _tail(nullptr), _show(show) {
 }
 
 Queue::~Queue() {
@@ -617,8 +617,8 @@ Sprite *Queue::remove(Sprite *spr) {
 		spr->_next->_prev = spr->_prev;
 	if (spr->_prev)
 		spr->_prev->_next = spr->_next;
-	spr->_prev = NULL;
-	spr->_next = NULL;
+	spr->_prev = nullptr;
+	spr->_next = nullptr;
 	return spr;
 }
 
@@ -627,12 +627,12 @@ Sprite *Queue::locate(int ref) {
 		if (spr->_ref == ref)
 			return spr;
 	}
-	return NULL;
+	return nullptr;
 }
 
-Vga::Vga(CGEEngine *vm) : _frmCnt(0), _msg(NULL), _name(NULL), _setPal(false), _mono(0), _vm(vm) {
-	_oldColors = NULL;
-	_newColors = NULL;
+Vga::Vga(CGEEngine *vm) : _frmCnt(0), _msg(nullptr), _name(nullptr), _setPal(false), _mono(0), _vm(vm) {
+	_oldColors = nullptr;
+	_newColors = nullptr;
 	_showQ = new Queue(true);
 	_spareQ = new Queue(false);
 	_sysPal = new Dac[kPalCount];
@@ -970,42 +970,42 @@ void Bitmap::hide(int16 x, int16 y) {
 
 /*--------------------------------------------------------------------------*/
 
-HorizLine::HorizLine(CGEEngine *vm) : Sprite(vm, NULL), _vm(vm) {
+HorizLine::HorizLine(CGEEngine *vm) : Sprite(vm, nullptr), _vm(vm) {
 	// Set the sprite list
 	BitmapPtr *HL = new BitmapPtr[2];
 	HL[0] = new Bitmap(_vm, "HLINE");
-	HL[1] = NULL;
+	HL[1] = nullptr;
 
 	setShapeList(HL);
 }
 
-SceneLight::SceneLight(CGEEngine *vm) : Sprite(vm, NULL), _vm(vm) {
+SceneLight::SceneLight(CGEEngine *vm) : Sprite(vm, nullptr), _vm(vm) {
 	// Set the sprite list
 	BitmapPtr *PR = new BitmapPtr[2];
 	PR[0] = new Bitmap(_vm, "PRESS");
-	PR[1] = NULL;
+	PR[1] = nullptr;
 
 	setShapeList(PR);
 }
 
-Speaker::Speaker(CGEEngine *vm): Sprite(vm, NULL), _vm(vm) {
+Speaker::Speaker(CGEEngine *vm): Sprite(vm, nullptr), _vm(vm) {
 	// Set the sprite list
 	BitmapPtr *SP = new BitmapPtr[3];
 	SP[0] = new Bitmap(_vm, "SPK_L");
 	SP[1] = new Bitmap(_vm, "SPK_R");
-	SP[2] = NULL;
+	SP[2] = nullptr;
 
 	setShapeList(SP);
 }
 
-PocLight::PocLight(CGEEngine *vm): Sprite(vm, NULL), _vm(vm) {
+PocLight::PocLight(CGEEngine *vm): Sprite(vm, nullptr), _vm(vm) {
 	// Set the sprite list
 	BitmapPtr *LI = new BitmapPtr[5];
 	LI[0] = new Bitmap(_vm, "LITE0");
 	LI[1] = new Bitmap(_vm, "LITE1");
 	LI[2] = new Bitmap(_vm, "LITE2");
 	LI[3] = new Bitmap(_vm, "LITE3");
-	LI[4] = NULL;
+	LI[4] = nullptr;
 
 	setShapeList(LI);
 
diff --git a/engines/cge/vmenu.cpp b/engines/cge/vmenu.cpp
index b6f0125fb5..a1ab81612f 100644
--- a/engines/cge/vmenu.cpp
+++ b/engines/cge/vmenu.cpp
@@ -50,7 +50,7 @@ MenuBar::MenuBar(CGEEngine *vm, uint16 w) : Talk(vm), _vm(vm) {
 
 	_ts = new BitmapPtr[2];
 	_ts[0] = new Bitmap(_vm, w, h, p);
-	_ts[1] = NULL;
+	_ts[1] = nullptr;
 	setShapeList(_ts);
 
 	_flags._slav = true;
@@ -59,11 +59,11 @@ MenuBar::MenuBar(CGEEngine *vm, uint16 w) : Talk(vm), _vm(vm) {
 	_flags._bDel = true;
 }
 
-Vmenu *Vmenu::_addr = NULL;
+Vmenu *Vmenu::_addr = nullptr;
 int Vmenu::_recent = -1;
 
 Vmenu::Vmenu(CGEEngine *vm, Choice *list, int x, int y)
-	: Talk(vm, VMGather(list), kTBRect), _menu(list), _bar(NULL), _vmgt(NULL), _vm(vm) {
+	: Talk(vm, VMGather(list), kTBRect), _menu(list), _bar(nullptr), _vmgt(nullptr), _vm(vm) {
 	Choice *cp;
 
 	_addr = this;
@@ -84,7 +84,7 @@ Vmenu::Vmenu(CGEEngine *vm, Choice *list, int x, int y)
 }
 
 Vmenu::~Vmenu() {
-	_addr = NULL;
+	_addr = nullptr;
 }
 
 #define CALL_MEMBER_FN(object,ptrToMember)  ((object).*(ptrToMember))
diff --git a/engines/cge/walk.cpp b/engines/cge/walk.cpp
index f8cf003061..94e7b976db 100644
--- a/engines/cge/walk.cpp
+++ b/engines/cge/walk.cpp
@@ -201,7 +201,7 @@ void Walk::reach(Sprite *spr, int mode) {
 		}
 	}
 	// note: insert SNAIL commands in reverse order
-	_vm->_commandHandler->insertCommand(kCmdPause, -1, 64, NULL);
+	_vm->_commandHandler->insertCommand(kCmdPause, -1, 64, nullptr);
 	_vm->_commandHandler->insertCommand(kCmdSeq, -1, kTSeq + mode, this);
 	if (spr) {
 		_vm->_commandHandler->insertCommand(kCmdWait, -1, -1, _vm->_hero);


Commit: 7f476c844f72b25ed915e1aeabd3b1bb4f93971d
    https://github.com/scummvm/scummvm/commit/7f476c844f72b25ed915e1aeabd3b1bb4f93971d
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
CGE2: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/cge2/detection.cpp
    engines/cge2/events.cpp
    engines/cge2/sound.cpp


diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp
index 8ed992917c..b7ca5dcea8 100644
--- a/engines/cge2/detection.cpp
+++ b/engines/cge2/detection.cpp
@@ -43,7 +43,7 @@ namespace CGE2 {
 
 static const PlainGameDescriptor CGE2Games[] = {
 		{ "sfinx", "Sfinx" },
-		{ 0, 0 }
+		{ nullptr, nullptr }
 };
 
 static const ADGameDescription gameDescriptions[] = {
@@ -162,7 +162,7 @@ public:
 static ADGameDescription s_fallbackDesc = {
 	"sfinx",
 	"Unknown version",
-	AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
+	AD_ENTRY1(nullptr, nullptr), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
 	Common::UNK_LANG,
 	Common::kPlatformDOS,
 	ADGF_NO_FLAGS,
@@ -170,8 +170,8 @@ static ADGameDescription s_fallbackDesc = {
 };
 
 static const ADFileBasedFallback fileBasedFallback[] = {
-	{ &s_fallbackDesc, { "vol.cat", "vol.dat", 0 } },
-	{ 0, { 0 } }
+	{ &s_fallbackDesc, { "vol.cat", "vol.dat", nullptr } },
+	{ nullptr, { nullptr } }
 };
 
 // This fallback detection looks identical to the one used for CGE. In fact, the difference resides
diff --git a/engines/cge2/events.cpp b/engines/cge2/events.cpp
index bd01965f4a..574236f618 100644
--- a/engines/cge2/events.cpp
+++ b/engines/cge2/events.cpp
@@ -56,7 +56,7 @@ bool Keyboard::getKey(Common::Event &event) {
 			return false;
 		// Display ScummVM version and translation strings
 		for (int i = 0; i < 3; i++)
-			_vm->_commandHandler->addCommand(kCmdInf, 1, kShowScummVMVersion + i, NULL);
+			_vm->_commandHandler->addCommand(kCmdInf, 1, kShowScummVMVersion + i, nullptr);
 		return false;
 	case Common::KEYCODE_F5:
 		_vm->saveGameDialog();
diff --git a/engines/cge2/sound.cpp b/engines/cge2/sound.cpp
index 90903081da..7cc54d20e0 100644
--- a/engines/cge2/sound.cpp
+++ b/engines/cge2/sound.cpp
@@ -170,7 +170,7 @@ DataCk *Fx::loadWave(EncryptedStream *file) {
 	byte *data = (byte *)malloc(file->size());
 
 	if (!data)
-		return 0;
+		return nullptr;
 
 	file->read(data, file->size());
 


Commit: 6d232990cfdddff534116a38e62a7dd4498c70b6
    https://github.com/scummvm/scummvm/commit/6d232990cfdddff534116a38e62a7dd4498c70b6
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
CHEWY: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/chewy/detection.cpp


diff --git a/engines/chewy/detection.cpp b/engines/chewy/detection.cpp
index f883c7bf27..964522c34b 100644
--- a/engines/chewy/detection.cpp
+++ b/engines/chewy/detection.cpp
@@ -27,12 +27,12 @@
 
 static const PlainGameDescriptor chewyGames[] = {
 	{"chewy", "Chewy: Esc from F5"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const char *directoryGlobs[] = {
 	"txt",
-	0
+	nullptr
 };
 
 namespace Chewy {
@@ -42,7 +42,7 @@ static const ChewyGameDescription gameDescriptions[] = {
 	{
 		{
 			"chewy",
-			0,
+			nullptr,
 			AD_ENTRY1s("atds.tap", "e6050c144dd4f23d79ea4f89a8ef306e", 218857),
 			Common::EN_ANY,
 			Common::kPlatformDOS,
@@ -55,7 +55,7 @@ static const ChewyGameDescription gameDescriptions[] = {
 		// Chewy - ESC from F5 - Spanish fanmade translation
 		{
 			"chewy",
-			0,
+			nullptr,
 			AD_ENTRY1s("atds.tap", "b1210066a524fe0f88862f44671ed97d", 226988),
 			Common::ES_ESP,
 			Common::kPlatformDOS,
@@ -72,7 +72,7 @@ static const ChewyGameDescription gameDescriptions[] = {
 		// Provided by lotharsm
 		{
 			"chewy",
-			0,
+			nullptr,
 			AD_ENTRY1s("atds.tap", "c117e884cc5b4bbe50ae1217d13916c4", 231071),
 			Common::DE_DEU,
 			Common::kPlatformDOS,
@@ -89,7 +89,7 @@ static const ChewyGameDescription gameDescriptions[] = {
 		// Provided by lotharsm
 		{
 			"chewy",
-			0,
+			nullptr,
 			AD_ENTRY1s("atds.tap", "e22f97761c0e7772ec99660f2277b1a4", 231001),
 			Common::DE_DEU,
 			Common::kPlatformDOS,
@@ -106,7 +106,7 @@ static const ChewyGameDescription gameDescriptions[] = {
 		// CD-ROM has the label "DEMO"
 		{
 			"chewy",
-			0,
+			nullptr,
 			AD_ENTRY1s("atds.tap", "c3be5641e90dd01274309b778cf8146d", 230686),
 			Common::DE_DEU,
 			Common::kPlatformDOS,


Commit: 0b818ad3f685ce256905c426ab824b9f15bfb608
    https://github.com/scummvm/scummvm/commit/0b818ad3f685ce256905c426ab824b9f15bfb608
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
CINE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/cine/anim.cpp
    engines/cine/bg_list.cpp
    engines/cine/cine.cpp
    engines/cine/detection.cpp
    engines/cine/gfx.cpp
    engines/cine/part.cpp
    engines/cine/script_fw.cpp
    engines/cine/script_os.cpp
    engines/cine/sound.cpp
    engines/cine/texte.cpp
    engines/cine/various.cpp


diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index d7a70cbe0f..cea2bfb8e9 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -217,8 +217,8 @@ int16 fixAnimDataTableEndFrame(int entry, int16 startFrame, int16 endFrame) {
 	}
 }
 
-AnimData::AnimData() : _width(0), _height(0), _bpp(0), _var1(0), _data(NULL),
-	_mask(NULL), _fileIdx(-1), _frameIdx(-1), _realWidth(0), _size(0) {
+AnimData::AnimData() : _width(0), _height(0), _bpp(0), _var1(0), _data(nullptr),
+	_mask(nullptr), _fileIdx(-1), _frameIdx(-1), _realWidth(0), _size(0) {
 
 	memset(_name, 0, sizeof(_name));
 }
@@ -228,7 +228,7 @@ AnimData::AnimData() : _width(0), _height(0), _bpp(0), _var1(0), _data(NULL),
  */
 AnimData::AnimData(const AnimData &src) : _width(src._width),
 	_height(src._height), _bpp(src._bpp), _var1(src._var1),
-	_data(NULL), _mask(NULL), _fileIdx(src._fileIdx),
+	_data(nullptr), _mask(nullptr), _fileIdx(src._fileIdx),
 	_frameIdx(src._frameIdx), _realWidth(src._realWidth), _size(src._size) {
 
 	if (src._data) {
@@ -314,8 +314,8 @@ void AnimData::load(byte *d, int type, uint16 w, uint16 h, int16 file,
 	_width = w * 2;
 	_height = h;
 	_var1 = _width >> 3;
-	_data = NULL;
-	_mask = NULL;
+	_data = nullptr;
+	_mask = nullptr;
 	_fileIdx = file;
 	_frameIdx = frame;
 	memset(_name, 0, sizeof(_name));
@@ -396,8 +396,8 @@ void AnimData::clear() {
 	_height = 0;
 	_bpp = 0;
 	_var1 = 0;
-	_data = NULL;
-	_mask = NULL;
+	_data = nullptr;
+	_mask = nullptr;
 	_fileIdx = -1;
 	_frameIdx = -1;
 	memset(_name, 0, sizeof(_name));
@@ -413,8 +413,8 @@ void AnimData::save(Common::OutSaveFile &fHandle) const {
 	fHandle.writeUint16BE(_var1);
 	fHandle.writeUint16BE(_bpp);
 	fHandle.writeUint16BE(_height);
-	fHandle.writeUint32BE(_data != NULL); // _data
-	fHandle.writeUint32BE(_mask != NULL); // _mask
+	fHandle.writeUint32BE(_data != nullptr); // _data
+	fHandle.writeUint32BE(_mask != nullptr); // _mask
 	fHandle.writeUint16BE(_fileIdx);
 	fHandle.writeUint16BE(_frameIdx);
 	fHandle.write(_name, sizeof(_name));
diff --git a/engines/cine/bg_list.cpp b/engines/cine/bg_list.cpp
index 304781012d..434badfc49 100644
--- a/engines/cine/bg_list.cpp
+++ b/engines/cine/bg_list.cpp
@@ -73,7 +73,7 @@ void removeBgIncrustsWithBgIdx(int16 bgIdx) {
 void createBgIncrustListElement(int16 objIdx, int16 param) {
 	BGIncrust tmp;
 
-	tmp.unkPtr = 0;
+	tmp.unkPtr = nullptr;
 	tmp.objIdx = objIdx;
 	tmp.param = param;
 	tmp.x = g_cine->_objectTable[objIdx].x;
@@ -104,7 +104,7 @@ void loadBgIncrustFromSave(Common::SeekableReadStream &fHandle, bool hasBgIdx) {
 		fHandle.readUint32BE();
 		fHandle.readUint32BE();
 
-		tmp.unkPtr = 0;
+		tmp.unkPtr = nullptr;
 		tmp.objIdx = fHandle.readUint16BE();
 		tmp.param = fHandle.readUint16BE();
 		tmp.x = fHandle.readUint16BE();
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index f4eff1322f..04fc97d389 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -41,9 +41,9 @@
 
 namespace Cine {
 
-Sound *g_sound = 0;
+Sound *g_sound = nullptr;
 
-CineEngine *g_cine = 0;
+CineEngine *g_cine = nullptr;
 
 CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc)
 	: Engine(syst),
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 4f80daf7b8..8e7b7d2510 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -32,7 +32,7 @@
 static const PlainGameDescriptor cineGames[] = {
 	{"fw", "Future Wars"},
 	{"os", "Operation Stealth"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #include "cine/detection_tables.h"
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 7585e108b8..c6d550812e 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -39,7 +39,7 @@
 namespace Cine {
 
 byte *collisionPage;
-FWRenderer *renderer = NULL;
+FWRenderer *renderer = nullptr;
 
 #define DEFAULT_MESSAGE_BG 1
 #define DEFAULT_CMD_Y 185
@@ -119,7 +119,7 @@ void plotPoint(int x, int y, int color, void *data) {
 /**
  * Initialize renderer
  */
-FWRenderer::FWRenderer() : _savedBackBuffers(), _background(NULL), _backupPal(), _cmd(""),
+FWRenderer::FWRenderer() : _savedBackBuffers(), _background(nullptr), _backupPal(), _cmd(""),
 	_messageBg(DEFAULT_MESSAGE_BG), _cmdY(DEFAULT_CMD_Y), _backBuffer(new byte[_screenSize]),
 	_activePal(), _changePal(0), _showCollisionPage(false), _fadeToBlackLastCalledMs(0) {
 
@@ -162,7 +162,7 @@ bool FWRenderer::initialize() {
 void FWRenderer::clear() {
 	delete[] _background;
 
-	_background = NULL;
+	_background = nullptr;
 	_backupPal.clear();
 	_activePal.clear();
 
@@ -672,7 +672,7 @@ void FWRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
 		sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
 		len = sprite->_realWidth * sprite->_height;
 		mask = new byte[len];
-		if (sprite->mask() != NULL) {
+		if (sprite->mask() != nullptr) {
 			memcpy(mask, sprite->mask(), len);
 		} else {
 			// This case happens in French Amiga Future Wars (Bug #10643) when
@@ -1202,7 +1202,7 @@ void FWRenderer::pushMenu(Menu *menu) {
 
 Menu *FWRenderer::popMenu() {
 	if (_menuStack.empty())
-		return 0;
+		return nullptr;
 
 	Menu *menu = _menuStack.top();
 	_menuStack.pop();
@@ -1210,8 +1210,8 @@ Menu *FWRenderer::popMenu() {
 }
 
 void FWRenderer::clearMenuStack() {
-	Menu *menu = 0;
-	while ((menu = popMenu()) != 0)
+	Menu *menu = nullptr;
+	while ((menu = popMenu()) != nullptr)
 		delete menu;
 }
 
@@ -2136,7 +2136,7 @@ void drawSpriteRaw(const byte *spritePtr, const byte *maskPtr, int16 width, int1
 }
 
 void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 width, int16 height, byte *page, int16 x, int16 y, byte transparentColor, byte bpp) {
-	byte *pMask = NULL;
+	byte *pMask = nullptr;
 
 	// draw the mask based on next objects in the list
 	Common::List<overlay>::iterator it;
@@ -2151,7 +2151,7 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
 		if ((pCurrentOverlay->type == 5) || ((pCurrentOverlay->type == 21) && (pCurrentOverlay->x == overlayPtr->objIdx))) {
 			AnimData *sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
 
-			if (pMask == NULL) {
+			if (pMask == nullptr) {
 				pMask = new byte[width * height];
 
 				for (int i = 0; i < height; i++) {
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index cb94361808..e88f0a72b6 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -268,7 +268,7 @@ byte *readBundleFile(int16 foundFileIdx, uint32 *size) {
 	}
 
 	// Set the size variable if a pointer to it has been given
-	if (size != NULL) {
+	if (size != nullptr) {
 		*size = g_cine->_partBuffer[foundFileIdx].unpackedSize;
 	}
 
@@ -278,7 +278,7 @@ byte *readBundleFile(int16 foundFileIdx, uint32 *size) {
 byte *readBundleSoundFileOS(const char *entryName, uint32 *size) {
 	int16 index = findFileInBundle(entryName);
 	if (index == -1) {
-		return NULL;
+		return nullptr;
 	}
 
 	return readBundleFile(index, size);
@@ -286,7 +286,7 @@ byte *readBundleSoundFileOS(const char *entryName, uint32 *size) {
 
 byte *readBundleSoundFileFW(const char *entryName, uint32 *size) {
 	int16 index;
-	byte *data = 0;
+	byte *data = nullptr;
 	char previousPartName[15] = "";
 
 	if (g_cine->getGameType() == Cine::GType_FW) {
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp
index 1423c780a0..730e47e35f 100644
--- a/engines/cine/script_fw.cpp
+++ b/engines/cine/script_fw.cpp
@@ -40,7 +40,7 @@ namespace Cine {
 uint16 compareVars(int16 a, int16 b);
 
 
-const Opcode *FWScript::_opcodeTable = 0;
+const Opcode *FWScript::_opcodeTable = nullptr;
 unsigned int FWScript::_numOpcodes = 0;
 
 void FWScript::setupTable() {
@@ -66,9 +66,9 @@ void FWScript::setupTable() {
 		{ &FWScript::o1_compareVar, "bc" },
 		{ &FWScript::o1_modifyObjectParam2, "bbb" },
 		/* 10 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_loadMask0, "b" },
 		/* 14 */
 		{ &FWScript::o1_unloadMask0, "b" },
@@ -81,7 +81,7 @@ void FWScript::setupTable() {
 		{ &FWScript::o1_addSpriteFilledToBgList, "b" },
 		{ &FWScript::o1_clearBgIncrustList, "" },
 		/* 1C */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_label, "l" },
 		{ &FWScript::o1_goto, "b" },
 		{ &FWScript::o1_gotoIfSup, "b" },
@@ -94,56 +94,56 @@ void FWScript::setupTable() {
 		{ &FWScript::o1_gotoIfDiff, "b" },
 		{ &FWScript::o1_removeLabel, "b" },
 		{ &FWScript::o1_loop, "bb" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		/* 28 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 2C */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 30 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_startGlobalScript, "b" },
 		{ &FWScript::o1_endGlobalScript, "b" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		/* 34 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 38 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_loadAnim, "s" },
 		/* 3C */
 		{ &FWScript::o1_loadBg, "s" },
 		{ &FWScript::o1_loadCt, "s" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_loadPart, "s" },
 		/* 40 */
 		{ &FWScript::o1_closePart, "" },
 		{ &FWScript::o1_loadNewPrcName, "bs" },
 		{ &FWScript::o1_requestCheckPendingDataLoad, "" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		/* 44 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_blitAndFade, "" },
 		{ &FWScript::o1_fadeToBlack, "" },
 		{ &FWScript::o1_transformPaletteRange, "bbwww" },
 		/* 48 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_setDefaultMenuBgColor, "b" },
 		{ &FWScript::o1_palRotate, "bbb" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		/* 4C */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_break, "" },
 		/* 50 */
 		{ &FWScript::o1_endScript, "x" },
@@ -151,24 +151,24 @@ void FWScript::setupTable() {
 		{ &FWScript::o1_loadGlobalVar, "bc" },
 		{ &FWScript::o1_compareGlobalVar, "bc" },
 		/* 54 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 58 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_declareFunctionName, "s" },
 		{ &FWScript::o1_freePartRange, "bb" },
 		{ &FWScript::o1_unloadAllMasks, "" },
 		/* 5C */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 60 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_setScreenDimensions, "wwww" },
 		/* 64 */
 		{ &FWScript::o1_displayBackground, "" },
@@ -181,7 +181,7 @@ void FWScript::setupTable() {
 		{ &FWScript::o1_disallowPlayerInput, "" },
 		{ &FWScript::o1_changeDataDisk, "b" },
 		/* 6C */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_loadMusic, "s" },
 		{ &FWScript::o1_playMusic, "" },
 		{ &FWScript::o1_fadeOutMusic, "" },
@@ -191,9 +191,9 @@ void FWScript::setupTable() {
 		{ &FWScript::o1_op72, "wbw" },
 		{ &FWScript::o1_op73, "wbw" },
 		/* 74 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_playSample, "bbwbww" },
 		/* 78 */
 		{ &FWScript::o1_playSampleSwapped, "bbwbww" },
@@ -358,7 +358,7 @@ void ScriptVars::reset() {
  * This constructor _MUST_ be followed by setdata() method call before the
  * instance can be used. It leaves the instance in partially invalid state.
  */
-RawScript::RawScript(uint16 s) : _size(s), _data(NULL),
+RawScript::RawScript(uint16 s) : _size(s), _data(nullptr),
 	_labels(SCRIPT_STACK_SIZE) { }
 
 /**
@@ -367,7 +367,7 @@ RawScript::RawScript(uint16 s) : _size(s), _data(NULL),
  * @param s Bytecode length
  */
 RawScript::RawScript(const FWScriptInfo &info, const byte *data, uint16 s) :
-	_size(s), _data(NULL), _labels(SCRIPT_STACK_SIZE) {
+	_size(s), _data(nullptr), _labels(SCRIPT_STACK_SIZE) {
 
 	setData(info, data);
 }
@@ -737,12 +737,12 @@ void FWScript::save(Common::OutSaveFile &fHandle) const {
  */
 const char *FWScriptInfo::opcodeInfo(byte opcode) const {
 	if (opcode == 0 || opcode > FWScript::_numOpcodes) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (!FWScript::_opcodeTable[opcode - 1].args) {
 		warning("Undefined opcode 0x%02X in FWScriptInfo::opcodeInfo", opcode - 1);
-		return NULL;
+		return nullptr;
 	}
 
 	return FWScript::_opcodeTable[opcode - 1].args;
@@ -754,12 +754,12 @@ const char *FWScriptInfo::opcodeInfo(byte opcode) const {
  */
 OpFunc FWScriptInfo::opcodeHandler(byte opcode) const {
 	if (opcode == 0 || opcode > FWScript::_numOpcodes) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (!FWScript::_opcodeTable[opcode - 1].proc) {
 		warning("Undefined opcode 0x%02X in FWScriptInfo::opcodeHandler", opcode - 1);
-		return NULL;
+		return nullptr;
 	}
 
 	return FWScript::_opcodeTable[opcode - 1].proc;
diff --git a/engines/cine/script_os.cpp b/engines/cine/script_os.cpp
index 8d7b985330..2434ae9872 100644
--- a/engines/cine/script_os.cpp
+++ b/engines/cine/script_os.cpp
@@ -36,7 +36,7 @@
 
 namespace Cine {
 
-const Opcode *OSScript::_opcodeTable = 0;
+const Opcode *OSScript::_opcodeTable = nullptr;
 unsigned int OSScript::_numOpcodes = 0;
 
 void OSScript::setupTable() {
@@ -62,9 +62,9 @@ void OSScript::setupTable() {
 		{ &FWScript::o1_compareVar, "bc" },
 		{ &FWScript::o1_modifyObjectParam2, "bbb" },
 		/* 10 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_loadMask0, "b" },
 		/* 14 */
 		{ &FWScript::o1_unloadMask0, "b" },
@@ -77,7 +77,7 @@ void OSScript::setupTable() {
 		{ &FWScript::o1_addSpriteFilledToBgList, "b" },
 		{ &FWScript::o1_clearBgIncrustList, "" },
 		/* 1C */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_label, "l" },
 		{ &FWScript::o1_goto, "b" },
 		{ &FWScript::o1_gotoIfSup, "b" },
@@ -90,56 +90,56 @@ void OSScript::setupTable() {
 		{ &FWScript::o1_gotoIfDiff, "b" },
 		{ &FWScript::o1_removeLabel, "b" },
 		{ &FWScript::o1_loop, "bb" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		/* 28 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 2C */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 30 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_startGlobalScript, "b" },
 		{ &FWScript::o1_endGlobalScript, "b" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		/* 34 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 38 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_loadAnim, "s" },
 		/* 3C */
 		{ &FWScript::o1_loadBg, "s" },
 		{ &FWScript::o2_loadCt, "s" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o2_loadPart, "s" },
 		/* 40 */
 		{ &FWScript::o1_closePart, "" },
 		{ &FWScript::o1_loadNewPrcName, "bs" },
 		{ &FWScript::o1_requestCheckPendingDataLoad, "" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		/* 44 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_blitAndFade, "" },
 		{ &FWScript::o1_fadeToBlack, "" },
 		{ &FWScript::o1_transformPaletteRange, "bbwww" },
 		/* 48 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_setDefaultMenuBgColor, "b" },
 		{ &FWScript::o1_palRotate, "bbb" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		/* 4C */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_break, "" },
 		/* 50 */
 		{ &FWScript::o1_endScript, "x" },
@@ -147,24 +147,24 @@ void OSScript::setupTable() {
 		{ &FWScript::o1_loadGlobalVar, "bc" },
 		{ &FWScript::o1_compareGlobalVar, "bc" },
 		/* 54 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 58 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_declareFunctionName, "s" },
 		{ &FWScript::o1_freePartRange, "bb" },
 		{ &FWScript::o1_unloadAllMasks, "" },
 		/* 5C */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 60 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_setScreenDimensions, "wwww" },
 		/* 64 */
 		{ &FWScript::o1_displayBackground, "" },
@@ -177,7 +177,7 @@ void OSScript::setupTable() {
 		{ &FWScript::o1_disallowPlayerInput, "" },
 		{ &FWScript::o1_changeDataDisk, "b" }, /* Same as opcodes 0x95 and 0xA9. */
 		/* 6C */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_loadMusic, "s" },
 		{ &FWScript::o1_playMusic, "" },
 		{ &FWScript::o1_fadeOutMusic, "" },
@@ -187,9 +187,9 @@ void OSScript::setupTable() {
 		{ &FWScript::o1_op72, "wbw" }, /* Same as opcode 0x73. TODO: Name this opcode properly. */
 		{ &FWScript::o1_op72, "wbw" }, /* Same as opcode 0x72. */
 		/* 74 */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o2_playSample, "bbwbww" },
 		/* 78 */
 		{ &FWScript::o2_playSampleAlt, "bbwbww" },
@@ -197,9 +197,9 @@ void OSScript::setupTable() {
 		{ &FWScript::o1_loadMask5, "b" },
 		{ &FWScript::o1_unloadMask5, "b" }, /* Last opcode used by Future Wars. */
 		/* 7C */
-		{ 0, 0 },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o2_addSeqListElement, "bbbbwww" },
 		/* 80 */
 		{ &FWScript::o2_removeSeq, "bb" },
@@ -214,7 +214,7 @@ void OSScript::setupTable() {
 		/* 88 */
 		{ &FWScript::o2_gotoIfEquNearest, "b" },
 		{ &FWScript::o2_gotoIfDiffNearest, "b" },
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o2_startObjectScript, "b" },
 		/* 8C */
 		{ &FWScript::o2_stopObjectScript, "b" },
@@ -224,16 +224,16 @@ void OSScript::setupTable() {
 		/* 90 */
 		{ &FWScript::o2_loadAbs, "bs" },
 		{ &FWScript::o2_loadBg, "b" },
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 94 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_changeDataDisk, "b" }, /* Same as opcodes 0x6B and 0xA9. */
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* 98 */
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		{ &FWScript::o2_wasZoneChecked, "b" },
 		{ &FWScript::o2_op9B, "wwwwwwww" }, /* TODO: Name this opcode properly. */
 		/* 9C */
@@ -249,10 +249,10 @@ void OSScript::setupTable() {
 		/* A4 */
 		{ &FWScript::o2_loadMask22, "b" }, /* TODO: Name this opcode properly. */
 		{ &FWScript::o2_unloadMask22, "b" }, /* TODO: Name this opcode properly. */
-		{ 0, 0 },
-		{ 0, 0 },
+		{ nullptr, nullptr },
+		{ nullptr, nullptr },
 		/* A8 */
-		{ 0, 0 },
+		{ nullptr, nullptr },
 		{ &FWScript::o1_changeDataDisk, "b" } /* Same as opcodes 0x6B and 0x95. */
 	};
 	OSScript::_opcodeTable = (const Opcode *)opcodeTable;
@@ -297,12 +297,12 @@ void OSScript::load(const ScriptVars &labels, const ScriptVars &local, uint16 co
  */
 const char *OSScriptInfo::opcodeInfo(byte opcode) const {
 	if (opcode == 0 || opcode > OSScript::_numOpcodes) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (!OSScript::_opcodeTable[opcode - 1].args) {
 		warning("Undefined opcode 0x%02X in OSScriptInfo::opcodeInfo", opcode - 1);
-		return NULL;
+		return nullptr;
 	}
 
 	return OSScript::_opcodeTable[opcode - 1].args;
@@ -314,12 +314,12 @@ const char *OSScriptInfo::opcodeInfo(byte opcode) const {
  */
 OpFunc OSScriptInfo::opcodeHandler(byte opcode) const {
 	if (opcode == 0 || opcode > OSScript::_numOpcodes) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (!OSScript::_opcodeTable[opcode - 1].proc) {
 		warning("Undefined opcode 0x%02X in OSScriptInfo::opcodeHandler", opcode - 1);
-		return NULL;
+		return nullptr;
 	}
 
 	return OSScript::_opcodeTable[opcode - 1].proc;
diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index edf02a81fe..bbb7a267d8 100644
--- a/engines/cine/sound.cpp
+++ b/engines/cine/sound.cpp
@@ -293,7 +293,7 @@ void PCSoundDriver::resetChannel(int channel) {
 }
 
 AdLibSoundDriver::AdLibSoundDriver(Audio::Mixer *mixer)
-	: _upCb(0), _upRef(0), _mixer(mixer) {
+	: _upCb(nullptr), _upRef(nullptr), _mixer(mixer) {
 
 	_opl = OPL::Config::create();
 	if (!_opl || !_opl->init())
@@ -400,7 +400,7 @@ void AdLibSoundDriver::onTimer() {
 }
 
 void AdLibSoundDriver::setupPreloadedInstrument(int channel) {
-	setupInstrument(NULL, channel, false);
+	setupInstrument(nullptr, channel, false);
 }
 
 void AdLibSoundDriver::setupInstrument(const byte *data, int channel, bool loadData) {
@@ -659,7 +659,7 @@ void AdLibSoundDriverADL::playSample(const byte *data, int size, int channel, in
 }
 
 MidiSoundDriverH32::MidiSoundDriverH32(MidiDriver *output)
-	: _output(output), _callback(0), _mutex() {
+	: _output(output), _callback(nullptr), _mutex() {
 }
 
 MidiSoundDriverH32::~MidiSoundDriverH32() {
@@ -1001,7 +1001,7 @@ void MidiSoundDriverH32::selectInstrument(int channel, int timbreGroup, int timb
 PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver)
 	: _playing(false), _driver(driver), _mutex() {
 	memset(_instrumentsData, 0, sizeof(_instrumentsData));
-	_sfxData = NULL;
+	_sfxData = nullptr;
 	_fadeOutCounter = 0;
 	_driver->setUpdateCallback(updateCallback, this);
 }
@@ -1009,7 +1009,7 @@ PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver)
 PCSoundFxPlayer::~PCSoundFxPlayer() {
 	Common::StackLock lock(_mutex);
 
-	_driver->setUpdateCallback(NULL, NULL);
+	_driver->setUpdateCallback(nullptr, nullptr);
 	stop();
 }
 
@@ -1033,7 +1033,7 @@ bool PCSoundFxPlayer::load(const char *song) {
 	}
 
 	for (int i = 0; i < NUM_INSTRUMENTS; ++i) {
-		_instrumentsData[i] = NULL;
+		_instrumentsData[i] = nullptr;
 		char instrument[64];
 		memset(instrument, 0, 64); // Clear the data first
 		memcpy(instrument, _sfxData + 20 + i * 30, 12);
@@ -1051,7 +1051,7 @@ bool PCSoundFxPlayer::load(const char *song) {
 				data && instrumentSize > 0x16) {
 				instrumentSize -= 0x16;
 				byte *tmp = (byte *)calloc(instrumentSize, 1);
-				if (tmp == NULL) {
+				if (tmp == nullptr) {
 					error("PCSoundFxPlayer::load('%s'): Out of memory (%d bytes)", song, instrumentSize);
 				}
 				memcpy(tmp, data + 0x16, instrumentSize);
@@ -1171,10 +1171,10 @@ void PCSoundFxPlayer::handlePattern(int channel, const byte *patternData) {
 void PCSoundFxPlayer::unload() {
 	for (int i = 0; i < NUM_INSTRUMENTS; ++i) {
 		free(_instrumentsData[i]);
-		_instrumentsData[i] = NULL;
+		_instrumentsData[i] = nullptr;
 	}
 	free(_sfxData);
-	_sfxData = NULL;
+	_sfxData = nullptr;
 }
 
 MusicType Sound::musicType() {
@@ -1182,7 +1182,7 @@ MusicType Sound::musicType() {
 }
 
 PCSound::PCSound(Audio::Mixer *mixer, CineEngine *vm)
-	: Sound(mixer, vm), _soundDriver(0) {
+	: Sound(mixer, vm), _soundDriver(nullptr) {
 
 	_currentMusic = 0;
 	_currentMusicStatus = 0;
@@ -1342,7 +1342,7 @@ void PCSound::stopSound(int channel) {
 PaulaSound::PaulaSound(Audio::Mixer *mixer, CineEngine *vm)
 	: Sound(mixer, vm), _sfxTimer(0), _musicTimer(0), _musicFadeTimer(0) {
 	_musicType = MT_AMIGA;
-	_moduleStream = 0;
+	_moduleStream = nullptr;
 	// The original is using the following timer frequency:
 	// 0.709379Mhz / 8000 = 88.672375Hz
 	// 1000000 / 88.672375Hz = 11277.46944863us
@@ -1395,7 +1395,7 @@ void PaulaSound::loadMusic(const char *name) {
 		// look for separate files
 		Common::File f;
 		if (f.open(name)) {
-			_moduleStream = Audio::makeSoundFxStream(&f, 0, _mixer->getOutputRate());
+			_moduleStream = Audio::makeSoundFxStream(&f, nullptr, _mixer->getOutputRate());
 			foundFile = true;
 		}
 	} else {
diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp
index db6a7bc3f2..6f3fb5490c 100644
--- a/engines/cine/texte.cpp
+++ b/engines/cine/texte.cpp
@@ -795,7 +795,7 @@ void freeErrmessDat() {
 	if (allocatedFailureMessages) {
 		free(const_cast<const char **>(failureMessages));
 	}
-	failureMessages = 0;
+	failureMessages = nullptr;
 	allocatedFailureMessages = false;
 }
 
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 5d60aee290..54577fe162 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -594,7 +594,7 @@ void processInventory(int16 x, int16 y) {
 	renderer->drawFrame();
 	renderer->popMenu();
 	delete menu;
-	menu = 0;
+	menu = nullptr;
 
 	manageEvents(PROCESS_INVENTORY, UNTIL_MOUSE_BUTTON_DOWN_UP);
 
@@ -1399,7 +1399,7 @@ uint16 executePlayerInput() {
 }
 
 void drawSprite(Common::List<overlay>::iterator it, const byte *spritePtr, const byte *maskPtr, uint16 width, uint16 height, byte *page, int16 x, int16 y) {
-	byte *msk = NULL;
+	byte *msk = nullptr;
 	int16 maskX, maskY, maskWidth, maskHeight;
 	uint16 maskSpriteIdx;
 


Commit: 6a59febd463588307805594b211396877da91177
    https://github.com/scummvm/scummvm/commit/6a59febd463588307805594b211396877da91177
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
COMPOSER: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/composer/composer.cpp
    engines/composer/detection.cpp
    engines/composer/graphics.cpp
    engines/composer/metaengine.cpp
    engines/composer/resource.cpp
    engines/composer/saveload.cpp


diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 16b78eb0a9..498037c2ec 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -42,7 +42,7 @@ namespace Composer {
 
 ComposerEngine::ComposerEngine(OSystem *syst, const ComposerGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
 	_rnd = new Common::RandomSource("composer");
-	_audioStream = NULL;
+	_audioStream = nullptr;
 	_currSoundPriority = 0;
 	_currentTime = 0;
 	_lastTime = 0;
@@ -51,7 +51,7 @@ ComposerEngine::ComposerEngine(OSystem *syst, const ComposerGameDescription *gam
 	_mouseVisible = true;
 	_mouseEnabled = false;
 	_mouseSpriteId = 0;
-	_lastButton = NULL;
+	_lastButton = nullptr;
 }
 
 ComposerEngine::~ComposerEngine() {
@@ -520,10 +520,10 @@ void ComposerEngine::unloadLibrary(uint id) {
 		_sprites.clear();
 		i->_buttons.clear();
 
-		_lastButton = NULL;
+		_lastButton = nullptr;
 
 		_mixer->stopAll();
-		_audioStream = NULL;
+		_audioStream = nullptr;
 
 		for (uint j = 0; j < _queuedScripts.size(); j++) {
 			_queuedScripts[j]._count = 0;
@@ -679,7 +679,7 @@ const Button *ComposerEngine::getButtonFor(const Sprite *sprite, const Common::P
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 void ComposerEngine::setButtonActive(uint16 id, bool active) {
diff --git a/engines/composer/detection.cpp b/engines/composer/detection.cpp
index 1aa74b3cd2..f7d5a9642f 100644
--- a/engines/composer/detection.cpp
+++ b/engines/composer/detection.cpp
@@ -35,7 +35,7 @@ static const PlainGameDescriptor composerGames[] = {
 	{"magictales", "Magic Tales"},
 	{"princess", "Magic Tales: The Princess and the Crab"},
 	{"sleepingcub", "Magic Tales: Sleeping Cub's Test of Courage"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #include "composer/detection_tables.h"
@@ -49,7 +49,7 @@ static const char *directoryGlobs[] = {
 	"programs",
 	"princess",
 	"sleepcub",
-	0
+	nullptr
 };
 
 class ComposerMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/composer/graphics.cpp b/engines/composer/graphics.cpp
index 0996dcd94e..045f0cdfd0 100644
--- a/engines/composer/graphics.cpp
+++ b/engines/composer/graphics.cpp
@@ -84,8 +84,8 @@ void Animation::seekToCurrPos() {
 }
 
 void ComposerEngine::loadAnimation(Animation *&anim, uint16 animId, int16 x, int16 y, int16 eventParam, int32 size) {
-	Common::SeekableReadStream *stream = NULL;
-	Pipe *newPipe = NULL;
+	Common::SeekableReadStream *stream = nullptr;
+	Pipe *newPipe = nullptr;
 
 	// First, check the existing pipes.
 	for (Common::List<Pipe *>::iterator j = _pipes.begin(); j != _pipes.end(); j++) {
@@ -98,7 +98,7 @@ void ComposerEngine::loadAnimation(Animation *&anim, uint16 animId, int16 x, int
 		// When loading from savegame, make sure we have the correct stream
 		if ((!size) || (stream->size() >= size))
 			break;
-		stream = NULL;
+		stream = nullptr;
 	}
 
 	// If we didn't find it, try the libraries.
@@ -117,7 +117,7 @@ void ComposerEngine::loadAnimation(Animation *&anim, uint16 animId, int16 x, int
 			// When loading from savegame, make sure we have the correct stream
 			if ((!size) || (stream->size() >= size))
 				break;
-			stream = NULL;
+			stream = nullptr;
 		}
 
 		uint32 type = j->_archive->getResourceFlags(ID_ANIM, animId);
@@ -149,9 +149,9 @@ void ComposerEngine::playAnimation(uint16 animId, int16 x, int16 y, int16 eventP
 		stopAnimation(*i);
 	}
 
-	Animation *anim = NULL;
+	Animation *anim = nullptr;
 	loadAnimation(anim, animId, x, y, eventParam);
-	if (anim != NULL) {
+	if (anim != nullptr) {
 		_anims.push_back(anim);
 		runEvent(kEventAnimStarted, animId, eventParam, 0);
 	}
@@ -174,7 +174,7 @@ void ComposerEngine::stopAnimation(Animation *anim, bool localOnly, bool pipesOn
 			} else if (entry.op == kAnimOpPlayWave) {
 				if (_currSoundPriority >= entry.priority) {
 					_mixer->stopAll();
-					_audioStream = NULL;
+					_audioStream = nullptr;
 				}
 			}
 		} else {
@@ -204,10 +204,10 @@ void ComposerEngine::playWaveForAnim(uint16 id, uint16 priority, bool bufferingO
 			return;
 		if (_currSoundPriority > priority) {
 			_mixer->stopAll();
-			_audioStream = NULL;
+			_audioStream = nullptr;
 		}
 	}
-	Common::SeekableReadStream *stream = NULL;
+	Common::SeekableReadStream *stream = nullptr;
 	bool fromPipe = true;
 	if (!bufferingOnly && hasResource(ID_WAVE, id)) {
 		stream = getResource(ID_WAVE, id);
@@ -476,7 +476,7 @@ Sprite *ComposerEngine::addSprite(uint16 id, uint16 animId, uint16 zorder, const
 		sprite._id = id;
 		if (!initSprite(sprite)) {
 			debug(1, "ignoring addSprite on invalid sprite %d", id);
-			return NULL;
+			return nullptr;
 		}
 	}
 
@@ -521,7 +521,7 @@ const Sprite *ComposerEngine::getSpriteAtPos(const Common::Point &pos) {
 			return &(*i);
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 void ComposerEngine::dirtySprite(const Sprite &sprite) {
@@ -797,7 +797,7 @@ Common::SeekableReadStream *ComposerEngine::getStreamForSprite(uint16 id) {
 	}
 	if (hasResource(ID_BMAP, id))
 		return getResource(ID_BMAP, id);
-	return NULL;
+	return nullptr;
 }
 
 bool ComposerEngine::initSprite(Sprite &sprite) {
diff --git a/engines/composer/metaengine.cpp b/engines/composer/metaengine.cpp
index 2f704aa342..c3be17cd96 100644
--- a/engines/composer/metaengine.cpp
+++ b/engines/composer/metaengine.cpp
@@ -53,7 +53,7 @@ Common::Platform ComposerEngine::getPlatform() const {
 
 bool ComposerEngine::loadDetectedConfigFile(Common::INIFile &configFile) const {
 	const ADGameFileDescription *res = _gameDescription->desc.filesDescriptions;
-	while (res->fileName != NULL) {
+	while (res->fileName != nullptr) {
 		if (res->fileType == GAME_CONFIGFILE) {
 			return configFile.loadFromFile(res->fileName);
 		}
@@ -96,7 +96,7 @@ bool ComposerMetaEngine::hasFeature(MetaEngineFeature f) const {
 }
 
 Common::String getSaveName(Common::InSaveFile *in) {
-	Common::Serializer ser(in, NULL);
+	Common::Serializer ser(in, nullptr);
 	Common::String name;
 	uint32 tmp;
 	ser.syncAsUint32LE(tmp);
diff --git a/engines/composer/resource.cpp b/engines/composer/resource.cpp
index fa1811c05a..6fdda19e1a 100644
--- a/engines/composer/resource.cpp
+++ b/engines/composer/resource.cpp
@@ -34,7 +34,7 @@ namespace Composer {
 // (copied from clone2727's mohawk code)
 
 Archive::Archive() {
-	_stream = 0;
+	_stream = nullptr;
 }
 
 Archive::~Archive() {
@@ -59,7 +59,7 @@ bool Archive::openFile(const Common::String &fileName) {
 
 void Archive::close() {
 	_types.clear();
-	delete _stream; _stream = 0;
+	delete _stream; _stream = nullptr;
 }
 
 bool Archive::hasResource(uint32 tag, uint16 id) const {
@@ -251,7 +251,7 @@ bool ComposerArchive::openStream(Common::SeekableReadStream *stream) {
 Pipe::Pipe(Common::SeekableReadStream *stream, uint16 id) {
 	_offset = 0;
 	_stream = stream;
-	_anim = NULL;
+	_anim = nullptr;
 	_pipeId = id;
 }
 
diff --git a/engines/composer/saveload.cpp b/engines/composer/saveload.cpp
index 231e687080..aef708d6a6 100644
--- a/engines/composer/saveload.cpp
+++ b/engines/composer/saveload.cpp
@@ -277,7 +277,7 @@ Common::Error ComposerEngine::loadGameState(int slot) {
 	if (!(in = _saveFileMan->openForLoading(filename)))
 		return Common::kPathNotFile;
 
-	Common::Serializer ser(in, NULL);
+	Common::Serializer ser(in, nullptr);
 	byte magic[4];
 	ser.syncBytes(magic, 4);
 	if (magic[0] != 'C' || magic[1] != 'M' || magic[2] != 'P' || magic[3] != 'S')
@@ -353,7 +353,7 @@ Common::Error ComposerEngine::loadGameState(int slot) {
 	_needsUpdate = true;
 
 	_mixer->stopAll();
-	_audioStream = NULL;
+	_audioStream = nullptr;
 
 	// Restore the buffered audio
 	ser.syncAsSint16LE(_currSoundPriority);
@@ -376,7 +376,7 @@ Common::Error ComposerEngine::saveGameState(int slot, const Common::String &desc
 	if (!(out = _saveFileMan->openForSaving(filename)))
 		return Common::kWritingFailed;
 
-	Common::Serializer ser(NULL, out);
+	Common::Serializer ser(nullptr, out);
 	byte magic[4] = {'C', 'M', 'P', 'S'};
 	ser.syncBytes(magic, 4);
 	ser.syncVersion(0);


Commit: 52e1aa78a062222061bffc1c3653b43ba2fed84b
    https://github.com/scummvm/scummvm/commit/52e1aa78a062222061bffc1c3653b43ba2fed84b
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
CRUISE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/cruise/actor.cpp
    engines/cruise/background.cpp
    engines/cruise/backgroundIncrust.cpp
    engines/cruise/cell.cpp
    engines/cruise/cruise.cpp
    engines/cruise/cruise_main.cpp
    engines/cruise/ctp.cpp
    engines/cruise/dataLoader.cpp
    engines/cruise/detection.cpp
    engines/cruise/font.cpp
    engines/cruise/function.cpp
    engines/cruise/linker.cpp
    engines/cruise/mainDraw.cpp
    engines/cruise/menu.cpp
    engines/cruise/object.cpp
    engines/cruise/overlay.cpp
    engines/cruise/perso.cpp
    engines/cruise/saveload.cpp
    engines/cruise/script.cpp
    engines/cruise/sound.cpp
    engines/cruise/stack.cpp
    engines/cruise/staticres.cpp
    engines/cruise/various.cpp
    engines/cruise/vars.cpp
    engines/cruise/volume.cpp


diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp
index 84a8d4e734..cf59106590 100644
--- a/engines/cruise/actor.cpp
+++ b/engines/cruise/actor.cpp
@@ -65,7 +65,7 @@ actorStruct *findActor(actorStruct *pStartEntry, int overlayIdx, int objIdx, int
 		pCurrentEntry = pCurrentEntry->next;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 int nclick_noeud;
@@ -636,14 +636,14 @@ int16 computePathfinding(MovementEntry &moveInfo, int16 x, int16 y, int16 destX,
 		return (-1);
 	}
 
-	valide_noeud(select_noeud, point_select, &nclick_noeud, NULL);
+	valide_noeud(select_noeud, point_select, &nclick_noeud, nullptr);
 
 	flag_aff_chemin = 0;
 
 	/******* cherche le deuxieme noeud ******/
 
 	num = 0;
-	while (num < NUM_PERSONS && persoTable[num] != NULL)
+	while (num < NUM_PERSONS && persoTable[num] != nullptr)
 		num++;
 
 	if (num == NUM_PERSONS) {
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index b51ef15515..e8196f152c 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -28,7 +28,7 @@ namespace Cruise {
 
 uint8 colorMode = 0;
 
-uint8 *backgroundScreens[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };	// wasn't initialized in original, but it's probably better
+uint8 *backgroundScreens[8] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };	// wasn't initialized in original, but it's probably better
 bool backgroundChanged[8] = { false, false, false, false, false, false, false, false };
 backgroundTableStruct backgroundTable[8];
 
@@ -107,7 +107,7 @@ int loadBackground(const char *name, int idx) {
 	backgroundChanged[idx] = true;
 
 	ptrToFree = gfxModuleData.pPage10;
-	if (loadFileSub1(&ptrToFree, name, NULL) < 0) {
+	if (loadFileSub1(&ptrToFree, name, nullptr) < 0) {
 		if (ptrToFree != gfxModuleData.pPage10)
 			MemFree(ptrToFree);
 
diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp
index 77e15ccf4c..342c52c6db 100644
--- a/engines/cruise/backgroundIncrust.cpp
+++ b/engines/cruise/backgroundIncrust.cpp
@@ -28,13 +28,13 @@ namespace Cruise {
 backgroundIncrustStruct backgroundIncrustHead;
 
 void resetBackgroundIncrustList(backgroundIncrustStruct *pHead) {
-	pHead->next = NULL;
-	pHead->prev = NULL;
+	pHead->next = nullptr;
+	pHead->prev = nullptr;
 }
 
 // blit background to another one
 void addBackgroundIncrustSub1(int fileIdx, int X, int Y, char *ptr2, int16 scale, char *destBuffer, char *dataPtr) {
-	assert((dataPtr != NULL) && (*dataPtr != 0));
+	assert((dataPtr != nullptr) && (*dataPtr != 0));
 
 	buildPolyModel(X, Y, scale, ptr2, destBuffer, dataPtr);
 }
@@ -63,11 +63,11 @@ void restoreBackground(backgroundIncrustStruct *pIncrust) {
 		return;
 	if (pIncrust->type != 1)
 		return;
-	if (pIncrust->ptr == NULL)
+	if (pIncrust->ptr == nullptr)
 		return;
 
 	uint8* pBackground = backgroundScreens[pIncrust->backgroundIdx];
-	if (pBackground == NULL)
+	if (pBackground == nullptr)
 		return;
 
 	backgroundChanged[pIncrust->backgroundIdx] = true;
@@ -96,14 +96,14 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx,	int16 objectIdx,
 
 	// Don't process any further if not a sprite or polygon
 	if (!ptr)
-		return NULL;
+		return nullptr;
 
 	if ((filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_SPRITE) &&
 		(filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_POLY))
-		return NULL;
+		return nullptr;
 
 	uint8 *backgroundPtr = backgroundScreens[backgroundIdx];
-	assert(backgroundPtr != NULL);
+	assert(backgroundPtr != nullptr);
 
 	backgroundChanged[backgroundIdx] = true;
 	backgroundIncrustStruct *currentHead = pHead;
@@ -117,7 +117,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx,	int16 objectIdx,
 	backgroundIncrustStruct *newElement = (backgroundIncrustStruct *)mallocAndZero(sizeof(backgroundIncrustStruct));
 
 	if (!newElement)
-		return NULL;
+		return nullptr;
 
 	newElement->next = currentHead->next;
 	currentHead->next = newElement;
@@ -138,7 +138,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx,	int16 objectIdx,
 	newElement->scale = params.scale;
 	newElement->frame = params.fileIdx;
 	newElement->spriteId = filesDatabase[params.fileIdx].subData.index;
-	newElement->ptr = NULL;
+	newElement->ptr = nullptr;
 	strcpy(newElement->name, filesDatabase[params.fileIdx].subData.name);
 
 	if (filesDatabase[params.fileIdx].subData.resourceType == OBJ_TYPE_SPRITE) {
@@ -148,7 +148,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx,	int16 objectIdx,
 		if (saveBuffer == 1)
 			backupBackground(newElement, newElement->X, newElement->Y, width, height, backgroundPtr);
 
-		drawSprite(width, height, NULL, filesDatabase[params.fileIdx].subData.ptr, newElement->Y,
+		drawSprite(width, height, nullptr, filesDatabase[params.fileIdx].subData.ptr, newElement->Y,
 			newElement->X, backgroundPtr, filesDatabase[params.fileIdx].subData.ptrMask);
 	} else {
 		// poly
@@ -172,7 +172,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx,	int16 objectIdx,
 			backupBackground(newElement, sizeTable[0] - 2, sizeTable[2], width, height, backgroundPtr);
 		}
 
-		addBackgroundIncrustSub1(params.fileIdx, newElement->X, newElement->Y, NULL, params.scale, (char *)backgroundPtr, (char *)filesDatabase[params.fileIdx].subData.ptr);
+		addBackgroundIncrustSub1(params.fileIdx, newElement->X, newElement->Y, nullptr, params.scale, (char *)backgroundPtr, (char *)filesDatabase[params.fileIdx].subData.ptr);
 	}
 
 	return newElement;
@@ -189,7 +189,7 @@ void regenerateBackgroundIncrust(backgroundIncrustStruct *pHead) {
 		if (frame < 0)
 			error("regenerateBackgroundIncrust() : Unexpected use of negative frame index");
 
-		if ((filesDatabase[frame].subData.ptr == NULL) || (strcmp(pl->name, filesDatabase[frame].subData.name))) {
+		if ((filesDatabase[frame].subData.ptr == nullptr) || (strcmp(pl->name, filesDatabase[frame].subData.name))) {
 			frame = NUM_FILE_ENTRIES - 1;
 			if (loadFile(pl->name, frame, pl->spriteId) < 0)
 				frame = -1;
@@ -201,10 +201,10 @@ void regenerateBackgroundIncrust(backgroundIncrustStruct *pHead) {
 				int width = filesDatabase[frame].width;
 				int height = filesDatabase[frame].height;
 
-				drawSprite(width, height, NULL, filesDatabase[frame].subData.ptr, pl->Y, pl->X, backgroundScreens[pl->backgroundIdx], filesDatabase[frame].subData.ptrMask);
+				drawSprite(width, height, nullptr, filesDatabase[frame].subData.ptr, pl->Y, pl->X, backgroundScreens[pl->backgroundIdx], filesDatabase[frame].subData.ptrMask);
 			} else {
 				// Poly
-				addBackgroundIncrustSub1(frame, pl->X, pl->Y, NULL, pl->scale, (char *)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr);
+				addBackgroundIncrustSub1(frame, pl->X, pl->Y, nullptr, pl->scale, (char *)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr);
 			}
 
 			backgroundChanged[pl->backgroundIdx] = true;
diff --git a/engines/cruise/cell.cpp b/engines/cruise/cell.cpp
index 46539463b8..ba076fd4e4 100644
--- a/engines/cruise/cell.cpp
+++ b/engines/cruise/cell.cpp
@@ -29,8 +29,8 @@ namespace Cruise {
 cellStruct cellHead;
 
 void resetPtr(cellStruct *ptr) {
-	ptr->next = NULL;
-	ptr->prev = NULL;
+	ptr->next = nullptr;
+	ptr->prev = nullptr;
 }
 
 void freeMessageList(cellStruct *objPtr) {
@@ -51,7 +51,7 @@ cellStruct *addCell(cellStruct *pHead, int16 overlayIdx, int16 objIdx, int16 typ
 	cellStruct *currentHead3;
 
 	if (getSingleObjectParam(overlayIdx, objIdx, 2, &var) < 0) {
-		return 0;
+		return nullptr;
 	}
 
 	currentHead3 = currentHead;
@@ -76,7 +76,7 @@ cellStruct *addCell(cellStruct *pHead, int16 overlayIdx, int16 objIdx, int16 typ
 		        (currentHead2->idx == objIdx) &&
 		        (currentHead2->type == type))
 
-			return NULL;
+			return nullptr;
 	}
 
 	currentHead = currentHead2;
@@ -84,7 +84,7 @@ cellStruct *addCell(cellStruct *pHead, int16 overlayIdx, int16 objIdx, int16 typ
 	newElement = (cellStruct *) mallocAndZero(sizeof(cellStruct));
 
 	if (!newElement)
-		return 0;
+		return nullptr;
 
 	newElement->next = currentHead3->next;
 	currentHead3->next = newElement;
@@ -96,7 +96,7 @@ cellStruct *addCell(cellStruct *pHead, int16 overlayIdx, int16 objIdx, int16 typ
 	newElement->freeze = 0;
 	newElement->parent = scriptNumber;
 	newElement->parentOverlay = scriptOverlay;
-	newElement->gfxPtr = NULL;
+	newElement->gfxPtr = nullptr;
 	newElement->followObjectIdx = objIdx;
 	newElement->followObjectOverlayIdx = overlayIdx;
 	newElement->parentType = scriptType;
@@ -152,7 +152,7 @@ void createTextObject(cellStruct *pObject, int overlayIdx, int messageIdx, int x
 	pNewElement->freeze = 0;
 	pNewElement->parent = parentIdx;
 	pNewElement->parentOverlay = parentOvl;
-	pNewElement->gfxPtr = NULL;
+	pNewElement->gfxPtr = nullptr;
 
 	cx = savePObject;
 
@@ -257,15 +257,15 @@ void sortCells(int16 ovlIdx, int16 ovjIdx, cellStruct *objPtr) {
 	cellStruct prov;
 	int16 newz, objz, sobjz;
 
-	pl4 = NULL;
+	pl4 = nullptr;
 
 	getSingleObjectParam(ovlIdx, ovjIdx, 2, &sobjz);
 	pl = objPtr;
-	prov.next = NULL;
-	prov.prev = NULL;
+	prov.next = nullptr;
+	prov.prev = nullptr;
 
 	pl2 = pl->next;
-	pllast = NULL;
+	pllast = nullptr;
 	plz = objPtr;
 
 	while (pl2) {
@@ -287,11 +287,11 @@ void sortCells(int16 ovlIdx, int16 ovjIdx, cellStruct *objPtr) {
 				prov.prev = pl2;
 			}
 
-			pl2->prev = NULL;
+			pl2->prev = nullptr;
 			pl2->next = prov.next;
 			prov.next = pl2;
 
-			if (pllast == NULL) {
+			if (pllast == nullptr) {
 				pllast = pl2;
 			}
 		} else {
diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp
index 39ce2df251..596b3d2755 100644
--- a/engines/cruise/cruise.cpp
+++ b/engines/cruise/cruise.cpp
@@ -116,7 +116,7 @@ void CruiseEngine::deinitialize() {
 	for (int i = 0; i < 8; ++i) {
 		if (backgroundScreens[i]) {
 			MemFree(backgroundScreens[i]);
-			backgroundScreens[i] = NULL;
+			backgroundScreens[i] = nullptr;
 		}
 	}
 }
@@ -148,7 +148,7 @@ bool CruiseEngine::loadLanguageStrings() {
 
 	} else {
 		// Try and use one of the pre-defined language lists
-		const char **p = NULL;
+		const char **p = nullptr;
 		switch (getLanguage()) {
 		case Common::EN_ANY:
 			p = englishLanguageStrings;
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 0857712e0a..6f6fcd6361 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -189,8 +189,8 @@ void initBigVar3() {
 			MemFree(filesDatabase[i].subData.ptr);
 		}
 
-		filesDatabase[i].subData.ptr = NULL;
-		filesDatabase[i].subData.ptrMask = NULL;
+		filesDatabase[i].subData.ptr = nullptr;
+		filesDatabase[i].subData.ptrMask = nullptr;
 
 		filesDatabase[i].subData.index = -1;
 		filesDatabase[i].subData.resourceType = 0;
@@ -198,7 +198,7 @@ void initBigVar3() {
 }
 
 void resetPtr2(scriptInstanceStruct *ptr) {
-	ptr->nextScriptPtr = NULL;
+	ptr->nextScriptPtr = nullptr;
 	ptr->scriptNumber = -1;
 }
 
@@ -214,27 +214,27 @@ void resetActorPtr(actorStruct *ptr) {
 		} while (p);
 	}
 
-	ptr->next = NULL;
-	ptr->prev = NULL;
+	ptr->next = nullptr;
+	ptr->prev = nullptr;
 }
 
 ovlData3Struct *getOvlData3Entry(int32 scriptNumber, int32 param) {
 	ovlDataStruct *ovlData = overlayTable[scriptNumber].ovlData;
 
 	if (!ovlData) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (param < 0) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (ovlData->numProc <= param) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (!ovlData->arrayProc) {
-		return NULL;
+		return nullptr;
 	}
 
 	return (&ovlData->arrayProc[param]);
@@ -244,19 +244,19 @@ ovlData3Struct *scriptFunc1Sub2(int32 scriptNumber, int32 param) {
 	ovlDataStruct *ovlData = overlayTable[scriptNumber].ovlData;
 
 	if (!ovlData) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (param < 0) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (ovlData->numRel <= param) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (!ovlData->ptr1) {
-		return NULL;
+		return nullptr;
 	}
 
 	return &ovlData->ptr1[param];
@@ -279,12 +279,12 @@ uint8 *getDataFromData3(ovlData3Struct *ptr, int param) {
 	uint8 *dataPtr;
 
 	if (!ptr)
-		return (NULL);
+		return (nullptr);
 
 	dataPtr = ptr->dataPtr;
 
 	if (!dataPtr)
-		return (NULL);
+		return (nullptr);
 
 	switch (param) {
 	case 0:
@@ -300,7 +300,7 @@ uint8 *getDataFromData3(ovlData3Struct *ptr, int param) {
 	case 5:
 		return (dataPtr + ptr->offsetToSubData5);
 	default:
-		return NULL;
+		return nullptr;
 	}
 }
 
@@ -414,8 +414,8 @@ void resetFileEntry(int32 entryNumber) {
 	if (filesDatabase[entryNumber].subData.ptrMask)
 		MemFree(filesDatabase[entryNumber].subData.ptrMask);
 
-	filesDatabase[entryNumber].subData.ptr = NULL;
-	filesDatabase[entryNumber].subData.ptrMask = NULL;
+	filesDatabase[entryNumber].subData.ptr = nullptr;
+	filesDatabase[entryNumber].subData.ptrMask = nullptr;
 	filesDatabase[entryNumber].widthInColumn = 0;
 	filesDatabase[entryNumber].width = 0;
 	filesDatabase[entryNumber].resType = OBJ_TYPE_LINE;
@@ -429,7 +429,7 @@ void resetFileEntry(int32 entryNumber) {
 uint8 *mainProc14(uint16 overlay, uint16 idx) {
 	assert(0);
 
-	return NULL;
+	return nullptr;
 }
 
 void CruiseEngine::initAllData() {
@@ -446,7 +446,7 @@ void CruiseEngine::initAllData() {
 	soundList[2].frameNum = -1;
 	soundList[3].frameNum = -1;
 
-	menuTable[0] = NULL;
+	menuTable[0] = nullptr;
 
 	for (int i = 0; i < 2000; i++)
 		globalVars[i] = 0;
@@ -455,8 +455,8 @@ void CruiseEngine::initAllData() {
 		backgroundTable[i].name[0] = 0;
 
 	for (int i = 0; i < NUM_FILE_ENTRIES; i++) {
-		filesDatabase[i].subData.ptr = NULL;
-		filesDatabase[i].subData.ptrMask = NULL;
+		filesDatabase[i].subData.ptr = nullptr;
+		filesDatabase[i].subData.ptrMask = nullptr;
 	}
 
 	initBigVar3();
@@ -784,7 +784,7 @@ void buildInventory(int X, int Y) {
 	pMenu = createMenu(X, Y, _vm->langString(ID_INVENTORY));
 	menuTable[1] = pMenu;
 
-	if (pMenu == NULL)
+	if (pMenu == nullptr)
 		return;
 
 	int numObjectInInventory = 0;
@@ -811,7 +811,7 @@ void buildInventory(int X, int Y) {
 
 	if (numObjectInInventory == 0) {
 		freeMenu(menuTable[1]);
-		menuTable[1] = NULL;
+		menuTable[1] = nullptr;
 	}
 }
 
@@ -822,12 +822,12 @@ menuElementStruct *currentMenuElement;
 menuElementSubStruct *getSelectedEntryInMenu(menuStruct *pMenu) {
 	menuElementStruct *pMenuElement;
 
-	if (pMenu == NULL) {
-		return NULL;
+	if (pMenu == nullptr) {
+		return nullptr;
 	}
 
 	if (pMenu->numElements == 0) {
-		return NULL;
+		return nullptr;
 	}
 
 	pMenuElement = pMenu->ptrNextElement;
@@ -844,7 +844,7 @@ menuElementSubStruct *getSelectedEntryInMenu(menuStruct *pMenu) {
 		pMenuElement = pMenuElement->next;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 bool createDialog(int objOvl, int objIdx, int x, int y) {
@@ -896,9 +896,9 @@ bool createDialog(int objOvl, int objIdx, int x, int y) {
 						char verbName[80];
 						verbName[0]	= 0;
 
-						ovlDataStruct *ovl2 = NULL;
-						ovlDataStruct *ovl3 = NULL;
-						ovlDataStruct *ovl4 = NULL;
+						ovlDataStruct *ovl2 = nullptr;
+						ovlDataStruct *ovl3 = nullptr;
+						ovlDataStruct *ovl4 = nullptr;
 
 						if (verbOvl > 0)
 							ovl2 = overlayTable[verbOvl].ovlData;
@@ -992,8 +992,8 @@ bool findRelation(int objOvl, int objIdx, int x, int y) {
 					char verbName[80];
 					verbName[0]	= 0;
 
-					ovlDataStruct *ovl2 = NULL;
-					ovlDataStruct *ovl3 = NULL;
+					ovlDataStruct *ovl2 = nullptr;
+					ovlDataStruct *ovl3 = nullptr;
 
 					if (verbOvl > 0)
 						ovl2 = overlayTable[verbOvl].ovlData;
@@ -1051,14 +1051,14 @@ int processInventory() {
 			int var4 = pMenuElementSub->header;
 
 			freeMenu(menuTable[1]);
-			menuTable[1] = NULL;
+			menuTable[1] = nullptr;
 
 			findRelation(var2, var4, currentMenuElementX + 80, currentMenuElementY);
 
 			return 1;
 		} else {
 			freeMenu(menuTable[1]);
-			menuTable[1] = NULL;
+			menuTable[1] = nullptr;
 		}
 	}
 
@@ -1066,12 +1066,12 @@ int processInventory() {
 }
 
 void callSubRelation(menuElementSubStruct *pMenuElement, int nOvl, int nObj) {
-	if (pMenuElement == NULL)
+	if (pMenuElement == nullptr)
 		return;
 
 	menuElementSubStruct* pCurrent = pMenuElement;
 
-	while (pCurrent != NULL) {
+	while (pCurrent != nullptr) {
 		int ovlIdx = pCurrent->ovlIdx;
 		int header = pCurrent->header;
 
@@ -1218,12 +1218,12 @@ int findHighColor() {
 }
 
 void callRelation(menuElementSubStruct *pMenuElement, int nObj2) {
-	if (pMenuElement == NULL)
+	if (pMenuElement == nullptr)
 		return;
 
 	menuElementSubStruct* pCurrent = pMenuElement;
 
-	while (pCurrent != NULL) {
+	while (pCurrent != nullptr) {
 		int ovlIdx = pCurrent->ovlIdx;
 		int header = pCurrent->header;
 
@@ -1354,20 +1354,20 @@ void callRelation(menuElementSubStruct *pMenuElement, int nObj2) {
 void closeAllMenu() {
 	if (menuTable[0]) {
 		freeMenu(menuTable[0]);
-		menuTable[0] = NULL;
+		menuTable[0] = nullptr;
 	}
 
 	if (menuTable[1]) {
 		freeMenu(menuTable[1]);
-		menuTable[1] = NULL;
+		menuTable[1] = nullptr;
 	}
 	if (linkedMsgList) {
 		assert(0);
 //					freeMsgList(linkedMsgList);
 	}
 
-	linkedMsgList = NULL;
-	linkedRelation = NULL;
+	linkedMsgList = nullptr;
+	linkedRelation = nullptr;
 }
 
 bool checkInput(int16 *buttonPtr) {
@@ -1494,7 +1494,7 @@ int CruiseEngine::processInput() {
 			changeCursor(CURSOR_NORMAL);
 		}
 
-		if ((menuTable[0] == NULL) && (!buttonDown)) {
+		if ((menuTable[0] == nullptr) && (!buttonDown)) {
 			int dialogFound = createDialog(dialogueOvl, dialogueObj, xdial, 0);
 
 			if (menuTable[0]) {
@@ -1502,7 +1502,7 @@ int CruiseEngine::processInput() {
 					currentActiveMenu = 0;
 				} else {
 					freeMenu(menuTable[0]);
-					menuTable[0] = NULL;
+					menuTable[0] = nullptr;
 					currentActiveMenu = -1;
 				}
 			} else {
@@ -1514,15 +1514,15 @@ int CruiseEngine::processInput() {
 					callRelation(getSelectedEntryInMenu(menuTable[0]), dialogueObj);
 
 					freeMenu(menuTable[0]);
-					menuTable[0] = NULL;
+					menuTable[0] = nullptr;
 
 					if (linkedMsgList) {
 						assert(0);
 						//					freeMsgList(linkedMsgList);
 					}
 
-					linkedMsgList = NULL;
-					linkedRelation = NULL;
+					linkedMsgList = nullptr;
+					linkedRelation = nullptr;
 
 					changeCursor(CURSOR_NORMAL);
 					currentActiveMenu = -1;
@@ -1550,14 +1550,14 @@ int CruiseEngine::processInput() {
 						callSubRelation(linkedRelation, objOvl, objIdx);
 					}
 					freeMenu(menuTable[0]);
-					menuTable[0] = NULL;
+					menuTable[0] = nullptr;
 				}
 
 				if (linkedMsgList) {
 //					freeMsgList(linkedMsgList);
 				}
-				linkedMsgList = NULL;
-				linkedRelation = NULL;
+				linkedMsgList = nullptr;
+				linkedRelation = nullptr;
 				changeCursor(CURSOR_NORMAL);
 			} else { // call sub relation when clicking in inventory
 				if (menuTable[0] && menuTable[1]) {
@@ -1576,7 +1576,7 @@ int CruiseEngine::processInput() {
 			// manage click on object menu
 			if (menuDown == 0) {
 				// Handle left click on an object
-				if (menuTable[0] == 0) {
+				if (menuTable[0] == nullptr) {
 					int objOvl;
 					int objIdx;
 					int objType;
@@ -1592,7 +1592,7 @@ int CruiseEngine::processInput() {
 							} else {
 								// object has a name but no relation, just move the character
 								freeMenu(menuTable[0]);
-								menuTable[0] = NULL;
+								menuTable[0] = nullptr;
 
 								aniX = mouseX;
 								aniY = mouseY;
@@ -1619,7 +1619,7 @@ int CruiseEngine::processInput() {
 						// if there is a linked relation, close menu
 						if (!linkedRelation) {
 							freeMenu(menuTable[0]);
-							menuTable[0] = NULL;
+							menuTable[0] = nullptr;
 							changeCursor(CURSOR_NORMAL);
 						} else { // else create the message for the linked relation
 							char text[80];
@@ -1651,15 +1651,15 @@ int CruiseEngine::processInput() {
 			keyboardCode = Common::KEYCODE_INVALID;
 
 			// close object menu if there is no linked relation
-			if ((linkedRelation == 0) && (menuTable[0])) {
+			if ((linkedRelation == nullptr) && (menuTable[0])) {
 				freeMenu(menuTable[0]);
-				menuTable[0] = NULL;
+				menuTable[0] = nullptr;
 				selectDown = 0;
 				menuDown = 0;
 				currentActiveMenu = -1;
 			}
 
-			if ((!selectDown) && (!menuDown) && (menuTable[1] == NULL)) {
+			if ((!selectDown) && (!menuDown) && (menuTable[1] == nullptr)) {
 				buildInventory(mouseX, mouseY);
 
 				if (menuTable[1]) {
@@ -1768,7 +1768,7 @@ void CruiseEngine::mainLoop() {
 
 	currentActiveMenu = -1;
 	autoMsg = -1;
-	linkedRelation = 0;
+	linkedRelation = nullptr;
 	userWait = false;
 	autoTrack = false;
 
diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp
index 4458e39e91..f4c499ae11 100644
--- a/engines/cruise/ctp.cpp
+++ b/engines/cruise/ctp.cpp
@@ -215,11 +215,11 @@ int initCt(const char *ctpName) {
 
 	if (!loadCtFromSave) {
 		for (int i = 0; i < 10; i++) {
-			persoTable[i] = NULL;
+			persoTable[i] = nullptr;
 		}
 	}
-	uint8* ptr = NULL;
-	if (!loadFileSub1(&ptr, ctpName, 0)) {
+	uint8* ptr = nullptr;
+	if (!loadFileSub1(&ptr, ctpName, nullptr)) {
 		MemFree(ptr);
 		return (-18);
 	}
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index d5b6541c2a..6c3a2ebd00 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -238,12 +238,12 @@ int getNumMaxEntiresInSet(uint8 *ptr) {
 }
 
 int loadFile(const char* name, int idx, int destIdx) {
-	uint8 *ptr = NULL;
+	uint8 *ptr = nullptr;
 	fileTypeEnum fileType;
 
 	fileType = getFileType(name);
 
-	loadFileSub1(&ptr, name, NULL);
+	loadFileSub1(&ptr, name, nullptr);
 
 	switch (fileType) {
 	case type_SET: {
@@ -280,12 +280,12 @@ int loadFile(const char* name, int idx, int destIdx) {
 }
 
 int loadFileRange(const char *name, int startIdx, int currentEntryIdx, int numIdx) {
-	uint8 *ptr = NULL;
+	uint8 *ptr = nullptr;
 	fileTypeEnum fileType;
 
 	fileType = getFileType(name);
 
-	loadFileSub1(&ptr, name, NULL);
+	loadFileSub1(&ptr, name, nullptr);
 
 	switch (fileType) {
 	case type_SET: {
@@ -320,14 +320,14 @@ int loadFileRange(const char *name, int startIdx, int currentEntryIdx, int numId
 }
 
 int loadFullBundle(const char *name, int startIdx) {
-	uint8 *ptr = NULL;
+	uint8 *ptr = nullptr;
 	fileTypeEnum fileType;
 
 	fileType = getFileType(name);
 
-	loadFileSub1(&ptr, name, NULL);
+	loadFileSub1(&ptr, name, nullptr);
 
-	if (ptr == NULL)
+	if (ptr == nullptr)
 		return 0;
 
 	switch (fileType) {
@@ -375,7 +375,7 @@ int loadFNTSub(uint8 *ptr, int destIdx) {
 
 	uint8 *destPtr = filesDatabase[fileIndex].subData.ptr;
 
-	if (destPtr != NULL) {
+	if (destPtr != nullptr) {
 		memcpy(destPtr, ptr2, loadFileVar1);
 
 		destPtr = filesDatabase[fileIndex].subData.ptr;
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index 4b91e457ca..57495bf5b5 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -28,7 +28,7 @@
 
 static const PlainGameDescriptor cruiseGames[] = {
 	{"cruise", "Cruise for a Corpse"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
@@ -109,7 +109,7 @@ static const CRUISEGameDescription gameDescriptions[] = {
 	{
 		{
 			"cruise",
-			0,
+			nullptr,
 			AD_ENTRY1("D1", "70f42a21cc257b01d58667853335f4f1"),
 			Common::DE_DEU,
 			Common::kPlatformAmiga,
@@ -120,7 +120,7 @@ static const CRUISEGameDescription gameDescriptions[] = {
 	{ // Amiga English US GOLD edition.
 		{
 			"cruise",
-			0,
+			nullptr,
 			AD_ENTRY1("D1", "de084e9d2c6e4b2cc14803bf849eda3e"),
 			Common::EN_ANY,
 			Common::kPlatformAmiga,
@@ -131,7 +131,7 @@ static const CRUISEGameDescription gameDescriptions[] = {
 	{ // Amiga Italian US GOLD edition.
 		{
 			"cruise",
-			0,
+			nullptr,
 			AD_ENTRY1("D1", "a0011075413b7335e003e8e3c9cf51b9"),
 			Common::IT_ITA,
 			Common::kPlatformAmiga,
@@ -142,7 +142,7 @@ static const CRUISEGameDescription gameDescriptions[] = {
 	{ // Amiga Spanish edition.
 		{
 			"cruise",
-			0,
+			nullptr,
 			AD_ENTRY1s("D1", "b600d0892a2605b9ead63e1c86a8a0a3", 700576),
 			Common::ES_ESP,
 			Common::kPlatformAmiga,
@@ -153,7 +153,7 @@ static const CRUISEGameDescription gameDescriptions[] = {
 	{ // AtariST English KixxXL edition.
 		{
 			"cruise",
-			0,
+			nullptr,
 			AD_ENTRY1("D1", "be78614d5fa34bdb68bb03a2a6130280"),
 			Common::EN_ANY,
 			Common::kPlatformAtariST,
@@ -164,7 +164,7 @@ static const CRUISEGameDescription gameDescriptions[] = {
 	{ // AtariST French edition. Bugreport #12824
 		{
 			"cruise",
-			0,
+			nullptr,
 			AD_ENTRY1s("D1", "485ff850b7035316621f632e33f56468", 537311),
 			Common::FR_FRA,
 			Common::kPlatformAtariST,
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp
index c04796da0f..65b53fc027 100644
--- a/engines/cruise/font.cpp
+++ b/engines/cruise/font.cpp
@@ -99,7 +99,7 @@ int32 getTextLineCount(int32 rightBorder_X, int16 wordSpacingWidth,
 void loadFNT(const char *fileName) {
 	uint8 header[4];
 
-	_systemFNT = NULL;
+	_systemFNT = nullptr;
 
 	Common::File fontFileHandle;
 
@@ -115,7 +115,7 @@ void loadFNT(const char *fileName) {
 
 		_systemFNT = (uint8 *)mallocAndZero(fontSize);
 
-		if (_systemFNT != NULL) {
+		if (_systemFNT != nullptr) {
 			fontFileHandle.seek(4);
 			fontFileHandle.read(_systemFNT, fontSize);
 
@@ -148,7 +148,7 @@ void initSystem() {
 
 	for (i = 0; i < 64; i++) {
 		strcpy(preloadData[i].name, "");
-		preloadData[i].ptr = NULL;
+		preloadData[i].ptr = nullptr;
 		preloadData[i].nofree = 0;
 	}
 
@@ -299,7 +299,7 @@ gfxEntryStruct *renderText(int inRightBorder_X, const char *string) {
 
 	// check if string is empty
 	if (!string) {
-		return NULL;
+		return nullptr;
 	}
 	// check if font has been loaded, else get system font
 	if (fontFileIndex != -1) {
@@ -313,7 +313,7 @@ gfxEntryStruct *renderText(int inRightBorder_X, const char *string) {
 	}
 
 	if (!fontPtr) {
-		return NULL;
+		return nullptr;
 	}
 
 	fontPtr_Desc = (const FontEntry *)((const uint8 *)fontPtr + sizeof(FontInfo));
@@ -333,7 +333,7 @@ gfxEntryStruct *renderText(int inRightBorder_X, const char *string) {
 	numLines = getTextLineCount(rightBorder_X, wordSpacingWidth, fontPtr_Desc, string);	// ok
 
 	if (!numLines) {
-		return NULL;
+		return nullptr;
 	}
 
 	stringHeight = ((wordSpacingHeight + lineHeight + 2) * numLines) + 1;
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 18dcaeeb50..9d083067d8 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -439,20 +439,20 @@ int16 Op_KillMenu() {
 	// Free menus, if active
 	if (menuTable[0]) {
 		freeMenu(menuTable[0]);
-		menuTable[0] = NULL;
+		menuTable[0] = nullptr;
 		currentActiveMenu = -1;
 	}
 
 	if (menuTable[1]) {
 		freeMenu(menuTable[1]);
-		menuTable[1] = NULL;
+		menuTable[1] = nullptr;
 		currentActiveMenu = -1;
 	}
 
 	// Free the message list
 //	if (linkedMsgList) freeMsgList(linkedMsgList);
-	linkedMsgList = NULL;
-	linkedRelation = NULL;
+	linkedMsgList = nullptr;
+	linkedRelation = nullptr;
 
 	return 0;
 }
@@ -1101,7 +1101,7 @@ actorStruct *addAnimation(actorStruct * pHead, int overlay, int objIdx, int para
 
 	actorStruct *pNewElement = (actorStruct *) MemAlloc(sizeof(actorStruct));
 	if (!pNewElement)
-		return NULL;
+		return nullptr;
 
 	memset(pNewElement, 0, sizeof(actorStruct));
 	pNewElement->next = pPrevious->next;
@@ -1163,7 +1163,7 @@ int removeAnimation(actorStruct * pHead, int overlay, int objIdx, int objType) {
 			pl2->next = pl4;
 			pl3 = pl4;
 
-			if (pl3 == NULL)
+			if (pl3 == nullptr)
 				pl3 = pHead;
 
 			pl3->prev = pl->prev;
@@ -1701,7 +1701,7 @@ int16 Op_DialogOff() {
 
 	if (menuTable[0]) {
 		freeMenu(menuTable[0]);
-		menuTable[0] = NULL;
+		menuTable[0] = nullptr;
 		changeCursor(CURSOR_NORMAL);
 		currentActiveMenu = -1;
 	}
@@ -1776,7 +1776,7 @@ int16 Op_YMenuItem() {
 
 
 int16 Op_Menu() {
-	return (int16)(menuTable[0] != NULL);
+	return (int16)(menuTable[0] != nullptr);
 }
 
 int16 Op_AutoControl() {
@@ -1843,7 +1843,7 @@ int16 Op_UserWait() {
 }
 
 opcodeFunction opcodeTablePtr[] = {
-	NULL, // 0x00
+	nullptr, // 0x00
 	Op_FadeIn,
 	Op_FadeOut,
 	Op_LoadBackground,
@@ -1858,11 +1858,11 @@ opcodeFunction opcodeTablePtr[] = {
 	Op_LoadOverlay,
 	Op_SetColor,
 	Op_PlayFX,
-	NULL,	// used to be debug
+	nullptr,	// used to be debug
 
 	Op_FreeOverlay, // 0x10
 	Op_FindOverlay,
-	NULL,	// used to be exec debug
+	nullptr,	// used to be exec debug
 	Op_AddMessage,
 	Op_RemoveMessage,
 	Op_UserWait,
@@ -1933,7 +1933,7 @@ opcodeFunction opcodeTablePtr[] = {
 	Op_MouseEnd,
 	Op_MsgExist,
 	Op_SetFont,
-	NULL, // MergeMsg
+	nullptr, // MergeMsg
 	Op_Display,
 	Op_GetMouseX,
 	Op_GetMouseY,
@@ -1954,7 +1954,7 @@ opcodeFunction opcodeTablePtr[] = {
 	Op_Sizeof,
 	Op_Preload,
 	Op_FreePreload,
-	NULL, // DeletePreload
+	nullptr, // DeletePreload
 	Op_VBL,
 	Op_LoadFrame,
 	Op_FreezeOverlay,
diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp
index 68ed923417..d0a48f2a60 100644
--- a/engines/cruise/linker.cpp
+++ b/engines/cruise/linker.cpp
@@ -64,25 +64,25 @@ exportEntryStruct *parseExport(int *out1, int *pExportedFuncionIdx, char *buffer
 	strToUpper(overlayName);
 	strToUpper(functionName);
 	if (strlen((char *)overlayName) == 0)
-		return NULL;
+		return nullptr;
 
 	idx = findOverlayByName2(overlayName);
 
 	if (idx == -4)
-		return (NULL);
+		return (nullptr);
 
 	if (overlayTable[idx].alreadyLoaded == 0)
-		return (NULL);
+		return (nullptr);
 
 	if (!overlayTable[idx].ovlData)
-		return (NULL);
+		return (nullptr);
 
 	numSymbGlob = overlayTable[idx].ovlData->numSymbGlob;
 	currentExportEntry = overlayTable[idx].ovlData->arraySymbGlob;
 	entity1Name = overlayTable[idx].ovlData->arrayNameSymbGlob;
 
 	if (!entity1Name)
-		return (0);
+		return (nullptr);
 
 	for (int i = 0; i < numSymbGlob; i++) {
 		char exportedName[256];
@@ -100,7 +100,7 @@ exportEntryStruct *parseExport(int *out1, int *pExportedFuncionIdx, char *buffer
 		currentExportEntry++;
 	}
 
-	return (NULL);
+	return (nullptr);
 }
 
 int updateScriptImport(int ovlIdx) {
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index 015d0b07e9..26f9d2cc15 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -1272,7 +1272,7 @@ void drawCtp() {
 #endif
 
 void drawMenu(menuStruct *pMenu) {
-	if (pMenu == NULL)
+	if (pMenu == nullptr)
 		return;
 
 	if (pMenu->numElements == 0)
@@ -1405,7 +1405,7 @@ void mainDraw(bool waitFl) {
 		}
 	}
 
-	autoCellHead.next = NULL;
+	autoCellHead.next = nullptr;
 
 	currentObjPtr = cellHead.next;
 
diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp
index 55592cb772..716c69ae0d 100644
--- a/engines/cruise/menu.cpp
+++ b/engines/cruise/menu.cpp
@@ -44,7 +44,7 @@ menuStruct *createMenu(int X, int Y, const char *menuName) {
 	entry->y = Y;
 	entry->stringPtr = menuName;
 	entry->numElements = 0;
-	entry->ptrNextElement = NULL;
+	entry->ptrNextElement = nullptr;
 	entry->gfx = renderText(160, menuName);
 
 	return entry;
@@ -70,7 +70,7 @@ void addSelectableMenuEntry(int ovlIdx, int headerIdx, menuStruct *pMenu, int pa
 						pSubStruct = (menuElementSubStruct *)allocAndZero(sizeof(menuElementSubStruct));
 						assert(pSubStruct);
 
-						pSubStruct->pNext = NULL;
+						pSubStruct->pNext = nullptr;
 						pSubStruct->ovlIdx = ovlIdx;
 						pSubStruct->header = headerIdx;
 
@@ -103,12 +103,12 @@ void addSelectableMenuEntry(int ovlIdx, int headerIdx, menuStruct *pMenu, int pa
 		assert(pSubStruct);
 
 		pNewElement->string = menuText;
-		pNewElement->next = NULL;
+		pNewElement->next = nullptr;
 		pNewElement->selected = false;
 		pNewElement->color = color;
 		pNewElement->gfx = renderText(160, menuText);
 
-		if (var_6 == NULL) {
+		if (var_6 == nullptr) {
 			pMenu->ptrNextElement = pNewElement;
 		} else {
 			var_6->next = pNewElement;
@@ -116,7 +116,7 @@ void addSelectableMenuEntry(int ovlIdx, int headerIdx, menuStruct *pMenu, int pa
 
 		pNewElement->ptrSub = pSubStruct;
 
-		pSubStruct->pNext = NULL;
+		pSubStruct->pNext = nullptr;
 		pSubStruct->ovlIdx = ovlIdx;
 		pSubStruct->header = headerIdx;
 
@@ -261,7 +261,7 @@ int playerMenu(int menuX, int menuY) {
 		int retourMenu = processMenu(menuTable[0]);
 
 		freeMenu(menuTable[0]);
-		menuTable[0] = NULL;
+		menuTable[0] = nullptr;
 		currentMouseButton = 0;
 
 		switch (retourMenu) {
diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp
index 845fc34d1f..9f5ff5819a 100644
--- a/engines/cruise/object.cpp
+++ b/engines/cruise/object.cpp
@@ -40,24 +40,24 @@ objDataStruct *getObjectDataFromOverlay(int ovlIdx, int objIdx) {
 	objDataStruct *var_6;
 
 	if (ovlIdx < 1 || objIdx < 0)
-		return NULL;
+		return nullptr;
 
 	if (!overlayTable[ovlIdx].ovlData)
-		return NULL;
+		return nullptr;
 
 	if (overlayTable[ovlIdx].ovlData->numObj <= objIdx)
-		return NULL;
+		return nullptr;
 
 	var_6 = overlayTable[ovlIdx].ovlData->arrayObject;
 
 	if (!var_6)
-		return NULL;
+		return nullptr;
 
 	return (&var_6[objIdx]);
 }
 
 int16 getMultipleObjectParam(int16 overlayIdx, int16 objectIdx, objectParamsQuery *returnParam) {
-	objectParams *ptr2 = 0;
+	objectParams *ptr2 = nullptr;
 	objDataStruct *ptr;
 	ovlDataStruct *ovlData;
 //  int16 type;
@@ -228,7 +228,7 @@ int16 getSingleObjectParam(int16 overlayIdx, int16 param2, int16 param3, int16 *
 	//char* ptr3 = NULL;
 	objDataStruct *ptr;
 	ovlDataStruct *ovlData;
-	objectParams *ptr2 = 0;
+	objectParams *ptr2 = nullptr;
 
 	ptr = getObjectDataFromOverlay(overlayIdx, param2);
 
@@ -312,7 +312,7 @@ const char *getObjectName(int index, const char *string) {
 	const char *ptr = string;
 
 	if (!string)
-		return NULL;
+		return nullptr;
 
 	int i = 0;
 //	int j = 0;
diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp
index f7df741892..9df46cc556 100644
--- a/engines/cruise/overlay.cpp
+++ b/engines/cruise/overlay.cpp
@@ -34,7 +34,7 @@ int numOfLoadedOverlay;
 void initOverlayTable() {
 	for (int i = 0; i < 90; i++) {
 		overlayTable[i].overlayName[0] = 0;
-		overlayTable[i].ovlData = NULL;
+		overlayTable[i].ovlData = nullptr;
 		overlayTable[i].alreadyLoaded = 0;
 		overlayTable[i].executeScripts = 0;
 	}
@@ -111,7 +111,7 @@ int freeOverlay(int overlayIdx) {
 	MemFree(ovlDataPtr->arrayNameRelocGlob);
 
 	MemFree(ovlDataPtr);
-	overlayTable[overlayIdx].ovlData = NULL;
+	overlayTable[overlayIdx].ovlData = nullptr;
 
 	debug(1, "freeOverlay: finish !");
 
@@ -202,28 +202,28 @@ int loadOverlay(const char *scriptName) {
 	debug(1, "OVL loading done...");
 
 	Common::MemoryReadStream s(unpackedBuffer, unpackedSize, DisposeAfterUse::YES);
-	unpackedBuffer = NULL;
+	unpackedBuffer = nullptr;
 
 	ovlData = overlayTable[scriptIdx].ovlData;
 
 	// Skip pointers
 	s.skip(60);
 
-	ovlData->arrayProc = NULL;
-	ovlData->ptr1 = NULL;
-	ovlData->arrayObject = NULL;
-	ovlData->arrayStates = NULL;
-	ovlData->arrayObjVar = NULL;
-	ovlData->stringTable = NULL;
-	ovlData->arraySymbGlob = NULL;
-	ovlData->arrayRelocGlob = NULL;
-	ovlData->arrayMsgRelHeader = NULL;
-	ovlData->nameVerbGlob = NULL;
-	ovlData->arrayNameObj = NULL;
-	ovlData->arrayNameRelocGlob = NULL;
-	ovlData->arrayNameSymbGlob = NULL;
-	ovlData->data4Ptr = NULL;
-	ovlData->ptr8 = NULL;
+	ovlData->arrayProc = nullptr;
+	ovlData->ptr1 = nullptr;
+	ovlData->arrayObject = nullptr;
+	ovlData->arrayStates = nullptr;
+	ovlData->arrayObjVar = nullptr;
+	ovlData->stringTable = nullptr;
+	ovlData->arraySymbGlob = nullptr;
+	ovlData->arrayRelocGlob = nullptr;
+	ovlData->arrayMsgRelHeader = nullptr;
+	ovlData->nameVerbGlob = nullptr;
+	ovlData->arrayNameObj = nullptr;
+	ovlData->arrayNameRelocGlob = nullptr;
+	ovlData->arrayNameSymbGlob = nullptr;
+	ovlData->data4Ptr = nullptr;
+	ovlData->ptr8 = nullptr;
 	ovlData->numProc = s.readUint16BE();
 	ovlData->numRel = s.readUint16BE();
 	ovlData->numSymbGlob = s.readUint16BE();
@@ -338,7 +338,7 @@ int loadOverlay(const char *scriptName) {
 
 		for (int i = 0; i < ovlData->numProc; i++) {
 			s.skip(4);
-			ovlData->arrayProc[i].dataPtr = NULL;
+			ovlData->arrayProc[i].dataPtr = nullptr;
 			ovlData->arrayProc[i].sizeOfData = s.readUint16BE();
 			ovlData->arrayProc[i].offsetToSubData3 = s.readUint16BE();
 			ovlData->arrayProc[i].offsetToImportData = s.readUint16BE();
@@ -388,7 +388,7 @@ int loadOverlay(const char *scriptName) {
 
 		for (int i = 0; i < ovlData->numRel; i++) {
 			s.skip(4);
-			ovlData->ptr1[i].dataPtr = NULL;
+			ovlData->ptr1[i].dataPtr = nullptr;
 			ovlData->ptr1[i].sizeOfData = s.readUint16BE();
 			ovlData->ptr1[i].offsetToSubData3 = s.readUint16BE();
 			ovlData->ptr1[i].offsetToImportData = s.readUint16BE();
@@ -550,7 +550,7 @@ int loadOverlay(const char *scriptName) {
 		}
 
 		Common::MemoryReadStream s2(unpackedBuffer, unpackedSize, DisposeAfterUse::YES);
-		unpackedBuffer = NULL;
+		unpackedBuffer = nullptr;
 
 		ovlData->specialString1Length = s2.readUint16BE();
 		if (ovlData->specialString1Length) {
diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp
index 7360ed1fae..0db887b1b8 100644
--- a/engines/cruise/perso.cpp
+++ b/engines/cruise/perso.cpp
@@ -33,7 +33,7 @@ int16 numPoly;
 void freePerso(int persoIdx) {
 	if (persoTable[persoIdx]) {
 		MemFree(persoTable[persoIdx]);
-		persoTable[persoIdx] = NULL;
+		persoTable[persoIdx] = nullptr;
 	}
 }
 
@@ -46,11 +46,11 @@ void freeCTP() {
 	if (_vm->_polyStruct) {
 		_vm->_polyStructNorm.clear();
 		_vm->_polyStructExp.clear();
-		_vm->_polyStruct = NULL;
+		_vm->_polyStruct = nullptr;
 	}
 
-	ctpVar17 = NULL;
-	_vm->_polyStruct = NULL;
+	ctpVar17 = nullptr;
+	_vm->_polyStruct = nullptr;
 
 	strcpy((char *)currentCtpName, "");
 }
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index 499f2a73eb..11941b1841 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -188,7 +188,7 @@ static void syncFilesDatabase(Common::Serializer &s) {
 		tmp = (fe.subData.ptr) ? 1 : 0;
 		s.syncAsUint32LE(tmp);
 		if (s.isLoading()) {
-			fe.subData.ptr = tmp ? (uint8 *)1 : 0;
+			fe.subData.ptr = tmp ? (uint8 *)1 : nullptr;
 		}
 
 		s.syncAsSint16LE(fe.subData.index);
@@ -201,7 +201,7 @@ static void syncFilesDatabase(Common::Serializer &s) {
 		tmp = (fe.subData.ptrMask) ? 1 : 0;
 		s.syncAsUint32LE(tmp);
 		if (s.isLoading()) {
-			fe.subData.ptrMask = tmp ? (uint8 *)1 : 0;
+			fe.subData.ptrMask = tmp ? (uint8 *)1 : nullptr;
 		}
 
 		s.syncAsUint16LE(fe.subData.resourceType);
@@ -276,8 +276,8 @@ static void syncOverlays2(Common::Serializer &s) {
 		} else {
 			// Loading code
 			ovlRestoreData[i]._sBssSize = ovlRestoreData[i]._sNumObj = 0;
-			ovlRestoreData[i]._pBss = NULL;
-			ovlRestoreData[i]._pObj = NULL;
+			ovlRestoreData[i]._pBss = nullptr;
+			ovlRestoreData[i]._pObj = nullptr;
 
 			if (overlayTable[i].alreadyLoaded) {
 				s.syncAsSint16LE(ovlRestoreData[i]._sBssSize);
@@ -352,7 +352,7 @@ void syncScript(Common::Serializer &s, scriptInstanceStruct *entry) {
 		}
 
 		if (s.isLoading()) {
-			ptr->nextScriptPtr = NULL;
+			ptr->nextScriptPtr = nullptr;
 			entry->nextScriptPtr = ptr;
 			entry = ptr;
 		} else {
@@ -374,7 +374,7 @@ static void syncCell(Common::Serializer &s) {
 			t = t->next;
 		}
 	} else {
-		cellHead.next = NULL; // Not in ASM code, but I guess the variable is defaulted in the EXE
+		cellHead.next = nullptr; // Not in ASM code, but I guess the variable is defaulted in the EXE
 	}
 	s.syncAsSint16LE(chunkCount);
 
@@ -413,7 +413,7 @@ static void syncCell(Common::Serializer &s) {
 		if (s.isSaving())
 			t = t->next;
 		else {
-			p->next = NULL;
+			p->next = nullptr;
 			t->next = p;
 			p->prev = cellHead.prev;
 			cellHead.prev = p;
@@ -479,7 +479,7 @@ static void syncIncrust(Common::Serializer &s) {
 		if (s.isSaving())
 			pl = pl->next;
 		else {
-			t->next = NULL;
+			t->next = nullptr;
 			pl->next = t;
 			t->prev = pl1->prev;
 			pl1->prev = t;
@@ -530,7 +530,7 @@ static void syncActors(Common::Serializer &s) {
 		if (s.isSaving())
 			ptr = ptr->next;
 		else {
-			p->next = NULL;
+			p->next = nullptr;
 			ptr->next = p;
 			p->prev = actorHead.prev;
 			actorHead.prev = p;
@@ -580,7 +580,7 @@ static void syncCT(Common::Serializer &s) {
 	int v = (_vm->_polyStruct) ? 1 : 0;
 	s.syncAsSint32LE(v);
 	if (s.isLoading())
-		_vm->_polyStruct = (v != 0) ? &_vm->_polyStructNorm : NULL;
+		_vm->_polyStruct = (v != 0) ? &_vm->_polyStructNorm : nullptr;
 
 	if (v == 0)
 		// There is no further data to load or save
@@ -602,7 +602,7 @@ static void syncCT(Common::Serializer &s) {
 
 		if (s.isLoading())
 			// Set up the pointer for the next structure
-			persoTable[i] = (v == 0) ? NULL : (persoStruct *)mallocAndZero(sizeof(persoStruct));
+			persoTable[i] = (v == 0) ? nullptr : (persoStruct *)mallocAndZero(sizeof(persoStruct));
 
 		if (v != 0)
 			syncPerso(s, *persoTable[i]);
@@ -644,7 +644,7 @@ void resetPreload() {
 		if (strlen(preloadData[i].name)) {
 			if (preloadData[i].ptr) {
 				MemFree(preloadData[i].ptr);
-				preloadData[i].ptr = NULL;
+				preloadData[i].ptr = nullptr;
 			}
 			strcpy(preloadData[i].name, "");
 			preloadData[i].nofree = 0;
@@ -656,7 +656,7 @@ void unloadOverlay(const char*name, int overlayNumber) {
 	releaseOverlay(name);
 
 	strcpy(overlayTable[overlayNumber].overlayName, "");
-	overlayTable[overlayNumber].ovlData = NULL;
+	overlayTable[overlayNumber].ovlData = nullptr;
 	overlayTable[overlayNumber].alreadyLoaded = 0;
 }
 
@@ -708,7 +708,7 @@ void initVars() {
 	soundList[3].frameNum = -1;
 
 	for (unsigned long int i = 0; i < 8; i++) {
-		menuTable[i] = NULL;
+		menuTable[i] = nullptr;
 	}
 
 	for (unsigned long int i = 0; i < 2000; i++) {
@@ -720,8 +720,8 @@ void initVars() {
 	}
 
 	for (unsigned long int i = 0; i < NUM_FILE_ENTRIES; i++) {
-		filesDatabase[i].subData.ptr = NULL;
-		filesDatabase[i].subData.ptrMask = NULL;
+		filesDatabase[i].subData.ptr = nullptr;
+		filesDatabase[i].subData.ptrMask = nullptr;
 	}
 
 	initBigVar3();
@@ -784,7 +784,7 @@ Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName)
 	const char *filename = _vm->getSavegameFile(saveGameIdx);
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	Common::OutSaveFile *f = saveMan->openForSaving(filename);
-	if (f == NULL)
+	if (f == nullptr)
 		return Common::kNoGameDataFoundError;
 
 	// Save the savegame header
@@ -798,7 +798,7 @@ Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName)
 		return Common::kWritingFailed;
 	} else {
 		// Create the remainder of the savegame
-		Common::Serializer s(NULL, f);
+		Common::Serializer s(nullptr, f);
 		DoSync(s);
 
 		f->finalize();
@@ -814,7 +814,7 @@ Common::Error loadSavegameData(int saveGameIdx) {
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	Common::InSaveFile *f = saveMan->openForLoading(_vm->getSavegameFile(saveGameIdx));
 
-	if (f == NULL) {
+	if (f == nullptr) {
 		printInfoBlackBox("Savegame not found...");
 		waitForPlayerInput();
 		return Common::kNoGameDataFoundError;
@@ -833,7 +833,7 @@ Common::Error loadSavegameData(int saveGameIdx) {
 	}
 
 	// Synchronise the remaining data of the savegame
-	Common::Serializer s(f, NULL);
+	Common::Serializer s(f, nullptr);
 	DoSync(s);
 
 	delete f;
@@ -841,7 +841,7 @@ Common::Error loadSavegameData(int saveGameIdx) {
 	// Post processing
 
 	for (int j = 0; j < 64; j++)
-		preloadData[j].ptr = NULL;
+		preloadData[j].ptr = nullptr;
 
 	for (int j = 1; j < numOfLoadedOverlay; j++) {
 		if (overlayTable[j].alreadyLoaded) {
@@ -892,8 +892,8 @@ Common::Error loadSavegameData(int saveGameIdx) {
 				;
 
 			for (int k = i; k < j; k++) {
-				filesDatabase[k].subData.ptr = NULL;
-				filesDatabase[k].subData.ptrMask = NULL;
+				filesDatabase[k].subData.ptr = nullptr;
+				filesDatabase[k].subData.ptrMask = nullptr;
 			}
 
 			/*if (j < 2) {
@@ -903,8 +903,8 @@ Common::Error loadSavegameData(int saveGameIdx) {
 			if (strlen(filesDatabase[i].subData.name) > 0) {
 				loadFileRange(filesDatabase[i].subData.name, filesDatabase[i].subData.index, i, j - i);
 			} else {
-				filesDatabase[i].subData.ptr = NULL;
-				filesDatabase[i].subData.ptrMask = NULL;
+				filesDatabase[i].subData.ptr = nullptr;
+				filesDatabase[i].subData.ptrMask = nullptr;
 			}
 
 			i = j - 1;
diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp
index 4eb6467cf5..164c25a60b 100644
--- a/engines/cruise/script.cpp
+++ b/engines/cruise/script.cpp
@@ -59,7 +59,7 @@ int32 opcodeType0() {
 		index = saveOpcodeVar;
 		// fall through
 	case 1: {
-		uint8 *address = 0;
+		uint8 *address = nullptr;
 		int type = getByteFromScript();
 		int ovl = getByteFromScript();
 		short int offset = getShortFromScript();
@@ -150,7 +150,7 @@ int32 opcodeType1()	{
 
 		int var_C = short1;
 
-		uint8 *ptr = 0;
+		uint8 *ptr = nullptr;
 		int type2;
 
 		if (!var_6)
@@ -229,7 +229,7 @@ int32 opcodeType2() {
 		index = saveOpcodeVar;
 		// fall through
 	case 1: {
-		uint8* adresse = NULL;
+		uint8* adresse = nullptr;
 		int type = getByteFromScript();
 		int overlay = getByteFromScript();
 
@@ -464,7 +464,7 @@ int32 opcodeType9() {		// stop script
 
 void setupFuncArray() {
 	for (int i = 0; i < 64; i++)
-		opcodeTypeTable[i] = NULL;
+		opcodeTypeTable[i] = nullptr;
 
 	opcodeTypeTable[1] = opcodeType0;
 	opcodeTypeTable[2] = opcodeType1;
@@ -509,13 +509,13 @@ uint8 *attacheNewScriptToTail(scriptInstanceStruct *scriptHandlePtr, int16 overl
 	else if (scriptType == 30)
 		data3Ptr = scriptFunc1Sub2(overlayNumber, param);
 	else
-		return (NULL);
+		return (nullptr);
 
 	if (!data3Ptr)
-		return (NULL);
+		return (nullptr);
 
 	if (!data3Ptr->dataPtr)
-		return (NULL);
+		return (nullptr);
 
 	var_C = data3Ptr->sysKey;
 	oldTail = scriptHandlePtr;
@@ -526,15 +526,15 @@ uint8 *attacheNewScriptToTail(scriptInstanceStruct *scriptHandlePtr, int16 overl
 	scriptInstanceStruct *tempPtr = (scriptInstanceStruct *)mallocAndZero(sizeof(scriptInstanceStruct));
 
 	if (!tempPtr)
-		return (NULL);
+		return (nullptr);
 
-	tempPtr->data = NULL;
+	tempPtr->data = nullptr;
 
 	if (var_C)
 		tempPtr->data = (uint8 *) mallocAndZero(var_C);
 
 	tempPtr->dataSize = var_C;
-	tempPtr->nextScriptPtr = NULL;
+	tempPtr->nextScriptPtr = nullptr;
 	tempPtr->scriptOffset = 0;
 	tempPtr->scriptNumber = param;
 	tempPtr->overlayNumber = overlayNumber;
@@ -621,7 +621,7 @@ int executeScripts(scriptInstanceStruct *ptr) {
 		}
 	} while (!opcodeTypeTable[(opcodeType & 0xFB) >> 3]());
 
-	currentScriptPtr = NULL;
+	currentScriptPtr = nullptr;
 
 	return (0);
 }
diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp
index 7a0fc5ec77..c7dfe7d371 100644
--- a/engines/cruise/sound.cpp
+++ b/engines/cruise/sound.cpp
@@ -216,7 +216,7 @@ public:
 
 	static void updateCallback(void *ref);
 
-	bool songLoaded() const { return _sfxData != NULL; }
+	bool songLoaded() const { return _sfxData != nullptr; }
 	bool songPlayed() const { return _songPlayed; }
 	bool playing() const { return _playing; }
 	uint8 numOrders() const { assert(_sfxData); return _sfxData[470]; }
@@ -232,7 +232,7 @@ public:
 byte *readBundleSoundFile(const char *name) {
 	// Load the correct file
 	int fileIdx = findFileInDisks(name);
-	if (fileIdx < 0) return NULL;
+	if (fileIdx < 0) return nullptr;
 
 	int unpackedSize = volumePtrToFileDescriptor[fileIdx].extSize + 2;
 	byte *data = (byte *)MemAlloc(unpackedSize);
@@ -579,7 +579,7 @@ void AdLibSoundDriverADL::playSample(const byte *data, int size, int channel, in
 PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver)
 	: _playing(false), _songPlayed(false), _driver(driver) {
 	memset(_instrumentsData, 0, sizeof(_instrumentsData));
-	_sfxData = NULL;
+	_sfxData = nullptr;
 	_fadeOutCounter = 0;
 	_driver->setUpdateCallback(updateCallback, this);
 
@@ -592,7 +592,7 @@ PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver)
 }
 
 PCSoundFxPlayer::~PCSoundFxPlayer() {
-	_driver->setUpdateCallback(NULL, NULL);
+	_driver->setUpdateCallback(nullptr, nullptr);
 	stop();
 }
 
@@ -619,7 +619,7 @@ bool PCSoundFxPlayer::load(const char *song) {
 	}
 
 	for (int i = 0; i < NUM_INSTRUMENTS; ++i) {
-		_instrumentsData[i] = NULL;
+		_instrumentsData[i] = nullptr;
 
 		char instrument[64];
 		memset(instrument, 0, 64); // Clear the data first
@@ -738,10 +738,10 @@ void PCSoundFxPlayer::handlePattern(int channel, const byte *patternData) {
 void PCSoundFxPlayer::unload() {
 	for (int i = 0; i < NUM_INSTRUMENTS; ++i) {
 		MemFree(_instrumentsData[i]);
-		_instrumentsData[i] = NULL;
+		_instrumentsData[i] = nullptr;
 	}
 	MemFree(_sfxData);
-	_sfxData = NULL;
+	_sfxData = nullptr;
 	_songPlayed = true;
 }
 
diff --git a/engines/cruise/stack.cpp b/engines/cruise/stack.cpp
index 52a7a84814..cce020f1b2 100644
--- a/engines/cruise/stack.cpp
+++ b/engines/cruise/stack.cpp
@@ -61,7 +61,7 @@ void pushPtr(void *ptr) {
 
 void *popPtr() {
 	if (positionInStack <= 0) {
-		return (0);
+		return (nullptr);
 	}
 
 	positionInStack--;
diff --git a/engines/cruise/staticres.cpp b/engines/cruise/staticres.cpp
index 1e300972bd..c89aafcf86 100644
--- a/engines/cruise/staticres.cpp
+++ b/engines/cruise/staticres.cpp
@@ -307,26 +307,26 @@ const byte mouseCursorMagnifyingGlass[] = {
 };
 
 const char *englishLanguageStrings[13] = {
-	"Pause", NULL, NULL, NULL, NULL, "Inventory", "Speak about...", "Player Menu", NULL,
+	"Pause", nullptr, nullptr, nullptr, nullptr, "Inventory", "Speak about...", "Player Menu", nullptr,
 	"Save", "Load", "Start Again", "Quit"
 };
 const char *frenchLanguageStrings[13] = {
-	"", NULL, NULL, NULL, NULL, "Inventaire", "Parler de...", "Menu Joueur", NULL,
+	"", nullptr, nullptr, nullptr, nullptr, "Inventaire", "Parler de...", "Menu Joueur", nullptr,
 	"Sauvegarde", "Chargement", "Recommencer le jeu", "Quitter"
 };
 // The original Amiga version does use "Speilermen\xFC" instead of "Spielermen\xFC", if we want to correct
 // this typo, we can easily do so.
 const char *germanLanguageStrings[13] = {
-	" ", NULL, NULL, NULL, NULL, "Inventar", "Sprechen ""\xFC""ber", "Speilermen\xFC", "Speicherlaufwerk",
+	" ", nullptr, nullptr, nullptr, nullptr, "Inventar", "Sprechen ""\xFC""ber", "Speilermen\xFC", "Speicherlaufwerk",
 	"Speichern", "Laden", "Neu beginnen", "Ende"
 };
 const char *italianLanguageStrings[13] = {
-	"Pausa", NULL, NULL, NULL, NULL, "Inventario", "Parla di...", "Menu giocatore", NULL,
+	"Pausa", nullptr, nullptr, nullptr, nullptr, "Inventario", "Parla di...", "Menu giocatore", nullptr,
 	"Salva", "Carica", "Ricomincia", "Esci"
 };
 
 const char *spanishLanguageStrings[13] = {
-	"Pausa", NULL, NULL, NULL, NULL, "Inventario", "Hablar de...", "Menu del jugador", NULL,
+	"Pausa", nullptr, nullptr, nullptr, nullptr, "Inventario", "Hablar de...", "Menu del jugador", nullptr,
 	"Salvar", "Cargar", "Recomenzar", "Salir"
 };
 
diff --git a/engines/cruise/various.cpp b/engines/cruise/various.cpp
index df09ac92c8..144ac1d6ff 100644
--- a/engines/cruise/various.cpp
+++ b/engines/cruise/various.cpp
@@ -29,11 +29,11 @@ bool PCFadeFlag;
 
 char *getText(int textIndex, int overlayIndex) {
 	if (!overlayTable[overlayIndex].ovlData) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (!overlayTable[overlayIndex].ovlData->stringTable) {
-		return NULL;
+		return nullptr;
 	}
 
 	return overlayTable[overlayIndex].ovlData->stringTable[textIndex].
diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp
index e9b68968ef..5e9903738a 100644
--- a/engines/cruise/vars.cpp
+++ b/engines/cruise/vars.cpp
@@ -24,7 +24,7 @@
 
 namespace Cruise {
 
-uint8 *_systemFNT = NULL;
+uint8 *_systemFNT = nullptr;
 
 uint8 itemColor = 1;
 uint8 selectColor = 3;
@@ -59,7 +59,7 @@ int16 autoTrack;
 int16 currentDiskNumber = 1;
 
 int16 volumeNumEntry;
-fileEntry *volumePtrToFileDescriptor = NULL;
+fileEntry *volumePtrToFileDescriptor = nullptr;
 
 uint32 volumeFileDescriptorSize;
 int16 volumeSizeOfEntry;
diff --git a/engines/cruise/volume.cpp b/engines/cruise/volume.cpp
index 99d86e48bb..24356c34cf 100644
--- a/engines/cruise/volume.cpp
+++ b/engines/cruise/volume.cpp
@@ -25,7 +25,7 @@
 
 namespace Cruise {
 
-uint8 *PAL_ptr = NULL;
+uint8 *PAL_ptr = nullptr;
 
 int16 numLoadedPal;
 int16 fileData2;
@@ -58,7 +58,7 @@ void closePal() {
 		_vm->_PAL_file.close();
 
 		MemFree(PAL_ptr);
-		PAL_ptr = NULL;
+		PAL_ptr = nullptr;
 
 		numLoadedPal = 0;
 		fileData2 = 0;
@@ -304,7 +304,7 @@ int closeCnf() {
 	for (long int i = 0; i < numOfDisks; i++) {
 		if (volumeData[i].ptr) {
 			MemFree(volumeData[i].ptr);
-			volumeData[i].ptr = NULL;
+			volumeData[i].ptr = nullptr;
 		}
 	}
 
@@ -321,7 +321,7 @@ int16 readVolCnf() {
 
 	for (int i = 0; i < 20; i++) {
 		volumeData[i].ident[0] = 0;
-		volumeData[i].ptr = NULL;
+		volumeData[i].ptr = nullptr;
 		volumeData[i].diskNumber = i + 1;
 		volumeData[i].size = 0;
 	}


Commit: 158cf7734b24942dece5cb0246330eee2b21faa9
    https://github.com/scummvm/scummvm/commit/158cf7734b24942dece5cb0246330eee2b21faa9
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
CRYO: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/cryo/detection.cpp
    engines/cryo/eden.cpp


diff --git a/engines/cryo/detection.cpp b/engines/cryo/detection.cpp
index a360f5e77d..3ff425efc7 100644
--- a/engines/cryo/detection.cpp
+++ b/engines/cryo/detection.cpp
@@ -27,7 +27,7 @@
 
 static const PlainGameDescriptor cryoGames[] = {
 	{"losteden", "Lost Eden"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 namespace Cryo {
@@ -38,7 +38,7 @@ static const ADGameDescription gameDescriptions[] = {
 	// Probably not worth it
 	{
 		"losteden",
-		0,
+		nullptr,
 		AD_ENTRY1s("EDEN6.HSQ", "00b43c44cf2ac50b1a45dfad5fa5360d", 17093),
 		Common::EN_ANY,
 		Common::kPlatformDOS,
@@ -49,8 +49,8 @@ static const ADGameDescription gameDescriptions[] = {
 	// Lost Eden PC interactive demo version
 	{
 		"losteden",
-		0,
-		AD_ENTRY1s("EDEN.DAT", 0, 205473728),
+		nullptr,
+		AD_ENTRY1s("EDEN.DAT", nullptr, 205473728),
 		Common::EN_ANY,
 		Common::kPlatformDOS,
 		ADGF_DEMO | ADGF_UNSTABLE,
@@ -60,8 +60,8 @@ static const ADGameDescription gameDescriptions[] = {
 	// Lost Eden PC version
 	{
 		"losteden",
-		0,
-		AD_ENTRY1s("EDEN.DAT", 0, 449853776),
+		nullptr,
+		AD_ENTRY1s("EDEN.DAT", nullptr, 449853776),
 		Common::EN_ANY,
 		Common::kPlatformDOS,
 		ADGF_UNSTABLE,
@@ -72,7 +72,7 @@ static const ADGameDescription gameDescriptions[] = {
 	// Added by Strangerke
 	{
 		"losteden",
-		0,
+		nullptr,
 		AD_ENTRY1s("EDEN.DAT", "2126f14fe38b47c7a132f7937c79a2f0", 451205552),
 		Common::EN_ANY,
 		Common::kPlatformDOS,
@@ -84,7 +84,7 @@ static const ADGameDescription gameDescriptions[] = {
 	// Added by Strangerke
 	{
 		"losteden",
-		0,
+		nullptr,
 		AD_ENTRY1s("EDEN.DAT", "378b1260ac400ecf35f8843357adcca6", 448040496),
 		Common::FR_FRA,
 		Common::kPlatformDOS,
@@ -95,8 +95,8 @@ static const ADGameDescription gameDescriptions[] = {
 	// Lost Eden DE PC version
 	{
 		"losteden",
-		0,
-		AD_ENTRY1s("EDEN.DAT", 0, 457719104),
+		nullptr,
+		AD_ENTRY1s("EDEN.DAT", nullptr, 457719104),
 		Common::DE_DEU,
 		Common::kPlatformDOS,
 		ADGF_UNSTABLE,
@@ -106,8 +106,8 @@ static const ADGameDescription gameDescriptions[] = {
 	// Lost Eden Mac version
 	{
 		"losteden",
-		0,
-		AD_ENTRY1s("EDEN.DAT", 0, 489739536),
+		nullptr,
+		AD_ENTRY1s("EDEN.DAT", nullptr, 489739536),
 		Common::EN_ANY,
 		Common::kPlatformMacintosh,
 		ADGF_UNSTABLE,
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index 573ea73125..e6a76b857c 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -1413,7 +1413,7 @@ void EdenGame::destroyCitadelRoom(int16 roomNum) {
 	room->_video = 0;
 	room->_level = 0;
 	_globals->_curAreaPtr->_citadelLevel = 0;
-	_globals->_curAreaPtr->_citadelRoomPtr = 0;
+	_globals->_curAreaPtr->_citadelRoomPtr = nullptr;
 	roomNum = (roomNum & ~0xFF) | room->_location;
 	for (; perso->_roomNum != 0xFFFF; perso++) {
 		if (perso->_roomNum == roomNum) {
@@ -2236,7 +2236,7 @@ void EdenGame::getDataSync() {
 		_numAnimFrames = 0;
 	if (_globals->_textNum == 144)
 		_numAnimFrames = 48;
-	_animationTable = 0;
+	_animationTable = nullptr;
 }
 
 // Original name: ReadNombreFrames
@@ -3729,9 +3729,9 @@ void EdenGame::initGlobals() {
 	_globals->_areaPtr = nullptr;
 	_globals->_lastAreaPtr = nullptr;
 	_globals->_curAreaPtr = nullptr;
-	_globals->_citaAreaFirstRoom = 0;
+	_globals->_citaAreaFirstRoom = nullptr;
 	_globals->_characterPtr = nullptr;
-	_globals->_roomCharacterPtr = 0;
+	_globals->_roomCharacterPtr = nullptr;
 	_globals->_lastInfoIdx = 0;
 	_globals->_nextInfoIdx = 0;
 	_globals->_iconsIndex = 16;
@@ -7274,7 +7274,7 @@ void EdenGame::DELETEcharge_objet_mob(Cube *cubep) {
 int EdenGame::nextVal(char **ptr, char *error) {
 	char c = 0;
 	char *p = *ptr;
-	int val = strtol(p, 0, 10);
+	int val = strtol(p, nullptr, 10);
 	while ((*p >= '0' && *p <= '9' && *p != 0) || *p == '-')
 		p++;
 	while ((*p == 13 || *p == 10 || *p == ',' || *p == ' ') && *p)


Commit: 441992ae3b03cd9438dcb95d1b229f81b708a9f0
    https://github.com/scummvm/scummvm/commit/441992ae3b03cd9438dcb95d1b229f81b708a9f0
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
CRYOMNI3D: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/cryomni3d/cryomni3d.cpp
    engines/cryomni3d/detection.cpp
    engines/cryomni3d/image/hlz.cpp


diff --git a/engines/cryomni3d/cryomni3d.cpp b/engines/cryomni3d/cryomni3d.cpp
index 1bb7b7c4ee..f08afda99b 100644
--- a/engines/cryomni3d/cryomni3d.cpp
+++ b/engines/cryomni3d/cryomni3d.cpp
@@ -211,7 +211,7 @@ Image::ImageDecoder *CryOmni3DEngine::loadHLZ(const Common::String &filename) {
 	if (!imageDecoder->loadStream(file)) {
 		warning("Failed to open hlz file %s", fname.c_str());
 		delete imageDecoder;
-		imageDecoder = 0;
+		imageDecoder = nullptr;
 		return nullptr;
 	}
 
diff --git a/engines/cryomni3d/detection.cpp b/engines/cryomni3d/detection.cpp
index 17cad02ad5..723bd7e280 100644
--- a/engines/cryomni3d/detection.cpp
+++ b/engines/cryomni3d/detection.cpp
@@ -35,7 +35,7 @@ namespace CryOmni3D {
 static const PlainGameDescriptor cryomni3DGames[] = {
 	{"atlantis", "Atlantis: The Lost Tales"},
 	{"versailles", "Versailles 1685"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/cryomni3d/image/hlz.cpp b/engines/cryomni3d/image/hlz.cpp
index a9bf0dcfbc..37fd227254 100644
--- a/engines/cryomni3d/image/hlz.cpp
+++ b/engines/cryomni3d/image/hlz.cpp
@@ -34,8 +34,8 @@
 namespace Image {
 
 HLZFileDecoder::HLZFileDecoder() {
-	_surface = 0;
-	_codec = 0;
+	_surface = nullptr;
+	_codec = nullptr;
 }
 
 HLZFileDecoder::~HLZFileDecoder() {
@@ -44,8 +44,8 @@ HLZFileDecoder::~HLZFileDecoder() {
 
 void HLZFileDecoder::destroy() {
 	delete _codec;
-	_codec = 0;
-	_surface = 0;
+	_codec = nullptr;
+	_surface = nullptr;
 }
 
 bool HLZFileDecoder::loadStream(Common::SeekableReadStream &stream) {


Commit: 02cfffcb674037acabb549456080b46a1855ad2b
    https://github.com/scummvm/scummvm/commit/02cfffcb674037acabb549456080b46a1855ad2b
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
DIRECTOR: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/director/archive.cpp
    engines/director/cast.cpp
    engines/director/detection.cpp
    engines/director/images.cpp
    engines/director/lingo/lingo-builtins.cpp
    engines/director/lingo/lingo-bytecode.cpp
    engines/director/lingo/lingo-code.cpp
    engines/director/lingo/lingo-codegen.cpp
    engines/director/lingo/lingo-events.cpp
    engines/director/lingo/lingo-funcs.cpp
    engines/director/lingo/lingo-lex.cpp
    engines/director/lingo/lingo-object.cpp
    engines/director/lingo/lingo-preprocessor.cpp
    engines/director/lingo/lingo-the.cpp
    engines/director/lingo/lingo.cpp
    engines/director/lingo/xlibs/cdromxobj.cpp
    engines/director/lingo/xlibs/fileio.cpp
    engines/director/lingo/xlibs/flushxobj.cpp
    engines/director/lingo/xlibs/fplayxobj.cpp
    engines/director/lingo/xlibs/labeldrvxobj.cpp
    engines/director/lingo/xlibs/memoryxobj.cpp
    engines/director/lingo/xlibs/movemousexobj.cpp
    engines/director/lingo/xlibs/orthoplayxobj.cpp
    engines/director/lingo/xlibs/palxobj.cpp
    engines/director/lingo/xlibs/popupmenuxobj.cpp
    engines/director/lingo/xlibs/serialportxobj.cpp
    engines/director/lingo/xlibs/soundjam.cpp
    engines/director/lingo/xlibs/videodiscxobj.cpp
    engines/director/lingo/xlibs/winxobj.cpp
    engines/director/score.cpp
    engines/director/util.cpp


diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index beb53ad199..91b231c1e5 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -36,7 +36,7 @@ namespace Director {
 // Base Archive code
 
 Archive::Archive() {
-	_stream = 0;
+	_stream = nullptr;
 	_isBigEndian = true;
 }
 
@@ -72,7 +72,7 @@ void Archive::close() {
 	if (_stream)
 		delete _stream;
 
-	_stream = 0;
+	_stream = nullptr;
 }
 
 int Archive::getFileSize() {
@@ -205,7 +205,7 @@ uint32 Archive::convertTagToUppercase(uint32 tag) {
 
 // Mac Archive code
 
-MacArchive::MacArchive() : Archive(), _resFork(0) {
+MacArchive::MacArchive() : Archive(), _resFork(nullptr) {
 }
 
 MacArchive::~MacArchive() {
@@ -215,7 +215,7 @@ MacArchive::~MacArchive() {
 void MacArchive::close() {
 	Archive::close();
 	delete _resFork;
-	_resFork = 0;
+	_resFork = nullptr;
 }
 
 bool MacArchive::openFile(const Common::String &fileName) {
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 9f473c7e6d..21a06fe5e1 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -549,8 +549,8 @@ void Cast::loadCastChildren() {
 		uint16 imgId = c->_key;
 		uint16 realId = 0;
 
-		Image::ImageDecoder *img = NULL;
-		Common::SeekableReadStream *pic = NULL;
+		Image::ImageDecoder *img = nullptr;
+		Common::SeekableReadStream *pic = nullptr;
 
 		if (_version >= kFileVer400) {
 			if (bitmapCast->_children.size() > 0) {
@@ -574,7 +574,7 @@ void Cast::loadCastChildren() {
 			}
 		}
 
-		if (pic == NULL) {
+		if (pic == nullptr) {
 			warning("Cast::loadCastChildren(): Bitmap image %d not found", imgId);
 			continue;
 		}
@@ -642,7 +642,7 @@ void Cast::loadSoundCasts() {
 			tag = soundCast->_children[0].tag;
 		}
 
-		Common::SeekableReadStreamEndian *sndData = NULL;
+		Common::SeekableReadStreamEndian *sndData = nullptr;
 
 		if (!_castArchive->hasResource(tag, sndId)) {
 			if (_castArchive->hasResource(MKTAG('s', 'n', 'd', ' '), sndId))
@@ -654,7 +654,7 @@ void Cast::loadSoundCasts() {
 			sndData = _castArchive->getResource(tag, sndId);
 		}
 
-		if (sndData != NULL) {
+		if (sndData != nullptr) {
 			if (sndData->size() == 0) {
 				// audio file is linked, load from the filesystem
 				AudioFileDecoder *audio = new AudioFileDecoder(_castsInfo[c->_key]->fileName);
@@ -691,7 +691,7 @@ Common::String Cast::getVideoPath(int castId) {
 		tag = digitalVideoCast->_children[0].tag;
 	}
 
-	Common::SeekableReadStreamEndian *videoData = NULL;
+	Common::SeekableReadStreamEndian *videoData = nullptr;
 
 	switch (tag) {
 	case MKTAG('M', 'o', 'o', 'V'):
@@ -702,7 +702,7 @@ Common::String Cast::getVideoPath(int castId) {
 		break;
 	}
 
-	if (videoData == NULL || videoData->size() == 0) {
+	if (videoData == nullptr || videoData->size() == 0) {
 		// video file is linked, load from the filesystem
 
 		Common::String filename = _castsInfo[castId]->fileName;
diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index 4ffb246318..d4620f739d 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -44,7 +44,7 @@ static struct CustomTarget {
 	{"d3-win", "win", "300" },
 	{"d4-win", "win", "400" },
 	{"director-movie", "win", "400" },
-	{ NULL, 0, 0 }
+	{ nullptr, nullptr, nullptr }
 };
 
 static const DebugChannelDef debugFlagList[] = {
@@ -79,7 +79,7 @@ public:
 		_directoryGlobs = Director::directoryGlobs;
 
 		// initialize customTarget hashmap here
-		for (int i = 0; customTargetList[i].name != NULL; i++)
+		for (int i = 0; customTargetList[i].name != nullptr; i++)
 			_customTarget[customTargetList[i].name] = true;
 	}
 
@@ -108,7 +108,7 @@ static Director::DirectorGameDescription s_fallbackDesc = {
 	{
 		"director",
 		"",
-		AD_ENTRY1(0, 0),
+		AD_ENTRY1(nullptr, nullptr),
 		Common::UNK_LANG,
 		Common::kPlatformWindows,
 		ADGF_TAILMD5,	// We calculate tail of the projector
@@ -132,7 +132,7 @@ ADDetectedGame DirectorMetaEngineDetection::fallbackDetect(const FileMap &allFil
 	desc->desc.flags = ADGF_TAILMD5;
 	desc->desc.platform = Common::kPlatformWindows;
 	desc->desc.guiOptions = GUIO0();
-	desc->desc.filesDescriptions[0].fileName = 0;
+	desc->desc.filesDescriptions[0].fileName = nullptr;
 	desc->version = 0;
 	desc->gameGID = Director::GID_GENERIC;
 
@@ -153,7 +153,7 @@ ADDetectedGame DirectorMetaEngineDetection::fallbackDetect(const FileMap &allFil
 			Common::String targetID, gameName, platform, version, tmp;
 
 			// First, fill the info based on the filename
-			for (int i = 0; customTargetList[i].name != NULL; i++) {
+			for (int i = 0; customTargetList[i].name != nullptr; i++) {
 				if (fileName.equalsIgnoreCase(customTargetList[i].name)) {
 					targetID = "director-fallback";
 					platform = customTargetList[i].platform;
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index d9ab5de3a2..00ead6cc43 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -30,10 +30,10 @@
 namespace Director {
 
 DIBDecoder::DIBDecoder() {
-	_surface = 0;
-	_palette = 0;
+	_surface = nullptr;
+	_palette = nullptr;
 	_paletteColorCount = 0;
-	_codec = 0;
+	_codec = nullptr;
 }
 
 DIBDecoder::~DIBDecoder() {
@@ -41,14 +41,14 @@ DIBDecoder::~DIBDecoder() {
 }
 
 void DIBDecoder::destroy() {
-	_surface = 0;	// It is deleted by BitmapRawDecoder
+	_surface = nullptr;	// It is deleted by BitmapRawDecoder
 
 	delete[] _palette;
-	_palette = 0;
+	_palette = nullptr;
 	_paletteColorCount = 0;
 
 	delete _codec;
-	_codec = 0;
+	_codec = nullptr;
 }
 
 void DIBDecoder::loadPalette(Common::SeekableReadStream &stream) {
@@ -134,7 +134,7 @@ BITDDecoder::~BITDDecoder() {
 void BITDDecoder::destroy() {
 	_surface->free();
 	delete _surface;
-	_surface = 0;
+	_surface = nullptr;
 
 	_paletteColorCount = 0;
 }
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 2be0e77371..83214ec23d 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -228,7 +228,7 @@ static BuiltinProto builtins[] = {
 	// XCMD/XFCN (HyperCard), normally exposed
 	{ "GetVolumes", LB::b_getVolumes, 0, 0, 400, FBLTIN },
 
-	{ 0, 0, 0, 0, 0, VOIDSYM }
+	{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
 };
 
 void Lingo::initBuiltIns() {
@@ -316,7 +316,7 @@ void Lingo::printSTUBWithArglist(const char *funcname, int nargs, const char *pr
 
 void Lingo::convertVOIDtoString(int arg, int nargs) {
 	if (_stack[_stack.size() - nargs + arg].type == VOID) {
-		if (_stack[_stack.size() - nargs + arg].u.s != NULL)
+		if (_stack[_stack.size() - nargs + arg].u.s != nullptr)
 			g_lingo->_stack[_stack.size() - nargs + arg].type = STRING;
 		else
 			warning("Incorrect convertVOIDtoString for arg %d of %d", arg, nargs);
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index 2e6cd1a49c..a06ea99518 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -138,7 +138,7 @@ static LingoV4Bytecode lingoV4[] = {
 	{ 0xa1, LC::cb_objectfieldpush, "wN" },
 	{ 0xa2, LC::cb_objectfieldassign, "wN" },
 	{ 0xa6, LC::cb_v4theentitynamepush, "wN" },
-	{ 0, 0, 0 }
+	{ 0, nullptr, nullptr }
 };
 
 static LingoV4TheEntity lingoV4TheEntity[] = {
@@ -683,7 +683,7 @@ void LC::cb_v4theentitypush() {
 
 	int firstArg = g_lingo->pop().asInt();
 	Datum result;
-	result.u.s = NULL;
+	result.u.s = nullptr;
 	result.type = VOID;
 
 	int key = (bank << 8) + firstArg;
@@ -780,7 +780,7 @@ void LC::cb_v4theentitynamepush() {
 	Common::String name = g_lingo->readString();
 
 	Datum id;
-	id.u.s = NULL;
+	id.u.s = nullptr;
 	id.type = VOID;
 
 	TheEntity *entity = g_lingo->_theEntities[name];
@@ -799,7 +799,7 @@ void LC::cb_v4theentityassign() {
 	int firstArg = g_lingo->pop().asInt();
 	Datum value = g_lingo->pop();
 	Datum result;
-	result.u.s = NULL;
+	result.u.s = nullptr;
 	result.type = VOID;
 
 	int key = (bank << 8) + firstArg;
@@ -823,7 +823,7 @@ void LC::cb_v4theentityassign() {
 	case kTEANOArgs:
 		{
 			Datum id;
-			id.u.s = NULL;
+			id.u.s = nullptr;
 			id.type = VOID;
 			debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(%s, VOID, %s, %s)", g_lingo->entity2str(entity), g_lingo->field2str(field), value.asString(true).c_str());
 			g_lingo->setTheEntity(entity, id, field, value);
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 657ce115db..d5685834be 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -68,7 +68,7 @@ static struct FuncDescr {
 	const char *name;
 	const char *args;
 } funcDescr[] = {
-	{ 0,					"STOP",				""  },
+	{ nullptr,					"STOP",				""  },
 	{ LC::c_asserterror,	"c_asserterror",	"" },
 	{ LC::c_asserterrordone,"c_asserterrordone","" },
 	{ LC::c_add,			"c_add",			"" },
@@ -173,7 +173,7 @@ static struct FuncDescr {
 	{ LC::cb_zeropush,		"cb_zeropush",		"" },
 	{ LC::c_stackpeek,		"c_stackpeek",		"i" },
 	{ LC::c_stackdrop,		"c_stackdrop",		"i" },
-	{ 0, 0, 0 }
+	{ nullptr, nullptr, nullptr }
 };
 
 void Lingo::initFuncs() {
@@ -195,7 +195,7 @@ void Lingo::push(Datum d) {
 
 void Lingo::pushVoid() {
 	Datum d;
-	d.u.s = NULL;
+	d.u.s = nullptr;
 	d.type = VOID;
 	push(d);
 }
@@ -408,7 +408,7 @@ void LC::c_intpush() {
 
 void LC::c_voidpush() {
 	Datum d;
-	d.u.s = NULL;
+	d.u.s = nullptr;
 	d.type = VOID;
 	g_lingo->push(d);
 }
@@ -1554,7 +1554,7 @@ void LC::call(const Symbol &funcSym, int nargs, bool allowRetVal) {
 							funcSym.name->c_str(), nargs, funcSym.nargs, funcSym.maxArgs, funcSym.nargs - nargs);
 				while (nargs < funcSym.nargs) {
 					Datum d;
-					d.u.s = NULL;
+					d.u.s = nullptr;
 					d.type = VOID;
 					g_lingo->push(d);
 					nargs++;
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index aae0729be9..24d33e27ca 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -262,7 +262,7 @@ int LingoCompiler::codeFloat(double f) {
 }
 
 int LingoCompiler::codeInt(int val) {
-	inst i = 0;
+	inst i = nullptr;
 	WRITE_UINT32(&i, val);
 	code1(i);
 
@@ -274,7 +274,7 @@ int LingoCompiler::codeCmd(const Common::String &s, int numpar) {
 
 	codeString(s.c_str());
 
-	inst num = 0;
+	inst num = nullptr;
 	WRITE_UINT32(&num, numpar);
 	code1(num);
 
@@ -286,7 +286,7 @@ int LingoCompiler::codeFunc(const Common::String &s, int numpar) {
 
 	codeString(s.c_str());
 
-	inst num = 0;
+	inst num = nullptr;
 	WRITE_UINT32(&num, numpar);
 	code1(num);
 
@@ -381,13 +381,13 @@ void LingoCompiler::updateLoopJumps(uint nextTargetPos, uint exitTargetPos) {
 	
 	for (uint i = 0; i < _currentLoop->nextRepeats.size(); i++) {
 		uint nextRepeatPos = _currentLoop->nextRepeats[i];
-		inst jmpOffset = 0;
+		inst jmpOffset = nullptr;
 		WRITE_UINT32(&jmpOffset, nextTargetPos - nextRepeatPos);
 		(*_currentAssembly)[nextRepeatPos + 1] = jmpOffset; 
 	}
 	for (uint i = 0; i < _currentLoop->exitRepeats.size(); i++) {
 		uint exitRepeatPos = _currentLoop->exitRepeats[i];
-		inst jmpOffset = 0;
+		inst jmpOffset = nullptr;
 		WRITE_UINT32(&jmpOffset, exitTargetPos - exitRepeatPos);
 		(*_currentAssembly)[exitRepeatPos + 1] = jmpOffset; 
 	}
@@ -804,11 +804,11 @@ bool LingoCompiler::visitInstanceNode(InstanceNode *node) {
 bool LingoCompiler::visitIfStmtNode(IfStmtNode *node) {
 	COMPILE(node->cond);
 	uint jzPos = _currentAssembly->size();
-	code2(LC::c_jumpifz, 0);
+	code2(LC::c_jumpifz, nullptr);
 	COMPILE_LIST(node->stmts);
 	uint endPos = _currentAssembly->size();
 
-	inst jzOffset = 0;
+	inst jzOffset = nullptr;
 	WRITE_UINT32(&jzOffset, endPos - jzPos);
 	(*_currentAssembly)[jzPos + 1] = jzOffset;
 
@@ -820,20 +820,20 @@ bool LingoCompiler::visitIfStmtNode(IfStmtNode *node) {
 bool LingoCompiler::visitIfElseStmtNode(IfElseStmtNode *node) {
 	COMPILE(node->cond);
 	uint jzPos = _currentAssembly->size();
-	code2(LC::c_jumpifz, 0);
+	code2(LC::c_jumpifz, nullptr);
 	COMPILE_LIST(node->stmts1);
 
 	uint jmpPos = _currentAssembly->size();
-	code2(LC::c_jump, 0);
+	code2(LC::c_jump, nullptr);
 	uint block2StartPos = _currentAssembly->size();
 	COMPILE_LIST(node->stmts2);
 	uint endPos = _currentAssembly->size();
 
-	inst jzOffset = 0;
+	inst jzOffset = nullptr;
 	WRITE_UINT32(&jzOffset, block2StartPos - jzPos);
 	(*_currentAssembly)[jzPos + 1] = jzOffset;
 
-	inst jmpOffset = 0;
+	inst jmpOffset = nullptr;
 	WRITE_UINT32(&jmpOffset, endPos - jmpPos);
 	(*_currentAssembly)[jmpPos + 1] = jmpOffset;
 
@@ -849,17 +849,17 @@ bool LingoCompiler::visitRepeatWhileNode(RepeatWhileNode *node) {
 	uint startPos = _currentAssembly->size();
 	COMPILE(node->cond);
 	uint jzPos = _currentAssembly->size();
-	code2(LC::c_jumpifz, 0);
+	code2(LC::c_jumpifz, nullptr);
 	COMPILE_LIST(node->stmts);
 	uint jmpPos = _currentAssembly->size();
-	code2(LC::c_jump, 0);
+	code2(LC::c_jump, nullptr);
 	uint endPos = _currentAssembly->size();
 
-	inst jzOffset = 0;
+	inst jzOffset = nullptr;
 	WRITE_UINT32(&jzOffset, endPos - jzPos);
 	(*_currentAssembly)[jzPos + 1] = jzOffset;
 
-	inst jmpOffset = 0;
+	inst jmpOffset = nullptr;
 	WRITE_UINT32(&jmpOffset, startPos - jmpPos);
 	(*_currentAssembly)[jmpPos + 1] = jmpOffset;
 
@@ -887,7 +887,7 @@ bool LingoCompiler::visitRepeatWithToNode(RepeatWithToNode *node) {
 		code1(LC::c_le);
 	}
 	uint jzPos = _currentAssembly->size();
-	code2(LC::c_jumpifz, 0);
+	code2(LC::c_jumpifz, nullptr);
 
 	COMPILE_LIST(node->stmts);
 
@@ -903,14 +903,14 @@ bool LingoCompiler::visitRepeatWithToNode(RepeatWithToNode *node) {
 	codeVarSet(*node->var);
 
 	uint jmpPos = _currentAssembly->size();
-	code2(LC::c_jump, 0);
+	code2(LC::c_jump, nullptr);
 	uint endPos = _currentAssembly->size();
 
-	inst jzOffset = 0;
+	inst jzOffset = nullptr;
 	WRITE_UINT32(&jzOffset, endPos - jzPos);
 	(*_currentAssembly)[jzPos + 1] = jzOffset;
 
-	inst jmpOffset = 0;
+	inst jmpOffset = nullptr;
 	WRITE_UINT32(&jmpOffset, startPos - jmpPos);
 	(*_currentAssembly)[jmpPos + 1] = jmpOffset;
 
@@ -940,7 +940,7 @@ bool LingoCompiler::visitRepeatWithInNode(RepeatWithInNode *node) {
 	codeInt(2);
 	code1(LC::c_le); 
 	uint jzPos = _currentAssembly->size();
-	code2(LC::c_jumpifz, 0);
+	code2(LC::c_jumpifz, nullptr);
 
 	code1(LC::c_stackpeek);	// get list
 	codeInt(2);
@@ -956,16 +956,16 @@ bool LingoCompiler::visitRepeatWithInNode(RepeatWithInNode *node) {
 	code1(LC::c_add);	// Increment counter
 
 	uint jmpPos = _currentAssembly->size();
-	code2(LC::c_jump, 0);
+	code2(LC::c_jump, nullptr);
 	uint endPos = _currentAssembly->size();
 	code1(LC::c_stackdrop);	// remove list, size, counter
 	codeInt(3);
 
-	inst jzOffset = 0;
+	inst jzOffset = nullptr;
 	WRITE_UINT32(&jzOffset, endPos - jzPos);
 	(*_currentAssembly)[jzPos + 1] = jzOffset;
 
-	inst jmpOffset = 0;
+	inst jmpOffset = nullptr;
 	WRITE_UINT32(&jmpOffset, startPos - jmpPos);
 	(*_currentAssembly)[jmpPos + 1] = jmpOffset;
 
@@ -983,7 +983,7 @@ bool LingoCompiler::visitNextRepeatNode(NextRepeatNode *node) {
 		return false;
 	}
 	_currentLoop->nextRepeats.push_back(_currentAssembly->size());
-	code2(LC::c_jump, 0);
+	code2(LC::c_jump, nullptr);
 	return true;
 }
 
@@ -995,7 +995,7 @@ bool LingoCompiler::visitExitRepeatNode(ExitRepeatNode *node) {
 		return false;
 	}
 	_currentLoop->exitRepeats.push_back(_currentAssembly->size());
-	code2(LC::c_jump, 0);
+	code2(LC::c_jump, nullptr);
 	return true;
 }
 
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index f7213ae05e..78d63364a1 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -76,7 +76,7 @@ struct EventHandlerType {
 
 	{ kEventGeneric,			"scummvm_generic" },
 
-	{ kEventNone, 0 }
+	{ kEventNone, nullptr }
 };
 
 void Lingo::initEventHandlerTypes() {
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index 293c589b05..730202a3b5 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -75,7 +75,7 @@ struct MCIToken {
 
 	{ kMCITokenNone, kMCITokenWait,   "wait", 0 },
 
-	{ kMCITokenNone, kMCITokenNone,   0, 0 }
+	{ kMCITokenNone, kMCITokenNone,   nullptr, 0 }
 };
 
 void Lingo::func_mci(const Common::String &name) {
@@ -166,8 +166,8 @@ void Lingo::func_mci(const Common::String &name) {
 				return;
 			}
 
-			uint32 from = strtol(params[1].c_str(), 0, 10);
-			uint32 to = strtol(params[2].c_str(), 0, 10);
+			uint32 from = strtol(params[1].c_str(), nullptr, 10);
+			uint32 to = strtol(params[2].c_str(), nullptr, 10);
 
 			_vm->getCurrentWindow()->getSoundManager()->playMCI(*_audioAliases[params[0]], from, to);
 		}
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp
index 5fbccfd404..140f7a97c7 100644
--- a/engines/director/lingo/lingo-lex.cpp
+++ b/engines/director/lingo/lingo-lex.cpp
@@ -249,7 +249,7 @@ struct yy_buffer_state
 /* Stack of input buffers. */
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = nullptr; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
@@ -271,7 +271,7 @@ static int yy_n_chars;		/* number of characters read into yy_ch_buf */
 int yyleng;
 
 /* Points to current character in buffer. */
-static char *yy_c_buf_p = NULL;
+static char *yy_c_buf_p = nullptr;
 static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
@@ -328,7 +328,7 @@ void yyfree ( void *  );
 #define YY_SKIP_YYWRAP
 typedef flex_uint8_t YY_CHAR;
 
-FILE *yyin = NULL, *yyout = NULL;
+FILE *yyin = nullptr, *yyout = nullptr;
 
 typedef int yy_state_type;
 
@@ -1603,7 +1603,7 @@ YY_RULE_SETUP
 case 81:
 YY_RULE_SETUP
 #line 284 "engines/director/lingo/lingo-lex.l"
-{ count(); yylval.i = strtol(yytext, NULL, 10); return tINT; }
+{ count(); yylval.i = strtol(yytext, nullptr, 10); return tINT; }
 	YY_BREAK
 case 82:
 YY_RULE_SETUP
@@ -1847,7 +1847,7 @@ static int yy_get_next_buffer (void)
 				}
 			else
 				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = NULL;
+				b->yy_ch_buf = nullptr;
 
 			if ( ! b->yy_ch_buf )
 				YY_FATAL_ERROR(
@@ -2149,7 +2149,7 @@ static void yy_load_buffer_state  (void)
 		return;
 
 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr;
 
 	if ( b->yy_is_our_buffer )
 		yyfree( (void *) b->yy_ch_buf  );
@@ -2220,7 +2220,7 @@ static void yy_load_buffer_state  (void)
  */
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-    	if (new_buffer == NULL)
+    	if (new_buffer == nullptr)
 		return;
 
 	yyensure_buffer_stack();
@@ -2254,7 +2254,7 @@ void yypop_buffer_state (void)
 		return;
 
 	yy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = NULL;
+	YY_CURRENT_BUFFER_LVALUE = nullptr;
 	if ((yy_buffer_stack_top) > 0)
 		--(yy_buffer_stack_top);
 
@@ -2324,7 +2324,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
 		/* They forgot to leave room for the EOB's. */
-		return NULL;
+		return nullptr;
 
 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
 	if ( ! b )
@@ -2333,7 +2333,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
 	b->yy_buf_pos = b->yy_ch_buf = base;
 	b->yy_is_our_buffer = 0;
-	b->yy_input_file = NULL;
+	b->yy_input_file = nullptr;
 	b->yy_n_chars = b->yy_buf_size;
 	b->yy_is_interactive = 0;
 	b->yy_at_bol = 1;
@@ -2509,10 +2509,10 @@ static int yy_init_globals (void)
      * This function is called from yylex_destroy(), so don't allocate here.
      */
 
-    (yy_buffer_stack) = NULL;
+    (yy_buffer_stack) = nullptr;
     (yy_buffer_stack_top) = 0;
     (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = NULL;
+    (yy_c_buf_p) = nullptr;
     (yy_init) = 0;
     (yy_start) = 0;
 
@@ -2521,8 +2521,8 @@ static int yy_init_globals (void)
     yyin = stdin;
     yyout = stdout;
 #else
-    yyin = NULL;
-    yyout = NULL;
+    yyin = nullptr;
+    yyout = nullptr;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
@@ -2538,13 +2538,13 @@ int yylex_destroy  (void)
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		yy_delete_buffer( YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
+		YY_CURRENT_BUFFER_LVALUE = nullptr;
 		yypop_buffer_state();
 	}
 
 	/* Destroy the stack itself. */
 	yyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = NULL;
+	(yy_buffer_stack) = nullptr;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
      * yylex() is called, initialization will occur. */
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 17d17e4c6b..d229428503 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -77,7 +77,7 @@ static struct PredefinedProto {
 	// script object and Xtra
 	{ "birth",					LM::m_new,					-1, 0,	kScriptObj | kXtraObj, 	400 },			// D4
 
-	{ 0, 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0, 0 }
 };
 
 static MethodProto windowMethods[] = {
@@ -87,7 +87,7 @@ static MethodProto windowMethods[] = {
 	{ "open",					LM::m_open,					 0, 0,	400 },			// D4
 	{ "moveToBack",				LM::m_moveToBack,			 0, 0,	400 },			// D4
 	{ "moveToFront",			LM::m_moveToFront,			 0, 0,	400 },			// D4
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void Lingo::initMethods() {
@@ -132,7 +132,7 @@ static struct XLibProto {
 	{ VideodiscXObj::fileNames,		VideodiscXObj::open,	VideodiscXObj::close,		kXObj,					200 }, 	// D2
 	{ RearWindowXObj::fileNames,	RearWindowXObj::open,	RearWindowXObj::close,		kXObj,					400 },	// D4
 	{ MoveMouseXObj::fileNames,		MoveMouseXObj::open,	MoveMouseXObj::close,		kXObj,					400 },	// D4
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, nullptr, 0, 0 }
 
 };
 
diff --git a/engines/director/lingo/lingo-preprocessor.cpp b/engines/director/lingo/lingo-preprocessor.cpp
index e4a25b8bf2..26ff6e4ce6 100644
--- a/engines/director/lingo/lingo-preprocessor.cpp
+++ b/engines/director/lingo/lingo-preprocessor.cpp
@@ -30,7 +30,7 @@ bool isspec(Common::u32char_type_t c) {
 	if (c > 127)
 		return false;
 
-	return strchr("-+*/%^:,()><&[]=", (char)c) != NULL;
+	return strchr("-+*/%^:,()><&[]=", (char)c) != nullptr;
 }
 
 static Common::U32String nexttok(const Common::u32char_type_t *s, const Common::u32char_type_t **newP = nullptr) {
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index ffab25d129..2c4a432041 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -154,7 +154,7 @@ TheEntity entities[] = {
 	{ kTheUpdateMovieEnabled,"updateMovieEnabled",false,400, false },//			D4 p
 	{ kTheWindow,			"window",			true,  400, false },	//			D4
 	{ kTheWindowList,		"windowList",		false, 400, false },	//			D4 p
-	{ kTheNOEntity, NULL, false, 0, false }
+	{ kTheNOEntity, nullptr, false, 0, false }
 };
 
 TheEntityField fields[] = {
@@ -289,7 +289,7 @@ TheEntityField fields[] = {
 
 	{ kTheSoundEntity,"volume",		kTheVolume,		300 },//		D3 p
 
-	{ kTheNOEntity, NULL, kTheNOField, 0 }
+	{ kTheNOEntity, nullptr, kTheNOField, 0 }
 };
 
 void Lingo::initTheEntities() {
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 6d25d24e1a..464f2c1de1 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -146,7 +146,7 @@ PCell::PCell(const Datum &prop, const Datum &val) {
 Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
 	g_lingo = this;
 
-	_currentScript = 0;
+	_currentScript = nullptr;
 	_currentScriptContext = nullptr;
 
 	_currentChannelId = -1;
@@ -160,7 +160,7 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
 	_floatPrecision = 4;
 	_floatPrecisionFormat = "%.4f";
 
-	_localvars = NULL;
+	_localvars = nullptr;
 
 	//kTheEntities
 	_itemDelimiter = ',';
@@ -556,7 +556,7 @@ int Lingo::getAlignedType(const Datum &d1, const Datum &d2, bool numsOnly) {
 	if (d1Type == STRING) {
 		Common::String src = d1.asString();
 		if (!src.empty()) {
-			char *endPtr = 0;
+			char *endPtr = nullptr;
 			strtod(src.c_str(), &endPtr);
 			if (*endPtr == 0) {
 				d1Type = FLOAT;
@@ -566,7 +566,7 @@ int Lingo::getAlignedType(const Datum &d1, const Datum &d2, bool numsOnly) {
 	if (d2Type == STRING) {
 		Common::String src = d2.asString();
 		if (!src.empty()) {
-			char *endPtr = 0;
+			char *endPtr = nullptr;
 			strtod(src.c_str(), &endPtr);
 			if (*endPtr == 0) {
 				d2Type = FLOAT;
@@ -731,7 +731,7 @@ int Datum::asInt() const {
 	case STRING:
 		{
 			Common::String src = asString();
-			char *endPtr = 0;
+			char *endPtr = nullptr;
 			int result = strtol(src.c_str(), &endPtr, 10);
 			if (*endPtr == 0) {
 				res = result;
@@ -766,7 +766,7 @@ double Datum::asFloat() const {
 	switch (type) {
 	case STRING:		{
 			Common::String src = asString();
-			char *endPtr = 0;
+			char *endPtr = nullptr;
 			double result = strtod(src.c_str(), &endPtr);
 			if (*endPtr == 0) {
 				res = result;
diff --git a/engines/director/lingo/xlibs/cdromxobj.cpp b/engines/director/lingo/xlibs/cdromxobj.cpp
index 25d37f4257..1d9d029f3e 100644
--- a/engines/director/lingo/xlibs/cdromxobj.cpp
+++ b/engines/director/lingo/xlibs/cdromxobj.cpp
@@ -114,7 +114,7 @@ namespace Director {
 const char *CDROMXObj::xlibName = "AppleAudioCD";
 const char *CDROMXObj::fileNames[] = {
 	"CD-ROM XObj",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
@@ -146,7 +146,7 @@ static MethodProto xlibMethods[] = {
 	{ "ScanFwd",		CDROMXObj::m_scanFwd,		 4, 4,  200 },	// D2
 	{ "ScanBwd",		CDROMXObj::m_scanBwd,		 4, 4,  200 },	// D2
 	{ "StopScan",		CDROMXObj::m_stopScan,		 0, 0,  200 },	// D2
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void CDROMXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/fileio.cpp b/engines/director/lingo/xlibs/fileio.cpp
index fe21cd1b62..7f23252221 100644
--- a/engines/director/lingo/xlibs/fileio.cpp
+++ b/engines/director/lingo/xlibs/fileio.cpp
@@ -35,7 +35,7 @@ namespace Director {
 const char *FileIO::xlibName = "FileIO";
 const char *FileIO::fileNames[] = {
 	"FileIO",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
@@ -56,7 +56,7 @@ static MethodProto xlibMethods[] = {
 	{ "status",					FileIO::m_status,			 0, 0,	200 },	// D2
 	{ "writeChar",				FileIO::m_writeChar,		 1, 1,	200 },	// D2
 	{ "writeString",			FileIO::m_writeString,		 1, 1,	200 },	// D2
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void FileIO::open(int type) {
@@ -154,7 +154,7 @@ void FileIO::m_new(int nargs) {
 		option = option.substr(1);
 		Common::String mask = prefix + "*.txt";
 
-		GUI::FileBrowserDialog browser(0, "txt", option.equalsIgnoreCase("write") ? GUI::kFBModeSave : GUI::kFBModeLoad, mask.c_str());
+		GUI::FileBrowserDialog browser(nullptr, "txt", option.equalsIgnoreCase("write") ? GUI::kFBModeSave : GUI::kFBModeLoad, mask.c_str());
 		if (browser.runModal() <= 0) {
 			g_lingo->push(Datum(kErrorFileNotFound));
 			return;
diff --git a/engines/director/lingo/xlibs/flushxobj.cpp b/engines/director/lingo/xlibs/flushxobj.cpp
index b25b52e6d8..08e2e71366 100644
--- a/engines/director/lingo/xlibs/flushxobj.cpp
+++ b/engines/director/lingo/xlibs/flushxobj.cpp
@@ -45,7 +45,7 @@ namespace Director {
 const char *FlushXObj::xlibName = "FlushXObj";
 const char *FlushXObj::fileNames[] = {
 	"FlushXObj",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
@@ -54,7 +54,7 @@ static MethodProto xlibMethods[] = {
 	{ "ClearMask",			FlushXObj::m_clearMask,			 0, 0,	400 },	// D4
 	{ "Flush",				FlushXObj::m_flush,				 0, 0,  400 },	// D4
 	{ "FlushEvents",		FlushXObj::m_flushEvents,		 2, 2,  400 },	// D4
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void FlushXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/fplayxobj.cpp b/engines/director/lingo/xlibs/fplayxobj.cpp
index ef53c08205..93c2e9b6d5 100644
--- a/engines/director/lingo/xlibs/fplayxobj.cpp
+++ b/engines/director/lingo/xlibs/fplayxobj.cpp
@@ -40,7 +40,7 @@ namespace Director {
 const char *FPlayXObj::xlibName = "FPlay";
 const char *FPlayXObj::fileNames[] = {
 	"FPlayXObj",
-	0
+	nullptr
 };
 
 static BuiltinProto builtins[] = {
@@ -52,7 +52,7 @@ static BuiltinProto builtins[] = {
 	{ "FileName",		FPlayXObj::b_filename,	-1,0, 200, FBLTIN },
 	{ "InputLevel",		FPlayXObj::b_inputlevel,-1,0, 200, FBLTIN },
 	{ "FSound",			FPlayXObj::b_fsound,	 0,0, 200, FBLTIN },
-	{ 0, 0, 0, 0, 0, VOIDSYM }
+	{ nullptr, nullptr, 0, 0, 0, VOIDSYM }
 };
 
 void FPlayXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/labeldrvxobj.cpp b/engines/director/lingo/xlibs/labeldrvxobj.cpp
index dd7a42b8d9..67b6d9e78d 100644
--- a/engines/director/lingo/xlibs/labeldrvxobj.cpp
+++ b/engines/director/lingo/xlibs/labeldrvxobj.cpp
@@ -46,14 +46,14 @@ namespace Director {
 const char *LabelDrvXObj::xlibName = "LabelDrv";
 const char *LabelDrvXObj::fileNames[] = {
 	"LabelDrv",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
 	{ "new",				LabelDrvXObj::m_new,		 0, 0,	400 },	// D4
 	{ "SetRange",			LabelDrvXObj::m_setRange,	 2, 2,  400 },	// D4
 	{ "GetDrive",			LabelDrvXObj::m_getDrive,	 1, 1,  400 },	// D4
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void LabelDrvXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/memoryxobj.cpp b/engines/director/lingo/xlibs/memoryxobj.cpp
index fd2db88600..3b68a47161 100644
--- a/engines/director/lingo/xlibs/memoryxobj.cpp
+++ b/engines/director/lingo/xlibs/memoryxobj.cpp
@@ -37,13 +37,13 @@ namespace Director {
 const char *MemoryXObj::xlibName = "Memory";
 const char *MemoryXObj::fileNames[] = {
 	"Memory XObj",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
 	{ "new",					MemoryXObj::m_new,			0,	0,	400 },	// D4
 	{ "Clear",					MemoryXObj::m_clear,		0,	0,	400 },	// D4
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void MemoryXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/movemousexobj.cpp b/engines/director/lingo/xlibs/movemousexobj.cpp
index 63c051e192..6cc0a92138 100644
--- a/engines/director/lingo/xlibs/movemousexobj.cpp
+++ b/engines/director/lingo/xlibs/movemousexobj.cpp
@@ -36,13 +36,13 @@ const char *MoveMouseXObj::fileNames[] = {
 	"MoveMouse",
 	"MoveMouse.XObj",
 	"MOVEWIN",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
 	{ "new",					MoveMouseXObj::m_new,			 0, 0,	400 },	// D4
 	{ "setMouseLoc",			MoveMouseXObj::m_setMouseLoc,	 2, 2,	400 },	// D4
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 MoveMouseXObject::MoveMouseXObject(ObjectType ObjectType) :Object<MoveMouseXObject>("MoveMouseXObj") {
diff --git a/engines/director/lingo/xlibs/orthoplayxobj.cpp b/engines/director/lingo/xlibs/orthoplayxobj.cpp
index 99f848a87b..8a33189e79 100644
--- a/engines/director/lingo/xlibs/orthoplayxobj.cpp
+++ b/engines/director/lingo/xlibs/orthoplayxobj.cpp
@@ -43,7 +43,7 @@ namespace Director {
 const char *OrthoPlayXObj::xlibName = "OrthoPlayXObj";
 const char *OrthoPlayXObj::fileNames[] = {
 	"OrthoPlay XObj",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
@@ -115,7 +115,7 @@ static MethodProto xlibMethods[] = {
 	{ "GotoOutPoint",		OrthoPlayXObj::m_gotoOutPoint,		 0, 0,  200 },	// D2
 	{ "GotoPrerollPoint",	OrthoPlayXObj::m_gotoPrerollPoint,	 0, 0,  200 },	// D2
 	{ "GotoPostrollPoint",	OrthoPlayXObj::m_gotoPostrollPoint,	 0, 0,  200 },	// D2
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void OrthoPlayXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/palxobj.cpp b/engines/director/lingo/xlibs/palxobj.cpp
index ba0adfac4d..4b403c242d 100644
--- a/engines/director/lingo/xlibs/palxobj.cpp
+++ b/engines/director/lingo/xlibs/palxobj.cpp
@@ -49,13 +49,13 @@ namespace Director {
 const char *PalXObj::xlibName = "FixPalette";
 const char *PalXObj::fileNames[] = {
 	"PalXObj",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
 	{ "new",				PalXObj::m_new,				 4, 4,	400 },	// D4
 	{ "PatchIt",			PalXObj::m_patchIt,			 0, 0,  400 },	// D4
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void PalXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/popupmenuxobj.cpp b/engines/director/lingo/xlibs/popupmenuxobj.cpp
index df5588abdd..cf07f49cd8 100644
--- a/engines/director/lingo/xlibs/popupmenuxobj.cpp
+++ b/engines/director/lingo/xlibs/popupmenuxobj.cpp
@@ -52,7 +52,7 @@ const char *PopUpMenuXObj::xlibName = "PopMenu";
 const char *PopUpMenuXObj::fileNames[] = {
 	"PopMenu",
 	"PopUp Menu XObj",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
@@ -68,7 +68,7 @@ static MethodProto xlibMethods[] = {
 	{ "SetItemMark",		PopUpMenuXObj::m_setItemMark,	 1, 1,  200 },	// D2
 	{ "Smart",				PopUpMenuXObj::m_smart,			 1, 1,  200 },	// D2
 	{ "SetItemIcon",		PopUpMenuXObj::m_setItemIcon,	 2, 2,  200 },	// D2
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void PopUpMenuXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/serialportxobj.cpp b/engines/director/lingo/xlibs/serialportxobj.cpp
index 2ffaa32478..598f6d9cc6 100644
--- a/engines/director/lingo/xlibs/serialportxobj.cpp
+++ b/engines/director/lingo/xlibs/serialportxobj.cpp
@@ -39,7 +39,7 @@ namespace Director {
 const char *SerialPortXObj::xlibName = "SerialPort";
 const char *SerialPortXObj::fileNames[] = {
 	"SerialPort",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
@@ -54,7 +54,7 @@ static MethodProto xlibMethods[] = {
 	{ "ConfigChan",			SerialPortXObj::m_configChan,	 2, 2,  200 },	// D2
 	{ "HShakeChan",			SerialPortXObj::m_hShakeChan,	 3, 3,  200 },	// D2
 	{ "SetUp",				SerialPortXObj::m_setUp,		 3, 3,  200 },	// D2
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void SerialPortXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/soundjam.cpp b/engines/director/lingo/xlibs/soundjam.cpp
index 5a38bdea5c..53e1fa5cfa 100644
--- a/engines/director/lingo/xlibs/soundjam.cpp
+++ b/engines/director/lingo/xlibs/soundjam.cpp
@@ -57,7 +57,7 @@ namespace Director {
 const char *SoundJam::xlibName = "SoundJam";
 const char *SoundJam::fileNames[] = {
 	"SoundJam",
-	0
+	nullptr
 };
 
 const int kJamChannel = 3;
@@ -74,7 +74,7 @@ static MethodProto xlibMethods[] = {
 	{ "hasSwitchHappened",	SoundJam::m_hasSwitchHappened, 0, 0, 400 },
 	{ "toggleMute",			SoundJam::m_toggleMute,		 0, 0,	400 },
 	{ "stop",				SoundJam::m_stop,			 0, 0,	400 },
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void SoundJam::open(int type) {
diff --git a/engines/director/lingo/xlibs/videodiscxobj.cpp b/engines/director/lingo/xlibs/videodiscxobj.cpp
index 23e6abdbd6..125b346682 100644
--- a/engines/director/lingo/xlibs/videodiscxobj.cpp
+++ b/engines/director/lingo/xlibs/videodiscxobj.cpp
@@ -111,7 +111,7 @@ namespace Director {
 const char *VideodiscXObj::xlibName = "LaserDisc";
 const char *VideodiscXObj::fileNames[] = {
 	"Videodisc XObj",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
@@ -140,7 +140,7 @@ static MethodProto xlibMethods[] = {
 	{ "VideoControl",	VideodiscXObj::m_videoControl,	 1, 1,	200 },	// D2
 	{ "AudioControl",	VideodiscXObj::m_audioControl,	 1, 1,	200 },	// D2
 	{ "Status",			VideodiscXObj::m_status,		 0, 0,	200 },	// D2
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void VideodiscXObj::open(int type) {
diff --git a/engines/director/lingo/xlibs/winxobj.cpp b/engines/director/lingo/xlibs/winxobj.cpp
index 2c96c8a7ac..ef8c5464b3 100644
--- a/engines/director/lingo/xlibs/winxobj.cpp
+++ b/engines/director/lingo/xlibs/winxobj.cpp
@@ -42,7 +42,7 @@ const char *RearWindowXObj::xlibName = "RearWindow";
 const char *RearWindowXObj::fileNames[] = {
 	"RearWindow.Xobj",
 	"winXObj",
-	0
+	nullptr
 };
 
 static MethodProto xlibMethods[] = {
@@ -50,7 +50,7 @@ static MethodProto xlibMethods[] = {
 	{ "GetMemoryNeeded",	RearWindowXObj::m_getMemoryNeeded,		0,	0,	400 },	// D4
 	{ "PatToWindow",		RearWindowXObj::m_patToWindow,			1,	1,	400 },	// D4
 	{ "IndexColorToWindow",	RearWindowXObj::m_indexColorToWindow,	1,	1,	400 },	// D4
-	{ 0, 0, 0, 0, 0 }
+	{ nullptr, nullptr, 0, 0, 0 }
 };
 
 void RearWindowXObj::open(int type) {
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b4ceda1814..2f12ec342f 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -171,7 +171,7 @@ void Score::setStartToLabel(Common::String &label) {
 void Score::gotoLoop() {
 	// This command has the playback head contonuously return to the first marker to to the left and then loop back.
 	// If no marker are to the left of the playback head, the playback head continues to the right.
-	if (_labels == NULL) {
+	if (_labels == nullptr) {
 		_nextFrame = 1;
 		return;
 	} else {
@@ -208,7 +208,7 @@ void Score::gotoPrevious() {
 }
 
 int Score::getNextLabelNumber(int referenceFrame) {
-	if (_labels == NULL || _labels->size() == 0)
+	if (_labels == nullptr || _labels->size() == 0)
 		return 0;
 
 	Common::SortedArray<Label *>::iterator i;
@@ -234,7 +234,7 @@ int Score::getNextLabelNumber(int referenceFrame) {
 }
 
 int Score::getPreviousLabelNumber(int referenceFrame) {
-	if (_labels == NULL || _labels->size() == 0)
+	if (_labels == nullptr || _labels->size() == 0)
 		return 0;
 
 	// One label
@@ -397,7 +397,7 @@ void Score::update() {
 	}
 
 	Common::SortedArray<Label *>::iterator i;
-	if (_labels != NULL) {
+	if (_labels != nullptr) {
 		for (i = _labels->begin(); i != _labels->end(); ++i) {
 			if ((*i)->number == _currentFrame) {
 				_currentLabel = _currentFrame;
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 5befff8902..67e66a7ab6 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -570,8 +570,8 @@ bool hasExtension(Common::String filename) {
 }
 
 Common::String testExtensions(Common::String component, Common::String initialPath, Common::String convPath) {
-	const char *extsD3[] = { ".MMM", 0 };
-	const char *extsD4[] = { ".DIR", ".DXR", 0 };
+	const char *extsD3[] = { ".MMM", nullptr };
+	const char *extsD4[] = { ".DIR", ".DXR", nullptr };
 
 	const char **exts = (g_director->getVersion() >= 400) ? extsD4 : extsD3;
 	for (int i = 0; exts[i]; ++i) {


Commit: 8c0f10e8173265b13a752b556aec7438fde8ed9c
    https://github.com/scummvm/scummvm/commit/8c0f10e8173265b13a752b556aec7438fde8ed9c
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
DM: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/dm/detection.cpp
    engines/dm/dungeonman.cpp
    engines/dm/eventman.cpp
    engines/dm/gfx.cpp
    engines/dm/projexpl.cpp


diff --git a/engines/dm/detection.cpp b/engines/dm/detection.cpp
index 2d459c7d4a..97019a987a 100644
--- a/engines/dm/detection.cpp
+++ b/engines/dm/detection.cpp
@@ -35,7 +35,7 @@ namespace DM {
 
 static const PlainGameDescriptor DMGames[] = {
 	{"dm", "Dungeon Master"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DMADGameDescription gameDescriptions[] = {
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 7f66253fc8..b62774c1c4 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -1478,7 +1478,7 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) {
 								} else {
 									projExpl.projectileDeleteEvent(squareThing);
 									unlinkThingFromList(squareThing, Thing(0), currMapX, currMapY);
-									projExpl.projectileDelete(squareThing, 0, currMapX, currMapY);
+									projExpl.projectileDelete(squareThing, nullptr, currMapX, currMapY);
 								}
 								break;
 							case kDMThingTypeArmour:
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index f87c1719dc..f7011276d9 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -844,7 +844,7 @@ void EventManager::processCommandQueue() {
 			displMan.drawViewport(k2_viewportAsBeforeSleepOrFreezeGame);
 			_vm->_waitForInputMaxVerticalBlankCount = 0;
 			_primaryMouseInput = _primaryMouseInputPartySleeping;
-			_secondaryMouseInput = 0;
+			_secondaryMouseInput = nullptr;
 			_primaryKeyboardInput = _primaryKeyboardInputPartySleeping;
 			_secondaryKeyboardInput = nullptr;
 			discardAllInput();
@@ -890,7 +890,7 @@ void EventManager::processCommandQueue() {
 		primaryKeyboardInputBackup = _primaryKeyboardInput;
 		secondaryKeyboardInputBackup = _secondaryKeyboardInput;
 		_primaryMouseInput = _primaryMouseInputFrozenGame;
-		_secondaryMouseInput = 0;
+		_secondaryMouseInput = nullptr;
 		_primaryKeyboardInput = _primaryKeyboardInputFrozenGame;
 		_secondaryKeyboardInput = nullptr;
 		discardAllInput();
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 813633c80c..a82fa47b4a 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -3806,7 +3806,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:;
 					blitToBitmapShrinkWithPalChange(bitmapRedBanana, _tmpBitmap, 48, 32, 48, 32, _palChangeSmoke);
 					bitmapRedBanana = _tmpBitmap;
 				}
-				blitBoxFilledWithMaskedBitmap(bitmapRedBanana, _bitmapViewport, 0, getDerivedBitmap(kDMDerivedBitmapViewport), boxExplosionPatternD0C, _vm->getRandomNumber(4) + 87, _vm->getRandomNumber(64), k112_byteWidthViewport, Color(k0x0080_BlitDoNotUseMask | kDMColorFlesh), 0, 0, 136, 93);
+				blitBoxFilledWithMaskedBitmap(bitmapRedBanana, _bitmapViewport, nullptr, getDerivedBitmap(kDMDerivedBitmapViewport), boxExplosionPatternD0C, _vm->getRandomNumber(4) + 87, _vm->getRandomNumber(64), k112_byteWidthViewport, Color(k0x0080_BlitDoNotUseMask | kDMColorFlesh), 0, 0, 136, 93);
 				addDerivedBitmap(kDMDerivedBitmapViewport);
 				warning("DISABLED CODE: f480_releaseBlock in drawObjectsCreaturesProjectilesExplosions");
 				//f480_releaseBlock(k0_DerivedBitmapViewport | 0x8000);
@@ -3876,7 +3876,7 @@ T0115200_DrawExplosion:
 		}
 	} while ((thingParam = dungeon.getNextThing(thingParam))!= _vm->_thingEndOfList);
 
-	if ((fluxcageExplosion != 0) && (doorFrontViewDrawingPass != 1) && !_doNotDrawFluxcagesDuringEndgame) { /* Fluxcage is an explosion displayed as a field (like teleporters), above all other graphics */
+	if ((fluxcageExplosion != nullptr) && (doorFrontViewDrawingPass != 1) && !_doNotDrawFluxcagesDuringEndgame) { /* Fluxcage is an explosion displayed as a field (like teleporters), above all other graphics */
 		AL_1_viewSquareExplosionIndex -= 3; /* Convert square index for explosions back to square index */
 		FieldAspect fieldAspect = _fieldAspects188[viewSquareIndex];
 		(fieldAspect._nativeBitmapRelativeIndex)++; /* NativeBitmapRelativeIndex is now the index of the Fluxcage field graphic */
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 3bcceb30e9..6a321b4414 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -377,7 +377,7 @@ void ProjExpl::projectileDelete(Thing projectileThing, Thing *groupSlot, int16 m
 	Projectile *projectile = (Projectile *)_vm->_dungeonMan->getThingData(projectileThing);
 	Thing projectileSlotThing = projectile->_slot;
 	if (projectileSlotThing.getType() != kDMThingTypeExplosion) {
-		if (groupSlot != NULL) {
+		if (groupSlot != nullptr) {
 			Thing previousThing = *groupSlot;
 			if (previousThing == _vm->_thingEndOfList) {
 				Thing *genericThing = (Thing *)_vm->_dungeonMan->getThingData(projectileSlotThing);
@@ -415,7 +415,7 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) {
 		uint16 stepEnergy = curEvent->_Cu._projectile.getStepEnergy();
 		if (projectile->_kineticEnergy <= stepEnergy) {
 			_vm->_dungeonMan->unlinkThingFromList(projectileThingNewCell = projectileThing, Thing(0), destinationMapX, destinationMapY);
-			projectileDelete(projectileThingNewCell, NULL, destinationMapX, destinationMapY);
+			projectileDelete(projectileThingNewCell, nullptr, destinationMapX, destinationMapY);
 			return;
 		}
 		projectile->_kineticEnergy -= stepEnergy;


Commit: 5adade14d2b6a86757b5da2a38729c190b6e6283
    https://github.com/scummvm/scummvm/commit/5adade14d2b6a86757b5da2a38729c190b6e6283
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
DRACI: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/draci/animation.cpp
    engines/draci/barchive.cpp
    engines/draci/detection.cpp
    engines/draci/draci.cpp
    engines/draci/font.cpp
    engines/draci/game.cpp
    engines/draci/saveload.cpp
    engines/draci/screen.cpp
    engines/draci/script.cpp
    engines/draci/sound.cpp
    engines/draci/sprite.cpp
    engines/draci/walking.cpp


diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp
index 2528383f4f..6ea165f95a 100644
--- a/engines/draci/animation.cpp
+++ b/engines/draci/animation.cpp
@@ -339,7 +339,7 @@ Animation *AnimationManager::getAnimation(int id) {
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 void AnimationManager::insert(Animation *anim, bool allocateIndex) {
@@ -494,7 +494,7 @@ void AnimationManager::deleteAfterIndex(int index) {
 const Animation *AnimationManager::getTopAnimation(int x, int y) const {
 	Common::List<Animation *>::const_iterator it;
 
-	Animation *retval = NULL;
+	Animation *retval = nullptr;
 
 	// Get transparent color for the current screen
 	const int transparent = _vm->_screen->getSurface()->getTransparentColor();
@@ -510,7 +510,7 @@ const Animation *AnimationManager::getTopAnimation(int x, int y) const {
 
 		const Drawable *frame = anim->getConstCurrentFrame();
 
-		if (frame == NULL) {
+		if (frame == nullptr) {
 			continue;
 		}
 
@@ -534,7 +534,7 @@ const Animation *AnimationManager::getTopAnimation(int x, int y) const {
 		if (matches) {
 			if (anim->getID() > kOverlayImage || anim->getID() < kSpeechText) {
 				return anim;
-			} else if (retval == NULL) {
+			} else if (retval == nullptr) {
 				retval = anim;
 			}
 		}
diff --git a/engines/draci/barchive.cpp b/engines/draci/barchive.cpp
index 0cd1097981..a30c20bbef 100644
--- a/engines/draci/barchive.cpp
+++ b/engines/draci/barchive.cpp
@@ -105,7 +105,7 @@ void BArchive::openDFW(const Common::String &path) {
 		_f.readUint16LE(); // Compressed length again (already read from the index table)
 		_files[i]._stopper = _f.readByte();
 
-		_files[i]._data = NULL; // File data will be read in on demand
+		_files[i]._data = nullptr; // File data will be read in on demand
 		_files[i]._crc = 0; // Dummy value; not used in DFW archives
 	}
 
@@ -217,7 +217,7 @@ void BArchive::openArchive(const Common::String &path) {
 			"Compression type flag is non-zero (file is compressed)");
 
 		_files[i]._crc = _f.readByte();	// CRC checksum of the file
-		_files[i]._data = NULL;		// File data will be read in on demand
+		_files[i]._data = nullptr;		// File data will be read in on demand
 		_files[i]._stopper = 0;		// Dummy value; not used in BAR files, needed in DFW
 	}
 
@@ -252,7 +252,7 @@ void BArchive::closeArchive() {
 	_f.close();
 
 	_opened = false;
-	_files = NULL;
+	_files = nullptr;
 	_fileCount = 0;
 }
 
@@ -268,7 +268,7 @@ BAFile *BArchive::loadFileBAR(uint i) {
 	// Else open archive and read in requested file
 	if (!_f.isOpen()) {
 		debugC(2, kDraciArchiverDebugLevel, "Error");
-		return NULL;
+		return nullptr;
 	}
 
 	// Read in the file (without the file header)
@@ -302,7 +302,7 @@ BAFile *BArchive::loadFileDFW(uint i) {
 	// Else open archive and read in requested file
 	if (!_f.isOpen()) {
 		debugC(2, kDraciArchiverDebugLevel, "Error");
-		return NULL;
+		return nullptr;
 	}
 
 	// Seek to raw data of the file
@@ -375,7 +375,7 @@ void BArchive::clearCache() {
 const BAFile *BArchive::getFile(uint i) {
 	// Check whether requested file exists
 	if (i >= _fileCount) {
-		return NULL;
+		return nullptr;
 	}
 
 	debugCN(2, kDraciArchiverDebugLevel, "Accessing file %d from archive %s... ",
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index eb4150363e..2c22496d8d 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -40,7 +40,7 @@ static const DebugChannelDef debugFlagList[] = {
 
 static const PlainGameDescriptor draciGames[] = {
 	{ "draci", "Draci Historie" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 namespace Draci {
@@ -48,7 +48,7 @@ namespace Draci {
 const ADGameDescription gameDescriptions[] = {
 	{
 		"draci",
-		0,
+		nullptr,
 		AD_ENTRY1s("INIT.DFW", "b890a5aeebaf16af39219cba2416b0a3", 906),
 		Common::EN_ANY,
 		Common::kPlatformDOS,
@@ -58,7 +58,7 @@ const ADGameDescription gameDescriptions[] = {
 
 	{
 		"draci",
-		0,
+		nullptr,
 		AD_ENTRY1s("INIT.DFW", "9921c8f0045679a8f37eca8d41c5ec02", 906),
 		Common::CZ_CZE,
 		Common::kPlatformDOS,
@@ -68,7 +68,7 @@ const ADGameDescription gameDescriptions[] = {
 
 	{
 		"draci",
-		0,
+		nullptr,
 		AD_ENTRY1s("INIT.DFW", "76b9b78a8a8809a240acc395df4d0715", 906),
 		Common::PL_POL,
 		Common::kPlatformDOS,
@@ -78,7 +78,7 @@ const ADGameDescription gameDescriptions[] = {
 
 	{
 		"draci",
-		0,
+		nullptr,
 		AD_ENTRY1s("INIT.DFW", "9a7115b91cdea361bcaff3e046ac7ded", 906),
 		Common::DE_DEU,
 		Common::kPlatformDOS,
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 33b49d5e98..0a8387124d 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -74,29 +74,29 @@ DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc)
 
 	setDebugger(new DraciConsole(this));
 
-	_screen = 0;
-	_mouse = 0;
-	_game = 0;
-	_script = 0;
-	_anims = 0;
-	_sound = 0;
-	_music = 0;
-	_smallFont = 0;
-	_bigFont = 0;
-	_iconsArchive = 0;
-	_objectsArchive = 0;
-	_spritesArchive = 0;
-	_paletteArchive = 0;
-	_roomsArchive = 0;
-	_overlaysArchive = 0;
-	_animationsArchive = 0;
-	_walkingMapsArchive = 0;
-	_itemsArchive = 0;
-	_itemImagesArchive = 0;
-	_initArchive = 0;
-	_stringsArchive = 0;
-	_soundsArchive = 0;
-	_dubbingArchive = 0;
+	_screen = nullptr;
+	_mouse = nullptr;
+	_game = nullptr;
+	_script = nullptr;
+	_anims = nullptr;
+	_sound = nullptr;
+	_music = nullptr;
+	_smallFont = nullptr;
+	_bigFont = nullptr;
+	_iconsArchive = nullptr;
+	_objectsArchive = nullptr;
+	_spritesArchive = nullptr;
+	_paletteArchive = nullptr;
+	_roomsArchive = nullptr;
+	_overlaysArchive = nullptr;
+	_animationsArchive = nullptr;
+	_walkingMapsArchive = nullptr;
+	_itemsArchive = nullptr;
+	_itemImagesArchive = nullptr;
+	_initArchive = nullptr;
+	_stringsArchive = nullptr;
+	_soundsArchive = nullptr;
+	_dubbingArchive = nullptr;
 	_showWalkingMap = 0;
 	_pauseStartTime = 0;
 }
diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp
index 669c7d85e0..49d9559ea7 100644
--- a/engines/draci/font.cpp
+++ b/engines/draci/font.cpp
@@ -34,8 +34,8 @@ const char * const kFontBig = "Big.fon";
 Font::Font(const Common::String &filename) {
 	_fontHeight = 0;
 	_maxCharWidth = 0;
-	_charWidths = NULL;
-	_charData = NULL;
+	_charWidths = nullptr;
+	_charData = nullptr;
 
 	loadFont(filename);
 }
@@ -123,7 +123,7 @@ uint8 Font::getCharWidth(uint8 chr) const {
  */
 
 void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_color) const {
-	assert(dst != NULL);
+	assert(dst != nullptr);
 	assert(tx >= 0);
 	assert(ty >= 0);
 
@@ -214,7 +214,7 @@ void Font::drawString(Surface *dst, const byte *str, uint len,
 
 void Font::drawString(Surface *dst, const Common::String &str,
 	                  int x, int y, int with_color, int spacing, bool markDirty) const {
-	assert(dst != NULL);
+	assert(dst != nullptr);
 	assert(x >= 0);
 	assert(y >= 0);
 
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index d3bbd33aad..7933836a14 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -266,26 +266,26 @@ void Game::init() {
 
 	// Initialize animation for object / room titles
 	_titleAnim = new Animation(_vm, kTitleText, 257, true);
-	_titleAnim->addFrame(new Text("", _vm->_smallFont, kTitleColor, 0, 0, 0), NULL);
+	_titleAnim->addFrame(new Text("", _vm->_smallFont, kTitleColor, 0, 0, 0), nullptr);
 	_vm->_anims->insert(_titleAnim, false);
 
 	// Initialize animation for speech text
 	Animation *speechAnim = new Animation(_vm, kSpeechText, 257, true);
-	speechAnim->addFrame(new Text("", _vm->_bigFont, kFontColor1, 0, 0, 0), NULL);
+	speechAnim->addFrame(new Text("", _vm->_bigFont, kFontColor1, 0, 0, 0), nullptr);
 	_vm->_anims->insert(speechAnim, false);
 
 	// Initialize inventory animation.  _iconsArchive is never flushed.
 	const BAFile *f = _vm->_iconsArchive->getFile(13);
 	_inventoryAnim = new Animation(_vm, kInventorySprite, 255, false);
 	Sprite *inventorySprite = new Sprite(f->_data, f->_length, 0, 0, true);
-	_inventoryAnim->addFrame(inventorySprite, NULL);
+	_inventoryAnim->addFrame(inventorySprite, nullptr);
 	_inventoryAnim->setRelative((kScreenWidth - inventorySprite->getWidth()) / 2,
 	                           (kScreenHeight - inventorySprite->getHeight()) / 2);
 	_vm->_anims->insert(_inventoryAnim, true);
 
 	for (uint i = 0; i < kDialogueLines; ++i) {
 		_dialogueAnims[i] = new Animation(_vm, kDialogueLinesID - i, 254, true);
-		_dialogueAnims[i]->addFrame(new Text("", _vm->_smallFont, kLineInactiveColor, 0, 0, 0), NULL);
+		_dialogueAnims[i]->addFrame(new Text("", _vm->_smallFont, kLineInactiveColor, 0, 0, 0), nullptr);
 
 		_dialogueAnims[i]->setRelative(1,
 		                      kScreenHeight - (i + 1) * _vm->_smallFont->getFontHeight());
@@ -343,7 +343,7 @@ void Game::handleOrdinaryLoop(int x, int y) {
 					}
 				}
 			} else {
-				_walkingState.setCallback(NULL, 0);
+				_walkingState.setCallback(nullptr, 0);
 				walkHero(x, y, kDirectionLast);
 			}
 		}
@@ -366,7 +366,7 @@ void Game::handleOrdinaryLoop(int x, int y) {
 					}
 				}
 			} else {
-				_walkingState.setCallback(NULL, 0);
+				_walkingState.setCallback(nullptr, 0);
 				walkHero(x, y, kDirectionLast);
 			}
 		} else {
@@ -374,7 +374,7 @@ void Game::handleOrdinaryLoop(int x, int y) {
 				_walkingState.setCallback(&_currentRoom._program, _currentRoom._use);
 				_walkingState.callback();
 			} else {
-				_walkingState.setCallback(NULL, 0);
+				_walkingState.setCallback(nullptr, 0);
 				walkHero(x, y, kDirectionLast);
 			}
 		}
@@ -482,13 +482,13 @@ void Game::handleDialogueLoop() {
 
 void Game::fadePalette(bool fading_out) {
 	_isFadeOut = fading_out;
-	const byte *startPal = NULL;
+	const byte *startPal = nullptr;
 	const byte *endPal = _currentRoom._palette >= 0
 		? _vm->_paletteArchive->getFile(_currentRoom._palette)->_data
-		: NULL;
+		: nullptr;
 	if (fading_out) {
 		startPal = endPal;
-		endPal = NULL;
+		endPal = nullptr;
 	}
 	for (int i = 1; i <= kBlackFadingIterations; ++i) {
 		_vm->_system->delayMillis(kBlackFadingTimeUnit);
@@ -502,8 +502,8 @@ void Game::advanceAnimationsAndTestLoopExit() {
 	if (_fadePhase > 0 && (_vm->_system->getMillis() - _fadeTick) >= kFadingTimeUnit) {
 		_fadeTick = _vm->_system->getMillis();
 		--_fadePhase;
-		const byte *startPal = _currentRoom._palette >= 0 ? _vm->_paletteArchive->getFile(_currentRoom._palette)->_data : NULL;
-		const byte *endPal = getScheduledPalette() >= 0 ? _vm->_paletteArchive->getFile(getScheduledPalette())->_data : NULL;
+		const byte *startPal = _currentRoom._palette >= 0 ? _vm->_paletteArchive->getFile(_currentRoom._palette)->_data : nullptr;
+		const byte *endPal = getScheduledPalette() >= 0 ? _vm->_paletteArchive->getFile(getScheduledPalette())->_data : nullptr;
 		_vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColors, _fadePhases - _fadePhase, _fadePhases);
 		if (_fadePhase == 0) {
 			if (_loopSubstatus == kInnerWhileFade) {
@@ -817,7 +817,7 @@ const GameObject *Game::getObjectWithAnimation(const Animation *anim) const {
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 void Game::removeItem(GameItem *item) {
@@ -839,12 +839,12 @@ void Game::loadItemAnimation(GameItem *item) {
 	_vm->_anims->insert(item->_anim, false);
 	// _itemImagesArchive is never flushed.
 	const BAFile *img = _vm->_itemImagesArchive->getFile(2 * item->_absNum);
-	item->_anim->addFrame(new Sprite(img->_data, img->_length, 0, 0, true), NULL);
+	item->_anim->addFrame(new Sprite(img->_data, img->_length, 0, 0, true), nullptr);
 }
 
 void Game::putItem(GameItem *item, int position) {
 	// Empty our hands
-	setCurrentItem(NULL);
+	setCurrentItem(nullptr);
 
 	if (!item)
 		return;
@@ -1191,7 +1191,7 @@ int Game::playHeroAnimation(int anim_index) {
 void Game::redrawWalkingPath(Animation *anim, byte color, const WalkingPath &path) {
 	Sprite *ov = _walkingMap.newOverlayFromPath(path, color);
 	delete anim->getFrame(0);
-	anim->replaceFrame(0, ov, NULL);
+	anim->replaceFrame(0, ov, nullptr);
 	anim->markDirtyRect(_vm->_screen->getSurface());
 }
 
@@ -1244,14 +1244,14 @@ void Game::walkHero(int x, int y, SightDirection dir) {
 
 void Game::initWalkingOverlays() {
 	_walkingMapOverlay = new Animation(_vm, kWalkingMapOverlay, 256, _vm->_showWalkingMap);
-	_walkingMapOverlay->addFrame(NULL, NULL);	// rewritten below by loadWalkingMap()
+	_walkingMapOverlay->addFrame(nullptr, nullptr);	// rewritten below by loadWalkingMap()
 	_vm->_anims->insert(_walkingMapOverlay, true);
 
 	_walkingShortestPathOverlay = new Animation(_vm, kWalkingShortestPathOverlay, 257, _vm->_showWalkingMap);
 	_walkingObliquePathOverlay = new Animation(_vm, kWalkingObliquePathOverlay, 258, _vm->_showWalkingMap);
 	WalkingPath emptyPath;
-	_walkingShortestPathOverlay->addFrame(_walkingMap.newOverlayFromPath(emptyPath, 0), NULL);
-	_walkingObliquePathOverlay->addFrame(_walkingMap.newOverlayFromPath(emptyPath, 0), NULL);
+	_walkingShortestPathOverlay->addFrame(_walkingMap.newOverlayFromPath(emptyPath, 0), nullptr);
+	_walkingObliquePathOverlay->addFrame(_walkingMap.newOverlayFromPath(emptyPath, 0), nullptr);
 	_vm->_anims->insert(_walkingShortestPathOverlay, true);
 	_vm->_anims->insert(_walkingObliquePathOverlay, true);
 }
@@ -1293,7 +1293,7 @@ void Game::loadWalkingMap(int mapID) {
 
 	Sprite *ov = _walkingMap.newOverlayFromMap(kWalkingMapOverlayColor);
 	delete _walkingMapOverlay->getFrame(0);
-	_walkingMapOverlay->replaceFrame(0, ov, NULL);
+	_walkingMapOverlay->replaceFrame(0, ov, nullptr);
 	_walkingMapOverlay->markDirtyRect(_vm->_screen->getSurface());
 }
 
@@ -1330,7 +1330,7 @@ void Game::loadOverlays() {
 		Sprite *sp = new Sprite(overlayFile->_data, overlayFile->_length, x, y, true);
 
 		Animation *anim = new Animation(_vm, kOverlayImage, z, true);
-		anim->addFrame(sp, NULL);
+		anim->addFrame(sp, nullptr);
 		// Since this is an overlay, we don't need it to be deleted
 		// when the GPL Release command is invoked
 		_vm->_anims->insert(anim, false);
@@ -1465,7 +1465,7 @@ void Game::enterNewRoom() {
 	loadOverlays();
 
 	// Draw the scene with the black palette and slowly fade into the right palette.
-	_vm->_screen->setPalette(NULL, 0, kNumColors);
+	_vm->_screen->setPalette(nullptr, 0, kNumColors);
 	_vm->_anims->drawScene(_vm->_screen->getSurface());
 	_vm->_screen->copyToScreen();
 
@@ -1797,7 +1797,7 @@ void GameItem::load(int itemID, BArchive *archive) {
 	_program._bytecode = f->_data;
 	_program._length = f->_length;
 
-	_anim = NULL;
+	_anim = nullptr;
 }
 
 void Room::load(int roomNum, BArchive *archive) {
diff --git a/engines/draci/saveload.cpp b/engines/draci/saveload.cpp
index 83c64b5725..d78e0719a8 100644
--- a/engines/draci/saveload.cpp
+++ b/engines/draci/saveload.cpp
@@ -85,7 +85,7 @@ Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName,
 	Common::String filename = vm.getSavegameFile(saveGameIdx);
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	Common::OutSaveFile *f = saveMan->openForSaving(filename);
-	if (f == NULL)
+	if (f == nullptr)
 		return Common::kNoGameDataFoundError;
 
 	TimeDate curTime;
@@ -105,7 +105,7 @@ Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName,
 		return Common::kWritingFailed;
 	} else {
 		// Create the remainder of the savegame
-		Common::Serializer s(NULL, f);
+		Common::Serializer s(nullptr, f);
 		vm._game->synchronize(s, header.version);
 
 		f->finalize();
@@ -120,7 +120,7 @@ Common::Error loadSavegameData(int saveGameIdx, DraciEngine *vm) {
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	Common::InSaveFile *f = saveMan->openForLoading(vm->getSavegameFile(saveGameIdx));
 
-	if (f == NULL) {
+	if (f == nullptr) {
 		return Common::kNoGameDataFoundError;
 	}
 
@@ -135,7 +135,7 @@ Common::Error loadSavegameData(int saveGameIdx, DraciEngine *vm) {
 	vm->_game->deleteObjectAnimations();
 
 	// Synchronise the remaining data of the savegame
-	Common::Serializer s(f, NULL);
+	Common::Serializer s(f, nullptr);
 	vm->_game->synchronize(s, header.version);
 	delete f;
 
diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp
index 2434a1312e..4ca03949c5 100644
--- a/engines/draci/screen.cpp
+++ b/engines/draci/screen.cpp
@@ -40,7 +40,7 @@ Screen::Screen(DraciEngine *vm) : _vm(vm) {
 	for (int i = 0; i < 3 * kNumColors; ++i) {
 		_blackPalette[i] = 0;
 	}
-	setPalette(NULL, 0, kNumColors);
+	setPalette(nullptr, 0, kNumColors);
 	this->clearScreen();
 }
 
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index 35c87e7acb..f48e91fe0a 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -41,8 +41,8 @@ namespace Draci {
 void Script::setupCommandList() {
 	/** A table of all the commands the game player uses */
 	static const GPL2Command gplCommands[] = {
-		{ 0,  0, "gplend",            0, { },                                NULL },
-		{ 0,  1, "exit",              0, { },                                NULL },
+		{ 0,  0, "gplend",            0, { },                                nullptr },
+		{ 0,  1, "exit",              0, { },                                nullptr },
 		{ 1,  1, "goto",              1, { kGPL2Ident },                     &Script::c_Goto },
 		{ 2,  1, "Let",               2, { kGPL2Ident, kGPL2Math },          &Script::c_Let },
 		{ 3,  1, "if",                2, { kGPL2Math, kGPL2Ident },          &Script::c_If },
@@ -88,18 +88,18 @@ void Script::setupCommandList() {
 		{ 25, 1, "PushNewRoom",       0, { },                                &Script::pushNewRoom },
 		{ 25, 2, "PopNewRoom",        0, { },                                &Script::popNewRoom },
 		// The following commands are not used in the original game files.
-		{ 16, 1, "RepaintInventory",  0, { },                                NULL },
-		{ 16, 2, "ExitInventory",     0, { },                                NULL },
-		{ 17, 1, "ExitMap",           0, { },                                NULL },
-		{ 18, 4, "FadeOutMusic",      1, { kGPL2Num },                       NULL },
-		{ 18, 5, "FadeInMusic",       1, { kGPL2Num },                       NULL },
+		{ 16, 1, "RepaintInventory",  0, { },                                nullptr },
+		{ 16, 2, "ExitInventory",     0, { },                                nullptr },
+		{ 17, 1, "ExitMap",           0, { },                                nullptr },
+		{ 18, 4, "FadeOutMusic",      1, { kGPL2Num },                       nullptr },
+		{ 18, 5, "FadeInMusic",       1, { kGPL2Num },                       nullptr },
 		// The following commands are not even defined in the game
 		// sources, but their numbers are allocated for internal
 		// purposes of the old player.
-		{ 26, 1, "ShowCheat",         0, { },                                NULL },
-		{ 26, 2, "HideCheat",         0, { },                                NULL },
-		{ 26, 3, "ClearCheat",        1, { kGPL2Num },                       NULL },
-		{ 27, 1, "FeedPassword",      3, { kGPL2Num, kGPL2Num, kGPL2Num },   NULL }
+		{ 26, 1, "ShowCheat",         0, { },                                nullptr },
+		{ 26, 2, "HideCheat",         0, { },                                nullptr },
+		{ 26, 3, "ClearCheat",        1, { kGPL2Num },                       nullptr },
+		{ 27, 1, "FeedPassword",      3, { kGPL2Num, kGPL2Num, kGPL2Num },   nullptr }
 	};
 
 	/** Operators used by the mathematical evaluator */
@@ -141,7 +141,7 @@ void Script::setupCommandList() {
 		// The following function is not even defined in the game
 		// sources, but its number is allocated for internal purposes
 		// of the old player.
-		{ NULL, "Cheat" },
+		{ nullptr, "Cheat" },
 	};
 
 	_commandList = gplCommands;
@@ -543,13 +543,13 @@ void Script::icoStat(const Common::Array<int> &params) {
 		// Remove the item from the inventory and release its animations.
 		_vm->_game->removeItem(item);
 		item->_anim->del();
-		item->_anim = NULL;
+		item->_anim = nullptr;
 
 		// If the item was in the hand, remove it from the hands and,
 		// if the cursor was set to this item (as opposed to, say, an
 		// arrow leading outside a location), set it to standard.
 		if (_vm->_game->getCurrentItem() == item) {
-			_vm->_game->setCurrentItem(NULL);
+			_vm->_game->setCurrentItem(nullptr);
 			_vm->_game->setPreviousItemPosition(-1);
 			if (_vm->_mouse->getCursorType() >= kItemCursor) {
 				_vm->_mouse->setCursorType(kNormalCursor);
@@ -728,7 +728,7 @@ void Script::talk(const Common::Array<int> &params) {
 
 	// Fetch the dubbing
 	SoundSample *sample = _vm->_sound->isMutedVoice()
-		? NULL : _vm->_dubbingArchive->getSample(sentenceID, 0);
+		? nullptr : _vm->_dubbingArchive->getSample(sentenceID, 0);
 
 	// Set the string and text color
 	surface->markDirtyRect(speechFrame->getRect(kNoDisplacement));
@@ -887,7 +887,7 @@ void Script::fadePalettePlay(const Common::Array<int> &params) {
 
 void Script::setPalette(const Common::Array<int> &params) {
 	if (_vm->_game->getScheduledPalette() == -1) {
-		_vm->_screen->setPalette(NULL, 0, kNumColors);
+		_vm->_screen->setPalette(nullptr, 0, kNumColors);
 	} else {
 		const BAFile *f;
 		f = _vm->_paletteArchive->getFile(_vm->_game->getScheduledPalette());
@@ -981,7 +981,7 @@ int Script::handleMathExpression(Common::ReadStream *reader) const {
 			func = _functionList[value-1];
 
 			// If not yet implemented
-			if (func._handler == 0) {
+			if (func._handler == nullptr) {
 				stk.pop();
 
 				// Pushing dummy value
@@ -1067,7 +1067,7 @@ const GPL2Command *Script::findCommand(byte num, byte subnum) const {
 		++i;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 /**
@@ -1182,7 +1182,7 @@ void Script::run(const GPL2Program &program, uint16 offset) {
 
 		GPLHandler handler = cmd->_handler;
 
-		if (handler != 0) {
+		if (handler != nullptr) {
 			// Call the handler for the current command
 			(this->*(cmd->_handler))(params);
 		}
diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp
index 953e1355ff..aa9ffe2232 100644
--- a/engines/draci/sound.cpp
+++ b/engines/draci/sound.cpp
@@ -56,7 +56,7 @@ void LegacySoundArchive::openArchive(const char *path) {
 	} else {
 		debugC(1, kDraciArchiverDebugLevel, "Error");
 		delete _f;
-		_f = NULL;
+		_f = nullptr;
 		return;
 	}
 
@@ -123,9 +123,9 @@ void LegacySoundArchive::openArchive(const char *path) {
 void LegacySoundArchive::closeArchive() {
 	clearCache();
 	delete _f;
-	_f = NULL;
+	_f = nullptr;
 	delete[] _samples;
-	_samples = NULL;
+	_samples = nullptr;
 	_sampleCount = 0;
 	_path = "";
 	_opened = false;
@@ -152,7 +152,7 @@ void LegacySoundArchive::clearCache() {
 SoundSample *LegacySoundArchive::getSample(int i, uint freq) {
 	// Check whether requested file exists
 	if (i < 0 || i >= (int)_sampleCount) {
-		return NULL;
+		return nullptr;
 	}
 
 	debugCN(2, kDraciArchiverDebugLevel, "Accessing sample %d from archive %s... ",
@@ -213,8 +213,8 @@ void ZipSoundArchive::openArchive(const char *path, const char *extension, Sound
 void ZipSoundArchive::closeArchive() {
 	clearCache();
 	delete _archive;
-	_archive = NULL;
-	_path = _extension = NULL;
+	_archive = nullptr;
+	_path = _extension = nullptr;
 	_sampleCount = _defaultFreq = 0;
 	_format = RAW;
 }
@@ -231,13 +231,13 @@ void ZipSoundArchive::clearCache() {
 
 SoundSample *ZipSoundArchive::getSample(int i, uint freq) {
 	if (i < 0 || i >= (int)_sampleCount) {
-		return NULL;
+		return nullptr;
 	}
 	debugCN(2, kDraciArchiverDebugLevel, "Accessing sample %d.%s from archive %s (format %d@%d, capacity %d): ",
 		i, _extension, _path, static_cast<int> (_format), _defaultFreq, _sampleCount);
 	if (freq != 0 && (_format != RAW && _format != RAW80)) {
 		error("Cannot resample a sound in compressed format");
-		return NULL;
+		return nullptr;
 	}
 
 	// We cannot really cache anything, because createReadStreamForMember()
@@ -253,7 +253,7 @@ SoundSample *ZipSoundArchive::getSample(int i, uint freq) {
 	sample._stream = _archive->createReadStreamForMember(filename);
 	if (!sample._stream) {
 		debugC(2, kDraciArchiverDebugLevel, "Doesn't exist");
-		return NULL;
+		return nullptr;
 	} else {
 		debugC(2, kDraciArchiverDebugLevel, "Read");
 		_cache.push_back(sample);
@@ -289,7 +289,7 @@ SndHandle *Sound::getHandle() {
 
 	error("Sound::getHandle(): Too many sound handles");
 
-	return NULL;	// for compilers that don't support NORETURN
+	return nullptr;	// for compilers that don't support NORETURN
 }
 
 uint Sound::playSoundBuffer(Audio::SoundHandle *handle, const SoundSample &buffer, int volume,
@@ -318,7 +318,7 @@ uint Sound::playSoundBuffer(Audio::SoundHandle *handle, const SoundSample &buffe
 			buffer._data + skip, buffer._length - skip /* length */, DisposeAfterUse::NO);
 	}
 
-	Audio::SeekableAudioStream *reader = NULL;
+	Audio::SeekableAudioStream *reader = nullptr;
 	switch (buffer._format) {
 	case RAW:
 	case RAW80:
diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp
index 32e34db032..a91ff59314 100644
--- a/engines/draci/sprite.cpp
+++ b/engines/draci/sprite.cpp
@@ -78,7 +78,7 @@ Sprite::Sprite(uint16 width, uint16 height, byte *raw_data, int x, int y, bool c
  *  pixel.
  */
 Sprite::Sprite(const byte *sprite_data, uint16 length, int x, int y, bool columnwise)
-	: _ownsData(false), _data(NULL), _mirror(false) {
+	: _ownsData(false), _data(nullptr), _mirror(false) {
 
 	Common::MemoryReadStream reader(sprite_data, length);
 	_width = reader.readSint16LE();
diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp
index 507bb9cc17..056849ee61 100644
--- a/engines/draci/walking.cpp
+++ b/engines/draci/walking.cpp
@@ -395,7 +395,7 @@ bool WalkingMap::managedToOblique(WalkingPath *path) const {
 
 void WalkingState::stopWalking() {
 	_path.clear();
-	_callback = NULL;
+	_callback = nullptr;
 }
 
 void WalkingState::startWalking(const Common::Point &p1, const Common::Point &p2,
@@ -450,9 +450,9 @@ void WalkingState::callback() {
 	debugC(2, kDraciWalkingDebugLevel, "Calling walking callback");
 
 	const GPL2Program &originalCallback = *_callback;
-	_callback = NULL;
+	_callback = nullptr;
 	_vm->_script->runWrapper(originalCallback, _callbackOffset, true, false);
-	_callbackLast = NULL;
+	_callbackLast = nullptr;
 	_callbackOffset = 0;
 }
 


Commit: 9937cc49bb8332b35308a639bb358ce7c5f71221
    https://github.com/scummvm/scummvm/commit/9937cc49bb8332b35308a639bb358ce7c5f71221
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
DRAGONS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/dragons/actor.cpp
    engines/dragons/background.cpp
    engines/dragons/cursor.cpp
    engines/dragons/detection.cpp
    engines/dragons/dragonini.cpp
    engines/dragons/dragonvar.cpp
    engines/dragons/scene.cpp
    engines/dragons/scriptopcodes.cpp
    engines/dragons/sequenceopcodes.cpp
    engines/dragons/specialopcodes.cpp


diff --git a/engines/dragons/actor.cpp b/engines/dragons/actor.cpp
index 91426cbcc3..cc828eb993 100644
--- a/engines/dragons/actor.cpp
+++ b/engines/dragons/actor.cpp
@@ -135,7 +135,7 @@ Actor *ActorManager::getActorByDisplayOrder(uint16 position) {
 Actor::Actor(uint16 id) : _actorID(id) {
 	_actorResource = nullptr;
 	_resourceID = -1;
-	_seqCodeIp = 0;
+	_seqCodeIp = nullptr;
 	_priorityLayer = 3;
 	_x_pos = 160;
 	_y_pos = 110;
diff --git a/engines/dragons/background.cpp b/engines/dragons/background.cpp
index d1a4b12eab..76e780faf2 100644
--- a/engines/dragons/background.cpp
+++ b/engines/dragons/background.cpp
@@ -84,7 +84,7 @@ void PriorityLayer::restoreTileMap(int16 x, int16 y, int16 w, int16 h) {
 
 }
 
-Background::Background() : _priorityLayer(0), _points2(0), _data(0) {
+Background::Background() : _priorityLayer(nullptr), _points2(nullptr), _data(nullptr) {
 	_layerSurface[0] = nullptr;
 	_layerSurface[1] = nullptr;
 	_layerSurface[2] = nullptr;
diff --git a/engines/dragons/cursor.cpp b/engines/dragons/cursor.cpp
index d58809912c..64e6fab40c 100644
--- a/engines/dragons/cursor.cpp
+++ b/engines/dragons/cursor.cpp
@@ -33,7 +33,7 @@
 
 namespace Dragons {
 
-Cursor::Cursor(DragonsEngine *vm): _vm(vm), _actor(0), _x(0), _y(0) {
+Cursor::Cursor(DragonsEngine *vm): _vm(vm), _actor(nullptr), _x(0), _y(0) {
 	_sequenceID = 0;
 	_data_800728b0_cursor_seqID = 0;
 	_iniUnderCursor = 0;
diff --git a/engines/dragons/detection.cpp b/engines/dragons/detection.cpp
index e6d4820750..0ef265bd46 100644
--- a/engines/dragons/detection.cpp
+++ b/engines/dragons/detection.cpp
@@ -26,7 +26,7 @@
 
 static const PlainGameDescriptor dragonsGames[] = {
 		{ "dragons", "Blazing Dragons" },
-		{ 0, 0 }
+		{ nullptr, nullptr }
 };
 
 namespace Dragons {
@@ -35,7 +35,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 	{
 			{
 					"dragons",
-					0,
+					nullptr,
 					AD_ENTRY1s("bigfile.dat", "02c26712bee57266f28235fdc0207725", 44990464),
 					Common::EN_USA,
 					Common::kPlatformPSX,
@@ -47,7 +47,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 	{
 			{
 					"dragons",
-					0,
+					nullptr,
 					AD_ENTRY1s("bigfile.dat", "02c26712bee57266f28235fdc0207725", 44992512),
 					Common::EN_GRB,
 					Common::kPlatformPSX,
@@ -59,7 +59,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 	{
 			{
 					"dragons",
-					0,
+					nullptr,
 					AD_ENTRY1s("bigfile.dat", "9854fed0d2b48522a62973e99b52a0be", 45099008),
 					Common::DE_DEU,
 					Common::kPlatformPSX,
@@ -71,7 +71,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 	{
 			{
 					"dragons",
-					0,
+					nullptr,
 					AD_ENTRY1s("bigfile.dat", "9854fed0d2b48522a62973e99b52a0be", 45107200),
 					Common::FR_FRA,
 					Common::kPlatformPSX,
@@ -84,7 +84,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 	{
 			{
 					"dragons",
-					0,
+					nullptr,
 					AD_ENTRY2s("bigfile.dat", "02c26712bee57266f28235fdc0207725", 44990464,
 							   "dtspeech.xa", "7f7ace860e5dd3696b51eace20215274", 182138880),
 					Common::RU_RUS,
@@ -100,7 +100,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 	{
 			{
 					"dragons",
-					0,
+					nullptr,
 					AD_ENTRY1s("bigfile.dat", "92b938703611789e1a007d6dfac7ef7e", 51668736),
 					Common::EN_USA,
 					Common::kPlatformPSX,
@@ -117,7 +117,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 
 static const char * const directoryGlobs[] = {
 	"resource",
-	0
+	nullptr
 };
 
 class DragonsMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/dragons/dragonini.cpp b/engines/dragons/dragonini.cpp
index c5191ab828..e347c18bfe 100644
--- a/engines/dragons/dragonini.cpp
+++ b/engines/dragons/dragonini.cpp
@@ -26,7 +26,7 @@
 namespace Dragons {
 
 #define DRAGON_INI_STRUCT_SIZE 0x22
-DragonINIResource::DragonINIResource(BigfileArchive *bigfileArchive): _bigfileArchive(bigfileArchive), _dragonINI(0) {
+DragonINIResource::DragonINIResource(BigfileArchive *bigfileArchive): _bigfileArchive(bigfileArchive), _dragonINI(nullptr) {
 	reset();
 }
 
diff --git a/engines/dragons/dragonvar.cpp b/engines/dragons/dragonvar.cpp
index 9cb18a87e0..a392d7001c 100644
--- a/engines/dragons/dragonvar.cpp
+++ b/engines/dragons/dragonvar.cpp
@@ -24,7 +24,7 @@
 
 namespace Dragons {
 
-DragonVAR::DragonVAR(BigfileArchive *bigfileArchive): _bigfileArchive(bigfileArchive), _data(0) {
+DragonVAR::DragonVAR(BigfileArchive *bigfileArchive): _bigfileArchive(bigfileArchive), _data(nullptr) {
 	reset();
 }
 
diff --git a/engines/dragons/scene.cpp b/engines/dragons/scene.cpp
index 37e150f5ec..a087ff7fb2 100644
--- a/engines/dragons/scene.cpp
+++ b/engines/dragons/scene.cpp
@@ -37,7 +37,7 @@ namespace Dragons {
 
 
 Scene::Scene(DragonsEngine *vm, Screen *screen, ScriptOpcodes *scriptOpcodes, ActorManager *actorManager, DragonRMS *dragonRMS, DragonINIResource *dragonINIResource, BackgroundResourceLoader *backgroundResourceLoader)
-		: _vm(vm), _screen(screen), _scriptOpcodes(scriptOpcodes), _stage(0), _actorManager(actorManager), _dragonRMS(dragonRMS), _dragonINIResource(dragonINIResource), _backgroundLoader(backgroundResourceLoader) {
+		: _vm(vm), _screen(screen), _scriptOpcodes(scriptOpcodes), _stage(nullptr), _actorManager(actorManager), _dragonRMS(dragonRMS), _dragonINIResource(dragonINIResource), _backgroundLoader(backgroundResourceLoader) {
 	_mapTransitionEffectSceneID = 2;
 	_data_800633ee = 0;
 
diff --git a/engines/dragons/scriptopcodes.cpp b/engines/dragons/scriptopcodes.cpp
index 58549ed66c..fbf3ec39f0 100644
--- a/engines/dragons/scriptopcodes.cpp
+++ b/engines/dragons/scriptopcodes.cpp
@@ -102,7 +102,7 @@ typedef Common::Functor1Mem<ScriptOpCall&, void, ScriptOpcodes> ScriptOpcodeI;
 void ScriptOpcodes::initOpcodes() {
 	// First clear everything
 	for (uint i = 0; i < DRAGONS_NUM_SCRIPT_OPCODES; ++i) {
-		_opcodes[i] = 0;
+		_opcodes[i] = nullptr;
 	}
 	// Register opcodes
 	OPCODE(1, opUnk1);
diff --git a/engines/dragons/sequenceopcodes.cpp b/engines/dragons/sequenceopcodes.cpp
index 0fb710aa0b..40407a27f4 100644
--- a/engines/dragons/sequenceopcodes.cpp
+++ b/engines/dragons/sequenceopcodes.cpp
@@ -74,7 +74,7 @@ typedef Common::Functor2Mem<Actor*, OpCall&, void, SequenceOpcodes> SequenceOpco
 void SequenceOpcodes::initOpcodes() {
 	// First clear everything
 	for (uint i = 0; i < DRAGONS_NUM_SEQ_OPCODES; ++i) {
-		_opcodes[i] = 0;
+		_opcodes[i] = nullptr;
 	}
 	// Register opcodes
 	OPCODE(1, opSetFramePointer);
diff --git a/engines/dragons/specialopcodes.cpp b/engines/dragons/specialopcodes.cpp
index c9b9535af6..662e825872 100644
--- a/engines/dragons/specialopcodes.cpp
+++ b/engines/dragons/specialopcodes.cpp
@@ -80,7 +80,7 @@ typedef Common::Functor0Mem<void, SpecialOpcodes> SpecialOpcodeI;
 void SpecialOpcodes::initOpcodes() {
 	// First clear everything
 	for (uint i = 0; i < DRAGONS_NUM_SPECIAL_OPCODES; ++i) {
-		_opcodes[i] = 0;
+		_opcodes[i] = nullptr;
 	}
 	// Register opcodes
 	OPCODE(1, spcCatapultMiniGame);


Commit: 8672b6281c6b729310095fd016a47dde8e2afca8
    https://github.com/scummvm/scummvm/commit/8672b6281c6b729310095fd016a47dde8e2afca8
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
DRASCULA: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/drascula/detection.cpp
    engines/drascula/drascula.cpp
    engines/drascula/graphics.cpp
    engines/drascula/rooms.cpp


diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 89d206b80a..0717929630 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -30,7 +30,7 @@
 
 static const PlainGameDescriptor drasculaGames[] = {
 	{"drascula", "Drascula: The Vampire Strikes Back"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 namespace Drascula {
@@ -43,7 +43,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula English version (original packed files)
 		{
 			"drascula",
-			0,
+			nullptr,
 			{
 				{"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
 				// HACK: List packet.001 twice to ensure this detector entry
@@ -63,7 +63,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula French version (original packed files)
 		{
 			"drascula",
-			0,
+			nullptr,
 			{
 				{"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
 				{"packet.002", 1, "4401123400f22f212b89f15fb4b43013", 721122},
@@ -80,7 +80,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula French version (ScummVM repacked files)
 		{
 			"drascula",
-			0,
+			nullptr,
 			{
 				{"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
 				{"packet.002", 1, "7b83cedb9bb326ed5143e5c459508d43", 722383},
@@ -97,7 +97,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula German version (original packed files)
 		{
 			"drascula",
-			0,
+			nullptr,
 			{
 				{"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
 				{"packet.003", 1, "e8f4dc6091037329bab4ddb1cba35807", 719728},
@@ -114,7 +114,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Italian version (original packed version)
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("packet.001", "0253e924af223f5fe52537023385159b", 32564209),
 			Common::IT_ITA,
 			Common::kPlatformDOS,
@@ -127,7 +127,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Italian version (ScummVM repacked files)
 		{
 			"drascula",
-			0,
+			nullptr,
 			{
 				{"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
 				{"packet.005", 1, "58caac54b891f5d7f335e710e45e5d29", 16209623},
@@ -144,7 +144,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Spanish version (original packed version)
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("packet.001", "3c971aba65a037d29d0b479cad6f5943", 31702652),
 			Common::ES_ESP,
 			Common::kPlatformDOS,
@@ -157,7 +157,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Spanish version (ScummVM repacked files)
 		{
 			"drascula",
-			0,
+			nullptr,
 			{
 				{"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
 				{"packet.004", 1, "a289d3cf80d50f25ec569b653248437e", 17205838},
@@ -174,7 +174,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Russian version (ScummVM repacked files)
 		{
 			"drascula",
-			0,
+			nullptr,
 			{
 				{"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
 				{"packet.006", 1, "e464b99de7f226391337510d5c328258", 697173},
@@ -193,7 +193,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula English version
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("14.ald", "09b2735953edcd43af115c65ae00b10e", 1595),
 			Common::EN_ANY,
 			Common::kPlatformDOS,
@@ -206,7 +206,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula French version
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("14.ald", "eeeee96b82169003630e08992248296c", 608),
 			Common::FR_FRA,
 			Common::kPlatformDOS,
@@ -219,7 +219,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula French version (updated - bug #6303)
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("14.ald", "1f9fbded768bee061cc22bc5bdeab540", 611),
 			Common::FR_FRA,
 			Common::kPlatformDOS,
@@ -232,7 +232,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula German version
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("14.ald", "72e46089033d56bad1c179ac36e2a9d2", 610),
 			Common::DE_DEU,
 			Common::kPlatformDOS,
@@ -245,7 +245,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Italian version
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("14.ald", "02b49a18328d0bf2efe6ba658c9c7a1d", 2098),
 			Common::IT_ITA,
 			Common::kPlatformDOS,
@@ -258,7 +258,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Italian version (updated - bug #6303)
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("14.ald", "ccaee939bb3b344c048f28f9205710d1", 2925),
 			Common::IT_ITA,
 			Common::kPlatformDOS,
@@ -271,7 +271,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Spanish version
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("14.ald", "0746ed1a5cc8d9728f790c29813f4b43", 23059),
 			Common::ES_ESP,
 			Common::kPlatformDOS,
@@ -283,7 +283,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
 		// Drascula Russian version
 		{
 			"drascula",
-			0,
+			nullptr,
 			AD_ENTRY1s("14.ald", "4dfab170eae935a2e9889196df427a4a", 1426),
 			Common::RU_RUS,
 			Common::kPlatformDOS,
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 08c092909e..2c065e8b41 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -37,37 +37,37 @@
 namespace Drascula {
 
 DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
-	_charMap = 0;
-	_itemLocations = 0;
-	_polX = 0;
-	_polY = 0;
-	_verbBarX = 0;
-	_x1d_menu = 0;
-	_y1d_menu = 0;
-	_frameX = 0;
-	_candleX = 0;
-	_candleY = 0;
-	_pianistX = 0;
-	_drunkX = 0;
-	_roomPreUpdates = 0;
-	_roomUpdates = 0;
-	_roomActions = 0;
-	_text = 0;
-	_textd = 0;
-	_textb = 0;
-	_textbj = 0;
-	_texte = 0;
-	_texti = 0;
-	_textl = 0;
-	_textp = 0;
-	_textt = 0;
-	_textvb = 0;
-	_textsys = 0;
-	_texthis = 0;
-	_textverbs = 0;
-	_textmisc = 0;
-	_textd1 = 0;
-	_talkSequences = 0;
+	_charMap = nullptr;
+	_itemLocations = nullptr;
+	_polX = nullptr;
+	_polY = nullptr;
+	_verbBarX = nullptr;
+	_x1d_menu = nullptr;
+	_y1d_menu = nullptr;
+	_frameX = nullptr;
+	_candleX = nullptr;
+	_candleY = nullptr;
+	_pianistX = nullptr;
+	_drunkX = nullptr;
+	_roomPreUpdates = nullptr;
+	_roomUpdates = nullptr;
+	_roomActions = nullptr;
+	_text = nullptr;
+	_textd = nullptr;
+	_textb = nullptr;
+	_textbj = nullptr;
+	_texte = nullptr;
+	_texti = nullptr;
+	_textl = nullptr;
+	_textp = nullptr;
+	_textt = nullptr;
+	_textvb = nullptr;
+	_textsys = nullptr;
+	_texthis = nullptr;
+	_textverbs = nullptr;
+	_textmisc = nullptr;
+	_textd1 = nullptr;
+	_talkSequences = nullptr;
 	_currentSaveSlot = 0;
 
 	term_int = 0;
@@ -150,17 +150,17 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
 	_rightMouseButton = 0;
 	*textName = 0;
 
-	crosshairCursor = 0;
-	mouseCursor = 0;
-	bgSurface = 0;
-	backSurface = 0;
-	cursorSurface = 0;
-	drawSurface3 = 0;
-	drawSurface2 = 0;
-	tableSurface = 0;
-	extraSurface = 0;
-	screenSurface = 0;
-	frontSurface = 0;
+	crosshairCursor = nullptr;
+	mouseCursor = nullptr;
+	bgSurface = nullptr;
+	backSurface = nullptr;
+	cursorSurface = nullptr;
+	drawSurface3 = nullptr;
+	drawSurface2 = nullptr;
+	tableSurface = nullptr;
+	extraSurface = nullptr;
+	screenSurface = nullptr;
+	frontSurface = nullptr;
 	previousMusic = 0;
 	roomMusic = 0;
 
@@ -175,7 +175,7 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
 
 	_keyBufferHead = _keyBufferTail = 0;
 
-	_roomHandlers = 0;
+	_roomHandlers = nullptr;
 }
 
 DrasculaEngine::~DrasculaEngine() {
@@ -1103,7 +1103,7 @@ char **DrasculaEngine::loadTexts(Common::File &in) {
 	int numTexts = in.readUint16BE();
 	char **res = (char **)malloc(sizeof(char *) * numTexts);
 	int entryLen;
-	char *pos = 0;
+	char *pos = nullptr;
 	int len;
 
 	for (int lang = 0; lang < _numLangs; lang++) {
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index 34831318be..44e33469c2 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -400,7 +400,7 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) {
 	*tmpMessageCurLine = 0;
 	// Get a word from the message
 	char* curWord = strtok(msg, " ");
-	while (curWord != NULL) {
+	while (curWord != nullptr) {
 		// Check if the word and the current line fit on screen
 		if (tmpMessageCurLine[0] != '\0')
 			Common::strlcat(tmpMessageCurLine, " ", 50);
@@ -416,8 +416,8 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) {
 		}
 
 		// Get next word
-		curWord = strtok(NULL, " ");
-		if (curWord == NULL) {
+		curWord = strtok(nullptr, " ");
+		if (curWord == nullptr) {
 			// The original has an interesting bug that if we split the text on several lines
 			// a space is added at the end (which impacts the alignment, and may even cause the line
 			// to become too long).
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index 8263483666..847ea5aea2 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -138,7 +138,7 @@ void DrasculaEngine::setupRoomsTable() {
 }
 
 void DrasculaEngine::freeRoomsTable() {
-	if (_roomHandlers == 0)
+	if (_roomHandlers == nullptr)
 		return;
 
 	for (uint32 i = 0; i < _roomHandlers->roomParsers.size(); i++)
@@ -154,7 +154,7 @@ void DrasculaEngine::freeRoomsTable() {
 	_roomHandlers->roomUpdaters.clear();
 
 	delete _roomHandlers;
-	_roomHandlers = 0;
+	_roomHandlers = nullptr;
 }
 
 bool DrasculaEngine::roomParse(int rN, int fl) {


Commit: 2c23cf985f5a8d49cb1a40981d625e8b47b58b83
    https://github.com/scummvm/scummvm/commit/2c23cf985f5a8d49cb1a40981d625e8b47b58b83
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
DREAMWEB: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/dreamweb/detection.cpp
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/keypad.cpp
    engines/dreamweb/monitor.cpp
    engines/dreamweb/newplace.cpp
    engines/dreamweb/object.cpp
    engines/dreamweb/print.cpp
    engines/dreamweb/saveload.cpp
    engines/dreamweb/stubs.cpp
    engines/dreamweb/talk.cpp


diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp
index 44446169b6..8c237530b1 100644
--- a/engines/dreamweb/detection.cpp
+++ b/engines/dreamweb/detection.cpp
@@ -37,7 +37,7 @@
 
 static const PlainGameDescriptor dreamWebGames[] = {
 	{ "dreamweb", "DreamWeb" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 5ceb4c42af..e3865f7f41 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -49,7 +49,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
 	_personText(kNumPersonTexts) {
 
 	_vSyncPrevTick = 0;
-	_sound = 0;
+	_sound = nullptr;
 	_speed = 1;
 	_turbo = false;
 	_oldMouseState = 0;
@@ -81,8 +81,8 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
 
 	_speechLoaded = false;
 
-	_backdropBlocks = 0;
-	_reelList = 0;
+	_backdropBlocks = nullptr;
+	_reelList = nullptr;
 
 	_oldSubject._type = 0;
 	_oldSubject._index = 0;
@@ -249,7 +249,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
 	for (uint i = 0; i < kNumReelRoutines+1; i++)
 		memset(&_reelRoutines[i], 0, sizeof(ReelRoutine));
 
-	_personData = 0;
+	_personData = nullptr;
 
 	for (uint i = 0; i < 16; i++)
 		memset(&_openInvList[i], 0, sizeof(ObjectRef));
@@ -263,7 +263,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
 	for (uint i = 0; i < kNumChanges; i++)
 		memset(&_listOfChanges[i], 0, sizeof(Change));
 
-	_currentCharset = 0;
+	_currentCharset = nullptr;
 
 	for (uint i = 0; i < 36; i++)
 		memset(&_pathData[i], 0, sizeof(RoomPaths));
diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp
index 6c43c741d3..46e44917cc 100644
--- a/engines/dreamweb/keypad.cpp
+++ b/engines/dreamweb/keypad.cpp
@@ -43,7 +43,7 @@ void DreamWebEngine::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 d
 		{ kKeypadx+31,kKeypadx+74,kKeypady+59,kKeypady+73,&DreamWebEngine::buttonEnter },
 		{ kKeypadx+72,kKeypadx+86,kKeypady+80,kKeypady+94,&DreamWebEngine::quitKey },
 		{ 0,320,0,200,&DreamWebEngine::blank },
-		{ 0xFFFF,0,0,0,0 }
+		{ 0xFFFF,0,0,0,nullptr }
 	};
 
 	getRidOfReels();
@@ -259,7 +259,7 @@ void DreamWebEngine::useMenu() {
 		RectWithCallback menuList[] = {
 			{ kMenux+54,kMenux+68,kMenuy+72,kMenuy+88,&DreamWebEngine::quitKey },
 			{ 0,320,0,200,&DreamWebEngine::blank },
-			{ 0xFFFF,0,0,0,0 }
+			{ 0xFFFF,0,0,0,nullptr }
 		};
 		checkCoords(menuList);
 	} while ((_getBack != 1) && !_quitRequested);
@@ -388,7 +388,7 @@ void DreamWebEngine::checkFolderCoords() {
 		{ 143,300,6,194, &DreamWebEngine::nextFolder },
 		{ 0,143,6,194, &DreamWebEngine::lastFolder },
 		{ 0,320,0,200, &DreamWebEngine::blank },
-		{ 0xFFFF,0,0,0, 0 }
+		{ 0xFFFF,0,0,0, nullptr }
 	};
 	checkCoords(folderList);
 }
@@ -519,7 +519,7 @@ void DreamWebEngine::enterSymbol() {
 			{ kSymbolx,kSymbolx+52,kSymboly+50,kSymboly+80,&DreamWebEngine::setBotLeft },
 			{ kSymbolx+52,kSymbolx+104,kSymboly+50,kSymboly+80,&DreamWebEngine::setBotRight },
 			{ 0,320,0,200,&DreamWebEngine::blank },
-			{ 0xFFFF,0,0,0,0 }
+			{ 0xFFFF,0,0,0,nullptr }
 		};
 		checkCoords(symbolList);
 	} while ((_getBack == 0) && !_quitRequested);
@@ -735,7 +735,7 @@ void DreamWebEngine::useDiary() {
 		{ kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamWebEngine::diaryKeyP },
 		{ kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamWebEngine::quitKey },
 		{ 0,320,0,200,&DreamWebEngine::blank },
-		{ 0xFFFF,0,0,0,0 }
+		{ 0xFFFF,0,0,0,nullptr }
 	};
 
 	do {
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index e51f393cae..946cca2719 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -108,7 +108,7 @@ void DreamWebEngine::useMon() {
 int DreamWebEngine::findCommand(const char *const cmdList[]) {
 	// Loop over all commands in the list and see if we get a match
 	int cmd = 0;
-	while (cmdList[cmd] != NULL) {
+	while (cmdList[cmd] != nullptr) {
 		const char *cmdStr = cmdList[cmd];
 		const char *inputStr = _inputLine;
 		// Compare the command, char by char, to see if we get a match.
@@ -133,7 +133,7 @@ bool DreamWebEngine::execCommand() {
 		"READ",
 		"LOGON",
 		"KEYS",
-		NULL
+		nullptr
 	};
 
 	static const char *const comlistFR[] = {
@@ -143,7 +143,7 @@ bool DreamWebEngine::execCommand() {
 		"LIRE",
 		"CONNEXION",
 		"TOUCHES", // should be CLES but it is translated as TOUCHES in the game...
-		NULL
+		nullptr
 	};
 
 	static const char *const comlistDE[] = {
@@ -153,7 +153,7 @@ bool DreamWebEngine::execCommand() {
 		"LIES",
 		"ZUGRIFF",
 		"DATEN",
-		NULL
+		nullptr
 	};
 
 	static const char *const comlistIT[] = {
@@ -163,7 +163,7 @@ bool DreamWebEngine::execCommand() {
 		"LEGGI",
 		"ACCEDI",
 		"CHIAVI",
-		NULL
+		nullptr
 	};
 
 	static const char *const comlistES[] = {
@@ -173,7 +173,7 @@ bool DreamWebEngine::execCommand() {
 		"LEER",
 		"ACCESO",
 		"CLAVES",
-		NULL
+		nullptr
 	};
 
 	if (_inputLine[0] == 0) {
@@ -276,7 +276,7 @@ void DreamWebEngine::printLogo() {
 void DreamWebEngine::input() {
 	memset(_inputLine, 0, sizeof(_inputLine));
 	_curPos = 0;
-	printChar(_monitorCharset, _monAdX, _monAdY, '>', 0, NULL, NULL);
+	printChar(_monitorCharset, _monAdX, _monAdY, '>', 0, nullptr, nullptr);
 	multiDump(_monAdX, _monAdY, 6, 8);
 	_monAdX += 6;
 	_cursLocX = _monAdX;
@@ -308,7 +308,7 @@ void DreamWebEngine::input() {
 			continue;
 		multiGet(_mapStore + _curPos * 256, _monAdX, _monAdY, 8, 8);
 		uint8 charWidth;
-		printChar(_monitorCharset, _monAdX, _monAdY, currentKey, 0, &charWidth, NULL);
+		printChar(_monitorCharset, _monAdX, _monAdY, currentKey, 0, &charWidth, nullptr);
 		_inputLine[_curPos * 2 + 1] = charWidth;
 		_monAdX += charWidth;
 		++_curPos;
@@ -384,7 +384,7 @@ void DreamWebEngine::showCurrentFile() {
 	while (*currentFile) {
 		char c = *currentFile++;
 		c = modifyChar(c);
-		printChar(_monitorCharset, &x, 37, c, 0, NULL, NULL);
+		printChar(_monitorCharset, &x, 37, c, 0, nullptr, nullptr);
 	}
 }
 
@@ -526,7 +526,7 @@ const char *DreamWebEngine::getKeyAndLogo(const char *foundString) {
 		monMessage(12);	// "Access denied, key required -"
 		monPrint(monitorKeyEntries[keyNum].username);
 		scrollMonitor();
-		return 0;
+		return nullptr;
 	}
 }
 
@@ -542,7 +542,7 @@ const char *DreamWebEngine::searchForString(const char *topic, const char *text)
 			c = makeCaps(*text++);
 
 			if (c == '*' || (delim == '=' && c == 34))
-				return 0;
+				return nullptr;
 
 			if (c == delim) {
 				delimCount++;
diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp
index 75ee2ed534..7982b691ca 100644
--- a/engines/dreamweb/newplace.cpp
+++ b/engines/dreamweb/newplace.cpp
@@ -83,7 +83,7 @@ void DreamWebEngine::selectLocation() {
 			{ 104,216,138,192,&DreamWebEngine::destSelect },
 			{ 273,320,157,198,&DreamWebEngine::getBack1 },
 			{ 0,320,0,200,&DreamWebEngine::blank },
-			{ 0xFFFF,0,0,0,0 }
+			{ 0xFFFF,0,0,0,nullptr }
 		};
 		checkCoords(destList);
 	}
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 807d3b3ff1..ba660d2918 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -162,7 +162,7 @@ void DreamWebEngine::examineOb(bool examineAgain) {
 				{ 144,176,64,96,&DreamWebEngine::setPickup },
 				{ 0,50,50,200,&DreamWebEngine::examineInventory },
 				{ 0,320,0,200,&DreamWebEngine::blank },
-				{ 0xFFFF,0,0,0,0 }
+				{ 0xFFFF,0,0,0,nullptr }
 			};
 			checkCoords(examList);
 			break;
@@ -176,7 +176,7 @@ void DreamWebEngine::examineOb(bool examineAgain) {
 				{ kInventx,_openChangeSize,kInventy+100,kInventy+100+kItempicsize,&DreamWebEngine::useOpened },
 				{ kInventx,kInventx+(5*kItempicsize),kInventy,kInventy+(2*kItempicsize),&DreamWebEngine::inToInv },
 				{ 0,320,0,200,&DreamWebEngine::blank },
-				{ 0xFFFF,0,0,0,0 }
+				{ 0xFFFF,0,0,0,nullptr }
 			};
 			checkCoords(invList1);
 			break;
@@ -187,7 +187,7 @@ void DreamWebEngine::examineOb(bool examineAgain) {
 				{ kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamWebEngine::incRyanPage },
 				{ kInventx,kInventx+(5*kItempicsize), kInventy,kInventy+(2*kItempicsize),&DreamWebEngine::selectOb },
 				{ 0,320,0,200,&DreamWebEngine::blank },
-				{ 0xFFFF,0,0,0,0 }
+				{ 0xFFFF,0,0,0,nullptr }
 			};
 			checkCoords(withList1);
 			break;
@@ -601,7 +601,7 @@ void DreamWebEngine::purgeALocation(uint8 index) {
 }
 
 const uint8 *DreamWebEngine::getObTextStart() {
-	const uint8 *textBase = 0;
+	const uint8 *textBase = nullptr;
 	const uint8 *text;
 	uint16 textOff = 0;
 	if (_objectType == kFreeObjectType) {
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index 680e2bd0bf..f3e4254b2f 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -69,9 +69,9 @@ void DreamWebEngine::printChar(const GraphicsFile &charSet, uint16* x, uint16 y,
 		return;
 
 	uint8 dummyWidth, dummyHeight;
-	if (width == NULL)
+	if (width == nullptr)
 		width = &dummyWidth;
-	if (height == NULL)
+	if (height == nullptr)
 		height = &dummyHeight;
 	if (_foreignRelease)
 		y -= 3;
@@ -242,7 +242,7 @@ const char *DreamWebEngine::monPrint(const char *string) {
 				break;
 			}
 			c = modifyChar(c);
-			printChar(_monitorCharset, &x, _monAdY, c, 0, NULL, NULL, true);
+			printChar(_monitorCharset, &x, _monAdY, c, 0, nullptr, nullptr, true);
 			_cursLocX = x;
 			_cursLocY = _monAdY;
 			_mainTimer = 1;
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index a75e054236..4827aeeb25 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -148,7 +148,7 @@ void DreamWebEngine::doLoad(int savegameId) {
 				{ kOpsx+2,kOpsx+92,kOpsy+4,kOpsy+81,&DreamWebEngine::selectSlot },
 				{ kOpsx+158,kOpsx+158+(18*3),kOpsy-17,kOpsy-1,&DreamWebEngine::selectSaveLoadPage },
 				{ 0,320,0,200,&DreamWebEngine::blank },
-				{ 0xFFFF,0,0,0,0 }
+				{ 0xFFFF,0,0,0,nullptr }
 			};
 			checkCoords(loadlist);
 			if (_getBack == 2)
@@ -244,7 +244,7 @@ void DreamWebEngine::saveGame() {
 				{ kOpsx+2,kOpsx+92,kOpsy+4,kOpsy+81,&DreamWebEngine::selectSlot },
 				{ kOpsx+158,kOpsx+158+(18*3),kOpsy-17,kOpsy-1,&DreamWebEngine::selectSaveLoadPage },
 				{ 0,320,0,200,&DreamWebEngine::blank },
-				{ 0xFFFF,0,0,0,0 }
+				{ 0xFFFF,0,0,0,nullptr }
 			};
 			checkCoords(savelist);
 		}
@@ -337,7 +337,7 @@ void DreamWebEngine::doSaveLoad() {
 		{ kOpsx+10,kOpsx+77,kOpsy+10,kOpsy+59,&DreamWebEngine::DOSReturn },
 		{ kOpsx+128,kOpsx+190,kOpsy+16,kOpsy+100,&DreamWebEngine::discOps },
 		{ 0,320,0,200,&DreamWebEngine::blank },
-		{ 0xFFFF,0,0,0,0 }
+		{ 0xFFFF,0,0,0,nullptr }
 	};
 
 	bool firstOps = true;
@@ -431,7 +431,7 @@ void DreamWebEngine::discOps() {
 		{ kOpsx+10,kOpsx+79,kOpsy+10,kOpsy+59,&DreamWebEngine::saveGame },
 		{ kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamWebEngine::getBackToOps },
 		{ 0,320,0,200,&DreamWebEngine::blank },
-		{ 0xFFFF,0,0,0,0 }
+		{ 0xFFFF,0,0,0,nullptr }
 	};
 
 	do {
@@ -531,7 +531,7 @@ void DreamWebEngine::savePosition(unsigned int slot, const char *descbuf) {
 	outSaveFile->write((const uint8 *)&header, sizeof(FileHeader));
 	outSaveFile->write(descbuf, len[0]);
 	// TODO: Convert more to serializer?
-	Common::Serializer s(0, outSaveFile);
+	Common::Serializer s(nullptr, outSaveFile);
 	syncGameVars(s, _vars);
 
 	// the Extras segment:
@@ -613,7 +613,7 @@ void DreamWebEngine::loadPosition(unsigned int slot) {
 	}
 
 	// TODO: Use serializer for more?
-	Common::Serializer s(inSaveFile, 0);
+	Common::Serializer s(inSaveFile, nullptr);
 	syncGameVars(s, _vars);
 
 	// the Extras segment:
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 16af26f0b8..c058c59443 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1008,7 +1008,7 @@ void DreamWebEngine::dumpTimedText() {
 		assert(!_needToDumpTimed);
 
 		tt = &_previousTimedTemp;
-		_previousTimedTemp._string = 0;
+		_previousTimedTemp._string = nullptr;
 		_previousTimedTemp._timeCount = 0;
 	} else if (_needToDumpTimed != 1) {
 		return;
@@ -1780,7 +1780,7 @@ void DreamWebEngine::mainScreen() {
 			{ 226,244,26,40,&DreamWebEngine::saveLoad },
 			{ 240,260,100,124,&DreamWebEngine::madmanRun },
 			{ 0,320,0,200,&DreamWebEngine::identifyOb },
-			{ 0xFFFF,0,0,0,0 }
+			{ 0xFFFF,0,0,0,nullptr }
 		};
 		checkCoords(mainList);
 	} else {
@@ -1791,7 +1791,7 @@ void DreamWebEngine::mainScreen() {
 			{ 226+48,244+48,26,40,&DreamWebEngine::saveLoad },
 			{ 240,260,100,124,&DreamWebEngine::madmanRun },
 			{ 0,320,0,200,&DreamWebEngine::identifyOb },
-			{ 0xFFFF,0,0,0,0 }
+			{ 0xFFFF,0,0,0,nullptr }
 		};
 		checkCoords(mainList2);
 	}
@@ -2015,14 +2015,14 @@ void DreamWebEngine::getRidOfTempText() {
 
 void DreamWebEngine::getRidOfAll() {
 	delete[] _backdropBlocks;
-	_backdropBlocks = 0;
+	_backdropBlocks = nullptr;
 
 	_setFrames.clear();
 	_reel1.clear();
 	_reel2.clear();
 	_reel3.clear();
 	delete[] _reelList;
-	_reelList = 0;
+	_reelList = nullptr;
 	_personText.clear();
 	_setDesc.clear();
 	_blockDesc.clear();
@@ -2077,7 +2077,7 @@ void DreamWebEngine::loadRoomData(const Room &room, bool skipDat) {
 	delete[] _reelList;
 	if (len[7] <= 36*sizeof(RoomPaths)) {
 		file.read((uint8 *)_pathData, len[7]);
-		_reelList = 0;
+		_reelList = nullptr;
 	} else {
 		file.read((uint8 *)_pathData, 36*sizeof(RoomPaths));
 		unsigned int reelLen = len[7] - 36*sizeof(RoomPaths);
@@ -2627,7 +2627,7 @@ void DreamWebEngine::decide() {
 		{ kOpsx+20,kOpsx+87,kOpsy+10,kOpsy+59,&DreamWebEngine::DOSReturn },
 		{ kOpsx+123,kOpsx+190,kOpsy+10,kOpsy+59,&DreamWebEngine::loadOld },
 		{ 0,320,0,200,&DreamWebEngine::blank },
-		{ 0xFFFF,0,0,0,0 }
+		{ 0xFFFF,0,0,0,nullptr }
 	};
 
 	do {
diff --git a/engines/dreamweb/talk.cpp b/engines/dreamweb/talk.cpp
index 855336d6db..2258d7e628 100644
--- a/engines/dreamweb/talk.cpp
+++ b/engines/dreamweb/talk.cpp
@@ -47,7 +47,7 @@ void DreamWebEngine::talk() {
 		{ 273,320,157,198,&DreamWebEngine::getBack1 },
 		{ 240,290,2,44,&DreamWebEngine::moreTalk },
 		{ 0,320,0,200,&DreamWebEngine::blank },
-		{ 0xFFFF,0,0,0,0 }
+		{ 0xFFFF,0,0,0,nullptr }
 	};
 
 	do {
@@ -217,7 +217,7 @@ bool DreamWebEngine::hangOnPQ() {
 	RectWithCallback quitList[] = {
 		{ 273,320,157,198,&DreamWebEngine::getBack1 },
 		{ 0,320,0,200,&DreamWebEngine::blank },
-		{ 0xFFFF,0,0,0,0 }
+		{ 0xFFFF,0,0,0,nullptr }
 	};
 
 	uint16 speechFlag = 0;


Commit: 0111a085604d0195240845f1f45c8ae11c5dba01
    https://github.com/scummvm/scummvm/commit/0111a085604d0195240845f1f45c8ae11c5dba01
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
GLK: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/glk/adrift/os_glk.cpp
    engines/glk/adrift/scdebug.cpp
    engines/glk/adrift/scexpr.cpp
    engines/glk/adrift/scgamest.cpp
    engines/glk/adrift/sclibrar.cpp
    engines/glk/adrift/sclocale.cpp
    engines/glk/adrift/scmemos.cpp
    engines/glk/adrift/scnpcs.cpp
    engines/glk/adrift/scobjcts.cpp
    engines/glk/adrift/scparser.cpp
    engines/glk/adrift/scprintf.cpp
    engines/glk/adrift/scprops.cpp
    engines/glk/adrift/screstrs.cpp
    engines/glk/adrift/scrunner.cpp
    engines/glk/adrift/sctaffil.cpp
    engines/glk/adrift/sctafpar.cpp
    engines/glk/adrift/scutils.cpp
    engines/glk/adrift/sxfile.cpp
    engines/glk/adrift/sxglob.cpp
    engines/glk/adrift/sxstubs.cpp
    engines/glk/adrift/sxutils.cpp
    engines/glk/advsys/glk_interface.cpp
    engines/glk/agt/agil.cpp
    engines/glk/agt/agtread.cpp
    engines/glk/agt/agxfile.cpp
    engines/glk/agt/auxfile.cpp
    engines/glk/agt/debugcmd.cpp
    engines/glk/agt/disassemble.cpp
    engines/glk/agt/exec.cpp
    engines/glk/agt/filename.cpp
    engines/glk/agt/gamedata.cpp
    engines/glk/agt/interface.cpp
    engines/glk/agt/metacommand.cpp
    engines/glk/agt/object.cpp
    engines/glk/agt/os_glk.cpp
    engines/glk/agt/parser.cpp
    engines/glk/agt/runverb.cpp
    engines/glk/agt/savegame.cpp
    engines/glk/agt/token.cpp
    engines/glk/agt/util.cpp
    engines/glk/alan2/alan2.cpp
    engines/glk/alan2/args.cpp
    engines/glk/alan2/exe.cpp
    engines/glk/alan2/main.cpp
    engines/glk/alan2/parse.cpp
    engines/glk/alan2/sysdep.cpp
    engines/glk/alan3/act.cpp
    engines/glk/alan3/actor.cpp
    engines/glk/alan3/alt_info.cpp
    engines/glk/alan3/debug.cpp
    engines/glk/alan3/event.cpp
    engines/glk/alan3/exe.cpp
    engines/glk/alan3/fnmatch.cpp
    engines/glk/alan3/glkio.cpp
    engines/glk/alan3/instance.cpp
    engines/glk/alan3/inter.cpp
    engines/glk/alan3/lists.cpp
    engines/glk/alan3/main.cpp
    engines/glk/alan3/memory.cpp
    engines/glk/alan3/msg.cpp
    engines/glk/alan3/output.cpp
    engines/glk/alan3/params.cpp
    engines/glk/alan3/parse.cpp
    engines/glk/alan3/reverse.cpp
    engines/glk/alan3/scan.cpp
    engines/glk/alan3/set.cpp
    engines/glk/alan3/stack.cpp
    engines/glk/alan3/state.cpp
    engines/glk/alan3/state_stack.cpp
    engines/glk/alan3/syntax.cpp
    engines/glk/alan3/sysdep.cpp
    engines/glk/alan3/syserr.cpp
    engines/glk/alan3/word.cpp
    engines/glk/archetype/archetype.cpp
    engines/glk/comprehend/comprehend.cpp
    engines/glk/comprehend/debugger_dumper.cpp
    engines/glk/comprehend/dictionary.cpp
    engines/glk/comprehend/game.cpp
    engines/glk/glk_api.cpp
    engines/glk/hugo/heglk.cpp
    engines/glk/hugo/hemedia.cpp
    engines/glk/jacl/encapsulate.cpp
    engines/glk/jacl/findroute.cpp
    engines/glk/jacl/glk_saver.cpp
    engines/glk/jacl/interpreter.cpp
    engines/glk/jacl/jacl_main.cpp
    engines/glk/jacl/jpp.cpp
    engines/glk/jacl/libcsv.cpp
    engines/glk/jacl/loader.cpp
    engines/glk/jacl/parser.cpp
    engines/glk/jacl/resolvers.cpp
    engines/glk/jacl/utils.cpp
    engines/glk/level9/bitmap.cpp
    engines/glk/level9/level9_main.cpp
    engines/glk/level9/os_glk.cpp
    engines/glk/magnetic/emu.cpp
    engines/glk/magnetic/glk.cpp
    engines/glk/quest/geas_file.cpp
    engines/glk/quest/geas_glk.cpp
    engines/glk/quest/geas_runner.cpp
    engines/glk/quest/quest.cpp
    engines/glk/quest/read_file.cpp
    engines/glk/scott/scott.cpp
    engines/glk/tads/os_banners.cpp
    engines/glk/tads/os_buffer.cpp
    engines/glk/tads/os_glk.cpp
    engines/glk/tads/tads2/built_in.cpp
    engines/glk/tads/tads2/character_map.cpp
    engines/glk/tads/tads2/command_line.cpp
    engines/glk/tads/tads2/debug.cpp
    engines/glk/tads/tads2/error_message.cpp
    engines/glk/tads/tads2/execute_command.cpp
    engines/glk/tads/tads2/file_io.cpp
    engines/glk/tads/tads2/get_string.cpp
    engines/glk/tads/tads2/line_source_file.cpp
    engines/glk/tads/tads2/memory_cache.cpp
    engines/glk/tads/tads2/memory_cache_heap.cpp
    engines/glk/tads/tads2/memory_cache_swap.cpp
    engines/glk/tads/tads2/object.cpp
    engines/glk/tads/tads2/os.cpp
    engines/glk/tads/tads2/output.cpp
    engines/glk/tads/tads2/play.cpp
    engines/glk/tads/tads2/qa_scriptor.cpp
    engines/glk/tads/tads2/regex.cpp
    engines/glk/tads/tads2/run.cpp
    engines/glk/tads/tads2/runtime_driver.cpp
    engines/glk/tads/tads2/tads2.cpp
    engines/glk/tads/tads2/tokenizer.cpp
    engines/glk/tads/tads2/vocabulary.cpp
    engines/glk/tads/tads2/vocabulary_parser.cpp
    engines/glk/window_text_buffer.cpp
    engines/glk/zcode/glk_interface.cpp
    engines/glk/zcode/processor.cpp
    engines/glk/zcode/windows.cpp


diff --git a/engines/glk/adrift/os_glk.cpp b/engines/glk/adrift/os_glk.cpp
index 1f94db46d6..4137543652 100644
--- a/engines/glk/adrift/os_glk.cpp
+++ b/engines/glk/adrift/os_glk.cpp
@@ -2800,7 +2800,7 @@ static int gsc_startup_code(Common::SeekableReadStream *game_stream, int restore
 	assert(game_stream);
 
 	/* Open a temporary Glk main window. */
-	window = g_vm->glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
+	window = g_vm->glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 0);
 	if (window) {
 		/* Clear and initialize the temporary window. */
 		g_vm->glk_window_clear(window);
@@ -2907,7 +2907,7 @@ static void gsc_main() {
 	}
 
 	/* Create the Glk window, and set its stream as the current one. */
-	gsc_main_window = g_vm->glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
+	gsc_main_window = g_vm->glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 0);
 	if (!gsc_main_window) {
 		gsc_fatal("GLK: Can't open main window");
 		g_vm->glk_exit();
diff --git a/engines/glk/adrift/scdebug.cpp b/engines/glk/adrift/scdebug.cpp
index cb1f107a5b..63380ae682 100644
--- a/engines/glk/adrift/scdebug.cpp
+++ b/engines/glk/adrift/scdebug.cpp
@@ -72,7 +72,7 @@ static const sc_strings_t DEBUG_COMMANDS[] = {
 	{"clearevents", DEBUG_CLEAREVENTS}, {"cleartasks", DEBUG_CLEARTASKS},
 	{"clearvariables", DEBUG_CLEARVARIABLES}, {"watchall", DEBUG_WATCHALL},
 	{"clearall", DEBUG_CLEARALL}, {"random", DEBUG_RANDOM}, {"quit", DEBUG_QUIT},
-	{NULL, DEBUG_NONE}
+	{nullptr, DEBUG_NONE}
 };
 
 /*
@@ -204,7 +204,7 @@ static void debug_finalize(sc_gameref_t game) {
 	sc_free(debug);
 
 	/* Remove the debug reference from the game. */
-	game->debugger = NULL;
+	game->debugger = nullptr;
 }
 
 
@@ -1340,9 +1340,9 @@ static void debug_dump_common(sc_gameref_t game, sc_command_t command,
 
 	/* Initialize variables to avoid gcc warnings. */
 	limit = 0;
-	class_ = NULL;
-	filter_function = NULL;
-	dumper_function = NULL;
+	class_ = nullptr;
+	filter_function = nullptr;
+	dumper_function = nullptr;
 
 	/* Switch to undo game on relevant commands. */
 	switch (command) {
@@ -1405,7 +1405,7 @@ static void debug_dump_common(sc_gameref_t game, sc_command_t command,
 	case DEBUG_VARIABLES:
 	case DEBUG_OLDVARIABLES:
 		class_ = "Variable";
-		filter_function = NULL;
+		filter_function = nullptr;
 		dumper_function = debug_dump_variable;
 		limit = debug_variable_count(game);
 		break;
@@ -1611,8 +1611,8 @@ static void debug_watchpoint_common(sc_gameref_t game, sc_command_t command,
 
 	/* Initialize variables to avoid gcc warnings. */
 	limit = 0;
-	class_ = NULL;
-	watchpoints = NULL;
+	class_ = nullptr;
+	watchpoints = nullptr;
 	action = FALSE;
 
 	/* Set action to TRUE or FALSE, for setting/clearing watchpoints. */
@@ -2484,7 +2484,7 @@ void debug_set_enabled(sc_gameref_t game, sc_bool enable) {
 sc_bool debug_get_enabled(sc_gameref_t game) {
 	const sc_debuggerref_t debug = debug_get_debugger(game);
 
-	return debug != NULL;
+	return debug != nullptr;
 }
 
 } // End of namespace Adrift
diff --git a/engines/glk/adrift/scexpr.cpp b/engines/glk/adrift/scexpr.cpp
index 0078f2c7ac..9a18a63725 100644
--- a/engines/glk/adrift/scexpr.cpp
+++ b/engines/glk/adrift/scexpr.cpp
@@ -88,13 +88,13 @@ static const sc_expr_multichar_t FUNCTION_TOKENS[] = {
 	{"mod", 3, TOK_MOD}, {"abs", 3, TOK_ABS}, {"len", 3, TOK_LEN},
 	{"val", 3, TOK_VAL}, {"and", 3, TOK_AND}, {"mid", 3, TOK_MID},
 	{"str", 3, TOK_STR}, {"or", 2, TOK_OR}, {"if", 2, TOK_IF},
-	{NULL, 0, TOK_NONE}
+	{nullptr, 0, TOK_NONE}
 };
 static const sc_expr_multichar_t OPERATOR_TOKENS[] = {
 	{"&&", 2, TOK_AND}, {"||", 2, TOK_OR},
 	{"==", 2, TOK_EQUAL}, {"!=", 2, TOK_NOT_EQUAL},
 	{"<>", 2, TOK_NOT_EQUAL}, {">=", 2, TOK_GREATER_EQ}, {"<=", 2, TOK_LESS_EQ},
-	{NULL, 0, TOK_NONE}
+	{nullptr, 0, TOK_NONE}
 };
 
 
@@ -119,10 +119,10 @@ static sc_int expr_multichar_search(const sc_char *name, const sc_expr_multichar
 
 
 /* Tokenizer variables. */
-static const sc_char *expr_expression = NULL;
+static const sc_char *expr_expression = nullptr;
 static sc_int expr_index = 0;
 static sc_vartype_t expr_token_value;
-static sc_char *expr_temporary = NULL;
+static sc_char *expr_temporary = nullptr;
 static sc_int expr_current_token = TOK_NONE;
 
 /*
@@ -173,8 +173,8 @@ static void expr_tokenize_start(const sc_char *expression) {
 static void expr_tokenize_end(void) {
 	/* Deallocate temporary strings, clear expression. */
 	sc_free(expr_temporary);
-	expr_temporary = NULL;
-	expr_expression = NULL;
+	expr_temporary = nullptr;
+	expr_expression = nullptr;
 	expr_index = 0;
 	expr_current_token = TOK_NONE;
 }
@@ -339,7 +339,7 @@ static sc_int expr_next_token(void) {
 	 * Get the basic next token.  We may adjust it later for unary minus/plus
 	 * depending on what it is, and the prior token.
 	 */
-	token_value.voidp = NULL;
+	token_value.voidp = nullptr;
 	token = expr_next_token_unadjusted(&token_value);
 
 	/* Special handling for unary minus/plus signs. */
@@ -419,7 +419,7 @@ static sc_stack_t expr_eval_stack[MAX_NESTING_DEPTH];
 static sc_int expr_eval_stack_index = 0;
 
 /* Variables set to reference for %...% values. */
-static sc_var_setref_t expr_varset = NULL;
+static sc_var_setref_t expr_varset = nullptr;
 
 /*
  * expr_eval_start()
@@ -675,7 +675,7 @@ static void expr_eval_action(CONTEXT, sc_int token) {
 		 * position, starting at 1, or 0 if not found.  Then free the popped
 		 * strings, and push back the result.
 		 */
-		search = (val1[0] != NUL) ? strstr(val1, val2) : NULL;
+		search = (val1[0] != NUL) ? strstr(val1, val2) : nullptr;
 		result = (!search) ? 0 : search - val1 + 1;
 		sc_free(val1);
 		sc_free(val2);
diff --git a/engines/glk/adrift/scgamest.cpp b/engines/glk/adrift/scgamest.cpp
index bc8d24ea1e..f5bd1e036d 100644
--- a/engines/glk/adrift/scgamest.cpp
+++ b/engines/glk/adrift/scgamest.cpp
@@ -517,14 +517,14 @@ sc_gameref_t gs_create(sc_var_setref_t vars, sc_prop_setref_t bundle, sc_filterr
 	game->filter = filter;
 
 	/* Set memento to NULL for now; it's added later. */
-	game->memento = NULL;
+	game->memento = nullptr;
 
 	/* Initialize for no debugger. */
-	game->debugger = NULL;
+	game->debugger = nullptr;
 
 	/* Initialize the undo buffers to NULL for now. */
-	game->temporary = NULL;
-	game->undo = NULL;
+	game->temporary = nullptr;
+	game->undo = nullptr;
 	game->undo_available = FALSE;
 
 	/* Create rooms state array. */
@@ -740,11 +740,11 @@ sc_gameref_t gs_create(sc_var_setref_t vars, sc_prop_setref_t bundle, sc_filterr
 	game->score = 0;
 	game->bold_room_names = TRUE;
 	game->verbose = FALSE;
-	game->current_room_name = NULL;
-	game->status_line = NULL;
-	game->title = NULL;
-	game->author = NULL;
-	game->hint_text = NULL;
+	game->current_room_name = nullptr;
+	game->status_line = nullptr;
+	game->title = nullptr;
+	game->author = nullptr;
+	game->hint_text = nullptr;
 
 	/* Resource controls. */
 	res_clear_resource(&game->requested_sound);
@@ -816,7 +816,7 @@ static void gs_string_copy(sc_char **to_string, const sc_char *from_string) {
 		*to_string = (sc_char *)sc_malloc(strlen(from_string) + 1);
 		strcpy(*to_string, from_string);
 	} else
-		*to_string = NULL;
+		*to_string = nullptr;
 }
 
 
diff --git a/engines/glk/adrift/sclibrar.cpp b/engines/glk/adrift/sclibrar.cpp
index 3e18b122d8..c02d1583e8 100644
--- a/engines/glk/adrift/sclibrar.cpp
+++ b/engines/glk/adrift/sclibrar.cpp
@@ -1008,12 +1008,12 @@ static sc_bool lib_can_go(sc_gameref_t game, sc_int room, sc_int direction) {
 /* List of direction names, for printing and counting exits. */
 static const sc_char *const DIRNAMES_4[] = {
 	"north", "east", "south", "west", "up", "down", "in", "out",
-	NULL
+	nullptr
 };
 static const sc_char *const DIRNAMES_8[] = {
 	"north", "east", "south", "west", "up", "down", "in", "out",
 	"northeast", "southeast", "southwest", "northwest",
-	NULL
+	nullptr
 };
 
 
@@ -1497,7 +1497,7 @@ sc_bool lib_cmd_hints(sc_gameref_t game) {
 
 	/* If the game has hints, display any relevant ones. */
 	if (game_has_hints) {
-		if (run_hint_iterate(game, NULL)) {
+		if (run_hint_iterate(game, nullptr)) {
 			if (if_confirm(SC_CONF_VIEW_HINTS))
 				if_display_hints(game);
 		} else
@@ -1709,8 +1709,8 @@ sc_bool lib_cmd_statusline(sc_gameref_t game) {
 	 * Retrieve the game's name and author, the description of the current
 	 * game room, and any formatted game status line.
 	 */
-	run_get_attributes(game, &name, &author, NULL, NULL,
-	                   &score, NULL, &room, &status, NULL, NULL, NULL, NULL);
+	run_get_attributes(game, &name, &author, nullptr, nullptr,
+	                   &score, nullptr, &room, &status, nullptr, nullptr, nullptr, nullptr);
 
 	/* If nothing is yet determined, print the game name and author. */
 	if (!room || sc_strempty(room)) {
@@ -2331,7 +2331,7 @@ sc_bool lib_cmd_examine_self(sc_gameref_t game) {
 	const sc_prop_setref_t bundle = gs_get_bundle(game);
 	sc_vartype_t vt_key[2];
 	sc_int task, object, count, trail;
-	const sc_char *description, *position = NULL;
+	const sc_char *description, *position = nullptr;
 
 	/* Get selection task. */
 	vt_key[0].string = "Globals";
@@ -2649,7 +2649,7 @@ static sc_int lib_disambiguate_object_common(sc_gameref_t game, const sc_char *v
 }
 
 static sc_int lib_disambiguate_object(sc_gameref_t game, const sc_char *verb, sc_bool *is_ambiguous) {
-	return lib_disambiguate_object_common(game, verb, NULL, -1, is_ambiguous);
+	return lib_disambiguate_object_common(game, verb, nullptr, -1, is_ambiguous);
 }
 
 static sc_int lib_disambiguate_object_extended(sc_gameref_t game, const sc_char *verb,
@@ -3354,7 +3354,7 @@ static sc_bool lib_try_game_command_common(sc_gameref_t game, const sc_char *ver
 }
 
 static sc_bool lib_try_game_command_short(sc_gameref_t game, const sc_char *verb, sc_int object) {
-	return lib_try_game_command_common(game, verb, object, NULL, -1, FALSE, FALSE);
+	return lib_try_game_command_common(game, verb, object, nullptr, -1, FALSE, FALSE);
 }
 
 static sc_bool lib_try_game_command_with_object(sc_gameref_t game, const sc_char *verb,
@@ -4326,7 +4326,7 @@ sc_bool lib_cmd_take_all(sc_gameref_t game) {
 	gs_set_multiple_references(game);
 	objects = lib_apply_multiple_filter(game,
 	                                    lib_take_not_associated_filter, -1,
-	                                    NULL);
+	                                    nullptr);
 	gs_clear_multiple_references(game);
 	if (objects > 0)
 		lib_take_backend(game);
@@ -4544,7 +4544,7 @@ sc_bool lib_cmd_take_all_from(sc_gameref_t game) {
 	gs_set_multiple_references(game);
 	objects = lib_apply_multiple_filter(game,
 	                                    lib_take_from_filter, associate,
-	                                    NULL);
+	                                    nullptr);
 	gs_clear_multiple_references(game);
 	if (objects > 0)
 		lib_take_from_object_backend(game, associate);
@@ -4687,7 +4687,7 @@ sc_bool lib_cmd_take_all_from_npc(sc_gameref_t game) {
 	gs_set_multiple_references(game);
 	objects = lib_apply_multiple_filter(game,
 	                                    lib_take_from_npc_filter, associate,
-	                                    NULL);
+	                                    nullptr);
 	gs_clear_multiple_references(game);
 	if (objects > 0)
 		lib_take_from_npc_backend(game, associate);
@@ -4927,7 +4927,7 @@ sc_bool lib_cmd_drop_all(sc_gameref_t game) {
 	gs_set_multiple_references(game);
 	objects = lib_apply_multiple_filter(game,
 	                                    lib_drop_filter, -1,
-	                                    NULL);
+	                                    nullptr);
 	gs_clear_multiple_references(game);
 	if (objects > 0)
 		lib_drop_backend(game);
@@ -5037,7 +5037,7 @@ sc_bool lib_cmd_give_object_npc(sc_gameref_t game) {
 		return is_ambiguous;
 
 	/* Get the referenced npc, and if none, consider complete. */
-	npc = lib_disambiguate_npc(game, "give to", NULL);
+	npc = lib_disambiguate_npc(game, "give to", nullptr);
 	if (npc == -1)
 		return TRUE;
 
@@ -5338,7 +5338,7 @@ sc_bool lib_cmd_wear_all(sc_gameref_t game) {
 	gs_set_multiple_references(game);
 	objects = lib_apply_multiple_filter(game,
 	                                    lib_wear_filter, -1,
-	                                    NULL);
+	                                    nullptr);
 	gs_clear_multiple_references(game);
 	if (objects > 0)
 		lib_wear_backend(game);
@@ -5576,7 +5576,7 @@ sc_bool lib_cmd_remove_all(sc_gameref_t game) {
 	gs_set_multiple_references(game);
 	objects = lib_apply_multiple_filter(game,
 	                                    lib_remove_filter, -1,
-	                                    NULL);
+	                                    nullptr);
 	gs_clear_multiple_references(game);
 	if (objects > 0)
 		lib_remove_backend(game);
@@ -5959,8 +5959,8 @@ static void lib_attempt_key_acquisition(sc_gameref_t game, sc_int object) {
 	 * capacity checks are meaningless.
 	 */
 	if (!obj_indirectly_held_by_player(game, object)) {
-		if (lib_object_too_heavy(game, object, NULL)
-		        || lib_object_too_large(game, object, NULL))
+		if (lib_object_too_heavy(game, object, nullptr)
+		        || lib_object_too_large(game, object, nullptr))
 			return;
 	}
 
@@ -6012,7 +6012,7 @@ sc_bool lib_cmd_unlock_object_with(sc_gameref_t game) {
 		pf_buffer_string(filter, "What do you want to unlock that with?\n");
 		return TRUE;
 	}
-	key = lib_disambiguate_object(game, "unlock that with", NULL);
+	key = lib_disambiguate_object(game, "unlock that with", nullptr);
 	if (key == -1)
 		return TRUE;
 
@@ -6201,7 +6201,7 @@ sc_bool lib_cmd_lock_object_with(sc_gameref_t game) {
 		pf_buffer_string(filter, "What do you want to lock that with?\n");
 		return TRUE;
 	}
-	key = lib_disambiguate_object(game, "lock that with", NULL);
+	key = lib_disambiguate_object(game, "lock that with", nullptr);
 	if (key == -1)
 		return TRUE;
 
@@ -6930,7 +6930,7 @@ sc_bool lib_cmd_put_all_in(sc_gameref_t game) {
 	gs_set_multiple_references(game);
 	objects = lib_apply_multiple_filter(game,
 	                                    lib_put_in_not_container_filter,
-	                                    container, NULL);
+	                                    container, nullptr);
 	gs_clear_multiple_references(game);
 	if (objects > 0)
 		lib_put_in_backend(game, container);
@@ -7298,7 +7298,7 @@ sc_bool lib_cmd_put_all_on(sc_gameref_t game) {
 	gs_set_multiple_references(game);
 	objects = lib_apply_multiple_filter(game,
 	                                    lib_put_on_not_supporter_filter,
-	                                    supporter, NULL);
+	                                    supporter, nullptr);
 	gs_clear_multiple_references(game);
 	if (objects > 0)
 		lib_put_on_backend(game, supporter);
@@ -7545,7 +7545,7 @@ sc_bool lib_cmd_attack_npc_with(sc_gameref_t game) {
 		return is_ambiguous;
 
 	/* Get the referenced object, and if none, consider complete. */
-	object = lib_disambiguate_object(game, "attack with", NULL);
+	object = lib_disambiguate_object(game, "attack with", nullptr);
 	if (object == -1)
 		return TRUE;
 
@@ -7918,8 +7918,8 @@ static sc_bool lib_stand_sit_lie(sc_gameref_t game, sc_int movement) {
 		sc_bool is_ambiguous;
 
 		/* Initialize variables to avoid gcc warnings. */
-		disambiguate = NULL;
-		cant_do_that = NULL;
+		disambiguate = nullptr;
+		cant_do_that = nullptr;
 		movement_mask = 0;
 
 		/* Set disambiguation and not amenable messages. */
@@ -8761,7 +8761,7 @@ sc_bool lib_cmd_shout(sc_gameref_t game) {
 
 sc_bool lib_cmd_say(sc_gameref_t game) {
 	const sc_filterref_t filter = gs_get_filter(game);
-	const sc_char *string = NULL;
+	const sc_char *string = nullptr;
 
 	switch (sc_randomint(1, 5)) {
 	case 1:
@@ -8840,7 +8840,7 @@ sc_bool lib_cmd_whistle(sc_gameref_t game) {
 
 sc_bool lib_cmd_interrogation(sc_gameref_t game) {
 	const sc_filterref_t filter = gs_get_filter(game);
-	const sc_char *string = NULL;
+	const sc_char *string = nullptr;
 
 	switch (sc_randomint(1, 17)) {
 	case 1:
diff --git a/engines/glk/adrift/sclocale.cpp b/engines/glk/adrift/sclocale.cpp
index 140e9c9be3..9180b1b31e 100644
--- a/engines/glk/adrift/sclocale.cpp
+++ b/engines/glk/adrift/sclocale.cpp
@@ -135,7 +135,7 @@ struct sc_locale_table_t {
  * Define a single static locale table set.  This set re-initializes if it
  * detects a locale change.
  */
-static sc_locale_table_t loc_locale_tables = {NULL, {0}, {0}, {0}, {0}, {0}};
+static sc_locale_table_t loc_locale_tables = {nullptr, {0}, {0}, {0}, {0}, {0}};
 
 
 /*
@@ -225,7 +225,7 @@ static const sc_locale_t CYRILLIC_LOCALE = {
 static const sc_locale_t *const AVAILABLE_LOCALES[] = {
 	&LATIN1_LOCALE,
 	&CYRILLIC_LOCALE,
-	NULL
+	nullptr
 };
 
 /*
@@ -256,7 +256,7 @@ static const sc_char *loc_locate_signature_in_date(const sc_char *date) {
 	if (converted == 3 && strlen(signature) == SIGNATURE_LENGTH)
 		return strstr(date, signature);
 	else
-		return NULL;
+		return nullptr;
 }
 
 
@@ -297,7 +297,7 @@ static sc_bool loc_compare_locale_signatures(const char *signature, const sc_loc
 static const sc_locale_t *loc_find_matching_locale(const sc_char *date,
 		const sc_locale_t *const *locales) {
 	const sc_char *signature;
-	const sc_locale_t *matched = NULL;
+	const sc_locale_t *matched = nullptr;
 
 	/* Get the month part of date, and if valid, search locale signatures. */
 	signature = loc_locate_signature_in_date(date);
@@ -385,7 +385,7 @@ static sc_int loc_ascii_strncasecmp(const sc_char *s1, const sc_char *s2, sc_int
  * if none yet set.
  */
 sc_bool loc_set_locale(const sc_char *name) {
-	const sc_locale_t *matched = NULL;
+	const sc_locale_t *matched = nullptr;
 	const sc_locale_t *const *iterator;
 	assert(name);
 
diff --git a/engines/glk/adrift/scmemos.cpp b/engines/glk/adrift/scmemos.cpp
index c26f6840c0..1d1ebf9bf8 100644
--- a/engines/glk/adrift/scmemos.cpp
+++ b/engines/glk/adrift/scmemos.cpp
@@ -470,7 +470,7 @@ void memo_next_command(sc_memo_setref_t memento, const sc_char **command,
 		*turns = history->turns;
 	} else {
 		/* Return NULL and zeroes if no more commands available. */
-		*command = NULL;
+		*command = nullptr;
 		*sequence = 0;
 		*timestamp = 0;
 		*turns = 0;
@@ -523,7 +523,7 @@ const sc_char *memo_find_command(sc_memo_setref_t memento, sc_int sequence) {
 	 * efficient here, but this is a rarely called function so we'll do it the
 	 * simpler way.
 	 */
-	matched = NULL;
+	matched = nullptr;
 	for (index_ = 0; index_ < MEMO_HISTORY_TABLE_SIZE; index_++) {
 		sc_historyref_t history;
 
@@ -539,7 +539,7 @@ const sc_char *memo_find_command(sc_memo_setref_t memento, sc_int sequence) {
 	 * history was not full, this will still return NULL as it should, since
 	 * this unused history's command found by the search above will be NULL.
 	 */
-	return matched ? matched->command : NULL;
+	return matched ? matched->command : nullptr;
 }
 
 
diff --git a/engines/glk/adrift/scnpcs.cpp b/engines/glk/adrift/scnpcs.cpp
index d3567f6c8f..debe023b0c 100644
--- a/engines/glk/adrift/scnpcs.cpp
+++ b/engines/glk/adrift/scnpcs.cpp
@@ -163,13 +163,13 @@ static sc_bool npc_room_in_roomgroup(sc_gameref_t game, sc_int room, sc_int grou
 static const sc_char *const DIRNAMES_4[] = {
 	"the north", "the east", "the south", "the west", "above", "below",
 	"inside", "outside",
-	NULL
+	nullptr
 };
 static const sc_char *const DIRNAMES_8[] = {
 	"the north", "the east", "the south", "the west", "above", "below",
 	"inside", "outside",
 	"the north-east", "the south-east", "the south-west", "the north-west",
-	NULL
+	nullptr
 };
 
 /*
diff --git a/engines/glk/adrift/scobjcts.cpp b/engines/glk/adrift/scobjcts.cpp
index 66c2e1e4ed..d9c8ba0317 100644
--- a/engines/glk/adrift/scobjcts.cpp
+++ b/engines/glk/adrift/scobjcts.cpp
@@ -234,7 +234,7 @@ sc_char *obj_state_name(sc_gameref_t game, sc_int objnum) {
 			count--;
 	}
 	if (count != 1)
-		return NULL;
+		return nullptr;
 
 	/* Find the end of the state string. */
 	for (last = first; last < length; last++) {
diff --git a/engines/glk/adrift/scparser.cpp b/engines/glk/adrift/scparser.cpp
index c705306974..a716b7a31e 100644
--- a/engines/glk/adrift/scparser.cpp
+++ b/engines/glk/adrift/scparser.cpp
@@ -77,7 +77,7 @@ static const sc_uip_token_entry_t UIP_TOKENS[] = {
 	{"%object%", 8, TOK_OBJECT_REFERENCE},
 	{"%number%", 8, TOK_NUMBER_REFERENCE},
 	{"%text%", 6, TOK_TEXT_REFERENCE},
-	{NULL, 0, TOK_NONE}
+	{nullptr, 0, TOK_NONE}
 };
 
 
@@ -86,12 +86,12 @@ static const sc_uip_token_entry_t UIP_TOKENS[] = {
  * For improved performance, we'll set it to indicate a static buffer if
  * short enough, otherwise it's allocated.
  */
-static const sc_char *uip_pattern = NULL;
+static const sc_char *uip_pattern = nullptr;
 static sc_int uip_index = 0;
 static const sc_char *uip_token_value;
 enum { UIP_ALLOCATION_AVOIDANCE_SIZE = 128 };
 static sc_char uip_static_temporary[UIP_ALLOCATION_AVOIDANCE_SIZE];
-static sc_char *uip_temporary = NULL;
+static sc_char *uip_temporary = nullptr;
 
 
 /*
@@ -134,8 +134,8 @@ static void uip_tokenize_end(void) {
 	/* Deallocate temporary if required, and clear pattern and index. */
 	if (uip_temporary != uip_static_temporary)
 		sc_free(uip_temporary);
-	uip_temporary = NULL;
-	uip_pattern = NULL;
+	uip_temporary = nullptr;
+	uip_pattern = nullptr;
 	uip_index = 0;
 }
 
@@ -152,7 +152,7 @@ static sc_uip_tok_t uip_next_token(void) {
 
 	/* Get next character, return EOS if at pattern end. */
 	if (uip_pattern[uip_index] == NUL) {
-		uip_token_value = NULL;
+		uip_token_value = nullptr;
 		return TOK_EOS;
 	}
 
@@ -162,7 +162,7 @@ static sc_uip_tok_t uip_next_token(void) {
 		while (sc_isspace(uip_pattern[uip_index])
 		        && uip_pattern[uip_index] != NUL)
 			uip_index++;
-		uip_token_value = NULL;
+		uip_token_value = nullptr;
 		return TOK_WHITESPACE;
 	}
 
@@ -174,7 +174,7 @@ static sc_uip_tok_t uip_next_token(void) {
 	if (entry->name) {
 		/* Advance over string, and return token. */
 		uip_index += entry->length;
-		uip_token_value = NULL;
+		uip_token_value = nullptr;
 		return entry->token;
 	}
 
@@ -249,7 +249,7 @@ typedef sc_ptnode_t *sc_ptnoderef_t;
 static sc_uip_tok_t uip_parse_lookahead = TOK_NONE;
 
 /* Parse tree for cleanup, and forward declaration of pattern list parser. */
-static sc_ptnoderef_t uip_parse_tree = NULL;
+static sc_ptnoderef_t uip_parse_tree = nullptr;
 
 /*
  * Pool of statically allocated nodes, for faster allocations.  Nodes are
@@ -421,10 +421,10 @@ static sc_ptnoderef_t uip_new_node(sc_pttype_t type) {
 	}
 
 	/* Fill in the remaining fields and return the new node. */
-	node->left_child = NULL;
-	node->right_sibling = NULL;
+	node->left_child = nullptr;
+	node->right_sibling = nullptr;
 	node->type = type;
-	node->word = NULL;
+	node->word = nullptr;
 
 	return node;
 }
@@ -492,7 +492,7 @@ static void uip_parse_alternatives(CONTEXT, sc_ptnoderef_t node) {
  * Parse a single pattern element.
  */
 static sc_ptnoderef_t uip_parse_element(CONTEXT) {
-	sc_ptnoderef_t node = NULL;
+	sc_ptnoderef_t node = nullptr;
 	sc_uip_tok_t token;
 
 	/* Handle pattern element based on lookahead token. */
@@ -746,9 +746,9 @@ static void uip_debug_dump(void) {
 
 
 /* String matching variables. */
-static const sc_char *uip_string = NULL;
+static const sc_char *uip_string = nullptr;
 static sc_int uip_posn = 0;
-static sc_gameref_t uip_game = NULL;
+static sc_gameref_t uip_game = nullptr;
 
 /*
  * uip_match_start()
@@ -767,9 +767,9 @@ static void uip_match_start(const sc_char *string, sc_gameref_t game) {
 
 static void uip_match_end(void) {
 	/* Clear match target string, and variable set. */
-	uip_string = NULL;
+	uip_string = nullptr;
 	uip_posn = 0;
-	uip_game = NULL;
+	uip_game = nullptr;
 }
 
 
@@ -1594,7 +1594,7 @@ static sc_char *uip_free_cleansed_string(sc_char *string, const sc_char *buffer)
 		sc_free(string);
 
 	/* Always returns NULL, for the syntactic convenience of the caller. */
-	return NULL;
+	return nullptr;
 }
 
 
@@ -1637,7 +1637,7 @@ sc_bool uip_match(const sc_char *pattern, const sc_char *string, sc_gameref_t ga
 		// Parse error -- clean up and fail
 		uip_tokenize_end();
 		uip_destroy_tree(uip_parse_tree);
-		uip_parse_tree = NULL;
+		uip_parse_tree = nullptr;
 		cleansed = uip_free_cleansed_string(cleansed, buffer);
 		return FALSE;
 	} else {
@@ -1660,7 +1660,7 @@ sc_bool uip_match(const sc_char *pattern, const sc_char *string, sc_gameref_t ga
 	uip_match_end();
 	cleansed = uip_free_cleansed_string(cleansed, buffer);
 	uip_destroy_tree(uip_parse_tree);
-	uip_parse_tree = NULL;
+	uip_parse_tree = nullptr;
 
 	/* Return result of matching. */
 	if (uip_trace)
@@ -1688,7 +1688,7 @@ sc_char *uip_replace_pronouns(sc_gameref_t game, const sc_char *string) {
 
 	/* Begin with a NULL buffer for lazy allocation. */
 	buffer_allocation = 0;
-	buffer = NULL;
+	buffer = nullptr;
 
 	/* Search for pronouns until no more string remains. */
 	current = string + strspn(string, WHITESPACE);
@@ -1699,7 +1699,7 @@ sc_char *uip_replace_pronouns(sc_gameref_t game, const sc_char *string) {
 
 		/* Initially, no object or NPC, no names, and a zero extent. */
 		object = npc = -1;
-		prefix = name = NULL;
+		prefix = name = nullptr;
 		extent = 0;
 
 		/*
diff --git a/engines/glk/adrift/scprintf.cpp b/engines/glk/adrift/scprintf.cpp
index fcbbc58767..f444cb8e65 100644
--- a/engines/glk/adrift/scprintf.cpp
+++ b/engines/glk/adrift/scprintf.cpp
@@ -83,7 +83,7 @@ static const sc_html_tags_t HTML_TAGS_TABLE[] = {
 	{"b", 1, SC_TAG_BOLD}, {"/b", 2, SC_TAG_ENDBOLD},
 	{"u", 1, SC_TAG_UNDERLINE}, {"/u", 2, SC_TAG_ENDUNDERLINE},
 	{"c", 1, SC_TAG_COLOR}, {"/c", 2, SC_TAG_ENDCOLOR},
-	{NULL, 0, SC_TAG_UNKNOWN}
+	{nullptr, 0, SC_TAG_UNKNOWN}
 };
 
 /*
@@ -144,7 +144,7 @@ sc_filterref_t pf_create(void) {
 	filter->magic = PRINTFILTER_MAGIC;
 	filter->buffer_length = 0;
 	filter->buffer_allocation = 0;
-	filter->buffer = NULL;
+	filter->buffer = nullptr;
 	filter->new_sentence = FALSE;
 	filter->is_muted = FALSE;
 	filter->needs_filtering = FALSE;
@@ -191,8 +191,8 @@ static sc_char *pf_interpolate_vars(const sc_char *string, sc_var_setref_t vars)
 	 * Begin with NULL buffer and name strings for lazy allocation, and clear
 	 * interpolation detection flag.
 	 */
-	buffer = NULL;
-	name = NULL;
+	buffer = nullptr;
+	name = nullptr;
 	is_interpolated = FALSE;
 
 	/* Run through the string looking for variables. */
@@ -271,7 +271,7 @@ static sc_char *pf_interpolate_vars(const sc_char *string, sc_var_setref_t vars)
 			strcat(buffer, marker);
 		} else {
 			sc_free(buffer);
-			buffer = NULL;
+			buffer = nullptr;
 		}
 	}
 
@@ -298,7 +298,7 @@ static sc_bool pf_replace_alr(const sc_char *string, sc_char **buffer, sc_int al
 	vt_key[1].integer = alr;
 	vt_key[2].string = "Original";
 	original = prop_get_string(bundle, "S<-sis", vt_key);
-	replacement = NULL;
+	replacement = nullptr;
 
 	/* Ignore pathological empty originals. */
 	if (original[0] == NUL)
@@ -342,7 +342,7 @@ static sc_bool pf_replace_alr(const sc_char *string, sc_char **buffer, sc_int al
 
 	/* Write back buffer, and if replacement set, the buffer was altered. */
 	*buffer = buffer_;
-	return replacement != NULL;
+	return replacement != nullptr;
 }
 
 
@@ -364,7 +364,7 @@ static sc_char *pf_replace_alrs(const sc_char *string, sc_prop_setref_t bundle,
 	 * lot of allocation and copying, we use two buffers to help with repeated
 	 * ALR replacement.
 	 */
-	buffer1 = buffer2 = NULL;
+	buffer1 = buffer2 = nullptr;
 	buffer = &buffer1;
 
 	/* Run through each ALR that exists. */
@@ -421,7 +421,7 @@ static sc_char *pf_replace_alrs(const sc_char *string, sc_prop_setref_t bundle,
 		sc_free(buffer1);
 		return buffer2;
 	} else
-		return NULL;
+		return nullptr;
 }
 
 
@@ -653,15 +653,15 @@ static sc_char *pf_filter_internal(const sc_char *string, sc_var_setref_t vars,
 			alr_applied = (sc_bool *)sc_malloc(alr_count * sizeof(*alr_applied));
 			memset(alr_applied, FALSE, alr_count * sizeof(*alr_applied));
 		} else
-			alr_applied = NULL;
+			alr_applied = nullptr;
 	} else {
 		/* Not including ALRs, so set alr count to 0, and flags to NULL. */
 		alr_count = 0;
-		alr_applied = NULL;
+		alr_applied = nullptr;
 	}
 
 	/* Loop for a sort-of arbitrary number of passes; probably enough. */
-	current = NULL;
+	current = nullptr;
 	for (iteration = 0; iteration < ITERATION_LIMIT; iteration++) {
 		sc_int inner_iteration;
 		const sc_char *initial;
@@ -760,7 +760,7 @@ sc_char *pf_filter_for_info(const sc_char *string, sc_var_setref_t vars) {
 	sc_char *current;
 
 	/* Filter this string, excluding ALRs replacements. */
-	current = pf_filter_internal(string, vars, NULL);
+	current = pf_filter_internal(string, vars, nullptr);
 
 	/* Our contract is to return an allocated string; copy if required. */
 	if (!current) {
@@ -910,7 +910,7 @@ const sc_char *pf_get_buffer(sc_filterref_t filter) {
 		assert(filter->buffer[filter->buffer_length] == NUL);
 		return filter->buffer;
 	} else
-		return NULL;
+		return nullptr;
 }
 
 sc_char *pf_transfer_buffer(sc_filterref_t filter) {
@@ -931,7 +931,7 @@ sc_char *pf_transfer_buffer(sc_filterref_t filter) {
 		/* Clear all filter fields down to empty values. */
 		filter->buffer_length = 0;
 		filter->buffer_allocation = 0;
-		filter->buffer = NULL;
+		filter->buffer = nullptr;
 		filter->new_sentence = FALSE;
 		filter->is_muted = FALSE;
 		filter->needs_filtering = FALSE;
@@ -939,7 +939,7 @@ sc_char *pf_transfer_buffer(sc_filterref_t filter) {
 		/* Return the allocated buffered text. */
 		return retval;
 	} else
-		return NULL;
+		return nullptr;
 }
 
 
@@ -955,7 +955,7 @@ void pf_empty(sc_filterref_t filter) {
 	filter->buffer_length = 0;
 	filter->buffer_allocation = 0;
 	sc_free(filter->buffer);
-	filter->buffer = NULL;
+	filter->buffer = nullptr;
 	filter->new_sentence = FALSE;
 	filter->is_muted = FALSE;
 	filter->needs_filtering = FALSE;
@@ -1314,7 +1314,7 @@ sc_char *pf_filter_input(const sc_char *string, sc_prop_setref_t bundle) {
 
 	/* Begin with a NULL buffer for lazy allocation. */
 	buffer_allocation = 0;
-	buffer = NULL;
+	buffer = nullptr;
 
 	/* Loop over each word in the string. */
 	current = string + strspn(string, WHITESPACE);
diff --git a/engines/glk/adrift/scprops.cpp b/engines/glk/adrift/scprops.cpp
index aab21d5760..9706366374 100644
--- a/engines/glk/adrift/scprops.cpp
+++ b/engines/glk/adrift/scprops.cpp
@@ -311,7 +311,7 @@ static sc_prop_noderef_t prop_find_child(sc_prop_noderef_t parent, sc_int type,
 	}
 
 	/* No matching child found. */
-	return NULL;
+	return nullptr;
 }
 
 
@@ -344,8 +344,8 @@ static sc_prop_noderef_t prop_add_child(sc_prop_noderef_t parent, sc_int type,
 	}
 
 	/* Initialize property and child list to visible nulls. */
-	child->property.voidp = NULL;
-	child->child_list = NULL;
+	child->property.voidp = nullptr;
+	child->child_list = nullptr;
 
 	/* Make a brief check for obvious overwrites. */
 	if (!parent->child_list && parent->property.voidp)
@@ -734,16 +734,16 @@ static sc_prop_setref_t prop_create_empty() {
 
 	/* Begin with an empty strings dictionary. */
 	bundle->dictionary_length = 0;
-	bundle->dictionary = NULL;
+	bundle->dictionary = nullptr;
 
 	/* Begin with no allocated node pools. */
 	bundle->node_pools_length = 0;
-	bundle->node_pools = NULL;
+	bundle->node_pools = nullptr;
 	bundle->node_count = 0;
 
 	/* Begin with no adopted addresses. */
 	bundle->orphans_length = 0;
-	bundle->orphans = NULL;
+	bundle->orphans = nullptr;
 
 	/* Leave open for insertions. */
 	bundle->is_readonly = FALSE;
@@ -753,12 +753,12 @@ static sc_prop_setref_t prop_create_empty() {
 	 * ensuring that every set has at least one node and one allocated pool.
 	 */
 	bundle->root_node = prop_new_node(bundle);
-	bundle->root_node->child_list = NULL;
+	bundle->root_node->child_list = nullptr;
 	bundle->root_node->name.string = "ROOT";
-	bundle->root_node->property.voidp = NULL;
+	bundle->root_node->property.voidp = nullptr;
 
 	/* No taf is yet connected with this set. */
-	bundle->taf = NULL;
+	bundle->taf = nullptr;
 
 	return bundle;
 }
@@ -793,25 +793,25 @@ void prop_destroy(sc_prop_setref_t bundle) {
 		sc_free(bundle->dictionary[index_]);
 	bundle->dictionary_length = 0;
 	sc_free(bundle->dictionary);
-	bundle->dictionary = NULL;
+	bundle->dictionary = nullptr;
 
 	/* Free adopted addresses. */
 	for (index_ = 0; index_ < bundle->orphans_length; index_++)
 		sc_free(bundle->orphans[index_]);
 	bundle->orphans_length = 0;
 	sc_free(bundle->orphans);
-	bundle->orphans = NULL;
+	bundle->orphans = nullptr;
 
 	/* Walk the tree, destroying the child list for each node found. */
 	prop_destroy_child_list(bundle->root_node);
-	bundle->root_node = NULL;
+	bundle->root_node = nullptr;
 
 	/* Destroy each node pool. */
 	for (index_ = 0; index_ < bundle->node_pools_length; index_++)
 		sc_free(bundle->node_pools[index_]);
 	bundle->node_pools_length = 0;
 	sc_free(bundle->node_pools);
-	bundle->node_pools = NULL;
+	bundle->node_pools = nullptr;
 
 	/* Destroy any taf associated with the bundle. */
 	if (bundle->taf)
@@ -837,7 +837,7 @@ sc_prop_setref_t prop_create(const sc_tafref_t taf) {
 	/* Populate it with data parsed from the taf file. */
 	if (!parse_game(taf, bundle)) {
 		prop_destroy(bundle);
-		return NULL;
+		return nullptr;
 	}
 
 	/* Note the taf for destruction later, and return the new set. */
diff --git a/engines/glk/adrift/screstrs.cpp b/engines/glk/adrift/screstrs.cpp
index 77b21101e7..2c25091229 100644
--- a/engines/glk/adrift/screstrs.cpp
+++ b/engines/glk/adrift/screstrs.cpp
@@ -693,7 +693,7 @@ enum {
 };
 
 /* #O#A(#O#)-style expression, for tokenizing. */
-static const sc_char *restr_expression = NULL;
+static const sc_char *restr_expression = nullptr;
 static sc_int restr_index = 0;
 
 /*
@@ -709,7 +709,7 @@ static void restr_tokenize_start(const sc_char *expression) {
 }
 
 static void restr_tokenize_end(void) {
-	restr_expression = NULL;
+	restr_expression = nullptr;
 	restr_index = 0;
 }
 
@@ -750,7 +750,7 @@ static sc_int restr_eval_stack = 0;
 static sc_int restr_eval_restriction = 0;
 
 /* The current game used to evaluate restrictions, and the task in question. */
-static sc_gameref_t restr_eval_game = NULL;
+static sc_gameref_t restr_eval_game = nullptr;
 static sc_int restr_eval_task = 0;
 
 /* The id of the lowest-indexed failing restriction. */
@@ -953,7 +953,7 @@ static const sc_char *restr_get_fail_message(sc_gameref_t game, sc_int task, sc_
 	message = prop_get_string(bundle, "S<-sisis", vt_key);
 
 	/* Return it, or NULL if empty. */
-	return !sc_strempty(message) ? message : NULL;
+	return !sc_strempty(message) ? message : nullptr;
 }
 
 
@@ -999,7 +999,7 @@ sc_bool restr_eval_task_restrictions(sc_gameref_t game, sc_int task, sc_bool *pa
 			sc_trace("Restr: task %ld has no restrictions\n", task);
 
 		*pass = TRUE;
-		*fail_message = NULL;
+		*fail_message = nullptr;
 		return TRUE;
 	}
 
@@ -1045,7 +1045,7 @@ sc_bool restr_eval_task_restrictions(sc_gameref_t game, sc_int task, sc_bool *pa
 	 */
 	*pass = result;
 	if (result)
-		*fail_message = NULL;
+		*fail_message = nullptr;
 	else
 		*fail_message = restr_get_fail_message(game, task, lowest_fail);
 	return TRUE;
diff --git a/engines/glk/adrift/scrunner.cpp b/engines/glk/adrift/scrunner.cpp
index dbf160f350..57ec5b0fc9 100644
--- a/engines/glk/adrift/scrunner.cpp
+++ b/engines/glk/adrift/scrunner.cpp
@@ -124,7 +124,7 @@ static sc_commands_t MOVE_COMMANDS_4[] = {
 	{"{go {to {the}}} [down/d]", lib_cmd_go_down},
 	{"{go {to {the}}} [in]", lib_cmd_go_in},
 	{"{go {to {the}}} [out/o]", lib_cmd_go_out},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 /* Movement commands for the eight point compass. */
@@ -141,7 +141,7 @@ static sc_commands_t MOVE_COMMANDS_8[] = {
 	{"{go {to {the}}} [southeast/south-east/se]", lib_cmd_go_southeast},
 	{"{go {to {the}}} [northwest/north-west/nw]", lib_cmd_go_northwest},
 	{"{go {to {the}}} [southwest/south-west/sw]", lib_cmd_go_southwest},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 /* "Priority" library commands, may take precedence over the game. */
@@ -198,7 +198,7 @@ static sc_commands_t PRIORITY_COMMANDS[] = {
 	},
 	{"[drop/put down] %text%", lib_cmd_drop_multiple},
 	{"put %text% down", lib_cmd_drop_multiple},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 /* Standard library commands, other than movement and priority above. */
@@ -466,7 +466,7 @@ static sc_commands_t STANDARD_COMMANDS[] = {
 	/* SCARE debugger hook command, placed last just in case... */
 	{"{#}debug{ger}", debug_cmd_debugger},
 
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 
@@ -571,7 +571,7 @@ static void run_update_status(sc_gameref_t game) {
 		pf_strip_tags(filtered);
 	} else
 		/* No status line, so use NULL. */
-		filtered = NULL;
+		filtered = nullptr;
 
 	/* Free any existing status line, then save this status text. */
 	sc_free(game->status_line);
@@ -739,7 +739,7 @@ static sc_bool run_task_is_loudly_restricted(sc_gameref_t game, sc_int task) {
 	}
 
 	/* Return TRUE if the task is restricted and indicates why. */
-	return !restrictions_passed && (fail_message != NULL);
+	return !restrictions_passed && (fail_message != nullptr);
 }
 
 
@@ -793,7 +793,7 @@ static sc_bool run_game_commands_common(sc_gameref_t game, const sc_char *string
 		is_matching = (sc_bool *)sc_malloc(task_count * sizeof(*is_matching));
 		memset(is_matching, FALSE, task_count * sizeof(*is_matching));
 	} else
-		is_matching = NULL;
+		is_matching = nullptr;
 
 	/*
 	 * Iterate over every task, ignoring those not runnable.  For each runnable
@@ -1078,7 +1078,7 @@ static sc_bool run_player_input(sc_gameref_t game) {
 		 */
 		length = (line_buffer[0] == NUL) ? 0 : 1;
 		while (line_buffer[length] != NUL
-		        && strchr(SEPARATORS, line_buffer[length]) == NULL)
+		        && strchr(SEPARATORS, line_buffer[length]) == nullptr)
 			length++;
 
 		/*
@@ -1092,7 +1092,7 @@ static sc_bool run_player_input(sc_gameref_t game) {
 
 		extent = length;
 		extent += (line_buffer[length] == NUL
-		           || strchr(SEPARATORS, line_buffer[length]) == NULL) ? 0 : 1;
+		           || strchr(SEPARATORS, line_buffer[length]) == nullptr) ? 0 : 1;
 		extent += strspn(line_buffer + extent, WHITESPACE);
 		memmove(line_buffer,
 		        line_buffer + extent, strlen(line_buffer) - extent + 1);
@@ -1429,7 +1429,7 @@ sc_gameref_t run_create(sc_read_callbackref_t callback, void *opaque) {
 	/* Create a new TAF using the callback; return NULL if this fails. */
 	taf = taf_create(callback, opaque);
 	if (!taf)
-		return NULL;
+		return nullptr;
 	else if (if_get_trace_flag(SC_DUMP_TAF))
 		taf_debug_dump(taf);
 
@@ -1438,7 +1438,7 @@ sc_gameref_t run_create(sc_read_callbackref_t callback, void *opaque) {
 	if (!bundle) {
 		sc_error("run_create: error parsing game data\n");
 		taf_destroy(taf);
-		return NULL;
+		return nullptr;
 	} else if (if_get_trace_flag(SC_DUMP_PROPERTIES))
 		prop_debug_dump(bundle);
 
@@ -1507,9 +1507,9 @@ static void run_restart_handler(sc_gameref_t game) {
 
 	/* Destroy invalid game status strings. */
 	sc_free(game->current_room_name);
-	game->current_room_name = NULL;
+	game->current_room_name = nullptr;
 	sc_free(game->status_line);
-	game->status_line = NULL;
+	game->status_line = nullptr;
 
 	/*
 	 * Now it's safely copied, destroy the temporary new game, and its
@@ -1793,7 +1793,7 @@ sc_bool run_restore(CONTEXT, sc_gameref_t game, sc_read_callbackref_t callback,
 sc_bool run_restore_prompted(CONTEXT, sc_gameref_t game) {
 	assert(gs_is_game_valid(game));
 
-	return run_restore_common(context, game, NULL, NULL);
+	return run_restore_common(context, game, nullptr, nullptr);
 }
 
 
@@ -1955,7 +1955,7 @@ void run_get_attributes(sc_gameref_t game, const sc_char **game_name, const sc_c
 			vt_key[0].string = "FontNameSize";
 			*preferred_font = prop_get_string(bundle, "S<-s", vt_key);
 		} else
-			*preferred_font = NULL;
+			*preferred_font = nullptr;
 	}
 
 	/* Return any other selected game attributes. */
@@ -2011,7 +2011,7 @@ sc_hintref_t run_hint_iterate(sc_gameref_t game, sc_hintref_t hint) {
 		task = hint - game->tasks;
 		if (task < 0 || task >= gs_task_count(game)) {
 			sc_error("run_hint_iterate: invalid iteration hint\n");
-			return NULL;
+			return nullptr;
 		}
 
 		/* Advance beyond current task. */
@@ -2025,7 +2025,7 @@ sc_hintref_t run_hint_iterate(sc_gameref_t game, sc_hintref_t hint) {
 	}
 
 	/* Return a pointer to the state of the task identified, or NULL. */
-	return task < gs_task_count(game) ? game->tasks + task : NULL;
+	return task < gs_task_count(game) ? game->tasks + task : nullptr;
 }
 
 
@@ -2054,10 +2054,10 @@ static const sc_char *run_get_hint_common(sc_gameref_t game, sc_hintref_t hint,
 	task = hint - game->tasks;
 	if (task < 0 || task >= gs_task_count(game)) {
 		sc_error("run_get_hint_common: invalid iteration hint\n");
-		return NULL;
+		return nullptr;
 	} else if (!task_has_hints(game, task)) {
 		sc_error("run_get_hint_common: task has no hint\n");
-		return NULL;
+		return nullptr;
 	}
 
 	/* Get the required game text by calling the given handler function. */
@@ -2073,7 +2073,7 @@ static const sc_char *run_get_hint_common(sc_gameref_t game, sc_hintref_t hint,
 	} else {
 		/* Hint text is empty; drop any text noted in game. */
 		sc_free(game->hint_text);
-		game->hint_text = NULL;
+		game->hint_text = nullptr;
 	}
 
 	return game->hint_text;
diff --git a/engines/glk/adrift/sctaffil.cpp b/engines/glk/adrift/sctaffil.cpp
index 2365c1a093..555da4e979 100644
--- a/engines/glk/adrift/sctaffil.cpp
+++ b/engines/glk/adrift/sctaffil.cpp
@@ -134,7 +134,7 @@ static sc_tafref_t taf_create_empty(void) {
 	memset(taf->header, 0, sizeof(taf->header));
 	taf->version = TAF_VERSION_NONE;
 	taf->total_in_bytes = 0;
-	taf->slabs = NULL;
+	taf->slabs = nullptr;
 	taf->slab_count = 0;
 	taf->slabs_allocated = 0;
 	taf->is_unterminated = FALSE;
@@ -476,7 +476,7 @@ static sc_tafref_t taf_create_from_callback(sc_read_callbackref_t callback,
 		if (in_bytes != VERSION_HEADER_SIZE) {
 			sc_error("taf_create: not enough data for standard TAF header\n");
 			taf_destroy(taf);
-			return NULL;
+			return nullptr;
 		}
 
 		/* Handle different TAF versions */
@@ -495,14 +495,14 @@ static sc_tafref_t taf_create_from_callback(sc_read_callbackref_t callback,
 				sc_error("taf_create:"
 				         " not enough data for extended TAF header\n");
 				taf_destroy(taf);
-				return NULL;
+				return nullptr;
 			}
 
 			taf->version = TAF_VERSION_400;
 
 		} else {
 			taf_destroy(taf);
-			return NULL;
+			return nullptr;
 		}
 	} else {
 		/* Saved games are always considered to be for ScummVM, version 5.0. */
@@ -537,7 +537,7 @@ static sc_tafref_t taf_create_from_callback(sc_read_callbackref_t callback,
 	}
 	if (!status) {
 		taf_destroy(taf);
-		return NULL;
+		return nullptr;
 	}
 
 	/* Return successfully. */
@@ -606,7 +606,7 @@ const sc_char *taf_next_line(sc_tafref_t taf) {
 	}
 
 	/* No more lines, so return NULL. */
-	return NULL;
+	return nullptr;
 }
 
 
diff --git a/engines/glk/adrift/sctafpar.cpp b/engines/glk/adrift/sctafpar.cpp
index 046cb24d33..a132fc3465 100644
--- a/engines/glk/adrift/sctafpar.cpp
+++ b/engines/glk/adrift/sctafpar.cpp
@@ -213,7 +213,7 @@ static const sc_parse_schema_t V400_PARSE_SCHEMA[] = {
 		"ALR",
 		"$Original $Replacement"
 	},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 /* Version 3.9 TAF file properties descriptor table. */
@@ -347,7 +347,7 @@ static const sc_parse_schema_t V390_PARSE_SCHEMA[] = {
 		"ALR",
 		"$Original $Replacement"
 	},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 /* Version 3.8 TAF file properties descriptor table. */
@@ -447,7 +447,7 @@ static const sc_parse_schema_t V380_PARSE_SCHEMA[] = {
 		"SYNONYM",
 		"$Replacement $Original"
 	},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 
@@ -467,20 +467,20 @@ static const sc_parse_schema_t *parse_select_schema(sc_tafref_t taf) {
 		return V380_PARSE_SCHEMA;
 	default:
 		sc_fatal("parse_select_schema: invalid TAF file version\n");
-		return NULL;
+		return nullptr;
 	}
 }
 
 
 /* The uncompressed TAF file from which we get all our data. */
-static sc_tafref_t parse_taf = NULL;
+static sc_tafref_t parse_taf = nullptr;
 static sc_int parse_tafline = 0;
 
 /* The parse schema selected for this TAF file. */
-static sc_parse_schema_t const *parse_schema = NULL;
+static sc_parse_schema_t const *parse_schema = nullptr;
 
 /* Properties bundle and trace flag, set before parsing. */
-static sc_prop_setref_t parse_bundle = NULL;
+static sc_prop_setref_t parse_bundle = nullptr;
 static sc_bool parse_trace = FALSE;
 
 /*
@@ -687,7 +687,7 @@ static const sc_char *parse_get_string_property(void) {
 
 
 /* Pushback line, and pushback requested flag. */
-static const sc_char *parse_pushback_line = NULL;
+static const sc_char *parse_pushback_line = nullptr;
 static sc_bool parse_use_pushback = FALSE;
 
 /*
@@ -1012,7 +1012,7 @@ static void parse_expression(CONTEXT, const sc_char *expression) {
  * string is malloc'ed, and the caller needs to handle that.
  */
 static sc_char *parse_read_multiline(CONTEXT) {
-	const sc_byte *separator = NULL;
+	const sc_byte *separator = nullptr;
 	const sc_char *line;
 	sc_char *multiline;
 
@@ -1142,7 +1142,7 @@ struct sc_parse_resource_t {
 enum { RESOURCE_GROW_INCREMENT = 32 };
 static sc_int parse_resources_length = 0;
 static sc_int parse_resources_size = 0;
-static sc_parse_resource_t *parse_resources = NULL;
+static sc_parse_resource_t *parse_resources = nullptr;
 
 
 /*
@@ -1159,7 +1159,7 @@ static void parse_clear_v400_resources_table(void) {
 			sc_free(parse_resources[index_].name);
 
 		sc_free(parse_resources);
-		parse_resources = NULL;
+		parse_resources = nullptr;
 	}
 	parse_resources_length = 0;
 	parse_resources_size = 0;
@@ -1835,7 +1835,7 @@ static void parse_fixup_v390_v380_room_alts(void) {
 		hide_objects = typehideobjects % V390_V380_ALT_TYPEHIDE_MULT;
 
 		parse_fixup_v390_v380_room_alt(m1, type, "AltRes",
-		                               m2, var2, NULL,
+		                               m2, var2, nullptr,
 		                               hide_objects, changed, var3,
 		                               display_room);
 	}
@@ -1862,7 +1862,7 @@ static void parse_fixup_v390_v380_room_alts(void) {
 		hide_objects = 0;
 
 		parse_fixup_v390_v380_room_alt(m1, type, "Task2Res",
-		                               m2, var2, NULL,
+		                               m2, var2, nullptr,
 		                               hide_objects, changed, var3,
 		                               display_room);
 	}
@@ -1886,7 +1886,7 @@ static void parse_fixup_v390_v380_room_alts(void) {
 		hide_objects = 0;
 
 		parse_fixup_v390_v380_room_alt(m1, type, "Task1Res",
-		                               m2, var2, NULL,
+		                               m2, var2, nullptr,
 		                               hide_objects, changed, var3,
 		                               display_room);
 	}
@@ -1909,7 +1909,7 @@ static void parse_fixup_v390_v380_room_alts(void) {
 		hide_objects = 0;
 
 		parse_fixup_v390_v380_room_alt(m1, type, "LastRes",
-		                               m2, var2, NULL,
+		                               m2, var2, nullptr,
 		                               hide_objects, changed, var3,
 		                               display_room);
 	}
@@ -3370,9 +3370,9 @@ sc_bool parse_game(sc_tafref_t taf, sc_prop_setref_t bundle) {
 	if (context._break) {
 		// Error with one of the TAF file lines
 		parse_clear_v400_resources_table();
-		parse_taf = NULL;
-		parse_bundle = NULL;
-		parse_schema = NULL;
+		parse_taf = nullptr;
+		parse_bundle = nullptr;
+		parse_schema = nullptr;
 		parse_depth = 0;
 		return FALSE;
 	}
@@ -3399,9 +3399,9 @@ sc_bool parse_game(sc_tafref_t taf, sc_prop_setref_t bundle) {
 	prop_solidify(parse_bundle);
 
 	/* Return successfully. */
-	parse_taf = NULL;
-	parse_bundle = NULL;
-	parse_schema = NULL;
+	parse_taf = nullptr;
+	parse_bundle = nullptr;
+	parse_schema = nullptr;
 	parse_depth = 0;
 	return TRUE;
 }
diff --git a/engines/glk/adrift/scutils.cpp b/engines/glk/adrift/scutils.cpp
index d1dc5141e9..d50257992c 100644
--- a/engines/glk/adrift/scutils.cpp
+++ b/engines/glk/adrift/scutils.cpp
@@ -118,7 +118,7 @@ void *sc_realloc(void *pointer, size_t size) {
 	}
 
 	if (pointer == sc_zero_allocation)
-		pointer = NULL;
+		pointer = nullptr;
 
 	allocated = realloc(pointer, size);
 	if (!allocated)
diff --git a/engines/glk/adrift/sxfile.cpp b/engines/glk/adrift/sxfile.cpp
index 992b93bb53..7ed749eda6 100644
--- a/engines/glk/adrift/sxfile.cpp
+++ b/engines/glk/adrift/sxfile.cpp
@@ -38,7 +38,7 @@ struct sx_scr_stream_t {
 	sc_bool is_open;
 	sc_bool is_writable;
 };
-static sx_scr_stream_t scr_serialization_stream = {NULL, 0, FALSE, FALSE};
+static sx_scr_stream_t scr_serialization_stream = {nullptr, 0, FALSE, FALSE};
 
 
 /*
@@ -59,11 +59,11 @@ void *file_open_file_callback(sc_bool is_save) {
 	if (stream->is_open) {
 		error("File open error: %s",
 		                "stream is in use (script limitation)");
-		return NULL;
+		return nullptr;
 	} else if (is_save && stream->data) {
 		error("File open error: %s",
 		                "stream has not been read (script limitation)");
-		return NULL;
+		return nullptr;
 	}
 
 	/*
@@ -71,10 +71,10 @@ void *file_open_file_callback(sc_bool is_save) {
 	 * no data available for a read-only open.
 	 */
 	if (is_save) {
-		stream->data = NULL;
+		stream->data = nullptr;
 		stream->length = 0;
 	} else if (!stream->data)
-		return NULL;
+		return nullptr;
 
 	stream->is_open = TRUE;
 	stream->is_writable = is_save;
@@ -147,7 +147,7 @@ void file_close_file_callback(void *opaque) {
 	 */
 	if (!stream->is_writable) {
 		sx_free(stream->data);
-		stream->data = NULL;
+		stream->data = nullptr;
 		stream->length = 0;
 	}
 	stream->is_writable = FALSE;
@@ -164,7 +164,7 @@ void file_cleanup(void) {
 	sx_scr_stream_t *const stream = &scr_serialization_stream;
 
 	sx_free(stream->data);
-	stream->data = NULL;
+	stream->data = nullptr;
 	stream->length = 0;
 	stream->is_writable = FALSE;
 	stream->is_open = FALSE;
diff --git a/engines/glk/adrift/sxglob.cpp b/engines/glk/adrift/sxglob.cpp
index f57eed7df2..3b7d0d0020 100644
--- a/engines/glk/adrift/sxglob.cpp
+++ b/engines/glk/adrift/sxglob.cpp
@@ -187,7 +187,7 @@ static const sx_test_data_t SHOULD_MATCH[] = {
 
 	{"???]", "abc]"}, {"[z-a]", "z"},
 	{"[a-z", "a"}, {"[a-", "a"}, {"[a", "a"}, {"[[", "["},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 static const sx_test_data_t SHOULD_NOT_MATCH[] = {
@@ -213,7 +213,7 @@ static const sx_test_data_t SHOULD_NOT_MATCH[] = {
 	{"*[a-z]*abc?xyz", "AabcQxyz"}, {"*[a-z]*abc?xyz", "aabcxyz"},
 
 	{"[z-a]", "a"}, {"[z-a]", "b"}, {"[", "a"}, {"[[", "a"},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 
diff --git a/engines/glk/adrift/sxstubs.cpp b/engines/glk/adrift/sxstubs.cpp
index c1432e71c4..0265022824 100644
--- a/engines/glk/adrift/sxstubs.cpp
+++ b/engines/glk/adrift/sxstubs.cpp
@@ -41,12 +41,12 @@ static sc_bool stub_trace = FALSE;
  * Input/output handler functions.  If assigned, calls to os_* functions are
  * routed here to allow the script runner to catch interpeter i/o.
  */
-static sc_bool(*stub_read_line)(sc_char *, sc_int) = NULL;
-static void (*stub_print_string)(const sc_char *) = NULL;
-static void *(*stub_open_file)(sc_bool) = NULL;
-static sc_int(*stub_read_file)(void *, sc_byte *, sc_int) = NULL;
-static void (*stub_write_file)(void *, const sc_byte *, sc_int) = NULL;
-static void (*stub_close_file)(void *) = NULL;
+static sc_bool(*stub_read_line)(sc_char *, sc_int) = nullptr;
+static void (*stub_print_string)(const sc_char *) = nullptr;
+static void *(*stub_open_file)(sc_bool) = nullptr;
+static sc_int(*stub_read_file)(void *, sc_byte *, sc_int) = nullptr;
+static void (*stub_write_file)(void *, const sc_byte *, sc_int) = nullptr;
+static void (*stub_close_file)(void *) = nullptr;
 
 /* Flags for whether to report tags and resources via stub_print_string(). */
 static sc_int stub_show_resources = 0;
@@ -79,12 +79,12 @@ stub_attach_handlers(sc_bool(*read_line)(sc_char *, sc_int),
 
 void
 stub_detach_handlers(void) {
-	stub_read_line = NULL;
-	stub_print_string = NULL;
-	stub_open_file = NULL;
-	stub_read_file = NULL;
-	stub_write_file = NULL;
-	stub_close_file = NULL;
+	stub_read_line = nullptr;
+	stub_print_string = nullptr;
+	stub_open_file = nullptr;
+	stub_read_file = nullptr;
+	stub_write_file = nullptr;
+	stub_close_file = nullptr;
 
 	stub_show_resources = 0;
 	stub_show_tags = 0;
@@ -282,7 +282,7 @@ os_open_file(sc_bool is_save) {
 	if (stub_open_file)
 		opaque = stub_open_file(is_save);
 	else
-		opaque = NULL;
+		opaque = nullptr;
 
 	if (stub_trace) {
 		if (opaque)
diff --git a/engines/glk/adrift/sxutils.cpp b/engines/glk/adrift/sxutils.cpp
index e4b3519ebf..9e0ba0d218 100644
--- a/engines/glk/adrift/sxutils.cpp
+++ b/engines/glk/adrift/sxutils.cpp
@@ -114,7 +114,7 @@ void *sx_realloc(void *pointer, size_t size) {
 	}
 
 	if (pointer == sx_zero_allocation)
-		pointer = NULL;
+		pointer = nullptr;
 
 	allocated = realloc(pointer, size);
 	if (!allocated)
@@ -168,7 +168,7 @@ static const sc_char NUL = '\0';
 static sc_bool sx_isspace(sc_char character) {
 	static const sc_char *const WHITESPACE = "\t\n\v\f\r ";
 
-	return character != NUL && strchr(WHITESPACE, character) != NULL;
+	return character != NUL && strchr(WHITESPACE, character) != nullptr;
 }
 
 static sc_bool sx_isprint(sc_char character) {
diff --git a/engines/glk/advsys/glk_interface.cpp b/engines/glk/advsys/glk_interface.cpp
index badfbefdb3..b42ce722c6 100644
--- a/engines/glk/advsys/glk_interface.cpp
+++ b/engines/glk/advsys/glk_interface.cpp
@@ -26,7 +26,7 @@ namespace Glk {
 namespace AdvSys {
 
 bool GlkInterface::initialize() {
-	_window = glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
+	_window = glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 1);
 	return _window != nullptr;
 }
 
diff --git a/engines/glk/agt/agil.cpp b/engines/glk/agt/agil.cpp
index 908b50de90..185e6600df 100644
--- a/engines/glk/agt/agil.cpp
+++ b/engines/glk/agt/agil.cpp
@@ -163,11 +163,11 @@ static void print_title(fc_type fc) {
 	else
 		buff = read_ttl(fc);
 
-	if (buff == NULL) {
+	if (buff == nullptr) {
 		writeln("");
 		writeln("");
 		s = formal_name(fc, fNONE);
-		if (s != NULL) {
+		if (s != nullptr) {
 			s[0] = toupper(s[0]);
 			agt_center(1);
 			agt_textcolor(-1);
@@ -186,7 +186,7 @@ static void print_title(fc_type fc) {
 		writeln("");
 		height = 0;
 	} else {
-		if (buff[0] != NULL && strncasecmp(buff[0], "COLORS", 6) == 0) {
+		if (buff[0] != nullptr && strncasecmp(buff[0], "COLORS", 6) == 0) {
 			/* Do screen colors */
 			skip_line = 1;
 		} else skip_line = 0;
@@ -194,7 +194,7 @@ static void print_title(fc_type fc) {
 		   starting with spaces. We use height as a loop variable
 		   and center_mode to store the count temporarily. */
 		center_mode = 0;
-		for (height = skip_line; buff[height] != NULL; height++)
+		for (height = skip_line; buff[height] != nullptr; height++)
 			if (!emptyline((uchar *)buff[height])) {
 				if (rspace(buff[height][0])) center_mode++;
 				else center_mode--;
@@ -220,7 +220,7 @@ static void print_title(fc_type fc) {
 
 	agt_textcolor(7);
 	agt_center(1);
-	if (buff != NULL) {
+	if (buff != nullptr) {
 		if (aver < AGX00 && height <= screen_height - 6)
 			writeln("[Created with Malmberg and Welch's Adventure Game Toolkit]");
 		if (height <= screen_height - 9) writeln("");
@@ -255,7 +255,7 @@ void print_instructions(fc_type fc) {
 
 	writeln("INSTRUCTIONS:");
 	if (open_ins_file(fc, 1)) {  /* Instruction file exists */
-		while (NULL != (buffer = read_ins_line())) {
+		while (nullptr != (buffer = read_ins_line())) {
 			for (s = (uchar *)buffer; *s != 0; s++) *s = trans_ascii[*s];
 			writeln(buffer);
 		}
@@ -443,9 +443,9 @@ static void game_end(void) {
 		writeln("");
 		agt_center(1);
 		if (winflag)
-			gen_sysmsg(148, "***** $You$ have won! *****", MSG_MAIN, NULL);
+			gen_sysmsg(148, "***** $You$ have won! *****", MSG_MAIN, nullptr);
 		if (deadflag)
-			gen_sysmsg(147, "***** $You$ have died! *****", MSG_MAIN, NULL);
+			gen_sysmsg(147, "***** $You$ have died! *****", MSG_MAIN, nullptr);
 		writeln("");
 		writeln("");
 		agt_center(0);
@@ -454,16 +454,16 @@ static void game_end(void) {
 		if (curr_lives > 1) { /* Resurrection code */
 			if (curr_lives == max_lives)
 				gen_sysmsg(151, "Hmmm.... so $you$'ve gotten $your$self killed. "
-				           "Would you like me to try a resurrection?", MSG_MAIN, NULL);
+				           "Would you like me to try a resurrection?", MSG_MAIN, nullptr);
 			else gen_sysmsg(152, "<Sigh>  $You$'ve died *again*. "
 				                "Would you like me to try another resurrection?",
-				                MSG_MAIN, NULL);
+				                MSG_MAIN, nullptr);
 			if (yesno("? ")) {  /* Now do resurrection */
 				curr_lives--;
 				quitflag = deadflag = 0;
 				gen_sysmsg(154,
 				           "$You$ emerge coughing from a cloud of dark green smoke.",
-				           MSG_MAIN, NULL);
+				           MSG_MAIN, nullptr);
 				writeln("");
 				loc = resurrect_room - first_room;
 				newlife_flag = 1;
@@ -473,7 +473,7 @@ static void game_end(void) {
 				return;
 			} else writeln("As you wish...");
 		} else if (max_lives > 1)
-			gen_sysmsg(153, "$You$'ve used up all of $your$ lives.", MSG_MAIN, NULL);
+			gen_sysmsg(153, "$You$'ve used up all of $your$ lives.", MSG_MAIN, nullptr);
 	}
 	writeln("");
 	print_score();
@@ -481,15 +481,15 @@ static void game_end(void) {
 	done_flag = quitflag; /* If player has QUIT, don't ask again */
 	while (!done_flag && !quitflag) {
 		writestr("Would you like to ");
-		if (restart_state != NULL) writestr("restart, ");
+		if (restart_state != nullptr) writestr("restart, ");
 		writestr("restore");
-		if (undo_state != NULL && can_undo)
+		if (undo_state != nullptr && can_undo)
 			writestr(", undo,");
-		else if (restart_state != NULL) writestr(",");
+		else if (restart_state != nullptr) writestr(",");
 		writestr(" or quit? ");
 		s = agt_readline(5);
 		if (strncasecmp(s, "RESTART", 7) == 0)
-			if (restart_state != NULL) {
+			if (restart_state != nullptr) {
 				restart_game();
 				done_flag = 1;
 			} else writeln("Sorry, I'm unable to do that because of limited memory.");
@@ -498,7 +498,7 @@ static void game_end(void) {
 				done_flag = 1;
 			} else writeln("(RESTORE failed)");
 		else if (strncasecmp(s, "UNDO", 4) == 0)
-			if (can_undo && undo_state != NULL) {
+			if (can_undo && undo_state != nullptr) {
 				putstate(undo_state);
 				done_flag = 1;
 			} else writeln("Insufficiant memory to support UNDO");
@@ -606,7 +606,7 @@ static int init(void) {
 		agt_var[i] = 0;
 
 	for (i = 0; i <= maxnoun - first_noun; i++) {
-		if (noun[i].position == NULL || noun[i].position[0] == '\0')
+		if (noun[i].position == nullptr || noun[i].position[0] == '\0')
 			noun[i].pos_prep = 0;
 		else noun[i].pos_prep = -1;
 		noun[i].pos_name = 0;
@@ -633,17 +633,17 @@ static int init(void) {
 			   game states */
 	tmp1 = (uchar *)rmalloc(MEM_MARGIN); /* Preserve some work space */
 
-	tmp2 = getstate(NULL); /* Make sure we have space to save */
-	if (tmp2 == NULL) can_save = 0;
+	tmp2 = getstate(nullptr); /* Make sure we have space to save */
+	if (tmp2 == nullptr) can_save = 0;
 	else can_save = 1;
 
-	if (tmp2 != NULL)
-		undo_state = getstate(NULL);
-	else undo_state = NULL;
+	if (tmp2 != nullptr)
+		undo_state = getstate(nullptr);
+	else undo_state = nullptr;
 
-	if (undo_state != NULL)
-		restart_state = getstate(NULL);
-	else restart_state = NULL;
+	if (undo_state != nullptr)
+		restart_state = getstate(nullptr);
+	else restart_state = nullptr;
 
 	rfree(tmp1);
 	rfree(tmp2);
@@ -691,7 +691,7 @@ static void fix_dummy(void) {
 	else {
 		PURE_DOT = FORCE_PURE_DOT;
 		for (i = 0; i < dp && !PURE_DOT; i++)
-			if (strchr(dict[i], '.') != NULL && /* i.e. dict[i] contains period */
+			if (strchr(dict[i], '.') != nullptr && /* i.e. dict[i] contains period */
 			        i != ext_code[wp])   /* The period itself _is_ a dictionary word:
 				avoid this false match */
 				PURE_DOT = 1;
@@ -703,9 +703,9 @@ static void fix_dummy(void) {
 static void fix_prompt(void) {
 	descr_line *d;
 
-	if (err_ptr == NULL) return;
+	if (err_ptr == nullptr) return;
 	d = read_descr(err_ptr[0].start, err_ptr[0].size);
-	if (d == NULL) return;
+	if (d == nullptr) return;
 	if (strncasecmp(d[0], "What Now?", 9) == 0)
 		err_ptr[0].size = err_ptr[0].start = 0;
 	free_descr(d);
@@ -750,7 +750,7 @@ static fc_type setup_game(fc_type fc)
 
 	/* Now that we *have* PATH information, go looking for the games */
 	/* At the very least, it creates an rmalloc'd copy of game_name */
-	read_config(openfile(fc, fCFG, NULL, 0), 0);
+	read_config(openfile(fc, fCFG, nullptr, 0), 0);
 	text_file = 0;
 	/* First pass through game specific config file */
 	build_trans_ascii();
@@ -768,7 +768,7 @@ static fc_type setup_game(fc_type fc)
 		menu_mode = opt_data[5];   /* See agtread.c for discussion of OPT file
 				format */
 	text_file = 1;
-	read_config(openfile(fc, fCFG, NULL, 0), 1); /*Game specific config file*/
+	read_config(openfile(fc, fCFG, nullptr, 0), 1); /*Game specific config file*/
 	text_file = 0;
 	if (min_ver > AGIL_VERID) {
 		if (FORCE_VERSION)
@@ -825,7 +825,7 @@ static fc_type setup_game(fc_type fc)
 	set_statline();
 	if (can_save == 0) {
 		writeln("[Insufficiant memory to support SAVE, RESTORE, or UNDO]");
-	} else if (undo_state == NULL)
+	} else if (undo_state == nullptr)
 		writeln("[Insufficiant memory to support UNDO]");
 	do_look = do_autoverb = 1;
 	newroom();
diff --git a/engines/glk/agt/agtread.cpp b/engines/glk/agt/agtread.cpp
index e10ca680d4..bc17bba888 100644
--- a/engines/glk/agt/agtread.cpp
+++ b/engines/glk/agt/agtread.cpp
@@ -145,7 +145,7 @@ void open_descr(fc_type fc) {
 	tline buff;
 
 	fd_desc = readopen(fc, fDSS, &errstr);
-	if (errstr != NULL)  fatal(errstr);
+	if (errstr != nullptr)  fatal(errstr);
 	desc_size = binsize(fd_desc);
 	if (DIAG) {
 		char *s;
@@ -187,7 +187,7 @@ void open_descr(fc_type fc) {
 		else rprintf("  [plaintext: %d/%d]\n", alpha, cnt);
 	}
 
-	mem_descr = NULL;
+	mem_descr = nullptr;
 	if (desc_size <= descr_maxmem) {
 		/* This is where we need to read the data in and convert it:
 		   encrypted Pascal strings --> plaintext C strings */
@@ -195,7 +195,7 @@ void open_descr(fc_type fc) {
 		mem_descr = (char *)rmalloc(desc_size);
 		/* Read in the whole file */
 		binread(fd_desc, mem_descr, desc_size, 1, &errstr);
-		if (errstr != NULL) fatal(errstr);
+		if (errstr != nullptr) fatal(errstr);
 		for (i = 0; i < desc_size; i += sizeof(tline))
 			convert_agt_descr((uchar *)(mem_descr + i));
 		/* Decode and convert to C string */
@@ -204,11 +204,11 @@ void open_descr(fc_type fc) {
 
 
 void close_descr(void) {
-	if (mem_descr != NULL)
+	if (mem_descr != nullptr)
 		rfree(mem_descr);
 	else {
 		readclose(fd_desc);
-		fd_desc = NULL;
+		fd_desc = nullptr;
 	}
 }
 
@@ -219,10 +219,10 @@ descr_line *agt_read_descr(long start, long len) {
 	long i;
 	const char *errstr;
 
-	if (len == -1 || start == -1) return NULL;
+	if (len == -1 || start == -1) return nullptr;
 	lines = (descr_line *)rmalloc(sizeof(descr_line) * (len + 1));
 
-	if (mem_descr != NULL) {
+	if (mem_descr != nullptr) {
 		d = ((tline *)mem_descr) + start;
 		for (i = 0; i < len; i++)
 			lines[i] = (char *)(d + i);
@@ -230,13 +230,13 @@ descr_line *agt_read_descr(long start, long len) {
 		d = (tline *)rmalloc(sizeof(tline) * len);
 		binseek(fd_desc, start * sizeof(tline));
 		binread(fd_desc, d, sizeof(tline), len, &errstr);
-		if (errstr != NULL) fatal(errstr);
+		if (errstr != nullptr) fatal(errstr);
 		for (i = 0; i < len; i++) {
 			lines[i] = (char *)(d + i);
 			convert_agt_descr((uchar *)(d + i));
 		}
 	}
-	lines[len] = NULL; /* Mark end of array */
+	lines[len] = nullptr; /* Mark end of array */
 	return lines;
 }
 
@@ -295,7 +295,7 @@ static void read_da2(fc_type fc) {
 		setb(seen);
 		seti(key);
 		setb(locked_door);
-		if (room_inside != NULL)
+		if (room_inside != nullptr)
 			room_inside[i] = fixsign16(buff[bp], buff[bp + 1]);
 		bp += 2; /* Skip # of nouns in this room */
 
@@ -403,7 +403,7 @@ static void read_da3(fc_type fc) {
 		setb(shootable);
 		seti(num_shots);
 		seti(points);
-		if (noun_inside != NULL)
+		if (noun_inside != nullptr)
 			noun_inside[i] = fixsign16(buff[bp], buff[bp + 1]);
 		bp += 2; /* Skip # of nouns contained in this one */
 		setb(win);
@@ -466,7 +466,7 @@ static void read_da4(fc_type fc) {
 		seti(weapon);
 		setb(hostile);
 		seti(points);
-		if (creat_inside != NULL)
+		if (creat_inside != nullptr)
 			creat_inside[i] = fixsign16(buff[bp], buff[bp + 1]);
 		bp += 2; /* Skip # of nouns the creature is carrying */
 		seti(counter);
@@ -567,7 +567,7 @@ static void read_da5(fc_type fc) {
 	buffopen(fc, fDA5, CREC_SIZE, "command", last_cmd);
 
 	if (aver >= AGT15F) cmd_ptr = (long *)rmalloc(sizeof(long) * last_cmd);
-	else cmd_ptr = NULL;
+	else cmd_ptr = nullptr;
 
 	bp = 0;
 	for (i = 0; i < last_cmd; i++) {
@@ -686,7 +686,7 @@ static void read_da6(fc_type fc)
 					command[i].data[ip] = fixsign16(cbuf[bp * 2L], cbuf[bp * 2L + 1]);
 			}
 		} else {
-			command[i].data = NULL;
+			command[i].data = nullptr;
 			command[i].cmdsize = 0;
 		}
 	rfree(cbuf);
@@ -880,7 +880,7 @@ static void read_line(genfile fd, const char *typestr)
 		} else chop_newline(linebuffer);
 		linenum++;
 	}
-	if (debug_da1 && typestr != NULL) {
+	if (debug_da1 && typestr != nullptr) {
 		rprintf("%s %4d:%s", typestr, linenum, linebuffer);
 		if (bhold) rprintf("     *");
 		writeln("");
@@ -894,7 +894,7 @@ static void report(const char *s, genfile fd) {
 }
 
 static int isbool(genfile fd) {
-	read_line(fd, NULL);
+	read_line(fd, nullptr);
 	bhold = 1;
 	return (strncasecmp(linebuffer, "TRUE", 4) == 0 ||
 	        strncasecmp(linebuffer, "FALSE", 5) == 0);
@@ -903,7 +903,7 @@ static int isbool(genfile fd) {
 static int isnum(genfile fd) {
 	char *errstr;
 
-	read_line(fd, NULL);
+	read_line(fd, nullptr);
 	bhold = 1;
 	(void)strtol(linebuffer, &errstr, 10);
 	while (*errstr == '\n' || *errstr == '\r') errstr++;
@@ -920,15 +920,15 @@ static rbool readrbool(genfile fd) {
 
 static long readnum(genfile fd) {
 	read_line(fd, "NUM ");
-	return strtol(linebuffer, NULL, 10);
+	return strtol(linebuffer, nullptr, 10);
 }
 
 
 static void readptr(genfile fd, descr_ptr *desc) {
 	read_line(fd, "PTR ");
-	desc->start = strtol(linebuffer, NULL, 10);
+	desc->start = strtol(linebuffer, nullptr, 10);
 	read_line(fd, "LEN");
-	desc->size = strtol(linebuffer, NULL, 10);
+	desc->size = strtol(linebuffer, nullptr, 10);
 }
 
 
@@ -1107,16 +1107,16 @@ noun inside information; this is used by agtout */
 
 	num_rflags = num_nflags = num_cflags = 0;
 	num_rprops = num_nprops = num_cprops = 0;
-	objflag = NULL;
-	objprop = NULL;
-	attrtable = NULL;
-	proptable = NULL;
+	objflag = nullptr;
+	objprop = nullptr;
+	attrtable = nullptr;
+	proptable = nullptr;
 	oflag_cnt = 0;
 	oprop_cnt = 0;
-	propstr = NULL;
+	propstr = nullptr;
 	propstr_size = 0;
-	vartable = NULL;
-	flagtable = NULL;
+	vartable = nullptr;
+	flagtable = nullptr;
 
 
 
@@ -1126,9 +1126,9 @@ noun inside information; this is used by agtout */
 	   should be allocated first */
 
 	synlist = (slist *)rmalloc(sizeof(slist) * TOTAL_VERB);
-	comblist = NULL; /* The original AGT didn't support multi-word verbs */
+	comblist = nullptr; /* The original AGT didn't support multi-word verbs */
 	num_comb = 0;
-	userprep = NULL; /* ... nor did it allow user-defined prepostions */
+	userprep = nullptr; /* ... nor did it allow user-defined prepostions */
 	num_prep = 0;
 
 	if (numglobal > 0)
@@ -1468,27 +1468,27 @@ static void set_da1_null(void)
 /* Set pointers that are malloc'd by try_read_da1 to NULL, to clear
  the way for free_da1_stuff to recover them */
 {
-	static_str = NULL;
+	static_str = nullptr;
 	ss_end = ss_size = 0;
-	command = NULL;
-	cmd_ptr = NULL;
-	synlist = NULL;
-	userstr = NULL;
-	sub_name = NULL;
-	globalnoun = NULL;
-	err_ptr = NULL;
-	quest_ptr = ans_ptr = NULL;
-	question = answer = NULL;
-	msg_ptr = room_ptr = help_ptr = special_ptr = NULL;
-	noun_ptr = push_ptr = pull_ptr = text_ptr = turn_ptr = play_ptr = NULL;
-	room_inside = noun_inside = creat_inside = NULL;
-	creat_ptr = ask_ptr = talk_ptr = NULL;
-	pictlist = pixlist = fontlist = songlist = NULL;
-	room = NULL;
-	noun = NULL;
-	creature = NULL;
-	command = NULL;
-	t_pictlist = t_pixlist = t_fontlist = t_songlist = NULL;
+	command = nullptr;
+	cmd_ptr = nullptr;
+	synlist = nullptr;
+	userstr = nullptr;
+	sub_name = nullptr;
+	globalnoun = nullptr;
+	err_ptr = nullptr;
+	quest_ptr = ans_ptr = nullptr;
+	question = answer = nullptr;
+	msg_ptr = room_ptr = help_ptr = special_ptr = nullptr;
+	noun_ptr = push_ptr = pull_ptr = text_ptr = turn_ptr = play_ptr = nullptr;
+	room_inside = noun_inside = creat_inside = nullptr;
+	creat_ptr = ask_ptr = talk_ptr = nullptr;
+	pictlist = pixlist = fontlist = songlist = nullptr;
+	room = nullptr;
+	noun = nullptr;
+	creature = nullptr;
+	command = nullptr;
+	t_pictlist = t_pixlist = t_fontlist = t_songlist = nullptr;
 }
 
 
@@ -1548,7 +1548,7 @@ static rbool read_da1(fc_type fc, rbool diag)
 	ver = 0;
 	aver = 0;
 	top_quest = 0; /* Highest question actually referenced; set by fixcmd */
-	fda1 = openfile(fc, fDA1, NULL, 0);
+	fda1 = openfile(fc, fDA1, nullptr, 0);
 	if (!filevalid(fda1, fDA1)) return 0;
 
 	if (DIAG) {
@@ -1671,13 +1671,13 @@ static void finish_read(rbool cleanup)
 			rfree(quest_ptr);
 			rfree(ans_ptr);
 		} else {
-			if (question != NULL)
+			if (question != nullptr)
 				question = (tline *)rrealloc(question, top_quest * sizeof(tline));
-			if (answer != NULL)
+			if (answer != nullptr)
 				answer = (tline *)rrealloc(answer, top_quest * sizeof(tline));
-			if (quest_ptr != NULL)
+			if (quest_ptr != nullptr)
 				quest_ptr = (descr_ptr *)rrealloc(quest_ptr, top_quest * sizeof(descr_ptr));
-			if (ans_ptr != NULL)
+			if (ans_ptr != nullptr)
 				ans_ptr = (descr_ptr *)rrealloc(ans_ptr, top_quest * sizeof(descr_ptr));
 		}
 	}
@@ -1703,7 +1703,7 @@ rbool readagt(fc_type fc, rbool diag)
 /* If diag==1, then extra diagnostic information is preserved */
 {
 	agx_file = 0;
-	mem_descr = NULL;
+	mem_descr = nullptr;
 	build_fixchar();
 	init_dict();
 	if (!read_da1(fc, diag)) return 0; /* Couldn't open DA1 file */
diff --git a/engines/glk/agt/agxfile.cpp b/engines/glk/agt/agxfile.cpp
index 6a2d331518..ed3f967046 100644
--- a/engines/glk/agt/agxfile.cpp
+++ b/engines/glk/agt/agxfile.cpp
@@ -481,7 +481,7 @@ static file_info fi_creat[] = {
 };
 
 static file_info fi_cmdhead[] = {
-	{FT_CMDPTR, DT_CMDPTR, NULL, 0},
+	{FT_CMDPTR, DT_CMDPTR, nullptr, 0},
 	r(FT_INT16, xx, cmd_rec, actor),
 	r(FT_WORD, xx, cmd_rec, verbcmd), r(FT_WORD, xx, cmd_rec, nouncmd),
 	r(FT_WORD, xx, cmd_rec, objcmd), r(FT_WORD, xx, cmd_rec, prep),
@@ -507,7 +507,7 @@ static file_info fi_descptr[] = {
 };
 
 static file_info fi_tline[] = {
-	{FT_TLINE, xx, NULL, 0},
+	{FT_TLINE, xx, nullptr, 0},
 	endrec
 };
 
@@ -556,7 +556,7 @@ static file_info fi_flagrec[] = { /* Ext R2-R2 */
 static void set_endrec(file_info *fi, int index) {
 	fi[index].ftype = FT_END;
 	fi[index].dtype = 0;
-	fi[index].ptr = NULL;
+	fi[index].ptr = nullptr;
 	fi[index].offset = 0;
 }
 
@@ -576,10 +576,10 @@ const char base_nostr[] = "no";
 
 static void conv_fstr(const char **s, rbool yes, rbool to_intern) {
 	if (to_intern) {  /* Convert to internal form */
-		assert(*s != NULL);
+		assert(*s != nullptr);
 		if (*s == static_str) *s = yes ? base_yesstr : base_nostr;
 	} else { /* convert to external form */
-		if (*s == NULL || *s == base_yesstr || *s == base_nostr)
+		if (*s == nullptr || *s == base_yesstr || *s == base_nostr)
 			*s = static_str;
 	}
 }
@@ -605,7 +605,7 @@ static void fix_objflag_str(rbool to_intern) {
 static long descr_ofs;
 
 void agx_close_descr(void) {
-	if (mem_descr != NULL)
+	if (mem_descr != nullptr)
 		rfree(mem_descr);
 	else if (descr_ofs != -1)
 		buffclose(); /* This closes the whole AGX file */
@@ -616,10 +616,10 @@ descr_line *agx_read_descr(long start, long size) {
 	descr_line *txt;
 	char *buff;
 
-	if (size <= 0) return NULL;
+	if (size <= 0) return nullptr;
 
-	if (mem_descr == NULL && descr_ofs != -1)
-		buff = (char *)read_recblock(NULL, FT_CHAR, size,
+	if (mem_descr == nullptr && descr_ofs != -1)
+		buff = (char *)read_recblock(nullptr, FT_CHAR, size,
 		                             descr_ofs + start, size * ft_leng[FT_CHAR]);
 	else
 		buff = mem_descr + start;
@@ -633,7 +633,7 @@ descr_line *agx_read_descr(long start, long size) {
 	for (line = 1; line < len;) /* Determine where each of the lines is */
 		if (buff[i++] == 0)
 			txt[line++] = buff + i;
-	txt[len] = NULL; /* Mark the end of the array */
+	txt[len] = nullptr; /* Mark the end of the array */
 	return txt;
 }
 
@@ -735,10 +735,10 @@ typedef struct {  /* Entries in the index header of the AGX file */
 } index_rec;
 
 static file_info fi_index[] = {
-	{FT_UINT32, DT_DEFAULT, NULL, offsetof(index_rec, file_offset)},
-	{FT_UINT32, DT_DEFAULT, NULL, offsetof(index_rec, blocksize)},
-	{FT_UINT32, DT_DEFAULT, NULL, offsetof(index_rec, numrec)},
-	{FT_UINT32, DT_DEFAULT, NULL, offsetof(index_rec, recsize)},
+	{FT_UINT32, DT_DEFAULT, nullptr, offsetof(index_rec, file_offset)},
+	{FT_UINT32, DT_DEFAULT, nullptr, offsetof(index_rec, blocksize)},
+	{FT_UINT32, DT_DEFAULT, nullptr, offsetof(index_rec, numrec)},
+	{FT_UINT32, DT_DEFAULT, nullptr, offsetof(index_rec, recsize)},
 	endrec
 };
 
@@ -766,16 +766,16 @@ struct file_head_rec  {
 };
 
 static file_info fi_header[] = {
-	{FT_UINT32, DT_LONG, NULL, offsetof(file_head_rec, fileid)}, /* File ID */
-	{FT_BYTE, DT_DEFAULT, NULL, offsetof(file_head_rec, ver_own)}, /* Owner */
-	{FT_BYTE, DT_DEFAULT, NULL, offsetof(file_head_rec, version)}, /* Version */
-	{FT_BYTE, DT_DEFAULT, NULL, offsetof(file_head_rec, ext_own)}, /*Ext owner*/
-	{FT_BYTE, DT_DEFAULT, NULL, offsetof(file_head_rec, extnum)}, /* Ext vers */
-	{FT_BYTE, DT_DEFAULT, NULL, offsetof(file_head_rec, eol_chk1)},
-	{FT_BYTE, DT_DEFAULT, NULL, offsetof(file_head_rec, eol_chk2)},
-	{FT_BYTE, DT_DEFAULT, NULL, offsetof(file_head_rec, fallback_ext)},
-	{FT_BYTE, DT_DEFAULT, NULL, offsetof(file_head_rec, res2)},
-	{FT_UINT32, DT_DEFAULT, NULL, offsetof(file_head_rec, res1)},
+	{FT_UINT32, DT_LONG, nullptr, offsetof(file_head_rec, fileid)}, /* File ID */
+	{FT_BYTE, DT_DEFAULT, nullptr, offsetof(file_head_rec, ver_own)}, /* Owner */
+	{FT_BYTE, DT_DEFAULT, nullptr, offsetof(file_head_rec, version)}, /* Version */
+	{FT_BYTE, DT_DEFAULT, nullptr, offsetof(file_head_rec, ext_own)}, /*Ext owner*/
+	{FT_BYTE, DT_DEFAULT, nullptr, offsetof(file_head_rec, extnum)}, /* Ext vers */
+	{FT_BYTE, DT_DEFAULT, nullptr, offsetof(file_head_rec, eol_chk1)},
+	{FT_BYTE, DT_DEFAULT, nullptr, offsetof(file_head_rec, eol_chk2)},
+	{FT_BYTE, DT_DEFAULT, nullptr, offsetof(file_head_rec, fallback_ext)},
+	{FT_BYTE, DT_DEFAULT, nullptr, offsetof(file_head_rec, res2)},
+	{FT_UINT32, DT_DEFAULT, nullptr, offsetof(file_head_rec, res1)},
 	endrec
 };
 
@@ -803,7 +803,7 @@ int read_agx(fc_type fc, rbool diag) {
 	int index_start;
 
 	agx_file = 1;
-	fsize = buffopen(fc, fAGX, 16, NULL, 1);
+	fsize = buffopen(fc, fAGX, 16, nullptr, 1);
 	if (fsize == 0) {
 		agx_file = 0;
 		return 0;
@@ -861,7 +861,7 @@ int read_agx(fc_type fc, rbool diag) {
 	/* This assumes that the file is long enough to absorb any
 	   'extra' blocks we read in in early versions with fewer blocks. */
 	/* (Right now, this must be true: the next block alone is big enough) */
-	index = (index_rec *)read_recarray(NULL, sizeof(index_rec), AGX_NUMBLOCK,
+	index = (index_rec *)read_recarray(nullptr, sizeof(index_rec), AGX_NUMBLOCK,
 	                                   fi_index, "File Index", index_start,
 	                                   index_recsize * AGX_NUMBLOCK);
 
@@ -926,33 +926,33 @@ int read_agx(fc_type fc, rbool diag) {
 
 	/* Need to read in ss_array before rooms/nouns/creatures */
 	ss_size = ss_end = index[13].numrec;
-	static_str = (char *)read_recblock(NULL, FT_CHAR,
+	static_str = (char *)read_recblock(nullptr, FT_CHAR,
 	                                   index[13].numrec, index[13].file_offset,
 	                                   index[13].blocksize);
 
 	synptr = syntbl_size = index[19].numrec;
-	syntbl = (word *)read_recblock(NULL, FT_WORD, index[19].numrec, index[19].file_offset,
+	syntbl = (word *)read_recblock(nullptr, FT_WORD, index[19].numrec, index[19].file_offset,
 	                               index[19].blocksize);
 
 	maxroom = first_room + index[2].numrec - 1;
 	set_roomdesc(fi_room);
-	room = (room_rec *)read_recarray(NULL, sizeof(room_rec), index[2].numrec,
+	room = (room_rec *)read_recarray(nullptr, sizeof(room_rec), index[2].numrec,
 	                                 fi_room, "Room", index[2].file_offset, index[2].blocksize);
 
 	maxnoun = first_noun + index[3].numrec - 1;
 	set_noundesc(fi_noun);
-	noun = (noun_rec *)read_recarray(NULL, sizeof(noun_rec), index[3].numrec,
+	noun = (noun_rec *)read_recarray(nullptr, sizeof(noun_rec), index[3].numrec,
 	                                 fi_noun, "Noun", index[3].file_offset, index[3].blocksize);
 
 	last_obj = maxcreat = first_creat + index[4].numrec - 1;
 	set_creatdesc(fi_creat);
-	creature = (creat_rec *)read_recarray(NULL, sizeof(creat_rec), index[4].numrec,
+	creature = (creat_rec *)read_recarray(nullptr, sizeof(creat_rec), index[4].numrec,
 	                                      fi_creat, "Creature", index[4].file_offset,
 	                                      index[4].blocksize);
 
 	last_cmd = index[5].numrec;
 	set_cmdptr(fi_cmdhead);
-	command = (cmd_rec *)read_recarray(NULL, sizeof(cmd_rec), index[5].numrec,
+	command = (cmd_rec *)read_recarray(nullptr, sizeof(cmd_rec), index[5].numrec,
 	                                   fi_cmdhead, "Metacommand", index[5].file_offset,
 	                                   index[5].blocksize);
 	if (filehead.ext_own != 'R' && filehead.fallback_ext <= 1) {
@@ -961,33 +961,33 @@ int read_agx(fc_type fc, rbool diag) {
 	}
 
 	NUM_ERR = index[6].numrec;
-	err_ptr = (descr_ptr *)read_recarray(NULL, sizeof(descr_ptr), index[6].numrec,
+	err_ptr = (descr_ptr *)read_recarray(nullptr, sizeof(descr_ptr), index[6].numrec,
 	                                     fi_descptr, "Error Message", index[6].file_offset,
 	                                     index[6].blocksize);
 
 	last_message = index[7].numrec;
-	msg_ptr = (descr_ptr *)read_recarray(NULL, sizeof(descr_ptr), index[7].numrec,
+	msg_ptr = (descr_ptr *)read_recarray(nullptr, sizeof(descr_ptr), index[7].numrec,
 	                                     fi_descptr, "Message", index[7].file_offset,
 	                                     index[7].blocksize);
 
 	MaxQuestion = index[8].numrec;
-	question = answer = NULL;
-	quest_ptr = (descr_ptr *)read_recarray(NULL, sizeof(descr_ptr), index[8].numrec,
+	question = answer = nullptr;
+	quest_ptr = (descr_ptr *)read_recarray(nullptr, sizeof(descr_ptr), index[8].numrec,
 	                                       fi_descptr, "Question", index[8].file_offset,
 	                                       index[8].blocksize);
 	if (index[9].numrec != index[8].numrec)
 		fatal("File corrputed: questions and answers don't match.");
-	ans_ptr = (descr_ptr *)read_recarray(NULL, sizeof(descr_ptr), index[9].numrec,
+	ans_ptr = (descr_ptr *)read_recarray(nullptr, sizeof(descr_ptr), index[9].numrec,
 	                                     fi_descptr, "Answer", index[9].file_offset,
 	                                     index[9].blocksize);
 
 	MAX_USTR = index[10].numrec;
-	userstr = (tline *)read_recarray(NULL, sizeof(tline), index[10].numrec,
+	userstr = (tline *)read_recarray(nullptr, sizeof(tline), index[10].numrec,
 	                                 fi_tline, "User String", index[10].file_offset,
 	                                 index[10].blocksize);
 
 	MAX_SUB = index[14].numrec;
-	sub_name = (word *)read_recblock(NULL, FT_WORD, index[14].numrec, index[14].file_offset,
+	sub_name = (word *)read_recblock(nullptr, FT_WORD, index[14].numrec, index[14].file_offset,
 	                                 index[14].blocksize);
 
 	if (index[16].numrec > MAX_PIX) {
@@ -1001,7 +1001,7 @@ int read_agx(fc_type fc, rbool diag) {
 	              index[16].blocksize);
 
 	numglobal = index[17].numrec;
-	globalnoun = (word *)read_recblock(NULL, FT_WORD,
+	globalnoun = (word *)read_recblock(nullptr, FT_WORD,
 	                                   index[17].numrec, index[17].file_offset,
 	                                   index[17].blocksize);
 
@@ -1017,25 +1017,25 @@ int read_agx(fc_type fc, rbool diag) {
 
 
 	DVERB = index[15].numrec - old_base_verb - MAX_SUB;
-	synlist = (slist *)read_recblock(NULL, FT_SLIST, index[15].numrec, index[15].file_offset,
+	synlist = (slist *)read_recblock(nullptr, FT_SLIST, index[15].numrec, index[15].file_offset,
 	                                 index[15].blocksize);
 	correct_synlist();
 
 	num_comb = index[28].numrec;
-	comblist = (slist *)read_recblock(NULL, FT_SLIST, index[28].numrec, index[28].file_offset,
+	comblist = (slist *)read_recblock(nullptr, FT_SLIST, index[28].numrec, index[28].file_offset,
 	                                  index[28].blocksize);
 
 	num_prep = index[29].numrec;
-	userprep = (slist *)read_recblock(NULL, FT_SLIST, index[29].numrec, index[29].file_offset,
+	userprep = (slist *)read_recblock(nullptr, FT_SLIST, index[29].numrec, index[29].file_offset,
 	                                  index[29].blocksize);
 
 	/* dicstr must be read in before dict */
 	dictstrsize = dictstrptr = index[20].numrec;
-	dictstr = (char *)read_recblock(NULL, FT_CHAR, index[20].numrec, index[20].file_offset,
+	dictstr = (char *)read_recblock(nullptr, FT_CHAR, index[20].numrec, index[20].file_offset,
 	                                index[20].blocksize);
 
 	dp = index[21].numrec;
-	dict = (char **)read_recblock(NULL, FT_DICTPTR,
+	dict = (char **)read_recblock(nullptr, FT_DICTPTR,
 	                              index[21].numrec, index[21].file_offset,
 	                              index[21].blocksize);
 
@@ -1048,20 +1048,20 @@ int read_agx(fc_type fc, rbool diag) {
 	}
 
 	maxpict = index[23].numrec;
-	pictlist = (filename *)read_recblock(NULL, FT_STR, index[23].numrec, index[23].file_offset,
+	pictlist = (filename *)read_recblock(nullptr, FT_STR, index[23].numrec, index[23].file_offset,
 	                                     index[23].blocksize);
 	maxpix = index[24].numrec;
-	pixlist = (filename *)read_recblock(NULL, FT_STR, index[24].numrec, index[24].file_offset,
+	pixlist = (filename *)read_recblock(nullptr, FT_STR, index[24].numrec, index[24].file_offset,
 	                                    index[24].blocksize);
 	maxfont = index[25].numrec;
-	fontlist = (filename *)read_recblock(NULL, FT_STR, index[25].numrec, index[25].file_offset,
+	fontlist = (filename *)read_recblock(nullptr, FT_STR, index[25].numrec, index[25].file_offset,
 	                                     index[25].blocksize);
 	maxsong = index[26].numrec;
-	songlist = (filename *)read_recblock(NULL, FT_STR, index[26].numrec, index[26].file_offset,
+	songlist = (filename *)read_recblock(nullptr, FT_STR, index[26].numrec, index[26].file_offset,
 	                                     index[26].blocksize);
 
 	vm_size = index[27].numrec;
-	verbinfo = (verbentry_rec *)read_recarray(NULL, sizeof(verbentry_rec), index[27].numrec,
+	verbinfo = (verbentry_rec *)read_recarray(nullptr, sizeof(verbentry_rec), index[27].numrec,
 	           fi_verbentry, "Menu Vocabulary", index[27].file_offset,
 	           index[27].blocksize);
 
@@ -1072,13 +1072,13 @@ int read_agx(fc_type fc, rbool diag) {
 	if (index[31].numrec != (uint32)objextsize(1))
 		fatal("Object property block not of the correct size.");
 
-	objflag = (uchar *)read_recblock(NULL, FT_BYTE, index[30].numrec, index[30].file_offset,
+	objflag = (uchar *)read_recblock(nullptr, FT_BYTE, index[30].numrec, index[30].file_offset,
 	                                 index[30].blocksize);
-	objprop = (long *)read_recblock(NULL, FT_INT32, index[31].numrec, index[31].file_offset,
+	objprop = (long *)read_recblock(nullptr, FT_INT32, index[31].numrec, index[31].file_offset,
 	                                index[31].blocksize);
 
 	oflag_cnt = index[32].numrec;
-	attrtable = (attrdef_rec *)read_recarray(NULL, sizeof(attrdef_rec), index[32].numrec,
+	attrtable = (attrdef_rec *)read_recarray(nullptr, sizeof(attrdef_rec), index[32].numrec,
 	            fi_attrrec, "Object Flag Table",
 	            index[32].file_offset,
 	            index[32].blocksize);
@@ -1086,7 +1086,7 @@ int read_agx(fc_type fc, rbool diag) {
 	   block 36 has been read in. */
 
 	oprop_cnt = index[33].numrec;
-	proptable = (propdef_rec *)read_recarray(NULL, sizeof(propdef_rec), index[33].numrec,
+	proptable = (propdef_rec *)read_recarray(nullptr, sizeof(propdef_rec), index[33].numrec,
 	            fi_proprec, "Object Property Table",
 	            index[33].file_offset,
 	            index[33].blocksize);
@@ -1095,29 +1095,29 @@ int read_agx(fc_type fc, rbool diag) {
 		/* Non-standard extension */
 //    int i;
 		for (i = 0; i < oflag_cnt; i++) /* These are converted later */
-			attrtable[i].ystr = NULL;
-		attrtable[i].nstr = NULL;
+			attrtable[i].ystr = nullptr;
+		attrtable[i].nstr = nullptr;
 		for (i = 0; i < oprop_cnt; i++)
 			proptable[i].str_cnt = 0;
 		propstr_size = 0;
-		propstr = NULL;
-		vartable = NULL;
-		flagtable = NULL;
+		propstr = nullptr;
+		vartable = nullptr;
+		flagtable = nullptr;
 	} else { /* Normal case */
 		propstr_size = index[34].numrec;
-		propstr = (const char **)read_recblock(NULL, FT_STR, index[34].numrec,
+		propstr = (const char **)read_recblock(nullptr, FT_STR, index[34].numrec,
 		                                       index[34].file_offset, index[34].blocksize);
 
 		if (index[35].numrec && index[35].numrec != (uint32)VAR_NUM + 1)
 			fatal("AGX file corrupted: variable itemization table size mismatch.");
-		vartable = (vardef_rec *)read_recarray(NULL, sizeof(vardef_rec), index[35].numrec,
+		vartable = (vardef_rec *)read_recarray(nullptr, sizeof(vardef_rec), index[35].numrec,
 		                                       fi_varrec, "Variable Itemization Table",
 		                                       index[35].file_offset,
 		                                       index[35].blocksize);
 
 		if (index[36].numrec && index[36].numrec != (uint32)FLAG_NUM + 1)
 			fatal("AGX file corrupted: flag itemization table size mismatch.");
-		flagtable = (flagdef_rec *)read_recarray(NULL, sizeof(flagdef_rec), index[36].numrec,
+		flagtable = (flagdef_rec *)read_recarray(nullptr, sizeof(flagdef_rec), index[36].numrec,
 		            fi_flagrec, "Flag Itemization Table",
 		            index[36].file_offset,
 		            index[36].blocksize);
@@ -1133,14 +1133,14 @@ int read_agx(fc_type fc, rbool diag) {
 	   agxread() but during play */
 	if ((long)index[11].blocksize <= descr_maxmem) {
 		/* ... if we decided to load descriptions into memory */
-		mem_descr = (char *)read_recblock(NULL, FT_CHAR, index[11].numrec,
+		mem_descr = (char *)read_recblock(nullptr, FT_CHAR, index[11].numrec,
 		                                  index[11].file_offset,
 		                                  index[11].blocksize);
 		buffclose(); /* Don't need to keep it open */
 		descr_ofs = -1;
 	} else {
 		descr_ofs = index[11].file_offset;
-		mem_descr = NULL;
+		mem_descr = nullptr;
 	}
 	reinit_dict();
 	return 1;
@@ -1239,8 +1239,8 @@ void agx_create(fc_type fc) {
 
 	/* This writes random data to the file; their only purpose
 	   is to prevent problems with seeking beyond the end of file */
-	write_recarray(NULL, sizeof(file_head_rec), 1, fi_header, 0);
-	write_recarray(NULL, sizeof(index_rec), AGX_NUMBLOCK, fi_index, 16);
+	write_recarray(nullptr, sizeof(file_head_rec), 1, fi_header, 0);
+	write_recarray(nullptr, sizeof(index_rec), AGX_NUMBLOCK, fi_index, 16);
 
 	old_base_verb = BASE_VERB; /* This will be constant for any given version
 				  of the interpreter, but may change across
@@ -1297,7 +1297,7 @@ static void agx_finish_index(void) {
 	gindex[6].numrec = NUM_ERR;
 	gindex[7].numrec = last_message;
 	gindex[8].numrec = gindex[9].numrec = MaxQuestion;
-	if (userstr != NULL)
+	if (userstr != nullptr)
 		gindex[10].numrec = MAX_USTR;
 	else gindex[10].numrec = 0;
 	gindex[13].numrec = ss_end;
@@ -1341,18 +1341,18 @@ void write_descr(descr_ptr *dp_, descr_line *txt) {
 	char *buff, *buffptr, *src;
 
 	size = 0;
-	if (txt == NULL) {
+	if (txt == nullptr) {
 		dp_->start = 0;
 		dp_->size = 0;
 		return;
 	}
 
-	for (i = 0; txt[i] != NULL; i++) /* Compute size */
+	for (i = 0; txt[i] != nullptr; i++) /* Compute size */
 		size += strlen(txt[i]) + 1; /* Remember trailing \0 */
 	buff = (char *)rmalloc(sizeof(char) * size);
 
 	buffptr = buff;
-	for (i = 0; txt[i] != NULL; i++) {
+	for (i = 0; txt[i] != nullptr; i++) {
 		for (src = txt[i]; *src != 0; src++, buffptr++)
 			*buffptr = *src;
 		*buffptr++ = 0;
@@ -1422,7 +1422,7 @@ void agx_write(void) {
 	write_recarray(ans_ptr, sizeof(descr_ptr), gindex[9].numrec,
 	               fi_descptr, gindex[9].file_offset);
 
-	if (userstr != NULL)
+	if (userstr != nullptr)
 		write_recarray(userstr, sizeof(tline), gindex[10].numrec,
 		               fi_tline, gindex[10].file_offset);
 
diff --git a/engines/glk/agt/auxfile.cpp b/engines/glk/agt/auxfile.cpp
index 58f45202c1..e76c594aea 100644
--- a/engines/glk/agt/auxfile.cpp
+++ b/engines/glk/agt/auxfile.cpp
@@ -175,7 +175,7 @@ static void cfg_option(int optnum, char *optstr[], rbool lastpass)
 {
 	rbool setflag;
 
-	if (optnum == 0 || optstr[0] == NULL) return;
+	if (optnum == 0 || optstr[0] == nullptr) return;
 
 	if (strncasecmp(optstr[0], "no_", 3) == 0) {
 		optstr[0] += 3;
@@ -226,19 +226,19 @@ rbool parse_config_line(char *buff, rbool lastpass) {
 	int optc;
 
 	optc = 0;
-	opt[0] = NULL;
+	opt[0] = nullptr;
 	for (p = buff; *p; p++) {
 		if (isspace(*p)) {  /* Whitespace */
-			if (opt[optc] != NULL) { /*... which means this is the first whitespace */
+			if (opt[optc] != nullptr) { /*... which means this is the first whitespace */
 				if (optc == 50) return 0; /* Too many */
-				opt[++optc] = NULL;
+				opt[++optc] = nullptr;
 			}
 			*p = 0;
 		} else  /* No whitespace */
-			if (opt[optc] == NULL) /* ...this is the first non-whitespace */
+			if (opt[optc] == nullptr) /* ...this is the first non-whitespace */
 				opt[optc] = p;
 	}
-	if (opt[optc] != NULL) opt[++optc] = NULL;
+	if (opt[optc] != nullptr) opt[++optc] = nullptr;
 	cfg_option(optc, opt, lastpass);
 	return 1;
 }
@@ -293,7 +293,7 @@ void read_opt(fc_type fc) {
 	genfile optfile;
 
 	have_opt = 0;
-	optfile = openbin(fc, fOPT, NULL, 0);
+	optfile = openbin(fc, fOPT, nullptr, 0);
 	if (filevalid(optfile, fOPT)) {
 		if (!binread(optfile, opt_data, 14, 1, &errstr))
 			fatal("Invalid OPT file.");
@@ -341,14 +341,14 @@ descr_line *read_ttl(fc_type fc) {
 	int i, j, height;
 	descr_line *buff;
 
-	ttlfile = openfile(fc, fTTL, NULL, 0);
+	ttlfile = openfile(fc, fTTL, nullptr, 0);
 	/* "Warning: Could not open title file '%s'." */
-	if (!filevalid(ttlfile, fTTL)) return NULL;
+	if (!filevalid(ttlfile, fTTL)) return nullptr;
 	build_fixchar();
 
 	buff = (descr_line *)rmalloc(sizeof(descr_line));
 	i = 0;
-	while (NULL != (buff[i] = readln(ttlfile, NULL, 0))) {
+	while (nullptr != (buff[i] = readln(ttlfile, nullptr, 0))) {
 		if (strncmp(buff[i], "END OF FILE", 11) == 0) break;
 		else if (aver >= AGT18 && aver <= AGT18MAX && check_dollar(buff[i]))
 			statusmode = 4;
@@ -357,14 +357,14 @@ descr_line *read_ttl(fc_type fc) {
 				buff[i][j] = fixchar[(uchar)buff[i][j]];
 			/* Advance i and set the next pointer to NULL */
 			buff = (descr_line *)rrealloc(buff, sizeof(descr_line) * (++i + 1));
-			buff[i] = NULL;
+			buff[i] = nullptr;
 		}
 		rfree(buff[i]);
 	}
 	readclose(ttlfile);
 
 	rfree(buff[i]);
-	while (buff[i] == NULL || strlen(buff[i]) <= 1) { /* Discard 'empty' lines */
+	while (buff[i] == nullptr || strlen(buff[i]) <= 1) { /* Discard 'empty' lines */
 		if (i == 0) break;
 		rfree(buff[i]);
 		i--;
@@ -381,8 +381,8 @@ descr_line *read_ttl(fc_type fc) {
 
 void free_ttl(descr_line *title) {
 	int i;
-	if (title == NULL) return;
-	for (i = 0; title[i] != NULL; i++)
+	if (title == nullptr) return;
+	for (i = 0; title[i] != nullptr; i++)
 		rfree(title[i]);
 	rfree(title);
 }
@@ -416,7 +416,7 @@ void add_verbrec(const char *verb_line, rbool addnew) {
 
 	s[0] = verbStr.firstChar();
 	s[1] = 0;
-	verbinfo[vm_size].objnum = strtol(s, NULL, 10) - 1;
+	verbinfo[vm_size].objnum = strtol(s, nullptr, 10) - 1;
 
 	verbStr.deleteChar(0);
 	verbStr.deleteChar(0);
@@ -452,7 +452,7 @@ void init_verbrec(void)
 /* Fill in vnum field */
 /* UNDO, RESTART, MENU  */
 {
-	verbinfo = NULL;
+	verbinfo = nullptr;
 	vm_size = 0;
 	newindex = 0;
 	if (freeze_mode) newindex = 1;  /* Don't include MENU option if we can't
@@ -469,7 +469,7 @@ void read_voc(fc_type fc) {
 	genfile vocfile;
 
 	init_verbrec();
-	vocfile = openfile(fc, fVOC, NULL, 0);
+	vocfile = openfile(fc, fVOC, nullptr, 0);
 	if (filevalid(vocfile, fVOC)) { /* Vocabulary file exists */
 		while (readln(vocfile, linbuf, 79))
 			add_verbrec(linbuf, 0);
@@ -490,16 +490,16 @@ void read_voc(fc_type fc) {
 static genfile insfile = BAD_TEXTFILE;
 static char *ins_buff;
 
-static descr_line *ins_descr = NULL;
+static descr_line *ins_descr = nullptr;
 static int ins_line;  /* Current instruction line */
 
 
 /* Return 1 on success, 0 on failure */
 rbool open_ins_file(fc_type fc, rbool report_error) {
-	ins_buff = NULL;
+	ins_buff = nullptr;
 	ins_line = 0;
 
-	if (ins_descr != NULL) return 1;
+	if (ins_descr != nullptr) return 1;
 
 	if (filevalid(insfile, fINS)) {
 		textrewind(insfile);
@@ -508,7 +508,7 @@ rbool open_ins_file(fc_type fc, rbool report_error) {
 
 	if (agx_file) {
 		ins_descr = read_descr(ins_ptr.start, ins_ptr.size);
-		if (ins_descr != NULL) return 1;
+		if (ins_descr != nullptr) return 1;
 
 		/* Note that if the AGX file doesn't contain an INS block, we
 		   don't immediatly give up but try opening <fname>.INS */
@@ -517,19 +517,19 @@ rbool open_ins_file(fc_type fc, rbool report_error) {
 	insfile = openfile(fc, fINS,
 	                   report_error
 	                   ? "Sorry, Instructions aren't available for this game"
-	                   : NULL,
+	                   : nullptr,
 	                   0);
 	return (filevalid(insfile, fINS));
 }
 
 char *read_ins_line(void) {
 	if (ins_descr) {
-		if (ins_descr[ins_line] != NULL)
+		if (ins_descr[ins_line] != nullptr)
 			return ins_descr[ins_line++];
-		else return NULL;
+		else return nullptr;
 	} else {
 		rfree(ins_buff);
-		ins_buff = readln(insfile, NULL, 0);
+		ins_buff = readln(insfile, nullptr, 0);
 		return ins_buff;
 	}
 }
@@ -537,7 +537,7 @@ char *read_ins_line(void) {
 void close_ins_file(void) {
 	if (ins_descr) {
 		free_descr(ins_descr);
-		ins_descr = NULL;
+		ins_descr = nullptr;
 	} else if (filevalid(insfile, fINS)) {
 		rfree(ins_buff);
 		readclose(insfile);
@@ -553,15 +553,15 @@ descr_line *read_ins(fc_type fc) {
 	int i;
 
 	i = 0;
-	txt = NULL;
+	txt = nullptr;
 	if (open_ins_file(fc, 0)) {  /* Instruction file exists */
-		while (NULL != (buff = read_ins_line())) {
+		while (nullptr != (buff = read_ins_line())) {
 			/* Enlarge txt; we use (i+2) here to leave space for the trailing \0 */
 			txt = (descr_line *)rrealloc(txt, sizeof(descr_ptr) * (i + 2));
 			txt[i++] = rstrdup(buff);
 		}
-		if (txt != NULL)
-			txt[i] = 0; /* There is space for this since we used (i+2) above */
+		if (txt != nullptr)
+			txt[i] = nullptr; /* There is space for this since we used (i+2) above */
 		close_ins_file();
 	}
 	return txt;
@@ -570,8 +570,8 @@ descr_line *read_ins(fc_type fc) {
 
 void free_ins(descr_line *instr) {
 	int i;
-	if (instr == NULL) return;
-	for (i = 0; instr[i] != NULL; i++)
+	if (instr == nullptr) return;
+	for (i = 0; instr[i] != nullptr; i++)
 		rfree(instr[i]);
 	rfree(instr);
 }
diff --git a/engines/glk/agt/debugcmd.cpp b/engines/glk/agt/debugcmd.cpp
index c5b9106881..32998f4cf3 100644
--- a/engines/glk/agt/debugcmd.cpp
+++ b/engines/glk/agt/debugcmd.cpp
@@ -249,7 +249,7 @@ static void edit_str() {
 	char buff[10];
 	char *tmpstr;
 
-	if (MAX_USTR == 0 || userstr == NULL) {
+	if (MAX_USTR == 0 || userstr == nullptr) {
 		writeln("This game doesn't contain any user strings");
 		return;
 	}
diff --git a/engines/glk/agt/disassemble.cpp b/engines/glk/agt/disassemble.cpp
index cd24c48f37..f0822483ae 100644
--- a/engines/glk/agt/disassemble.cpp
+++ b/engines/glk/agt/disassemble.cpp
@@ -42,8 +42,8 @@ static void print_msg(descr_ptr dptr) {
 	descr_line *txt;
 
 	txt = read_descr(dptr.start, dptr.size);
-	if (txt != NULL) {
-		for (j = 0; txt[j] != NULL; j++) {
+	if (txt != nullptr) {
+		for (j = 0; txt[j] != nullptr; j++) {
 			dbgprintf("\n");
 			debugout(txt[j]);
 		}
@@ -85,7 +85,7 @@ void print_special_obj(int i)
 		dval = 0; /* Silence compiler warnings. */
 		fatal("INTERNAL ERROR: Invalid *dval* in print_special_obj.");
 	}
-	if (dbgflagptr == NULL)
+	if (dbgflagptr == nullptr)
 		/* This determines whether we are linked with agtout or agil */
 		return;
 	s = getname(dval);
@@ -147,10 +147,10 @@ int argout(int dtype, int dval, int optype) {
 				dbgprintf("RoomFlag%d", dval);
 				break;
 			case AGT_QUEST:  /* Question */
-				if (dval <= MaxQuestion && dval >= 1 && question != NULL) {
+				if (dval <= MaxQuestion && dval >= 1 && question != nullptr) {
 					dbgprintf("\nQ%d:%s\n", dval, question[dval - 1]);
 					dbgprintf("[A:%s]", answer[dval - 1]);
-				} else if (quest_ptr != NULL) {
+				} else if (quest_ptr != nullptr) {
 					dbgprintf("\nQ%d: ", dval);
 					print_msg(quest_ptr[dval - 1]);
 					dbgprintf("[A:");
@@ -158,7 +158,7 @@ int argout(int dtype, int dval, int optype) {
 				}
 				break;
 			case AGT_MSG: /* Message */
-				if (dval > last_message || dval < 1 || msg_ptr == NULL)
+				if (dval > last_message || dval < 1 || msg_ptr == nullptr)
 					dbgprintf("ILLEGAL MESSAGE");
 				else {
 					dbgprintf("(Msg%d)", dval);
@@ -167,7 +167,7 @@ int argout(int dtype, int dval, int optype) {
 				}
 				break;
 			case AGT_ERR: /* Message */
-				if (dval > NUM_ERR || dval < 1 || err_ptr == NULL)
+				if (dval > NUM_ERR || dval < 1 || err_ptr == nullptr)
 					dbgprintf("ILLEGAL MESSAGE");
 				else {
 					dbgprintf("(Std%d)", dval);
@@ -176,7 +176,7 @@ int argout(int dtype, int dval, int optype) {
 				}
 				break;
 			case AGT_STR: /* String */
-				if (dval - 1 >= MAX_USTR || userstr == NULL)
+				if (dval - 1 >= MAX_USTR || userstr == nullptr)
 					dbgprintf("ILLEGAL STRING");
 				else
 					dbgprintf("\nStr%d:%s", dval, userstr[dval]);
diff --git a/engines/glk/agt/exec.cpp b/engines/glk/agt/exec.cpp
index 90583e3fa5..5e88bb82b0 100644
--- a/engines/glk/agt/exec.cpp
+++ b/engines/glk/agt/exec.cpp
@@ -236,7 +236,7 @@ static void num_name_func(parse_rec *obj_rec, char *fill_buff, word prev_adj)
 {
 	word w;
 
-	if (obj_rec == NULL) {
+	if (obj_rec == nullptr) {
 		strcpy(fill_buff, "");
 		return;
 	}
@@ -369,7 +369,7 @@ static int wordcode_match(const char **pvarname, char *fill_buff,
 	if (context == MSG_PARSE) {
 		/* The only special subsitution allowed is $word$. */
 		if (match_str(pvarname, "WORD$")) {
-			if (pword == NULL) fill_buff[0] = 0;
+			if (pword == nullptr) fill_buff[0] = 0;
 			else rstrncpy(fill_buff, pword, FILL_SIZE);
 			return 1;
 		} else return 0;
@@ -489,7 +489,7 @@ static char *wordvar_match(const char **pvarname, char match_type,
 	start = *pvarname;
 	if (match_type == '$') {
 		i = wordcode_match(pvarname, fill_buff, context, pword);
-		if (i == 0) return NULL;
+		if (i == 0) return nullptr;
 		/* Now need to fix capitalization */
 		switch (capstate(start)) {
 		case 0:
@@ -506,18 +506,18 @@ static char *wordvar_match(const char **pvarname, char match_type,
 	} else {  /* So match type is '#' */
 		if (match_str(pvarname, "VAR")) {
 			hold_val = extract_number(pvarname, VAR_NUM, '#');
-			if (hold_val < 0) return NULL;
+			if (hold_val < 0) return nullptr;
 			hold_val = agt_var[hold_val];
 		} else if (match_str(pvarname, "CNT") ||
 		           match_str(pvarname, "CTR")) {
 			hold_val = extract_number(pvarname, CNT_NUM, '#');
-			if (hold_val < 0) return NULL;
+			if (hold_val < 0) return nullptr;
 			hold_val = cnt_val(agt_counter[hold_val]);
 		} else if (match_str(pvarname, "PROP")) {
 			extract_prop_val(pvarname, &hold_prop, &hold_val, 1, '#');
 			if (hold_prop == BAD_PROP) hold_val = 0;
 		} else
-			return NULL;
+			return nullptr;
 
 		/* Now to convert hold_val into a string */
 		sprintf(fill_buff, "%d", hold_val);
@@ -558,7 +558,7 @@ static char  *format_line(const char *s, int context, const char *pword)
 			oldp = p++;  /* Save old value in case we are wrong and then
 		  increment p */
 			fill_word = wordvar_match(&p, fill_type, context, pword);
-			if (fill_word == NULL) {
+			if (fill_word == nullptr) {
 				/*i.e. no match-- so just copy it verbatim */
 				t[i++] = fill_type;
 				just_seen_adj = 0;
@@ -617,9 +617,9 @@ static void gen_print_descr(descr_ptr dp_, rbool nl,
 	textbold = 0;
 	agt_par(1);
 	txt = read_descr(dp_.start, dp_.size);
-	if (txt != NULL)
-		for (j = 0; txt[j] != NULL; j++)
-			lineout(txt[j], nl || (txt[j + 1] != NULL), context, pword);
+	if (txt != nullptr)
+		for (j = 0; txt[j] != nullptr; j++)
+			lineout(txt[j], nl || (txt[j + 1] != nullptr), context, pword);
 	free_descr(txt);
 	agt_par(0);
 	agt_textcolor(7);
@@ -627,7 +627,7 @@ static void gen_print_descr(descr_ptr dp_, rbool nl,
 }
 
 void print_descr(descr_ptr dp_, rbool nl) {
-	gen_print_descr(dp_, nl, MSG_DESC, NULL);
+	gen_print_descr(dp_, nl, MSG_DESC, nullptr);
 }
 
 void quote(int msgnum) {
@@ -637,11 +637,11 @@ void quote(int msgnum) {
 	int len;
 
 	txt = read_descr(msg_ptr[msgnum - 1].start, msg_ptr[msgnum - 1].size);
-	if (txt != NULL) {
-		for (len = 0; txt[len] != NULL; len++);
+	if (txt != nullptr) {
+		for (len = 0; txt[len] != nullptr; len++);
 		qptr = (char **)rmalloc(len * sizeof(char *));
 		for (i = 0; i < len; i++)
-			qptr[i] = format_line(txt[i], MSG_DESC, NULL);
+			qptr[i] = format_line(txt[i], MSG_DESC, nullptr);
 		free_descr(txt);
 		textbox(qptr, len, TB_BORDER | TB_CENTER);
 		rfree(qptr);
@@ -692,9 +692,9 @@ void gen_sysmsg(int msgid, const char *s, int context, const char *pword)
 
 	if (DEBUG_SMSG) rprintf("\nSTD %d", msgid);
 
-	use_game_msg = ((PURE_SYSMSG || s == NULL)
+	use_game_msg = ((PURE_SYSMSG || s == nullptr)
 	                && msgid != 0 && msgid <= NUM_ERR
-	                && err_ptr != NULL);
+	                && err_ptr != nullptr);
 
 	if (use_game_msg) {
 		/* Check for fall-back messages */
@@ -714,7 +714,7 @@ void gen_sysmsg(int msgid, const char *s, int context, const char *pword)
 	if (!use_game_msg) {
 		/* Either the game doesn't redefine the message, or we're ignoring
 		   redefinitions */
-		if (s == NULL) return;
+		if (s == nullptr) return;
 		pronoun_mode = 1;
 		lineout(s, nl, context, pword);
 		pronoun_mode = !PURE_PROSUB;
@@ -723,7 +723,7 @@ void gen_sysmsg(int msgid, const char *s, int context, const char *pword)
 
 
 void sysmsg(int msgid, const char *s) {
-	gen_sysmsg(msgid, s, MSG_RUN, NULL);
+	gen_sysmsg(msgid, s, MSG_RUN, nullptr);
 }
 
 
@@ -741,7 +741,7 @@ void alt_sysmsg(int msgid, const char *s, parse_rec *new_dobjrec, parse_rec *new
 	iobj = p_obj(new_iobjrec);
 	iobj_rec = new_iobjrec;
 
-	gen_sysmsg(msgid, s, MSG_RUN, NULL);
+	gen_sysmsg(msgid, s, MSG_RUN, nullptr);
 
 	dobj = save_dobj;
 	dobj_rec = save_dobjrec;
@@ -753,7 +753,7 @@ void alt_sysmsg(int msgid, const char *s, parse_rec *new_dobjrec, parse_rec *new
 void sysmsgd(int msgid, const char *s, parse_rec *new_dobjrec)
 /* Front end for sysmsg w/alternative direct object */
 {
-	alt_sysmsg(msgid, s, new_dobjrec, NULL);
+	alt_sysmsg(msgid, s, new_dobjrec, nullptr);
 }
 
 
@@ -797,33 +797,33 @@ static rbool check_answer(char *ans, long start, long size)
 		loop over them */
 
 	astr = read_descr(start, size);
-	if (astr == NULL) {
+	if (astr == nullptr) {
 		if (!PURE_ERROR)
 			writeln("GAME ERROR: Empty answer field.");
 		return 1;
 	}
 
 	match_mode = 0;
-	for (i = 0; astr[i] != NULL; i++)
-		if (strstr(astr[i], "OR") != NULL) {
+	for (i = 0; astr[i] != nullptr; i++)
+		if (strstr(astr[i], "OR") != nullptr) {
 			match_mode = 1;
 			break;
 		}
 
 	corr = ans;
-	for (i = 0; astr[i] != NULL; i++) { /* loop over all lines of the answer */
+	for (i = 0; astr[i] != nullptr; i++) { /* loop over all lines of the answer */
 		p = astr[i];
 		do {
 			q = strstr(p, "OR");
 			r = strstr(p, "AND");
-			if (q == NULL || (r != NULL && r < q)) q = r;
-			if (q == NULL) q = p + strlen(p); /* i.e. points at the concluding null */
+			if (q == nullptr || (r != nullptr && r < q)) q = r;
+			if (q == nullptr) q = p + strlen(p); /* i.e. points at the concluding null */
 			corr2 = match_string(corr, p, q - p);
-			if (corr2 == NULL && match_mode == 0) {
+			if (corr2 == nullptr && match_mode == 0) {
 				free_descr(astr);
 				return 0;
 			}
-			if (corr2 != NULL && match_mode == 1) {
+			if (corr2 != nullptr && match_mode == 1) {
 				free_descr(astr);
 				return 1;
 			}
@@ -847,12 +847,12 @@ rbool match_answer(char *ans, int anum) {
 
 	for (corr = ans; *corr != 0; corr++)
 		*corr = tolower(*corr);
-	if (answer != NULL) {
+	if (answer != nullptr) {
 		/* corr=strstr(ans,answer[anum]); */
 		corr = match_string(ans, answer[anum], strlen(answer[anum]));
 		rfree(ans);
-		if (corr == NULL) return 0;
-	} else if (ans_ptr != NULL) {
+		if (corr == nullptr) return 0;
+	} else if (ans_ptr != nullptr) {
 		ans_corr = check_answer(ans, ans_ptr[anum].start, ans_ptr[anum].size);
 		rfree(ans);
 		return ans_corr;
@@ -870,9 +870,9 @@ rbool ask_question(int qnum)
 	qnum--;
 
 	/* Now actually ask the question and compare the answers */
-	if (question != NULL)
+	if (question != nullptr)
 		writeln(question[qnum]);
-	else if (quest_ptr != NULL)
+	else if (quest_ptr != nullptr)
 		print_descr(quest_ptr[qnum], 1);
 	else {
 		writeln("INT ERR: Invalid question pointer");
@@ -893,12 +893,12 @@ long read_number(void) {
 
 	n = 1;
 	do {
-		if (n != 1) gen_sysmsg(218, "Please enter a *number*. ", MSG_MAIN, NULL);
+		if (n != 1) gen_sysmsg(218, "Please enter a *number*. ", MSG_MAIN, nullptr);
 		s = agt_readline(1);
 		n = strtol(s, &err, 10);
-		if (err == s) err = NULL;
+		if (err == s) err = nullptr;
 		rfree(s);
-	} while (err == NULL);
+	} while (err == nullptr);
 	return n;
 }
 
@@ -1001,7 +1001,7 @@ void look_room(void) {
 	compute_seen();
 	writeln("");
 	if (islit()) {
-		if (room[loc].name != NULL && room[loc].name[0] != 0 &&
+		if (room[loc].name != nullptr && room[loc].name[0] != 0 &&
 		        (!PURE_ROOMTITLE)) {
 			agt_textcolor(-1);  /* Emphasized text on */
 			writestr(room[loc].name);
@@ -1045,7 +1045,7 @@ static void run_autoverb(void) {
 
 	if (room[loc].autoverb != 0) {
 		v0 = verb_code(room[loc].autoverb);
-		(void)scan_metacommand(0, v0, 0, 0, 0, NULL);
+		(void)scan_metacommand(0, v0, 0, 0, 0, nullptr);
 	}
 	free_all_parserec();
 	vb = savevb;
@@ -1083,7 +1083,7 @@ static void creat_initdesc(void) {
 void listpictname(const char *s) {
 	static rbool first_pict = 1; /* True until we output first picture */
 
-	if (s == NULL) {
+	if (s == nullptr) {
 		if (!first_pict) writeln(""); /* Trailing newline */
 		first_pict = 1;
 		return;
@@ -1114,7 +1114,7 @@ void list_viewable(void)
 {
 	int i;
 
-	listpictname(NULL);
+	listpictname(nullptr);
 
 	if (room[loc].pict != 0)
 		listpictname("scene");
@@ -1128,7 +1128,7 @@ void list_viewable(void)
 	for (i = 0; i < maxpix; i++)
 		if (room[loc].PIX_bits & (1L << i))
 			listpictname(dict[pix_name[i]]);
-	listpictname(NULL);
+	listpictname(nullptr);
 }
 
 
@@ -1337,7 +1337,7 @@ static int save_vnum;
 static word save_prep;
 static parse_rec save_actor;
 static parse_rec save_obj;
-parse_rec *save_lnoun = NULL;
+parse_rec *save_lnoun = nullptr;
 
 
 
@@ -1350,7 +1350,7 @@ void exec(parse_rec *actor_, int vnum,
 	if (vnum == verb_code(ext_code[wagain]) && lnoun[0].info == D_END
 	        && iobj_->info == D_END &&
 	        (actor_->info == D_END || actor_->obj == save_actor.obj))
-		if (save_lnoun == NULL) {
+		if (save_lnoun == nullptr) {
 			rfree(lnoun);
 			sysmsg(186,
 			       "You can't use AGAIN until you've entered at least one command.");
@@ -1362,7 +1362,7 @@ void exec(parse_rec *actor_, int vnum,
 			memcpy(iobj_, &save_obj, sizeof(parse_rec));
 			rfree(lnoun);
 			lnoun = save_lnoun;
-			save_lnoun = NULL;
+			save_lnoun = nullptr;
 		}
 	else
 		realverb = input[vp];
@@ -1371,12 +1371,12 @@ void exec(parse_rec *actor_, int vnum,
 	runverbs(actor_, vnum, lnoun, prep_, iobj_);
 
 	if (cmd_saveable) {
-		if (save_lnoun != NULL) rfree(save_lnoun);
+		if (save_lnoun != nullptr) rfree(save_lnoun);
 
 		memcpy(&save_actor, actor_, sizeof(parse_rec));
 		save_vnum = vnum;
 		save_lnoun = lnoun;
-		lnoun = NULL;
+		lnoun = nullptr;
 		save_prep = prep_;
 		memcpy(&save_obj, iobj_, sizeof(parse_rec));
 	} else
diff --git a/engines/glk/agt/filename.cpp b/engines/glk/agt/filename.cpp
index bf93c492aa..70b1232528 100644
--- a/engines/glk/agt/filename.cpp
+++ b/engines/glk/agt/filename.cpp
@@ -47,7 +47,7 @@ const char *extname[] = {
 #ifdef PATH_SEP
 static const char *path_sep = PATH_SEP;
 #else
-static const char *path_sep = NULL;
+static const char *path_sep = nullptr;
 #endif
 
 /* This returns the options to use when opening the given file type */
@@ -69,7 +69,7 @@ const char *filetype_info(filetype ft, rbool rw) {
 	}
 	if (ft == fLOG) return rw ? "w" : "r";
 	fatal("INTERNAL ERROR: Invalid filetype.");
-	return NULL;
+	return nullptr;
 }
 
 
@@ -105,17 +105,17 @@ char *assemble_filename(const char *path, const char *root,
 	char *name;
 
 	len1 = len2 = len3 = 0;
-	if (path != NULL) len1 = strlen(path);
-	if (root != NULL) len2 = strlen(root);
-	if (ext != NULL) len3 = strlen(ext);
+	if (path != nullptr) len1 = strlen(path);
+	if (root != nullptr) len2 = strlen(root);
+	if (ext != nullptr) len3 = strlen(ext);
 	name = (char *)rmalloc(len1 + len2 + len3 + 1);
-	if (path != NULL) memcpy(name, path, len1);
+	if (path != nullptr) memcpy(name, path, len1);
 #ifdef PREFIX_EXT
 	if (ext != NULL) memcpy(name + len1, ext, len3);
 	if (root != NULL) memcpy(name + len1 + len3, root, len2);
 #else
-	if (root != NULL) memcpy(name + len1, root, len2);
-	if (ext != NULL) memcpy(name + len1 + len2, ext, len3);
+	if (root != nullptr) memcpy(name + len1, root, len2);
+	if (ext != nullptr) memcpy(name + len1 + len2, ext, len3);
 #endif
 	name[len1 + len2 + len3] = 0;
 	return name;
@@ -145,7 +145,7 @@ static rbool smatch(char c, const char *matchset) {
 static int find_path_sep(const char *name) {
 	int i;
 
-	if (path_sep == NULL)
+	if (path_sep == nullptr)
 		return -1;
 	for (i = strlen(name) - 1; i >= 0; i--)
 		if (smatch(name[i], path_sep)) break;
@@ -201,7 +201,7 @@ static char *extract_piece(const char *name, int extlen, rbool isext) {
 		len = xlen;
 		xlen = tmp;
 	}
-	if (len == 0) return NULL;
+	if (len == 0) return nullptr;
 	root = (char *)rmalloc((len + 1) * sizeof(char));
 #ifdef PREFIX_EXT
 	first = isext ? 1 : 0;
@@ -293,7 +293,7 @@ fc_type init_file_context(const char *name, filetype ft) {
 
 	p = find_path_sep(fc->gamename);
 	if (p < 0)
-		fc->path = NULL;
+		fc->path = nullptr;
 	else {
 		fc->path = (char *)rmalloc((p + 2) * sizeof(char));
 		memcpy(fc->path, fc->gamename, p + 1);
@@ -330,12 +330,12 @@ fc_type convert_file_context(fc_type fc, filetype ft, const char *name) {
 	local_ftype = (ft == fSAV || ft == fSCR || ft == fLOG);
 	if (BATCH_MODE || make_test) local_ftype = 0;
 
-	if (name == NULL) {
+	if (name == nullptr) {
 		nfc = (file_context_rec *)rmalloc(sizeof(file_context_rec));
-		nfc->gamename = NULL;
-		nfc->path = NULL;
+		nfc->gamename = nullptr;
+		nfc->path = nullptr;
 		nfc->shortname = rstrdup(fc->shortname);
-		nfc->ext = NULL;
+		nfc->ext = nullptr;
 		nfc->ft = fNONE;
 		nfc->special = 0;
 	} else {
@@ -343,7 +343,7 @@ fc_type convert_file_context(fc_type fc, filetype ft, const char *name) {
 	}
 
 	/* If path already defined, then combine paths. */
-	if (!local_ftype && nfc->path != NULL && !absolute_path(nfc->path)) {
+	if (!local_ftype && nfc->path != nullptr && !absolute_path(nfc->path)) {
 		char *newpath;
 		newpath = nfc->path;
 		newpath = assemble_filename(fc->path, nfc->path, "");
@@ -353,7 +353,7 @@ fc_type convert_file_context(fc_type fc, filetype ft, const char *name) {
 
 	/* scripts, save-games and logs should go in  the working directory,
 	   not the game directory, so leave nfc->path equal to NULL for them. */
-	if (!local_ftype && nfc->path == NULL)
+	if (!local_ftype && nfc->path == nullptr)
 		nfc->path = rstrdup(fc->path); /* Put files in game directory */
 	return nfc;
 }
@@ -387,7 +387,7 @@ static genfile try_open_file(const char *path, const char *root,
 static genfile findread(file_context_rec *fc, filetype ft) {
 	genfile f;
 
-	f = NULL;
+	f = nullptr;
 
 	if (ft == fAGT_STD) {
 		f = try_open_file(fc->path, AGTpSTD, "", filetype_info(ft, 0), 0);
@@ -395,7 +395,7 @@ static genfile findread(file_context_rec *fc, filetype ft) {
 	}
 	if (ft == fAGX || ft == fNONE) /* Try opening w/o added extension */
 		f = try_open_file(fc->path, fc->shortname, fc->ext, filetype_info(ft, 0), 0);
-	if (f == NULL)
+	if (f == nullptr)
 		f = try_open_file(fc->path, fc->shortname, extname[ft], filetype_info(ft, 0), 0);
 	return f;
 }
@@ -408,9 +408,9 @@ static genfile findread(file_context_rec *fc, filetype ft) {
 genfile readopen(fc_type fc, filetype ft, const char **errstr) {
 	genfile f;
 
-	*errstr = NULL;
+	*errstr = nullptr;
 	f = findread(fc, ft);
-	if (f == NULL) {
+	if (f == nullptr) {
 		*errstr = "Cannot open file";
 	}
 	return f;
@@ -421,7 +421,7 @@ rbool fileexist(fc_type fc, filetype ft) {
 
 	if (fc->special) return 0;
 	f = try_open_file(fc->path, fc->shortname, extname[ft], filetype_info(ft, 0), 1);
-	if (f != NULL) { /* File already exists */
+	if (f != nullptr) { /* File already exists */
 		readclose(f);
 		return 1;
 	}
@@ -434,17 +434,17 @@ genfile writeopen(fc_type fc, filetype ft,
 	char *name;
 	genfile f;
 
-	*errstr = NULL;
-	name = NULL;
+	*errstr = nullptr;
+	name = nullptr;
 
 	{
 		name = assemble_filename(FC(fc)->path, FC(fc)->shortname, extname[ft]);
 		f = fopen(name, filetype_info(ft, 1));
 	}
-	if (f == NULL) {
+	if (f == nullptr) {
 		*errstr = "Cannot open file";
 	}
-	if (pfileid == NULL)
+	if (pfileid == nullptr)
 		rfree(name);
 	else
 		*pfileid = name;
@@ -453,7 +453,7 @@ genfile writeopen(fc_type fc, filetype ft,
 
 
 rbool filevalid(genfile f, filetype ft) {
-	return (f != NULL);
+	return (f != nullptr);
 }
 
 
@@ -470,8 +470,8 @@ void binseek(genfile f, long offset) {
 long varread(genfile f, void *buff, long recsize, long recnum, const char **errstr) {
 	long num;
 
-	*errstr = NULL;
-	assert(f != NULL);
+	*errstr = nullptr;
+	assert(f != nullptr);
 
 	num = fread(buff, recsize, recnum, f);
 	if (num != recnum)
@@ -485,14 +485,14 @@ rbool binread(genfile f, void *buff, long recsize, long recnum, const char **err
 	long num;
 
 	num = varread(f, buff, recsize, recnum, errstr);
-	if (num < recsize * recnum && *errstr == NULL)
+	if (num < recsize * recnum && *errstr == nullptr)
 		*errstr = rstrdup("Unexpected end of file.");
-	return (*errstr == NULL);
+	return (*errstr == nullptr);
 }
 
 
 rbool binwrite(genfile f, void *buff, long recsize, long recnum, rbool ferr) {
-	assert(f != NULL);
+	assert(f != nullptr);
 
 	if (fwrite(buff, recsize, recnum, f) != (size_t)recnum) {
 		if (ferr) fatal("binwrite");
@@ -502,13 +502,13 @@ rbool binwrite(genfile f, void *buff, long recsize, long recnum, rbool ferr) {
 }
 
 void readclose(genfile f) {
-	assert(f != NULL);
+	assert(f != nullptr);
 
 	fclose(f);
 }
 
 void writeclose(genfile f, file_id_type fileid) {
-	assert(f != NULL);
+	assert(f != nullptr);
 	rfree(fileid);
 
 	fclose(f);
@@ -519,7 +519,7 @@ long binsize(genfile f)
 {
 	long pos, leng;
 
-	assert(f != NULL);
+	assert(f != nullptr);
 
 	pos = ftell(f);
 	fseek(f, 0, SEEK_END);
@@ -538,7 +538,7 @@ rbool textrewind(genfile f) {
 
 
 genfile badfile(filetype ft) {
-	return NULL;
+	return nullptr;
 }
 
 } // End of namespace AGT
diff --git a/engines/glk/agt/gamedata.cpp b/engines/glk/agt/gamedata.cpp
index 3627a30cea..033070d88b 100644
--- a/engines/glk/agt/gamedata.cpp
+++ b/engines/glk/agt/gamedata.cpp
@@ -698,7 +698,7 @@ static void init0_dict(void)
 	dictstrptr = 4; /* Point just after 'any' */
 	dictstrsize = DICT_GRAN;
 	dp = 1;
-	syntbl = NULL;
+	syntbl = nullptr;
 	synptr = 0;
 	syntbl_size = 0; /* Clear synonym table */
 }
@@ -806,15 +806,15 @@ static void enter_verbs(int vp, const char *s)
 
 
 void init_dict(void) {
-	dict = NULL;
-	verblist = NULL;
-	syntbl = NULL;
+	dict = nullptr;
+	verblist = nullptr;
+	syntbl = nullptr;
 	no_syn = 0;
-	auxsyn = NULL;
-	preplist = NULL;
-	verbflag = NULL;
-	auxcomb = NULL;
-	old_agt_verb = NULL;
+	auxsyn = nullptr;
+	preplist = nullptr;
+	verbflag = nullptr;
+	auxcomb = nullptr;
+	old_agt_verb = nullptr;
 	num_auxcomb = 0;
 }
 
@@ -865,7 +865,7 @@ void reinit_dict(void)
 	no_syn = no_auxsyn;
 
 	auxsyn = (slist *)rmalloc(sizeof(slist) * TOTAL_VERB);
-	auxcomb = NULL;
+	auxcomb = nullptr;
 	num_auxcomb = 0;
 	preplist = (slist *)rmalloc(sizeof(slist) * TOTAL_VERB);
 	verbflag = (uchar *)rmalloc(sizeof(uchar) * TOTAL_VERB);
@@ -899,13 +899,13 @@ void reinit_dict(void)
 		addsyn(-1);
 	}
 	no_syn = 0; /* Return to usual state */
-	verblist = NULL;
+	verblist = nullptr;
 
 	/* Now initialize old_agt_verb array */
-	for (i = 0; old_agt_verb_str[i] != NULL; i++);
+	for (i = 0; old_agt_verb_str[i] != nullptr; i++);
 	rfree(old_agt_verb);
 	old_agt_verb = (word *)rmalloc(sizeof(word) * (i + 1));
-	for (i = 0; old_agt_verb_str[i] != NULL; i++) {
+	for (i = 0; old_agt_verb_str[i] != nullptr; i++) {
 		old_agt_verb[i] = search_dict(old_agt_verb_str[i]);
 		assert(old_agt_verb[i] != -1);
 	}
@@ -1346,8 +1346,8 @@ descr_line *read_descr(long start, long size) {
 }
 
 void free_descr(descr_line *txt) {
-	if (txt == NULL) return;
-	if (mem_descr == NULL)
+	if (txt == nullptr) return;
+	if (mem_descr == nullptr)
 		rfree(txt[0]);  /* First free the string block containing the text...*/
 	rfree(txt);    /* ... then the array of pointers to it */
 }
@@ -1571,9 +1571,9 @@ void init_flags(void) {
 	bold_mode = 0;
 	dbg_nomsg = 0; /* Print out MSG arguments to metacommands */
 	debug_mode = 0;
-	dbgflagptr = NULL;
-	dbgvarptr = NULL;
-	dbgcntptr = NULL;
+	dbgflagptr = nullptr;
+	dbgvarptr = nullptr;
+	dbgcntptr = nullptr;
 	no_auxsyn = 0;
 	text_file = 0;
 #ifdef PATH_SEP
diff --git a/engines/glk/agt/interface.cpp b/engines/glk/agt/interface.cpp
index 9eb3e4e218..b2a38cba20 100644
--- a/engines/glk/agt/interface.cpp
+++ b/engines/glk/agt/interface.cpp
@@ -630,7 +630,7 @@ void prompt_out(int n)
 	if (PURE_INPUT && n == 1) agt_textcolor(-1);
 	if (n == 1) {
 		agt_newline();
-		gen_sysmsg(1, ">", MSG_MAIN, NULL);
+		gen_sysmsg(1, ">", MSG_MAIN, nullptr);
 	}
 	if (n == 2) agt_puts("? ");
 	agt_textcolor(7);
@@ -672,23 +672,23 @@ void set_test_mode(fc_type fc) {
 	log_in = readopen(fc, fLOG, &errstr);
 
 	if (make_test) {
-		if (errstr == NULL)
+		if (errstr == nullptr)
 			fatal("Log file already exists.");
-		log_out = writeopen(fc, fLOG, NULL, &errstr);
-		if (errstr != NULL)
+		log_out = writeopen(fc, fLOG, nullptr, &errstr);
+		if (errstr != nullptr)
 			fatal("Couldn't create log file.");
 		logflag = 1;
 		return;
 	}
 
 	logdelay = 0;
-	if (errstr != NULL)
+	if (errstr != nullptr)
 		fatal("Couldn't open log file.");
 	logflag = 2;
 
 	script_on = 1;
-	scriptfile = writeopen(fc, fSCR, NULL, &errstr);
-	if (errstr != NULL)
+	scriptfile = writeopen(fc, fSCR, nullptr, &errstr);
+	if (errstr != nullptr)
 		fatal("Couldn't open script file.");
 }
 
diff --git a/engines/glk/agt/metacommand.cpp b/engines/glk/agt/metacommand.cpp
index 16de023bbf..cc1f5ed971 100644
--- a/engines/glk/agt/metacommand.cpp
+++ b/engines/glk/agt/metacommand.cpp
@@ -217,7 +217,7 @@ static int decode_instr(op_rec *oprec, const integer *data, int maxleng) {
 	rbool special_arg1;  /* Is the first argument a special 0-length argument? */
 
 	oprec->negate = oprec->failmsg = oprec->disambig = 0;
-	oprec->errmsg = NULL;
+	oprec->errmsg = nullptr;
 	oprec->op = -1;
 	oprec->opdata = &illegal_def;
 	oprec->argcnt = 0;
@@ -336,7 +336,7 @@ static int decode_instr(op_rec *oprec, const integer *data, int maxleng) {
 static rbool decode_args(int ip_, op_rec *oprec) {
 	rbool grammer_arg; /* Have NOUN/OBJECT that is 0 and so failed argok tests */
 
-	if (oprec->errmsg != NULL) {
+	if (oprec->errmsg != nullptr) {
 		if (!PURE_ERROR)
 			writeln(oprec->errmsg);
 		return 0;
@@ -412,7 +412,7 @@ typedef struct {
 } subcall_rec;
 
 
-static subcall_rec *substack = NULL;
+static subcall_rec *substack = nullptr;
 static short subcnt = 0;
 static short subsize = 0;
 
@@ -428,7 +428,7 @@ static rbool push_subcall(int cnum, int ip_, int failaddr) {
 		rm_trap = 0;
 		substack = (subcall_rec *)rrealloc(substack, subsize * sizeof(subcall_rec));
 		rm_trap = 1;
-		if (substack == NULL) { /* out of memory */
+		if (substack == nullptr) { /* out of memory */
 			substack = savestack;
 			return 0;
 		}
@@ -748,7 +748,7 @@ static rbool fix_objrec(parse_rec **objrec, word match,
 						int real_obj,
 						parse_rec *actrec, parse_rec *dobjrec,
 						parse_rec *iobjrec) {
-	if (real_obj) *objrec = make_parserec(real_obj, NULL);
+	if (real_obj) *objrec = make_parserec(real_obj, nullptr);
 	else if (match == ext_code[wdobject]) *objrec = copy_parserec(iobjrec);
 	else if (match == ext_code[wdnoun]) *objrec = copy_parserec(dobjrec);
 	else if (match == ext_code[wdname]) *objrec = copy_parserec(actrec);
@@ -957,7 +957,7 @@ static void scan_for_actor(integer m_actor, int *start, int *end) {
 	assert(m_actor != 0);
 
 	if (aver >= AGX00) {
-		if (start != NULL) *start = verbptr[DIR_ADDR_CODE];
+		if (start != nullptr) *start = verbptr[DIR_ADDR_CODE];
 		*end = verbend[DIR_ADDR_CODE];
 		return;
 	}
@@ -969,7 +969,7 @@ static void scan_for_actor(integer m_actor, int *start, int *end) {
 		}
 	*end = i;
 
-	if (start == NULL) return;
+	if (start == nullptr) return;
 
 	for (i = verbptr[DIR_ADDR_CODE]; i <= *end; i++)
 		if (creat_fix[command[i].actor - first_creat]
@@ -1071,7 +1071,7 @@ int scan_metacommand(integer m_actor, int vcode,
 				/* REDIRECT :If we do a redirect from a broader grammar to a
 				   narrower grammer, it will be noted so that certain types
 				   of grammer checking can be disabled. */
-				if (redir_flag != NULL) {
+				if (redir_flag != nullptr) {
 					if (*redir_flag < 2
 					        && redir_narrows_grammar(&command[oldi], &command[i]))
 						*redir_flag = 2;
@@ -1134,7 +1134,7 @@ int scan_metacommand(integer m_actor, int vcode,
 				if (m_actor == 0)
 					scanend = verbend[vcode];
 				else
-					scan_for_actor(m_actor, NULL, &scanend);
+					scan_for_actor(m_actor, nullptr, &scanend);
 				m_verb = syntbl[auxsyn[vcode]];
 
 				i--; /* Cause the last command to restart,
diff --git a/engines/glk/agt/object.cpp b/engines/glk/agt/object.cpp
index bc38354d66..9540bc1a67 100644
--- a/engines/glk/agt/object.cpp
+++ b/engines/glk/agt/object.cpp
@@ -38,7 +38,7 @@ namespace AGT {
 
 /* Make artificial parse record for an object */
 parse_rec *make_parserec(int obj, parse_rec *rec) {
-	if (rec == NULL) rec = (parse_rec *)rmalloc(sizeof(parse_rec));
+	if (rec == nullptr) rec = (parse_rec *)rmalloc(sizeof(parse_rec));
 	rec->obj = obj;
 	rec->info = D_NOUN;
 	rec->noun = it_name(obj);
@@ -57,7 +57,7 @@ void tmpobj(parse_rec *objrec) {
 
 parse_rec *copy_parserec(parse_rec *rec) {
 	parse_rec *newrec;
-	if (rec == NULL) return NULL;
+	if (rec == nullptr) return nullptr;
 	newrec = (parse_rec *)rmalloc(sizeof(parse_rec));
 	memcpy(newrec, rec, sizeof(parse_rec));
 	return newrec;
@@ -91,7 +91,7 @@ static const char *it_sdesc(int item) {
 	if (tnoun(item)) return noun[item - first_noun].shortdesc;
 	if (tcreat(item)) return creature[item - first_creat].shortdesc;
 	if (item < 0) return dict[-item];
-	return NULL;
+	return nullptr;
 }
 
 rbool it_possess(int item) {
@@ -254,7 +254,7 @@ void it_reposition(int item, int newloc, rbool save_pos) {
 			noun[item - first_noun].pos_prep = 0;
 			noun[item - first_noun].pos_name = 0;
 			noun[item - first_noun].nearby_noun = 0;
-			noun[item - first_noun].position = NULL;
+			noun[item - first_noun].position = nullptr;
 #if 0  /* I think this was wrong, so I'm commenting it out. */
 			noun[item - first_noun].initdesc = 0;
 #endif
@@ -283,7 +283,7 @@ void it_reposition(int item, int newloc, rbool save_pos) {
 		noun[i].nearby_noun = 0;
 		noun[i].pos_prep = 0;
 		noun[i].pos_name = 0;
-		noun[i].position = NULL;
+		noun[i].position = nullptr;
 	}
 }
 
@@ -776,7 +776,7 @@ static void rundesc(int i, descr_ptr dp_[], const char *shortdesc, int msgid) {
 	if (dp_[i].size > 0)
 		print_descr(dp_[i], 1);
 	else if (!invischeck(shortdesc))
-		raw_lineout(shortdesc, 1, MSG_DESC, NULL);
+		raw_lineout(shortdesc, 1, MSG_DESC, nullptr);
 	else sysmsg(msgid, "$You$ see nothing unexpected.");
 }
 
@@ -840,7 +840,7 @@ static int print_obj(int obj, int ind_lev)
 	if (tcreat(obj) && creature[obj - first_creat].initdesc != 0)
 		return 0; /* Don't print normal description if printing initdesc */
 
-	s0 = NULL;
+	s0 = nullptr;
 	sdesc_flag = !player_has(obj); /* This should be tested. */
 	sdesc_flag = sdesc_flag || (ind_lev > 1);  /* It seems that AGT uses the
 						sdesc for describing items
@@ -868,7 +868,7 @@ static int print_obj(int obj, int ind_lev)
 	} else if (!invischeck(s)) {
 		retval = 1; /* We're actually going to print something */
 		for (i = 0; i < ind_lev; i++) writestr("   ");
-		raw_lineout(s, sdesc_flag, MSG_DESC, NULL);
+		raw_lineout(s, sdesc_flag, MSG_DESC, nullptr);
 		/* Do $word$ formatting if sdesc */
 		/* Need to output container */
 		parent = it_loc(obj);
@@ -950,10 +950,10 @@ static void *compute_addr(int obj, int prop, const prop_struct *ptable) {
 	} else if (tcreat(obj)) {
 		base = (void *)(&creature[obj - first_creat]);
 		ofs = ptable[prop].creature;
-	} else return NULL;
+	} else return nullptr;
 
 	if (ofs == -1) /* Field doesn't exist in this type of object */
-		return NULL;
+		return nullptr;
 
 	return (void *)(((char *)base) + ofs);
 }
@@ -964,7 +964,7 @@ long getprop(int obj, int prop) {
 
 	if (prop >= NUM_PROP) return 0;
 	paddr = (integer *)compute_addr(obj, prop, proplist);
-	if (paddr == NULL) return 0;
+	if (paddr == nullptr) return 0;
 	return *paddr;
 }
 
@@ -977,7 +977,7 @@ void setprop(int obj, int prop, long val) {
 	}
 
 	paddr = (integer *)compute_addr(obj, prop, proplist);
-	if (paddr == NULL) {
+	if (paddr == nullptr) {
 		writeln("GAME ERROR: Property-object mismatch.");
 		return;
 	}
@@ -989,7 +989,7 @@ rbool getattr(int obj, int prop) {
 
 	if (prop >= NUM_ATTR) return 0;
 	paddr = (rbool *)compute_addr(obj, prop, attrlist);
-	if (paddr == NULL) return 0;
+	if (paddr == nullptr) return 0;
 	return *paddr;
 }
 
@@ -1002,7 +1002,7 @@ void setattr(int obj, int prop, rbool val) {
 	}
 
 	paddr = (rbool *)compute_addr(obj, prop, attrlist);
-	if (paddr == NULL) {
+	if (paddr == nullptr) {
 		writeln("GAME ERROR: Property-object mismatch.");
 		return;
 	}
diff --git a/engines/glk/agt/os_glk.cpp b/engines/glk/agt/os_glk.cpp
index 157a7ba378..9fb168d897 100644
--- a/engines/glk/agt/os_glk.cpp
+++ b/engines/glk/agt/os_glk.cpp
@@ -102,7 +102,7 @@ static void gagt_fatal(const char *string) {
 		error("INTERNAL ERROR: %s", string);
 
 	/* Cancel all possible pending window input events. */
-	g_vm->glk_cancel_line_event(g_vm->gagt_main_window, NULL);
+	g_vm->glk_cancel_line_event(g_vm->gagt_main_window, nullptr);
 	g_vm->glk_cancel_char_event(g_vm->gagt_main_window);
 
 	/* Print a message indicating the error. */
@@ -265,7 +265,7 @@ int agt_rand(int a, int b) {
  */
 static void gagt_workround_menus() {
 	free(verbmenu);
-	verbmenu = NULL;
+	verbmenu = nullptr;
 
 	menu_mode = 0;
 }
@@ -286,7 +286,7 @@ static int gagt_workround_fileexist(fc_type fc, filetype ft) {
 	genfile file;
 	const char *errstr;
 
-	errstr = NULL;
+	errstr = nullptr;
 	file = readopen(fc, ft, &errstr);
 
 	if (file) {
@@ -660,8 +660,8 @@ static void gagt_iso_to_cp(const unsigned char *from_string, unsigned char *to_s
  * that don't support separate windows.  We also need a copy of the last
  * status buffer printed for non-windowing Glk libraries, for comparison.
  */
-static char *gagt_status_buffer = NULL,
-			 *gagt_status_buffer_printed = NULL;
+static char *gagt_status_buffer = nullptr,
+			 *gagt_status_buffer_printed = nullptr;
 
 /*
  * Indication that we are in mid-delay.  The delay is silent, and can look
@@ -892,7 +892,7 @@ static void gagt_status_redraw() {
 			parent = g_vm->glk_window_get_parent(g_vm->gagt_status_window);
 			g_vm->glk_window_set_arrangement(parent,
 			                                 winmethod_Above | winmethod_Fixed,
-			                                 height, NULL);
+			                                 height, nullptr);
 
 			gagt_status_update();
 		}
@@ -929,10 +929,10 @@ static void gagt_status_in_delay(int inside_delay) {
  */
 static void gagt_status_cleanup() {
 	free(gagt_status_buffer);
-	gagt_status_buffer = NULL;
+	gagt_status_buffer = nullptr;
 
 	free(gagt_status_buffer_printed);
-	gagt_status_buffer_printed = NULL;
+	gagt_status_buffer_printed = nullptr;
 }
 
 
@@ -1437,14 +1437,14 @@ struct gagt_line_s {
  * Definition of the actual page buffer.  This is a doubly-linked list of
  * lines, with a tail pointer to facilitate adding entries at the end.
  */
-static gagt_lineref_t gagt_page_head = NULL,
-					  gagt_page_tail = NULL;
+static gagt_lineref_t gagt_page_head = nullptr,
+					  gagt_page_tail = nullptr;
 
 /*
  * Definition of the current output line; this one is appended to on
  * agt_puts(), and transferred into the page buffer on agt_newline().
  */
-static gagt_string_t gagt_current_buffer = { NULL, NULL, 0, 0 };
+static gagt_string_t gagt_current_buffer = { nullptr, nullptr, 0, 0 };
 
 /*
  * gagt_string_append()
@@ -1481,14 +1481,14 @@ static void gagt_string_append(gagt_stringref_t buffer, const char *string,
 
 static void gagt_string_transfer(gagt_stringref_t from, gagt_stringref_t to) {
 	*to = *from;
-	from->data = from->attributes = NULL;
+	from->data = from->attributes = nullptr;
 	from->allocation = from->length = 0;
 }
 
 static void gagt_string_free(gagt_stringref_t buffer) {
 	free(buffer->data);
 	free(buffer->attributes);
-	buffer->data = buffer->attributes = NULL;
+	buffer->data = buffer->attributes = nullptr;
 	buffer->allocation = buffer->length = 0;
 }
 
@@ -1579,7 +1579,7 @@ static void gagt_output_delete() {
 		free(line);
 	}
 
-	gagt_page_head = gagt_page_tail = NULL;
+	gagt_page_head = gagt_page_tail = nullptr;
 
 	gagt_string_free(&gagt_current_buffer);
 }
@@ -1651,11 +1651,11 @@ void agt_newline() {
 		line->is_hyphenated = gagt_is_string_hyphenated(&line->buffer);
 
 		/* For now, default the remaining page buffer fields for the line. */
-		line->paragraph = NULL;
+		line->paragraph = nullptr;
 		line->font_hint = HINT_NONE;
 
 		/* Add to the list, creating a new list if necessary. */
-		line->next = NULL;
+		line->next = nullptr;
 		line->prior = gagt_page_tail;
 		if (gagt_page_head)
 			gagt_page_tail->next = line;
@@ -1740,8 +1740,8 @@ struct gagt_paragraph_s {
  * A doubly-linked list of paragraphs, with a tail pointer to facilitate
  * adding entries at the end.
  */
-static gagt_paragraphref_t gagt_paragraphs_head = NULL,
-						   gagt_paragraphs_tail = NULL;
+static gagt_paragraphref_t gagt_paragraphs_head = nullptr,
+						   gagt_paragraphs_tail = nullptr;
 
 /*
  * gagt_paragraphs_delete()
@@ -1760,7 +1760,7 @@ static void gagt_paragraphs_delete() {
 		free(paragraph);
 	}
 
-	gagt_paragraphs_head = gagt_paragraphs_tail = NULL;
+	gagt_paragraphs_head = gagt_paragraphs_tail = nullptr;
 }
 
 
@@ -1777,7 +1777,7 @@ static gagt_lineref_t gagt_find_paragraph_start(const gagt_lineref_t begin) {
 	 * Advance line to the beginning of the next paragraph, stopping on the
 	 * first non-blank line, or at the end of the page buffer.
 	 */
-	match = NULL;
+	match = nullptr;
 	for (line = begin; line; line = gagt_get_next_page_line(line)) {
 		if (!line->is_blank) {
 			match = line;
@@ -1959,12 +1959,12 @@ static void gagt_paragraph_page() {
 		paragraph = (gagt_paragraphref_t)gagt_malloc(sizeof(*paragraph));
 		paragraph->magic = GAGT_PARAGRAPH_MAGIC;
 		paragraph->first_line = start;
-		paragraph->special = NULL;
+		paragraph->special = nullptr;
 		paragraph->line_count = 1;
 		paragraph->id = gagt_paragraphs_tail ? gagt_paragraphs_tail->id + 1 : 0;
 
 		/* Add to the list, creating a new list if necessary. */
-		paragraph->next = NULL;
+		paragraph->next = nullptr;
 		paragraph->prior = gagt_paragraphs_tail;
 		if (gagt_paragraphs_head)
 			gagt_paragraphs_tail->next = paragraph;
@@ -1994,7 +1994,7 @@ static void gagt_paragraph_page() {
 		if (line)
 			start = gagt_find_paragraph_start(line);
 		else
-			start = NULL;
+			start = nullptr;
 	}
 }
 
@@ -2052,7 +2052,7 @@ static gagt_lineref_t gagt_get_next_paragraph_line(const gagt_lineref_t line) {
 	if (next_line && next_line->paragraph == line->paragraph)
 		return next_line;
 	else
-		return NULL;
+		return nullptr;
 }
 
 static gagt_lineref_t gagt_get_prior_paragraph_line(const gagt_lineref_t line) {
@@ -2063,7 +2063,7 @@ static gagt_lineref_t gagt_get_prior_paragraph_line(const gagt_lineref_t line) {
 	if (prior_line && prior_line->paragraph == line->paragraph)
 		return prior_line;
 	else
-		return NULL;
+		return nullptr;
 }
 
 
@@ -2708,7 +2708,7 @@ static gagt_special_t GAGT_SPECIALS[] = {
 	},
 
 	/* End of table sentinel entry.  Do not delete. */
-	{0, {NULL}, NULL}
+	{0, {nullptr}, nullptr}
 };
 
 
@@ -2767,7 +2767,7 @@ static gagt_specialref_t gagt_find_equivalent_special(gagt_paragraphref_t paragr
 	gagt_specialref_t special, match;
 
 	/* Check each special paragraph entry for a match against this paragraph. */
-	match = NULL;
+	match = nullptr;
 	for (special = GAGT_SPECIALS; special->replace; special++) {
 		if (gagt_compare_special_paragraph(special, paragraph)) {
 			match = special;
@@ -3700,10 +3700,10 @@ static void gagt_command_script(const char *argument) {
 			return;
 		}
 
-		g_vm->glk_stream_close(g_vm->gagt_transcript_stream, NULL);
-		g_vm->gagt_transcript_stream = NULL;
+		g_vm->glk_stream_close(g_vm->gagt_transcript_stream, nullptr);
+		g_vm->gagt_transcript_stream = nullptr;
 
-		g_vm->glk_window_set_echo_stream(g_vm->gagt_main_window, NULL);
+		g_vm->glk_window_set_echo_stream(g_vm->gagt_main_window, nullptr);
 
 		gagt_normal_string("Glk transcript is now off.\n");
 	}
@@ -3765,8 +3765,8 @@ static void gagt_command_inputlog(const char *argument) {
 			return;
 		}
 
-		g_vm->glk_stream_close(g_vm->gagt_inputlog_stream, NULL);
-		g_vm->gagt_inputlog_stream = NULL;
+		g_vm->glk_stream_close(g_vm->gagt_inputlog_stream, nullptr);
+		g_vm->gagt_inputlog_stream = nullptr;
 
 		gagt_normal_string("Glk input log is now off.\n");
 	}
@@ -3833,8 +3833,8 @@ static void gagt_command_readlog(const char *argument) {
 			return;
 		}
 
-		g_vm->glk_stream_close(g_vm->gagt_readlog_stream, NULL);
-		g_vm->gagt_readlog_stream = NULL;
+		g_vm->glk_stream_close(g_vm->gagt_readlog_stream, nullptr);
+		g_vm->gagt_readlog_stream = nullptr;
 
 		gagt_normal_string("Glk read log is now off.\n");
 	}
@@ -4170,7 +4170,7 @@ static void gagt_command_statusline(const char *argument) {
 
 		/* Expand the status window down to a second line. */
 		g_vm->glk_window_set_arrangement(g_vm->glk_window_get_parent(g_vm->gagt_status_window),
-		                                 winmethod_Above | winmethod_Fixed, 2, NULL);
+		                                 winmethod_Above | winmethod_Fixed, 2, nullptr);
 		g_vm->gagt_extended_status_enabled = TRUE;
 
 		gagt_normal_string("Glk status line mode is now 'extended'.\n");
@@ -4185,7 +4185,7 @@ static void gagt_command_statusline(const char *argument) {
 
 		/* Shrink the status window down to one line. */
 		g_vm->glk_window_set_arrangement(g_vm->glk_window_get_parent(g_vm->gagt_status_window),
-		                                 winmethod_Above | winmethod_Fixed, 1, NULL);
+		                                 winmethod_Above | winmethod_Fixed, 1, nullptr);
 		g_vm->gagt_extended_status_enabled = FALSE;
 
 		gagt_normal_string("Glk status line mode is now 'short'.\n");
@@ -4294,7 +4294,7 @@ static gagt_command_t GAGT_COMMAND_TABLE[] = {
 	{"version",        gagt_command_version,        FALSE},
 	{"commands",       gagt_command_commands,       TRUE},
 	{"help",           gagt_command_help,           TRUE},
-	{NULL, NULL, FALSE}
+	{nullptr, nullptr, FALSE}
 };
 
 
@@ -4349,7 +4349,7 @@ static void gagt_command_help(const char *cmd) {
 		return;
 	}
 
-	matched = NULL;
+	matched = nullptr;
 	for (entry = GAGT_COMMAND_TABLE; entry->command; entry++) {
 		if (gagt_strncasecmp(cmd, entry->command, strlen(cmd)) == 0) {
 			if (matched) {
@@ -4560,7 +4560,7 @@ static int gagt_command_escape(const char *string) {
 		 * the cmd passed in.
 		 */
 		matches = 0;
-		matched = NULL;
+		matched = nullptr;
 		for (entry = GAGT_COMMAND_TABLE; entry->command; entry++) {
 			if (gagt_strncasecmp(cmd, entry->command, strlen(cmd)) == 0) {
 				matches++;
@@ -4620,7 +4620,7 @@ static gagt_abbreviation_t GAGT_ABBREVIATIONS[] = {
 	{'k', "attack"},   {'l', "look"},   {'p', "open"},
 	{'q', "quit"},     {'r', "drop"},   {'t', "take"},
 	{'x', "examine"},  {'y', "yes"},    {'z', "wait"},
-	{'\0', NULL}
+	{'\0', nullptr}
 };
 
 
@@ -4644,7 +4644,7 @@ static void gagt_expand_abbreviations(char *buffer, int size) {
 
 	/* Scan the abbreviations table for a match. */
 	abbreviation = g_vm->glk_char_to_lower((unsigned char) command_[0]);
-	expansion = NULL;
+	expansion = nullptr;
 	for (entry = GAGT_ABBREVIATIONS; entry->expansion; entry++) {
 		if (entry->abbreviation == abbreviation) {
 			expansion = entry->expansion;
@@ -4736,8 +4736,8 @@ char *agt_input(int in_type) {
 		 * We're at the end of the log stream.  Close it, and then continue
 		 * on to request a line from Glk.
 		 */
-		g_vm->glk_stream_close(g_vm->gagt_readlog_stream, NULL);
-		g_vm->gagt_readlog_stream = NULL;
+		g_vm->glk_stream_close(g_vm->gagt_readlog_stream, nullptr);
+		g_vm->gagt_readlog_stream = nullptr;
 	}
 
 	/* Set this up as a read buffer for the main window, and wait. */
@@ -4884,8 +4884,8 @@ char agt_getkey(rbool echo_char) {
 		 * We're at the end of the log stream.  Close it, and then continue
 		 * on to request a character from Glk.
 		 */
-		g_vm->glk_stream_close(g_vm->gagt_readlog_stream, NULL);
-		g_vm->gagt_readlog_stream = NULL;
+		g_vm->glk_stream_close(g_vm->gagt_readlog_stream, nullptr);
+		g_vm->gagt_readlog_stream = nullptr;
 	}
 
 	/*
@@ -5063,7 +5063,7 @@ void init_interface() {
 	 * If it fails, we'll return, and the caller can detect this by looking
 	 * for a NULL main window.
 	 */
-	g_vm->gagt_main_window = g_vm->glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
+	g_vm->gagt_main_window = g_vm->glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 0);
 	if (!g_vm->gagt_main_window)
 		return;
 
@@ -5544,7 +5544,7 @@ static void gagt_main() {
 	if (!(gagt_workround_fileexist(fc, fAGX)
 	        || gagt_workround_fileexist(fc, fDA1))) {
 		if (g_vm->gagt_status_window)
-			g_vm->glk_window_close(g_vm->gagt_status_window, NULL);
+			g_vm->glk_window_close(g_vm->gagt_status_window, nullptr);
 		gagt_header_string("Glk AGiliTy Error\n\n");
 		gagt_normal_string("Can't find or open game '");
 		gagt_normal_string(g_vm->gagt_gamefile);
@@ -5574,16 +5574,16 @@ static void gagt_main() {
 
 	/* Close any open transcript, input log, and/or read log. */
 	if (g_vm->gagt_transcript_stream) {
-		g_vm->glk_stream_close(g_vm->gagt_transcript_stream, NULL);
-		g_vm->gagt_transcript_stream = NULL;
+		g_vm->glk_stream_close(g_vm->gagt_transcript_stream, nullptr);
+		g_vm->gagt_transcript_stream = nullptr;
 	}
 	if (g_vm->gagt_inputlog_stream) {
-		g_vm->glk_stream_close(g_vm->gagt_inputlog_stream, NULL);
-		g_vm->gagt_inputlog_stream = NULL;
+		g_vm->glk_stream_close(g_vm->gagt_inputlog_stream, nullptr);
+		g_vm->gagt_inputlog_stream = nullptr;
 	}
 	if (g_vm->gagt_readlog_stream) {
-		g_vm->glk_stream_close(g_vm->gagt_readlog_stream, NULL);
-		g_vm->gagt_readlog_stream = NULL;
+		g_vm->glk_stream_close(g_vm->gagt_readlog_stream, nullptr);
+		g_vm->gagt_readlog_stream = nullptr;
 	}
 }
 
@@ -5679,7 +5679,7 @@ void gagt_finalizer() {
 		 */
 		if (g_vm->gagt_main_window) {
 			g_vm->glk_cancel_char_event(g_vm->gagt_main_window);
-			g_vm->glk_cancel_line_event(g_vm->gagt_main_window, NULL);
+			g_vm->glk_cancel_line_event(g_vm->gagt_main_window, nullptr);
 
 			g_vm->glk_set_style(style_Alert);
 			g_vm->glk_put_string("\n\nHit any key to exit.\n");
diff --git a/engines/glk/agt/parser.cpp b/engines/glk/agt/parser.cpp
index cb87366004..f2cb355108 100644
--- a/engines/glk/agt/parser.cpp
+++ b/engines/glk/agt/parser.cpp
@@ -57,7 +57,7 @@ int ip_back, parse_ip;
 static int vnum;  /* Verb number from synonym scan */
 
 /* Pointers to negative-terminated arrays of possible nouns */
-static parse_rec *lactor = NULL, *lobj = NULL, *lnoun = NULL;
+static parse_rec *lactor = nullptr, *lobj = nullptr, *lnoun = nullptr;
 
 static int ambig_flag = 0;
 /* Was last input ambiguous? (so player could be entering
@@ -81,7 +81,7 @@ int all_err_msg[] = {73, 83, 113, 103, /* open, close, lock, unlock: 15 - 18 */
 static void freeall(void) {
 	rfree(lnoun);
 	rfree(lobj);
-	lnoun = lobj = NULL;
+	lnoun = lobj = nullptr;
 }
 
 
@@ -546,7 +546,7 @@ static rbool ident_objrec(parse_rec *p1, parse_rec *p2) {
 static parse_rec *fix_actor(parse_rec *alist) {
 	int i, cnt;
 
-	assert(alist != NULL);
+	assert(alist != nullptr);
 	if (alist[0].info == D_ALL) { /* ALL?! */
 		rfree(alist);
 		return new_list();
@@ -644,7 +644,7 @@ static int score_disambig(parse_rec *rec, int ambig_type)
 	if (ambig_type == 1) /* ACTOR */
 		return DISAMBIG_SUCC;
 	else if (ambig_type == 2) /* NOUN */
-		return check_obj(lactor, vnum, rec, prep, NULL);
+		return check_obj(lactor, vnum, rec, prep, nullptr);
 	else if (ambig_type == 3) /* IOBJ */
 		return check_obj(lactor, vnum, lnoun, prep, rec);
 	else fatal("Invalid ambig_type!");
@@ -674,7 +674,7 @@ static parse_rec *expand_all(parse_rec *lnoun_) {
 	creature[i].scratch = 0;
 	objloop(i)
 	if (((verbflag[vnum]&VERB_GLOBAL) != 0 || visible(i))
-	        && (lnoun_ == NULL || !scan_andrec(i, lnoun_))) {
+	        && (lnoun_ == nullptr || !scan_andrec(i, lnoun_))) {
 		temp_obj.obj = i;
 		if (score_disambig(&temp_obj, 2) >= 500) {
 			if (tnoun(i)) noun[i - first_noun].scratch = 1;
@@ -950,7 +950,7 @@ static parse_rec *disambig(int ambig_set, parse_rec *list, parse_rec *truenoun)
 /* ambig_set = 1 for actor, 2 for noun, 3 for object */
 {
 	if (ambig_flag == ambig_set || ambig_flag == 0) { /* restart where we left off...*/
-		if (truenoun == NULL || truenoun[0].info == D_END) disambig_ofs = -1;
+		if (truenoun == nullptr || truenoun[0].info == D_END) disambig_ofs = -1;
 		disambig_ofs = disambig_phrase(&list, truenoun, disambig_ofs, ambig_set);
 		if (disambig_ofs == -1) ambig_flag = 0; /* Success */
 		else if (disambig_ofs == -2) ambig_flag = -1; /* Error: elim all choices */
@@ -1085,7 +1085,7 @@ static parse_rec *parse_a_noun(void)
 			nlist = add_rec(nlist, -input[oip], numval, D_NUM);
 
 		/* Next handle the flag nouns and global nouns */
-		if (globalnoun != NULL)
+		if (globalnoun != nullptr)
 			for (i = 0; i < numglobal; i++)
 				if (input[oip] == globalnoun[i])
 					nlist = add_rec(nlist, -input[oip], 0, D_GLOBAL);
@@ -1191,7 +1191,7 @@ static int parse_cmd(void)
 	/* First go looking for an actor. */
 	ap = ip;
 	new_actor = 0;
-	if (lactor == NULL) {
+	if (lactor == nullptr) {
 		new_actor = 1;
 		lactor = parse_noun(0, 1);
 		/* Check that actor is a creature. */
@@ -1252,7 +1252,7 @@ TELLHack:  /* This is used to restart the noun/prep/object scan
 		rfree(lactor);
 		rfree(lobj);
 		lactor = lnoun;
-		lnoun = NULL;
+		lnoun = nullptr;
 		vp = ip; /* Replace TELL with new verb */
 		vnum = id_verb(); /* May increment ip (ip points att last word in verb) */
 		goto TELLHack;  /* Go back up and reparse the sentence from
@@ -1327,7 +1327,7 @@ TELLHack:  /* This is used to restart the noun/prep/object scan
 
 
 static void v_undo(void) {
-	if (undo_state == NULL) {
+	if (undo_state == nullptr) {
 		writeln("There is insufficiant memory to support UNDO");
 		ip = -1;
 		return;
@@ -1356,7 +1356,7 @@ rbool parse(void)
 	int fixword;
 	int start_ip;
 
-	currnoun = NULL;
+	currnoun = nullptr;
 	start_ip = ip;
 	/* First, we need to see if someone has issued an OOPS command.
 	   OOPS commands are always assumed to stand alone. (i.e. no
@@ -1388,7 +1388,7 @@ rbool parse(void)
 			ambig_flag = 0;
 			rfree(currnoun);
 			freeall();
-			currnoun = NULL;
+			currnoun = nullptr;
 		}
 	}
 
@@ -1450,7 +1450,7 @@ rbool parse(void)
 	   we save the undo state before executing if this is the first command
 	   in a sequence. (That is, UNDO undoes whole lines of commands,
 	   not just individual commands) */
-	if (start_ip == 0 && undo_state != NULL) {
+	if (start_ip == 0 && undo_state != nullptr) {
 		undo_state = getstate(undo_state);
 		can_undo = 1;
 	}
@@ -1465,7 +1465,7 @@ rbool parse(void)
 
 	/* Now we clear lnoun and lobj; lactor is handled elsewhere since
 	   we might have FRED, GET ROCK THEN GO NORTH */
-	lnoun = lobj = NULL;
+	lnoun = lobj = nullptr;
 
 	/* Finally check for THENs */
 
@@ -1495,8 +1495,8 @@ void menu_cmd(void) {
 	int nm_size, nm_width; /* Size and width of noun menu */
 
 
-	nounval = NULL;
-	nounmenu = NULL;
+	nounval = nullptr;
+	nounmenu = nullptr;
 	/* Get verb+prep */
 	choice = agt_menu("", vm_size, vm_width, verbmenu);
 	if (choice == -1 || doing_restore) return;
@@ -1590,7 +1590,7 @@ void menu_cmd(void) {
 		return;
 	}
 
-	if (undo_state != NULL) {
+	if (undo_state != nullptr) {
 		undo_state = getstate(undo_state);
 		can_undo = 1;
 	}
@@ -1599,7 +1599,7 @@ void menu_cmd(void) {
 	tmpobj(&actrec);
 	actrec.obj = 0;
 	exec(&actrec, vnum_, lnoun, prep_, &mobj);
-	lnoun = NULL; /* exec() is responsible for freeing lnoun */
+	lnoun = nullptr; /* exec() is responsible for freeing lnoun */
 }
 
 
diff --git a/engines/glk/agt/runverb.cpp b/engines/glk/agt/runverb.cpp
index 940547267c..12cb1c0f2b 100644
--- a/engines/glk/agt/runverb.cpp
+++ b/engines/glk/agt/runverb.cpp
@@ -71,7 +71,7 @@ static void v_go(int dir) {
 			return;
 		}
 		clear_stack();
-		(void)scan_metacommand(0, v0, 0, 0, 0, NULL);
+		(void)scan_metacommand(0, v0, 0, 0, 0, nullptr);
 		return;
 	}
 	if (newloc < first_room) {
@@ -103,7 +103,7 @@ static void v_go(int dir) {
 			curr_creat_rec = &tmpcreat;
 			make_parserec(i + first_creat, &tmpcreat);
 			sysmsg(14, "$The_c$$c_name$ blocks $your$ way.");
-			curr_creat_rec = NULL;
+			curr_creat_rec = nullptr;
 			return;
 		}
 
@@ -113,7 +113,7 @@ static void v_go(int dir) {
 		oldloc = tmploc; /* Can backtrack as long as not from special */
 	if (dir == 12 && special_ptr[loc].size > 0)
 		/* need to print special of NEW room */
-		runptr(loc, special_ptr, "INTERNAL ERROR: Invalid special ptr", 0, NULL, NULL);
+		runptr(loc, special_ptr, "INTERNAL ERROR: Invalid special ptr", 0, nullptr, nullptr);
 
 	if (tmploc == loc && dir == 12) /* SPECIAL that sends us nowhere */
 		do_look = 0;
@@ -164,19 +164,19 @@ static void v_noun(int vc, parse_rec *nounrec) {
 	if (vc == 0) /* Push */
 		runptr(dobj_ - first_noun, push_ptr,
 		       "$You$ $verb$ $the_n$$noun$ for a while, but nothing happens.",
-		       171, nounrec, NULL);
+		       171, nounrec, nullptr);
 	if (vc == 1) /* Pull */
 		runptr(dobj_ - first_noun, pull_ptr,
 		       "$You$ $verb$ $the_n$$noun$ a bit, but nothing happens.", 174,
-		       nounrec, NULL);
+		       nounrec, nullptr);
 	if (vc == 2) /* Turn */
 		runptr(dobj_ - first_noun, turn_ptr,
 		       "$You$ $verb$ $the_n$$noun$, but nothing happens.", 165,
-		       nounrec, NULL);
+		       nounrec, nullptr);
 	if (vc == 3) /* Play */
 		runptr(dobj_ - first_noun, play_ptr,
 		       "$You$ $verb$ $the_n$$noun$ for a bit, but nothing happens.", 177,
-		       nounrec, NULL);
+		       nounrec, nullptr);
 }
 
 /* vc==1 if ASK, 0 if TALK TO */
@@ -254,10 +254,10 @@ static void v_read(parse_rec *nounrec) {
 	}
 	if (text_ptr[dobj_ - first_noun].size > 0)
 		runptr(dobj_ - first_noun, text_ptr,
-		       "INTERNAL ERROR: Invalid read pointer", 0, NULL, NULL);
+		       "INTERNAL ERROR: Invalid read pointer", 0, nullptr, nullptr);
 	else
 		runptr(dobj_ - first_noun, noun_ptr, "$You$ learn nothing new.",
-		       193, nounrec, NULL);
+		       193, nounrec, nullptr);
 }
 
 
@@ -729,10 +729,10 @@ static void v_attack(uchar missile, parse_rec *targrec, parse_rec *weprec) {
 
 	if (targ == 0) {
 		if (!missile) {
-			alt_sysmsg(206, "Attack what???", NULL, weprec);
+			alt_sysmsg(206, "Attack what???", nullptr, weprec);
 			return;
 		} else {
-			alt_sysmsg(188, "$You$ fire a shot into the air.", NULL, weprec);
+			alt_sysmsg(188, "$You$ fire a shot into the air.", nullptr, weprec);
 			return;
 		}
 	}
@@ -762,7 +762,7 @@ static void v_attack(uchar missile, parse_rec *targrec, parse_rec *weprec) {
 		if (!missile) {
 			int msgnum;
 			if (creature[targ - first_creat].hostile) {
-				alt_sysmsg(50, NULL, weprec, targrec); /* Preliminary message */
+				alt_sysmsg(50, nullptr, weprec, targrec); /* Preliminary message */
 				msgnum = 51;
 			} else msgnum = 54;
 			if (noun[wep - first_noun].drinkable) { /* i.e. a liquid */
@@ -970,7 +970,7 @@ void v_inventory(void) {
 static void v_quit(void) {
 	sysmsg(145, "Are you sure you want to quit?");
 	if (yesno("")) {
-		sysmsg(146, NULL);
+		sysmsg(146, nullptr);
 		quitflag = 1;
 	}
 }
@@ -1153,7 +1153,7 @@ rbool metacommand_cycle(int save_vb, int *p_redir_flag) {
 	supress_debug = !debug_any;
 	clear_stack();
 	if ((PURE_METAVERB || !was_metaverb)
-	        && 2 == scan_metacommand(0, 0, 0, 0, 0, NULL))
+	        && 2 == scan_metacommand(0, 0, 0, 0, 0, nullptr))
 		return 1;
 
 	supress_debug = 0;
@@ -1165,7 +1165,7 @@ rbool metacommand_cycle(int save_vb, int *p_redir_flag) {
 	if (actor != 0 && aver < AGX00) {
 		if (DEBUG_AGT_CMD)
 			debugout("*** Scanning: ANYBODY metacommands ****\n");
-		if (2 == scan_metacommand(2, vb, dobj, prep, iobj, NULL))
+		if (2 == scan_metacommand(2, vb, dobj, prep, iobj, nullptr))
 			return 1;
 	}
 
@@ -1293,7 +1293,7 @@ void exec_verb(void) {
 
 			case 50:
 				runptr(loc, help_ptr, "Sorry, you're on your own here.",
-				       2, NULL, NULL);
+				       2, nullptr, nullptr);
 				break;   /* HELP */
 			case 32:
 				v_inventory();
@@ -1401,7 +1401,7 @@ void exec_verb(void) {
 				break;
 			case (OLD_VERB+1):
 				cmd_saveable = 0; /* RESTART */
-				if (restart_state == NULL)
+				if (restart_state == nullptr)
 					writeln("Sorry, too little memory to support RESTART.");
 				else {
 					doing_restore = 2;
@@ -1447,7 +1447,7 @@ void exec_verb(void) {
 				replay(0);
 				break;
 			case (OLD_VERB+12): /* MENU */
-				if (verbmenu == NULL) {
+				if (verbmenu == nullptr) {
 					writeln("Sorry, but menus are not supported by this game.");
 					menu_mode = 0;
 					break;
@@ -1501,7 +1501,7 @@ void exec_verb(void) {
 		supress_debug = !debug_any;
 		clear_stack();
 		if ((PURE_METAVERB || !was_metaverb) &&
-		        2 == scan_metacommand(0, 57, 0, 0, 0, NULL))
+		        2 == scan_metacommand(0, 57, 0, 0, 0, nullptr))
 			turndone = 1;
 		supress_debug = 0;
 	}
@@ -1538,8 +1538,8 @@ int objcheck_cycle(rbool *success, parse_rec *act, int verbid,
 	/* The xobj_rec don't really matter */
 	dobj = dorec->obj;
 	dobj_rec = copy_parserec(dorec);
-	if (iorec == NULL) {
-		iobj_rec = make_parserec(0, NULL);
+	if (iorec == nullptr) {
+		iobj_rec = make_parserec(0, nullptr);
 		iobj = 0;
 	} else {
 		iobj = iorec->obj;
@@ -1550,7 +1550,7 @@ int objcheck_cycle(rbool *success, parse_rec *act, int verbid,
 	*success = 1;
 	supress_debug = !debug_disambig;
 	if (actor != 0 && aver < AGX00) {
-		result = scan_metacommand(2, verbid, dobj, prep_, iobj, NULL);
+		result = scan_metacommand(2, verbid, dobj, prep_, iobj, nullptr);
 		if (result == 2) {
 			free_all_parserec();
 			return disambig_score;
@@ -1561,7 +1561,7 @@ int objcheck_cycle(rbool *success, parse_rec *act, int verbid,
 		}
 	}
 	clear_stack();
-	result = scan_metacommand(actor, verbid, dobj, prep_, iobj, NULL);
+	result = scan_metacommand(actor, verbid, dobj, prep_, iobj, nullptr);
 	supress_debug = 0;
 	switch (result) {
 	case -2:
@@ -1589,7 +1589,7 @@ int check_obj(parse_rec *act, int verbid,
 	int result;
 	rbool success;
 
-	if (iorec == NULL)
+	if (iorec == nullptr)
 		do_disambig = 1; /* Disambiguating dobj */
 	else
 		do_disambig = 2; /* Disambiguating iobj */
diff --git a/engines/glk/agt/savegame.cpp b/engines/glk/agt/savegame.cpp
index 062706444c..3f2235b39c 100644
--- a/engines/glk/agt/savegame.cpp
+++ b/engines/glk/agt/savegame.cpp
@@ -154,7 +154,7 @@ static file_info fi_savecreat[] = {
 };
 
 static file_info fi_saveustr[] = {
-	{FT_TLINE, DT_DEFAULT, NULL, 0},
+	{FT_TLINE, DT_DEFAULT, nullptr, 0},
 	endrec
 };
 
@@ -168,12 +168,12 @@ uchar *getstate(uchar *gs)
 	rbool new_block; /* True if we allocate a new block */
 	long bp;
 
-	if (gs == NULL) {
+	if (gs == nullptr) {
 		rm_trap = 0; /* Don't exit on out-of-memory condition */
 		gs = (uchar *)rmalloc(state_size); /* This should be enough. */
 		rm_trap = 1;
-		if (gs == NULL) /* This is why we set rm_trap to 0 before calling rmalloc */
-			return NULL;
+		if (gs == nullptr) /* This is why we set rm_trap to 0 before calling rmalloc */
+			return nullptr;
 		new_block = 1;
 	} else new_block = 0;
 
@@ -202,13 +202,13 @@ uchar *getstate(uchar *gs)
 	bp += write_recarray(creature, sizeof(creat_rec),
 	                     rangefix(maxcreat - first_creat + 1),
 	                     fi_savecreat, bp);
-	if (userstr != NULL)
+	if (userstr != nullptr)
 		bp += write_recarray(userstr, sizeof(tline), MAX_USTR, fi_saveustr, bp);
-	if (objflag != NULL)
+	if (objflag != nullptr)
 		bp += write_recblock(objflag, FT_BYTE, objextsize(0), bp);
-	if (objprop != NULL)
+	if (objprop != nullptr)
 		bp += write_recblock(objprop, FT_INT32, objextsize(1), bp);
-	set_internal_buffer(NULL);
+	set_internal_buffer(nullptr);
 	gs[0] = bp & 0xFF;
 	gs[1] = (bp >> 8) & 0xFF;
 	gs[2] = (bp >> 16) & 0xFF;
@@ -257,7 +257,7 @@ void putstate(uchar *gs) { /* Restores games state. */
 	fi_savecreat[0].ptr = creat_ptr;
 	bp = 6;
 
-	read_globalrec(fi_savehead, 0, bp, 0);
+	read_globalrec(fi_savehead, nullptr, bp, 0);
 	bp += compute_recsize(fi_savehead);
 	read_recblock(flag, FT_BYTE, FLAG_NUM + 1, bp, 0);
 	bp += ft_leng[FT_BYTE] * (FLAG_NUM + 1);
@@ -267,36 +267,36 @@ void putstate(uchar *gs) { /* Restores games state. */
 	bp += ft_leng[FT_INT32] * (VAR_NUM + 1);
 
 	numrec = rangefix(maxroom - first_room + 1);
-	read_recarray(room, sizeof(room_rec), numrec, fi_saveroom, 0, bp, 0);
+	read_recarray(room, sizeof(room_rec), numrec, fi_saveroom, nullptr, bp, 0);
 	bp += compute_recsize(fi_saveroom) * numrec;
 	numrec = rangefix(maxnoun - first_noun + 1);
-	read_recarray(noun, sizeof(noun_rec), numrec, fi_savenoun, 0, bp, 0);
+	read_recarray(noun, sizeof(noun_rec), numrec, fi_savenoun, nullptr, bp, 0);
 	bp += compute_recsize(fi_savenoun) * numrec;
 	numrec = rangefix(maxcreat - first_creat + 1);
-	read_recarray(creature, sizeof(creat_rec), numrec, fi_savecreat, 0, bp, 0);
+	read_recarray(creature, sizeof(creat_rec), numrec, fi_savecreat, nullptr, bp, 0);
 	bp += compute_recsize(fi_savecreat) * numrec;
-	if (userstr != NULL) {
-		read_recarray(userstr, sizeof(tline), MAX_USTR, fi_saveustr, 0, bp, 0);
+	if (userstr != nullptr) {
+		read_recarray(userstr, sizeof(tline), MAX_USTR, fi_saveustr, nullptr, bp, 0);
 		bp += ft_leng[FT_TLINE] * MAX_USTR;
 	}
-	if (objflag != NULL) {
+	if (objflag != nullptr) {
 		i = objextsize(0);
 		read_recblock(objflag, FT_BYTE, i, bp, 0);
 		bp += ft_leng[FT_BYTE] * i;
 	}
-	if (objprop != NULL) {
+	if (objprop != nullptr) {
 		i = objextsize(1);
 		read_recblock(objprop, FT_INT32, i, bp, 0);
 		bp += ft_leng[FT_INT32] * i;
 	}
-	set_internal_buffer(NULL);
+	set_internal_buffer(nullptr);
 
 	if (skip_descr)   /* Need to "fix" position information. This is a hack. */
 		/* Basically, this sets the position of each object to its default */
 		/* The problem here is that the usual position info is invalid-- we've
 		   changed games, and hence dictionaries */
 		for (i = 0; i < maxnoun - first_noun; i++) {
-			if (noun[i].position != NULL && noun[i].position[0] != 0)
+			if (noun[i].position != nullptr && noun[i].position[0] != 0)
 				noun[i].pos_prep = -1;
 			else noun[i].pos_prep = 0;
 		}
@@ -305,7 +305,7 @@ void putstate(uchar *gs) { /* Restores games state. */
 			if (noun[i].pos_prep == -1)
 				noun[i].position = noun[i].initpos;
 			else
-				noun[i].position = NULL;
+				noun[i].position = nullptr;
 
 	init_vals();
 	skip_descr = 0; /* If we set this to 1, restore it to its original state */
@@ -330,7 +330,7 @@ void init_state_sys(void)
 	             + ft_leng[FT_BYTE] * objextsize(0)
 	             + ft_leng[FT_INT32] * objextsize(1)
 	             + 6;  /* Six bytes in header */
-	if (userstr != NULL) state_size += ft_leng[FT_TLINE] * MAX_USTR;
+	if (userstr != nullptr) state_size += ft_leng[FT_TLINE] * MAX_USTR;
 }
 
 
@@ -342,11 +342,11 @@ extern Common::Error savegame(Common::WriteStream *savefile) {
 	long size;
 
 #ifndef UNDO_SAVE
-	gs = getstate(NULL);
+	gs = getstate(nullptr);
 #else
 	gs = undo_state;
 #endif
-	if (gs == NULL) {
+	if (gs == nullptr) {
 		writeln("Insufficiant memory to support SAVE.");
 		return Common::kWritingFailed;
 	}
diff --git a/engines/glk/agt/token.cpp b/engines/glk/agt/token.cpp
index 84619fc330..6e7e511488 100644
--- a/engines/glk/agt/token.cpp
+++ b/engines/glk/agt/token.cpp
@@ -157,7 +157,7 @@ void move_in_dir(int obj, int dir) {
 /*  Stack routines:   Manipulating the expression stack                */
 /* ------------------------------------------------------------------- */
 
-static long *stack = NULL;
+static long *stack = nullptr;
 static int sp = 0; /* Stack pointer */
 static int stacksize = 0; /* Actual space allocated to the stack */
 
diff --git a/engines/glk/agt/util.cpp b/engines/glk/agt/util.cpp
index ea8ae885ef..363f573bae 100644
--- a/engines/glk/agt/util.cpp
+++ b/engines/glk/agt/util.cpp
@@ -151,9 +151,9 @@ void *rmalloc(long size) {
 		error("Memory allocation error: Over-sized structure requested.");
 	}
 	assert(size >= 0);
-	if (size == 0) return NULL;
+	if (size == 0) return nullptr;
 	p = malloc((size_t)size);
-	if (p == NULL && rm_trap && size > 0) {
+	if (p == nullptr && rm_trap && size > 0) {
 		error("Memory allocation error: Out of memory.");
 	}
 	if (rm_acct) ralloc_cnt++;
@@ -169,21 +169,21 @@ void *rrealloc(void *old, long size) {
 	assert(size >= 0);
 	if (size == 0) {
 		r_free(old);
-		return NULL;
+		return nullptr;
 	}
-	if (rm_acct && old == NULL) ralloc_cnt++;
+	if (rm_acct && old == nullptr) ralloc_cnt++;
 	p = realloc(old, (size_t)size);
-	if (p == NULL && rm_trap && size > 0) {
+	if (p == nullptr && rm_trap && size > 0) {
 		error("Memory reallocation error: Out of memory.");
 	}
 	return p;
 }
 
 char *rstrdup(const char *s) {
-	if (s == NULL) return NULL;
+	if (s == nullptr) return nullptr;
 
 	char *t = scumm_strdup(s);
-	if (t == NULL && rm_trap) {
+	if (t == nullptr && rm_trap) {
 		error("Memory duplication error: Out of memory.");
 	}
 	if (rm_acct) ralloc_cnt++;
@@ -194,7 +194,7 @@ char *rstrdup(const char *s) {
 void r_free(void *p) {
 	int tmp;
 
-	if (p == NULL) return;
+	if (p == nullptr) return;
 
 	tmp = get_rm_size();            /* Take worst case in all cases */
 	if (tmp > rm_size) rm_size = tmp;
@@ -248,14 +248,14 @@ char *concdup(const char *s1, const char *s2) {
 	char *s;
 
 	len1 = len2 = 0;
-	if (s1 != NULL) len1 = strlen(s1);
-	if (s2 != NULL) len2 = strlen(s2);
+	if (s1 != nullptr) len1 = strlen(s1);
+	if (s2 != nullptr) len2 = strlen(s2);
 
 	s = (char *)rmalloc(sizeof(char) * (len1 + len2 + 2));
-	if (s1 != NULL)
+	if (s1 != nullptr)
 		memcpy(s, s1, len1);
 	memcpy(s + len1, " ", 1);
-	if (s2 != NULL)
+	if (s2 != nullptr)
 		memcpy(s + len1 + 1, s2, len2);
 	s[len1 + len2 + 1] = 0;
 	return s;
@@ -386,7 +386,7 @@ genfile openfile(fc_type fc, filetype ext, const char *err, rbool ferr)
 	const char *errstr;
 
 	tfile = readopen(fc, ext, &errstr);
-	if (errstr != NULL && err != NULL)
+	if (errstr != nullptr && err != nullptr)
 		print_error("", ext, err, ferr);
 
 	return tfile;
@@ -406,7 +406,7 @@ genfile openbin(fc_type fc, filetype ext, const char *err, rbool ferr)
 	char *fname;
 
 	f = readopen(fc, ext, &errstr);
-	if (errstr != NULL && err != NULL) {
+	if (errstr != nullptr && err != nullptr) {
 		fname = formal_name(fc, ext);
 		print_error(fname, ext, err, ferr);
 		rfree(fname);
@@ -439,7 +439,7 @@ pass it back as its return value.  n is ignored in this case */
 	int i, j, csize;
 	int buffsize; /* Current size of buff, if we are allocating it dynamically */
 
-	if (buff == NULL) {
+	if (buff == nullptr) {
 		buff = (char *)rrealloc(buff, READLN_GRAIN * sizeof(char));
 		buffsize = READLN_GRAIN;
 		n = buffsize - 1;
@@ -480,7 +480,7 @@ pass it back as its return value.  n is ignored in this case */
 
 	if (i == 0 && (c == EOF || c == DOS_EOF)) { /* We've hit the end of the file */
 		if (buffsize >= 0) rfree(buff);
-		return NULL;
+		return nullptr;
 	}
 
 	if (buffsize >= 0) { /* Shrink buffer to appropriate size */
@@ -503,7 +503,7 @@ pass it back as its return value.  n is ignored in this case */
 
 genfile bfile;
 
-static uchar *buffer = NULL;
+static uchar *buffer = nullptr;
 static long buffsize; /* How big the buffer is */
 static long record_size;  /* Size of a record in the file */
 static long buff_frame;  /* The file index corrosponding to buffer[0] */
@@ -551,12 +551,12 @@ buffreopen will be called before any major file activity
 	char ebuff[200];
 	const char *errstr;
 
-	assert(buffer == NULL); /* If not, it means these routines have been
+	assert(buffer == nullptr); /* If not, it means these routines have been
 			   called by someone else who isn't done yet */
 
 	bfile = readopen(fc, ext, &errstr);
-	if (errstr != NULL) {
-		if (rectype == NULL) {
+	if (errstr != nullptr) {
+		if (rectype == nullptr) {
 			return 0;
 		} else
 			fatal(errstr);
@@ -701,13 +701,13 @@ file_id_type bw_fileid;
 void bw_open(fc_type fc, filetype ext) {
 	const char *errstr;
 
-	assert(buffer == NULL);
+	assert(buffer == nullptr);
 
 	bfile = writeopen(fc, ext, &bw_fileid, &errstr);
-	if (errstr != NULL) fatal(errstr);
+	if (errstr != nullptr) fatal(errstr);
 	bw_last = 0;
 	buffsize = 0;
-	buffer = NULL;
+	buffer = nullptr;
 #ifdef DEBUG_SEEK
 	bw_fileleng = 0;
 #endif
@@ -740,7 +740,7 @@ static void bw_setblock(long fofs, long recnum, long rsize)
 /* Set parameters for current block */
 {
 	/* First, flush old block if neccessary */
-	if (buffer != NULL) {
+	if (buffer != nullptr) {
 		bw_flush();
 		rfree(buffer);
 	}
@@ -790,7 +790,7 @@ void bw_close(void) {
 /* If the internal buffer is not NULL, it is used instead of a file */
 /* (This is used by RESTART, etc. to save state to memory rather than
    to a file) */
-static uchar *int_buff = NULL;
+static uchar *int_buff = nullptr;
 static long ibuff_ofs, ibuff_rsize;
 
 void set_internal_buffer(void *buff) {
@@ -813,7 +813,7 @@ static uchar *get_ibuff(long index) {
 static void buff_blockread(void *buff, long size, long offset) {
 	const char *errstr;
 
-	if (int_buff != NULL)
+	if (int_buff != nullptr)
 		memcpy((char *)buff, int_buff + offset, size);
 	else {
 		binseek(bfile, offset);
@@ -824,7 +824,7 @@ static void buff_blockread(void *buff, long size, long offset) {
 
 /* This writes buff to disk. */
 static void bw_blockwrite(void *buff, long size, long offset) {
-	if (int_buff != NULL)
+	if (int_buff != nullptr)
 		memcpy(int_buff + offset, (char *)buff, size);
 	else {
 		bw_flush();
@@ -956,12 +956,12 @@ static void read_filerec(file_info *rec_desc, const uchar *filedata) {
 			mask = 1;
 			filedata += 1;
 		}
-		if (filebase == NULL || (filedata - filebase) >= record_size) {
+		if (filebase == nullptr || (filedata - filebase) >= record_size) {
 			/* We're past the end of the block; read in zeros for the rest
 			of entries. */
 			past_eob = 1;
 			filedata = zero_block;
-			filebase = NULL;
+			filebase = nullptr;
 		}
 		switch (rec_desc->ftype) {
 		case FT_INT16:
@@ -1186,7 +1186,7 @@ void *read_recarray(void *base, long eltsize, long numelts,
 	file_info *curr;
 	uchar *file_data;
 
-	if (numelts == 0) return NULL;
+	if (numelts == 0) return nullptr;
 
 	if (int_buff)
 		set_ibuff(file_offset, compute_recsize(field_info));
@@ -1194,7 +1194,7 @@ void *read_recarray(void *base, long eltsize, long numelts,
 		buffreopen(file_offset, compute_recsize(field_info), numelts,
 		           file_blocksize, rectype);
 
-	if (base == NULL)
+	if (base == nullptr)
 		base = rmalloc(eltsize * numelts);
 
 	for (curr = field_info; curr->ftype != FT_END; curr++)
@@ -1236,7 +1236,7 @@ long write_recarray(void *base, long eltsize, long numelts,
 	else
 		bw_setblock(file_offset, numelts, compute_recsize(field_info));
 
-	if (base != NULL)
+	if (base != nullptr)
 		for (curr = field_info; curr->ftype != FT_END; curr++)
 			if (curr->dtype != DT_DESCPTR && curr->dtype != DT_CMDPTR)
 				curr->ptr = ((char *)base + curr->offset);
@@ -1246,7 +1246,7 @@ long write_recarray(void *base, long eltsize, long numelts,
 			file_data = get_ibuff(i);
 		else
 			file_data = bw_getbuff(i);
-		if (base != NULL) {
+		if (base != nullptr) {
 			write_filerec(field_info, file_data);
 			for (curr = field_info; curr->ftype != FT_END; curr++)
 				if (curr->dtype == DT_DESCPTR)
@@ -1294,7 +1294,7 @@ long write_globalrec(file_info *global_info, long file_offset) {
 
 
 static file_info fi_temp[] = {
-	{0, DT_DEFAULT, NULL, 0},
+	{0, DT_DEFAULT, nullptr, 0},
 	endrec
 };
 
@@ -1307,7 +1307,7 @@ void *read_recblock(void *base, int ftype, long numrec,
 	switch (ftype) {
 	case FT_CHAR:
 	case FT_BYTE:
-		if (base == NULL) base = rmalloc(numrec * sizeof(char));
+		if (base == nullptr) base = rmalloc(numrec * sizeof(char));
 		buff_blockread(base, numrec, offset);
 		if (ftype == FT_CHAR) {
 			long i;
diff --git a/engines/glk/alan2/alan2.cpp b/engines/glk/alan2/alan2.cpp
index d875deecb3..d4d0982956 100644
--- a/engines/glk/alan2/alan2.cpp
+++ b/engines/glk/alan2/alan2.cpp
@@ -60,7 +60,7 @@ bool Alan2::initialize() {
 		_advName = Common::String(_advName.c_str(), _advName.size() - 4);
 
 	// first, open a window for error output
-	glkMainWin = g_vm->glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
+	glkMainWin = g_vm->glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 0);
 	if (glkMainWin == nullptr)
 		::error("FATAL ERROR: Cannot open initial window");
 
diff --git a/engines/glk/alan2/args.cpp b/engines/glk/alan2/args.cpp
index 66989f6058..2306487384 100644
--- a/engines/glk/alan2/args.cpp
+++ b/engines/glk/alan2/args.cpp
@@ -35,9 +35,9 @@ static void switches(unsigned argc, char *argv[]) {
 void args(int argc, char *argv[]) {
 	char *prgnam;
 
-	if ((prgnam = strrchr(argv[0], '\\')) == NULL
-	        && (prgnam = strrchr(argv[0], '/')) == NULL
-	        && (prgnam = strrchr(argv[0], ':')) == NULL)
+	if ((prgnam = strrchr(argv[0], '\\')) == nullptr
+	        && (prgnam = strrchr(argv[0], '/')) == nullptr
+	        && (prgnam = strrchr(argv[0], ':')) == nullptr)
 		prgnam = argv[0];
 	else
 		prgnam++;
@@ -50,7 +50,7 @@ void args(int argc, char *argv[]) {
 	if (advnam[0] == '\0')
 		/* No game given, try program name */
 		if (scumm_stricmp(prgnam, PROGNAME) != 0
-		        && strstr(prgnam, PROGNAME) == 0)
+		        && strstr(prgnam, PROGNAME) == nullptr)
 			advnam = scumm_strdup(argv[0]);
 }
 
diff --git a/engines/glk/alan2/exe.cpp b/engines/glk/alan2/exe.cpp
index 0053f68a4c..275cf0c061 100644
--- a/engines/glk/alan2/exe.cpp
+++ b/engines/glk/alan2/exe.cpp
@@ -811,15 +811,15 @@ static void dscrobj(Aword obj) {
 }
 
 static void dscract(Aword act) {
-	ScrElem *scr = NULL;
+	ScrElem *scr = nullptr;
 
 	if (acts[act - ACTMIN].script != 0) {
 		for (scr = (ScrElem *) addrTo(acts[act - ACTMIN].scradr); !endOfTable(scr); scr++)
 			if (scr->code == acts[act - ACTMIN].script)
 				break;
-		if (endOfTable(scr)) scr = NULL;
+		if (endOfTable(scr)) scr = nullptr;
 	}
-	if (scr != NULL && scr->dscr != 0)
+	if (scr != nullptr && scr->dscr != 0)
 		interpret(scr->dscr);
 	else if (acts[act - ACTMIN].dscr != 0)
 		interpret(acts[act - ACTMIN].dscr);
@@ -1125,7 +1125,7 @@ Aword contains(Aptr string, Aptr substring) {
 	strlow((char *)string);
 	strlow((char *)substring);
 
-	found = (strstr((char *)string, (char *)substring) != 0);
+	found = (strstr((char *)string, (char *)substring) != nullptr);
 
 	free((char *)string);
 	free((char *)substring);
diff --git a/engines/glk/alan2/main.cpp b/engines/glk/alan2/main.cpp
index bae21c0790..f0e0c3f61e 100644
--- a/engines/glk/alan2/main.cpp
+++ b/engines/glk/alan2/main.cpp
@@ -174,12 +174,12 @@ void statusline() {
 	int pcol = col;
 	uint i;
 
-	if (NULL == glkStatusWin)
+	if (nullptr == glkStatusWin)
 		return;
 
 	g_vm->glk_set_window(glkStatusWin);
 	g_vm->glk_window_clear(glkStatusWin);
-	g_vm->glk_window_get_size(glkStatusWin, &glkWidth, NULL);
+	g_vm->glk_window_get_size(glkStatusWin, &glkWidth, nullptr);
 
 	g_vm->glk_set_style(style_User1);
 	for (i = 0; i < glkWidth; i++)
@@ -265,7 +265,7 @@ void clear() {
 void *allocate(unsigned long len /* IN - Length to allocate */) {
 	void *p = (void *)malloc((size_t)len);
 
-	if (p == NULL)
+	if (p == nullptr)
 		syserr("Out of memory.");
 
 	return p;
@@ -433,7 +433,7 @@ void output(const char original[]) {
 	if (str[0] != '$' || str[1] != '$')
 		space();            /* Output space if needed (& not inhibited) */
 
-	while ((symptr = strchr(str, '$')) != (char *) NULL) {
+	while ((symptr = strchr(str, '$')) != (char *) nullptr) {
 		ch = *symptr;       /* Terminate before symbol */
 		*symptr = '\0';
 		if (strlen(str) > 0) {
@@ -730,16 +730,16 @@ static AltElem *findalt(
 	AltElem *alt;
 
 	if (vrbsadr == 0)
-		return (NULL);
+		return (nullptr);
 
 	for (vrb = (VrbElem *) addrTo(vrbsadr); !endOfTable(vrb); vrb++)
 		if ((int)vrb->code == cur.vrb) {
 			for (alt = (AltElem *) addrTo(vrb->alts); !endOfTable(alt); alt++)
 				if (alt->param == param || alt->param == 0)
 					return alt;
-			return NULL;
+			return nullptr;
 		}
-	return NULL;
+	return nullptr;
 }
 
 
@@ -757,27 +757,27 @@ Boolean possible() {
 	fail = FALSE;
 	alt[0] = findalt(header->vrbs, 0);
 	/* Perform global checks */
-	if (alt[0] != 0 && alt[0]->checks != 0) {
+	if (alt[0] != nullptr && alt[0]->checks != 0) {
 		if (!trycheck(alt[0]->checks, FALSE)) return FALSE;
 		if (fail) return FALSE;
 	}
 
 	/* Now CHECKs in this location */
 	alt[1] = findalt(locs[cur.loc - LOCMIN].vrbs, 0);
-	if (alt[1] != 0 && alt[1]->checks != 0)
+	if (alt[1] != nullptr && alt[1]->checks != 0)
 		if (!trycheck(alt[1]->checks, FALSE))
 			return FALSE;
 
 	for (i = 0; params[i].code != EOD; i++) {
 		alt[i + 2] = findalt(objs[params[i].code - OBJMIN].vrbs, i + 1);
 		/* CHECKs in a possible parameter */
-		if (alt[i + 2] != 0 && alt[i + 2]->checks != 0)
+		if (alt[i + 2] != nullptr && alt[i + 2]->checks != 0)
 			if (!trycheck(alt[i + 2]->checks, FALSE))
 				return FALSE;
 	}
 
 	for (i = 0; i < 2 || params[i - 2].code != EOD; i++)
-		if (alt[i] != 0 && alt[i]->action != 0)
+		if (alt[i] != nullptr && alt[i]->action != 0)
 			break;
 	if (i >= 2 && params[i - 2].code == EOD)
 		/* Didn't find any code for this verb/object combination */
@@ -803,7 +803,7 @@ static void do_it(CONTEXT) {
 	fail = FALSE;
 	alt[0] = findalt(header->vrbs, 0);
 	/* Perform global checks */
-	if (alt[0] != 0 && alt[0]->checks != 0) {
+	if (alt[0] != nullptr && alt[0]->checks != 0) {
 		if (trcflg)
 			printf("\n<VERB %d, CHECK, GLOBAL:>\n", cur.vrb);
 		if (!trycheck(alt[0]->checks, TRUE)) return;
@@ -812,7 +812,7 @@ static void do_it(CONTEXT) {
 
 	/* Now CHECKs in this location */
 	alt[1] = findalt(locs[cur.loc - LOCMIN].vrbs, 0);
-	if (alt[1] != 0 && alt[1]->checks != 0) {
+	if (alt[1] != nullptr && alt[1]->checks != 0) {
 		if (trcflg)
 			printf("\n<VERB %d, CHECK, in LOCATION:>\n", cur.vrb);
 		if (!trycheck(alt[1]->checks, TRUE)) return;
@@ -821,7 +821,7 @@ static void do_it(CONTEXT) {
 
 	for (i = 0; params[i].code != EOD; i++) {
 		if (isLit(params[i].code))
-			alt[i + 2] = 0;
+			alt[i + 2] = nullptr;
 		else {
 			if (isObj(params[i].code))
 				alt[i + 2] = findalt(objs[params[i].code - OBJMIN].vrbs, i + 1);
@@ -830,7 +830,7 @@ static void do_it(CONTEXT) {
 			else
 				syserr("Illegal parameter type.");
 			/* CHECKs in the parameters */
-			if (alt[i + 2] != 0 && alt[i + 2]->checks != 0) {
+			if (alt[i + 2] != nullptr && alt[i + 2]->checks != 0) {
 				if (trcflg)
 					printf("\n<VERB %d, CHECK, in Parameter #%d:>\n", cur.vrb, i);
 				if (!trycheck(alt[i + 2]->checks, TRUE)) return;
@@ -841,7 +841,7 @@ static void do_it(CONTEXT) {
 
 	/* Check for anything to execute... */
 	for (i = 0; i < 2 || params[i - 2].code != EOD; i++)
-		if (alt[i] != 0 && alt[i]->action != 0)
+		if (alt[i] != nullptr && alt[i]->action != 0)
 			break;
 	if (i >= 2 && params[i - 2].code == EOD) {
 		// Didn't find any code for this verb/object combination
@@ -857,7 +857,7 @@ static void do_it(CONTEXT) {
 		done[i] = FALSE;
 	i--;
 	while (i >= 0) {
-		if (alt[i] != 0)
+		if (alt[i] != nullptr)
 			if (alt[i]->qual == (Aword)Q_BEFORE || alt[i]->qual == (Aword)Q_ONLY) {
 				if (alt[i]->action != 0) {
 					if (trcflg) {
@@ -883,7 +883,7 @@ static void do_it(CONTEXT) {
 
 	/* Then execute any not declared as AFTER, i.e. the default */
 	for (i = 0; i < 2 || params[i - 2].code != EOD; i++) {
-		if (alt[i] != 0)
+		if (alt[i] != nullptr)
 			if (alt[i]->qual != (Aword)Q_AFTER) {
 				if (!done[i] && alt[i]->action != 0) {
 					if (trcflg) {
@@ -905,7 +905,7 @@ static void do_it(CONTEXT) {
 	/* Finally, the ones declared as after */
 	i--;
 	while (i >= 0) {
-		if (alt[i] != 0)
+		if (alt[i] != nullptr)
 			if (!done[i] && alt[i]->action != 0) {
 				if (trcflg) {
 					if (i == 0)
@@ -1081,7 +1081,7 @@ static void load() {
 	/* Allocate and load memory */
 
 	/* No memory allocated yet? */
-	if (memory == NULL) {
+	if (memory == nullptr) {
 #ifdef V25COMPATIBLE
 		if (tmphdr.vers[0] == 2 && tmphdr.vers[1] == 5)
 			/* We need some more memory to expand 2.5 format*/
diff --git a/engines/glk/alan2/parse.cpp b/engines/glk/alan2/parse.cpp
index 5b97448cfb..9a43f81306 100644
--- a/engines/glk/alan2/parse.cpp
+++ b/engines/glk/alan2/parse.cpp
@@ -125,7 +125,7 @@ static char *gettoken(char *tokBuf) {
 	static char *marker;
 	static char oldch;
 
-	if (tokBuf == NULL)
+	if (tokBuf == nullptr)
 		*marker = oldch;
 	else
 		marker = tokBuf;
@@ -140,7 +140,7 @@ static char *gettoken(char *tokBuf) {
 		while (*marker != '\"') marker++;
 		marker++;
 	} else if (*marker == '\0' || *marker == '\n')
-		return NULL;
+		return nullptr;
 	else
 		marker++;
 	oldch = *marker;
@@ -171,12 +171,12 @@ static void agetline(CONTEXT) {
 		strcpy(isobuf, buf);
 
 		token = gettoken(isobuf);
-		if (token != NULL && strcmp("debug", token) == 0 && header->debug) {
+		if (token != nullptr && strcmp("debug", token) == 0 && header->debug) {
 			dbgflg = TRUE;
 			debug();
-			token = NULL;
+			token = nullptr;
 		}
-	} while (token == NULL);
+	} while (token == nullptr);
 	eol = FALSE;
 	lin = 1;
 }
@@ -224,7 +224,7 @@ static void scan(CONTEXT) {
 			CALL1(unknown, token)
 		}
 		wrds[i] = EOD;
-		eol = (token = gettoken(NULL)) == NULL;
+		eol = (token = gettoken(nullptr)) == nullptr;
 	} while (!eol);
 }
 
@@ -287,10 +287,10 @@ static void unambig(CONTEXT, ParamElem plst[]) {
 	static ParamElem *savlst; /* Saved list for backup at EOD */
 	int firstWord, lastWord;  /* The words the player used */
 
-	if (refs == NULL)
+	if (refs == nullptr)
 		refs = (ParamElem *)allocate((MAXENTITY + 1) * sizeof(ParamElem));
 
-	if (savlst == NULL)
+	if (savlst == nullptr)
 		savlst = (ParamElem *)allocate((MAXENTITY + 1) * sizeof(ParamElem));
 
 	if (isLiteral(wrds[wrdidx])) {
@@ -388,12 +388,12 @@ static void unambig(CONTEXT, ParamElem plst[]) {
 }
 
 static void simple(CONTEXT, ParamElem olst[]) {
-	static ParamElem *tlst = NULL;
+	static ParamElem *tlst = nullptr;
 	int savidx = wrdidx;
 	Boolean savplur = FALSE;
 	int i;
 
-	if (tlst == NULL)
+	if (tlst == nullptr)
 		tlst = (ParamElem *) allocate(sizeof(ParamElem) * (MAXENTITY + 1));
 	tlst[0].code = EOD;
 
@@ -448,9 +448,9 @@ static void simple(CONTEXT, ParamElem olst[]) {
 
 */
 static void complex(CONTEXT, ParamElem olst[]) {
-	static ParamElem *alst = NULL;
+	static ParamElem *alst = nullptr;
 
-	if (alst == NULL)
+	if (alst == nullptr)
 		alst = (ParamElem *) allocate((MAXENTITY + 1) * sizeof(ParamElem));
 
 	if (isAll(wrds[wrdidx])) {
@@ -526,10 +526,10 @@ static void tryMatch(CONTEXT, ParamElem matchLst[]) {
 	ClaElem *cla;         /* Pointer to class definitions */
 	Boolean anyPlural = FALSE;    /* Any parameter that was plural? */
 	int i, p;
-	static ParamElem *tlst = NULL; /* List of params found by complex() */
-	static Boolean *checked = NULL; /* Corresponding parameter checked? */
+	static ParamElem *tlst = nullptr; /* List of params found by complex() */
+	static Boolean *checked = nullptr; /* Corresponding parameter checked? */
 
-	if (tlst == NULL) {
+	if (tlst == nullptr) {
 		tlst = (ParamElem *) allocate((MAXENTITY + 1) * sizeof(ParamElem));
 		checked = (Boolean *) allocate((MAXENTITY + 1) * sizeof(Boolean));
 	}
@@ -695,7 +695,7 @@ static void match(CONTEXT, ParamElem *matchLst) {
 }
 
 void parse(CONTEXT) {
-	if (mlst == NULL) {       /* Allocate large enough paramlists */
+	if (mlst == nullptr) {       /* Allocate large enough paramlists */
 		mlst = (ParamElem *) allocate(sizeof(ParamElem) * (MAXENTITY + 1));
 		mlst[0].code = EOD;
 		pmlst = (ParamElem *) allocate(sizeof(ParamElem) * (MAXENTITY + 1));
diff --git a/engines/glk/alan2/sysdep.cpp b/engines/glk/alan2/sysdep.cpp
index f9f92171fd..2056a7f14c 100644
--- a/engines/glk/alan2/sysdep.cpp
+++ b/engines/glk/alan2/sysdep.cpp
@@ -110,17 +110,17 @@ static char uppChrs[] = {
 
 
 int isSpace(int c) {            /* IN - Native character to test */
-	return (c != '\0' && strchr(spcChrs, c) != 0);
+	return (c != '\0' && strchr(spcChrs, c) != nullptr);
 }
 
 
 int isLower(int c) {            /* IN - Native character to test */
-	return (c != '\0' && strchr(lowChrs, c) != 0);
+	return (c != '\0' && strchr(lowChrs, c) != nullptr);
 }
 
 
 int isUpper(int c) {            /* IN - Native character to test */
-	return (c != '\0' && strchr(uppChrs, c) != 0);
+	return (c != '\0' && strchr(uppChrs, c) != nullptr);
 }
 
 int isLetter(int c) {           /* IN - Native character to test */
@@ -158,13 +158,13 @@ char *strupp(char str[]) {      /* INOUT - Native string to convert */
 
 int isLowerCase(int c) {        /* IN - ISO character to test */
 	static char lowChars[] = "abcdefghijklmnopqrstuvwxyz\340\341\342\343\344\345\346\347\351\352\353\354\355\356\357\360\361\362\363\364\365\366\370\371\372\373\374\375\376\377";
-	return (c != '\0' && strchr(lowChars, c) != 0);
+	return (c != '\0' && strchr(lowChars, c) != nullptr);
 }
 
 
 int isUpperCase(int c) {        /* IN - ISO character to test */
 	static char upperChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337";
-	return (c != '\0' && strchr(upperChars, c) != 0);
+	return (c != '\0' && strchr(upperChars, c) != nullptr);
 }
 
 
diff --git a/engines/glk/alan3/act.cpp b/engines/glk/alan3/act.cpp
index 720a35d2ce..21967e15cc 100644
--- a/engines/glk/alan3/act.cpp
+++ b/engines/glk/alan3/act.cpp
@@ -33,12 +33,12 @@ namespace Alan3 {
 
 /*----------------------------------------------------------------------*/
 static void executeCommand(CONTEXT, int verb, Parameter parameters[]) {
-	static AltInfo *altInfos = NULL; /* Need to survive lots of different exits...*/
+	static AltInfo *altInfos = nullptr; /* Need to survive lots of different exits...*/
 	int altIndex;
 	bool flag;
 
 	/* Did we leave anything behind last time... */
-	if (altInfos != NULL)
+	if (altInfos != nullptr)
 		free(altInfos);
 
 	altInfos = findAllAlternatives(verb, parameters);
@@ -53,7 +53,7 @@ static void executeCommand(CONTEXT, int verb, Parameter parameters[]) {
 
 	/* Now perform actions! First try any BEFORE or ONLY from inside out */
 	for (altIndex = lastAltInfoIndex(altInfos); altIndex >= 0; altIndex--) {
-		if (altInfos[altIndex].alt != 0) // TODO Can this ever be NULL? Why?
+		if (altInfos[altIndex].alt != nullptr) // TODO Can this ever be NULL? Why?
 			if (altInfos[altIndex].alt->qual == (Aword)Q_BEFORE
 			        || altInfos[altIndex].alt->qual == (Aword)Q_ONLY) {
 				FUNC1(executedOk, flag, &altInfos[altIndex])
@@ -66,7 +66,7 @@ static void executeCommand(CONTEXT, int verb, Parameter parameters[]) {
 
 	/* Then execute any not declared as AFTER, i.e. the default */
 	for (altIndex = 0; !altInfos[altIndex].end; altIndex++) {
-		if (altInfos[altIndex].alt != 0) {
+		if (altInfos[altIndex].alt != nullptr) {
 			if (altInfos[altIndex].alt->qual != (Aword)Q_AFTER) {
 				FUNC1(executedOk, flag, &altInfos[altIndex])
 				if (!flag)
@@ -77,7 +77,7 @@ static void executeCommand(CONTEXT, int verb, Parameter parameters[]) {
 
 	/* Finally, the ones declared as AFTER */
 	for (altIndex = lastAltInfoIndex(altInfos); altIndex >= 0; altIndex--) {
-		if (altInfos[altIndex].alt != 0) {
+		if (altInfos[altIndex].alt != nullptr) {
 			FUNC1(executedOk, flag, &altInfos[altIndex])
 			if (!flag)
 				CALL0(abortPlayerCommand)
diff --git a/engines/glk/alan3/actor.cpp b/engines/glk/alan3/actor.cpp
index 337034fcd3..b91677d1c2 100644
--- a/engines/glk/alan3/actor.cpp
+++ b/engines/glk/alan3/actor.cpp
@@ -42,7 +42,7 @@ ScriptEntry *scriptOf(int actor) {
 		if (!isEndOfArray(scr))
 			return scr;
 	}
-	return NULL;
+	return nullptr;
 }
 
 
@@ -51,7 +51,7 @@ StepEntry *stepOf(int actor) {
 	StepEntry *step;
 	ScriptEntry *scr = scriptOf(actor);
 
-	if (scr == NULL) return NULL;
+	if (scr == nullptr) return nullptr;
 
 	step = (StepEntry *)pointerTo(scr->steps);
 	step = &step[admin[actor].step];
@@ -64,7 +64,7 @@ StepEntry *stepOf(int actor) {
 void describeActor(CONTEXT, int actor) {
 	ScriptEntry *script = scriptOf(actor);
 
-	if (script != NULL && script->description != 0) {
+	if (script != nullptr && script->description != 0) {
 		CALL1(interpret, script->description)
 	} else if (hasDescription(actor)) {
 		CALL1(describeAnything, actor)
diff --git a/engines/glk/alan3/alt_info.cpp b/engines/glk/alan3/alt_info.cpp
index 21cbb16387..17f06a5a88 100644
--- a/engines/glk/alan3/alt_info.cpp
+++ b/engines/glk/alan3/alt_info.cpp
@@ -75,7 +75,7 @@ static void traceAltInfo(CONTEXT, AltInfo *alt) {
 		break;
 	case PARAMETER_LEVEL: {
 		char *parameterName = parameterNameInSyntax(current.verb, alt->parameter);
-		if (parameterName != NULL)
+		if (parameterName != nullptr)
 			printf("in parameter %s(#%d)=", parameterName, alt->parameter);
 		else
 			printf("in parameter #%d=", alt->parameter);
@@ -100,7 +100,7 @@ static void traceVerbCheck(CONTEXT, AltInfo *alt, bool execute) {
 
 /*======================================================================*/
 bool checkFailed(CONTEXT, AltInfo *altInfo, bool execute) {
-	if (altInfo->alt != NULL && altInfo->alt->checks != 0) {
+	if (altInfo->alt != nullptr && altInfo->alt->checks != 0) {
 		R0CALL2(traceVerbCheck, altInfo, execute)
 
 		// TODO Why does this not generate a regression error with !
@@ -153,7 +153,7 @@ bool executedOk(CONTEXT, AltInfo *altInfo) {
 
 /*======================================================================*/
 bool canBeExecuted(AltInfo *altInfo) {
-	return altInfo->alt != NULL && altInfo->alt->action != 0;
+	return altInfo->alt != nullptr && altInfo->alt->action != 0;
 }
 
 
@@ -193,7 +193,7 @@ static void addAlternative(AltInfoArray altInfos, int verb, int level, Aint para
 	AltInfo *altInfoP = nextFreeAltInfo(altInfos);
 
 	altInfoP->alt = (*finder)(verb, parameterNumber, theInstance, theClass);
-	if (altInfoP->alt != NULL) {
+	if (altInfoP->alt != nullptr) {
 		primeAltInfo(altInfoP, level, parameterNumber, theInstance, theClass);
 		altInfoP[1].end = TRUE;
 	}
@@ -256,7 +256,7 @@ bool anyCheckFailed(CONTEXT, AltInfoArray altInfo, bool execute) {
 	int altIndex;
 	bool flag;
 
-	if (altInfo != NULL)
+	if (altInfo != nullptr)
 		for (altIndex = 0; !altInfo[altIndex].end; altIndex++) {
 			current.instance = altInfo[altIndex].instance;
 
@@ -272,7 +272,7 @@ bool anythingToExecute(AltInfo altInfo[]) {
 	int altIndex;
 
 	/* Check for anything to execute... */
-	if (altInfo != NULL)
+	if (altInfo != nullptr)
 		for (altIndex = 0; !altInfo[altIndex].end; altIndex++)
 			if (canBeExecuted(&altInfo[altIndex]))
 				return TRUE;
@@ -293,7 +293,7 @@ static VerbEntry *findVerbEntry(int verbCode, VerbEntry *entries) {
 				return verbEntry;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 
@@ -302,17 +302,17 @@ static AltEntry *findAlternative(Aaddr verbTableAddress, int verbCode, int param
 	AltEntry *alt;
 	VerbEntry *verbEntry;
 
-	if (verbTableAddress == 0) return NULL;
+	if (verbTableAddress == 0) return nullptr;
 
 	verbEntry = findVerbEntry(verbCode, (VerbEntry *) pointerTo(verbTableAddress));
-	if (verbEntry != NULL)
+	if (verbEntry != nullptr)
 		for (alt = (AltEntry *) pointerTo(verbEntry->alts); !isEndOfArray(alt); alt++) {
 			if (alt->param == parameterNumber || alt->param == 0) {
 				if (verbEntry->code < 0) current.meta = TRUE;
 				return alt;
 			}
 		}
-	return NULL;
+	return nullptr;
 }
 
 
@@ -360,7 +360,7 @@ static bool possibleWithFinder(CONTEXT, int verb, Parameter parameters[], AltInf
 	else
 		anything = anythingToExecute(allAlternatives);
 
-	if (allAlternatives != NULL)
+	if (allAlternatives != nullptr)
 		deallocate(allAlternatives);
 
 	return (anything);
diff --git a/engines/glk/alan3/debug.cpp b/engines/glk/alan3/debug.cpp
index 3f5d747bbe..7f8b343a53 100644
--- a/engines/glk/alan3/debug.cpp
+++ b/engines/glk/alan3/debug.cpp
@@ -58,7 +58,7 @@ static void showAttributes(AttributeEntry *attrib) {
 	int i;
 	char str[80];
 
-	if (attrib == 0)
+	if (attrib == nullptr)
 		return;
 
 	i = 1;
@@ -151,7 +151,7 @@ static void listInstances(CONTEXT, char *pattern) {
 	bool found = FALSE;
 
 	for (ins = 1; ins <= header->instanceMax; ins++) {
-		if (pattern == NULL || (pattern != NULL && match(pattern, idOfInstance(context, ins)))) {
+		if (pattern == nullptr || (pattern != nullptr && match(pattern, idOfInstance(context, ins)))) {
 			if (!found) {
 				output("Instances:");
 				found = TRUE;
@@ -159,7 +159,7 @@ static void listInstances(CONTEXT, char *pattern) {
 			CALL1(listInstance, ins)
 		}
 	}
-	if (pattern != NULL && !found)
+	if (pattern != nullptr && !found)
 		output("No instances matched the pattern.");
 }
 
@@ -428,13 +428,13 @@ char *readSourceLine(int file, int line) {
 	frefid_t sourceFileRef = g_vm->glk_fileref_create_by_name(fileusage_TextMode, sourceFileName(file), 0);
 	strid_t sourceFile = g_vm->glk_stream_open_file(sourceFileRef, filemode_Read, 0);
 
-	if (sourceFile != NULL) {
+	if (sourceFile != nullptr) {
 		for (count = 0; count < line; count++) {
 			if (!readLine(*sourceFile, buffer, SOURCELINELENGTH))
-				return NULL;
+				return nullptr;
 
 			// If not read the whole line, or no newline, try to read again
-			while (strchr(buffer, '\n') == NULL) {
+			while (strchr(buffer, '\n') == nullptr) {
 				if (!readLine(*sourceFile, buffer, SOURCELINELENGTH))
 					break;
 			}
@@ -444,13 +444,13 @@ char *readSourceLine(int file, int line) {
 		return buffer;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 /*======================================================================*/
 void showSourceLine(int fileNumber, int line) {
 	char *buffer = readSourceLine(fileNumber, line);
-	if (buffer != NULL) {
+	if (buffer != nullptr) {
 		if (buffer[strlen(buffer) - 1] == '\n')
 			buffer[strlen(buffer) - 1] = '\0';
 		printf("<%05d>: %s", line, buffer);
@@ -653,7 +653,7 @@ static const DebugParseEntry commandEntries[] = {
 	{"exit", "", EXIT_COMMAND, "exit to game, enter 'debug' to get back"},
 	{"x", "", EXIT_COMMAND, "d:o"},
 	{"quit", "", QUIT_COMMAND, "quit game"},
-	{NULL, NULL, '\0', NULL}
+	{nullptr, nullptr, '\0', nullptr}
 };
 
 static const DebugParseEntry traceSubcommand[] = {
@@ -662,7 +662,7 @@ static const DebugParseEntry traceSubcommand[] = {
 	{"instructions", "", TRACE_INSTRUCTION_COMMAND, ""},
 	{"pushs", "", TRACE_PUSH_COMMAND, ""},
 	{"stacks", "", TRACE_STACK_COMMAND, ""},
-	{NULL, NULL, '\0', NULL}
+	{nullptr, nullptr, '\0', nullptr}
 };
 
 
@@ -691,13 +691,13 @@ static void handleHelpCommand() {
 	const DebugParseEntry *entry = commandEntries;
 
 	int maxLength = 0;
-	for (entry = commandEntries; entry->command != NULL; entry++) {
+	for (entry = commandEntries; entry->command != nullptr; entry++) {
 		if (strlen(entry->command) + strlen(entry->parameter) > (uint)maxLength)
 			maxLength = strlen(entry->command) + strlen(entry->parameter);
 	}
 
 	output("$nADBG Commands (can be abbreviated):");
-	for (entry = commandEntries; entry->command != NULL; entry++) {
+	for (entry = commandEntries; entry->command != nullptr; entry++) {
 		char buf[200];
 		sprintf(buf, "$i%s %s %s$n$t$t-- %s", entry->command, entry->parameter, padding(entry, maxLength), entry->helpText);
 		output(buf);
@@ -707,22 +707,22 @@ static void handleHelpCommand() {
 
 /*----------------------------------------------------------------------*/
 static const DebugParseEntry *findEntry(char *command, const DebugParseEntry *entry) {
-	while (entry->command != NULL) {
+	while (entry->command != nullptr) {
 		if (scumm_strnicmp(command, entry->command, strlen(command)) == 0)
 			return entry;
 		entry++;
 	}
-	return NULL;
+	return nullptr;
 }
 
 
 /*----------------------------------------------------------------------*/
 static char parseDebugCommand(char *command) {
 	const DebugParseEntry *entry = findEntry(command, commandEntries);
-	if (entry != NULL) {
+	if (entry != nullptr) {
 		if (strlen(command) < strlen(entry->command)) {
 			/* See if there are any more partial matches */
-			if (findEntry(command, entry + 1) != NULL)
+			if (findEntry(command, entry + 1) != nullptr)
 				/* TODO: we should list the possible matches somehow */
 				return AMBIGUOUS_COMMAND;
 		}
@@ -813,15 +813,15 @@ static void toggleStackTrace() {
 
 /*----------------------------------------------------------------------*/
 static int parseTraceCommand() {
-	char *subcommand = strtok(NULL, "");
+	char *subcommand = strtok(nullptr, "");
 	const DebugParseEntry *entry;
-	if (subcommand == 0)
+	if (subcommand == nullptr)
 		return UNKNOWN_COMMAND;
 	else {
 		entry = findEntry(subcommand, traceSubcommand);
-		if (entry != NULL) {
+		if (entry != nullptr) {
 			if (strlen(subcommand) < strlen(entry->command)) {
-				if (findEntry(subcommand, entry + 1) != NULL)
+				if (findEntry(subcommand, entry + 1) != nullptr)
 					return AMBIGUOUS_COMMAND;
 			}
 			return entry->code;
@@ -880,16 +880,16 @@ static void handleTraceCommand() {
 
 /*----------------------------------------------------------------------*/
 static void handleBreakCommand(int fileNumber) {
-	char *parameter = strtok(NULL, ":");
-	if (parameter != NULL && Common::isAlpha((int)parameter[0])) {
+	char *parameter = strtok(nullptr, ":");
+	if (parameter != nullptr && Common::isAlpha((int)parameter[0])) {
 		fileNumber = sourceFileNumber(parameter);
 		if (fileNumber == -1) {
 			printf("No such file: '%s'\n", parameter);
 			return;
 		}
-		parameter = strtok(NULL, "");
+		parameter = strtok(nullptr, "");
 	}
-	if (parameter == NULL)
+	if (parameter == nullptr)
 		listBreakpoints();
 	else
 		setBreakpoint(fileNumber, atoi(parameter));
@@ -898,8 +898,8 @@ static void handleBreakCommand(int fileNumber) {
 
 /*----------------------------------------------------------------------*/
 static void handleDeleteCommand(bool calledFromBreakpoint, int line, int fileNumber) {
-	char *parameter = strtok(NULL, "");
-	if (parameter == NULL) {
+	char *parameter = strtok(nullptr, "");
+	if (parameter == nullptr) {
 		if (calledFromBreakpoint)
 			deleteBreakpoint(line, fileNumber);
 		else
@@ -921,8 +921,8 @@ static void handleNextCommand(bool calledFromBreakpoint) {
 
 /*----------------------------------------------------------------------*/
 static void handleLocationsCommand(CONTEXT) {
-	char *parameter = strtok(NULL, "");
-	if (parameter == 0)
+	char *parameter = strtok(nullptr, "");
+	if (parameter == nullptr)
 		listLocations(context);
 	else
 		showLocation(context, atoi(parameter));
@@ -931,8 +931,8 @@ static void handleLocationsCommand(CONTEXT) {
 
 /*----------------------------------------------------------------------*/
 static void handleActorsCommand(CONTEXT) {
-	char *parameter = strtok(NULL, "");
-	if (parameter == NULL)
+	char *parameter = strtok(nullptr, "");
+	if (parameter == nullptr)
 		listActors(context);
 	else
 		showActor(context, atoi(parameter));
@@ -941,8 +941,8 @@ static void handleActorsCommand(CONTEXT) {
 
 /*----------------------------------------------------------------------*/
 static void handleClassesCommand(CONTEXT) {
-	char *parameter = strtok(NULL, "");
-	if (parameter == NULL || strchr(parameter, '*') != 0) {
+	char *parameter = strtok(nullptr, "");
+	if (parameter == nullptr || strchr(parameter, '*') != nullptr) {
 		output("Classes:");
 		showClassHierarchy(1, 0);
 		listInstances(context, parameter);
@@ -956,8 +956,8 @@ static void handleClassesCommand(CONTEXT) {
 
 /*----------------------------------------------------------------------*/
 static void handleObjectsCommand(CONTEXT) {
-	char *parameter = strtok(NULL, "");
-	if (parameter == NULL)
+	char *parameter = strtok(nullptr, "");
+	if (parameter == nullptr)
 		listObjects(context);
 	else
 		showObject(context, atoi(parameter));
@@ -966,10 +966,10 @@ static void handleObjectsCommand(CONTEXT) {
 
 /*----------------------------------------------------------------------*/
 static void handleInstancesCommand(CONTEXT) {
-	char *parameter = strtok(NULL, "");
+	char *parameter = strtok(nullptr, "");
 	uint i;
 
-	if (parameter == NULL || strchr(parameter, '*') != 0)
+	if (parameter == nullptr || strchr(parameter, '*') != nullptr)
 		listInstances(context, parameter);
 	else if (Common::isDigit((int)parameter[0]))
 		showInstance(context, atoi(parameter));
diff --git a/engines/glk/alan3/event.cpp b/engines/glk/alan3/event.cpp
index 73d7d9d876..9c582c9abd 100644
--- a/engines/glk/alan3/event.cpp
+++ b/engines/glk/alan3/event.cpp
@@ -27,7 +27,7 @@ namespace Alan3 {
 
 /* PUBLIC DATA */
 int eventQueueSize = 0;
-EventQueueEntry *eventQueue = NULL;
+EventQueueEntry *eventQueue = nullptr;
 int eventQueueTop = 0;
 EventEntry *events;
 
diff --git a/engines/glk/alan3/exe.cpp b/engines/glk/alan3/exe.cpp
index 3a7c8adf37..2e393fc958 100644
--- a/engines/glk/alan3/exe.cpp
+++ b/engines/glk/alan3/exe.cpp
@@ -65,7 +65,7 @@ void print(Aword fpos, Aword len) {
 	int i;
 	long savfp = 0;     /* Temporary saved text file position */
 	bool savedPrintFlag = printFlag;
-	void *info = NULL;      /* Saved decoding info */
+	void *info = nullptr;      /* Saved decoding info */
 
 
 	if (len == 0) return;
@@ -172,7 +172,7 @@ void visits(Aword v) {
 
 /*----------------------------------------------------------------------*/
 static void sayUndoneCommand(char *words) {
-	static Parameter *messageParameters = NULL;
+	static Parameter *messageParameters = nullptr;
 	messageParameters = (Parameter *)ensureParameterArrayAllocated(messageParameters);
 
 	current.location = where(HERO, DIRECT);
@@ -284,7 +284,7 @@ void cancelEvent(Aword theEvent) {
 /*----------------------------------------------------------------------*/
 static void increaseEventQueue(void) {
 	eventQueue = (EventQueueEntry *)realloc(eventQueue, (eventQueueTop + 2) * sizeof(EventQueueEntry));
-	if (eventQueue == NULL) syserr("Out of memory in increaseEventQueue()");
+	if (eventQueue == nullptr) syserr("Out of memory in increaseEventQueue()");
 
 	eventQueueSize = eventQueueTop + 2;
 }
@@ -383,7 +383,7 @@ static int skipWordForwards(char *string, int position) {
 
 	uint i;
 
-	for (i = position; i <= strlen(string) && strchr(separators, string[i]) == NULL; i++)
+	for (i = position; i <= strlen(string) && strchr(separators, string[i]) == nullptr; i++)
 		;
 	return i;
 }
@@ -419,7 +419,7 @@ static int skipWordBackwards(char *string, int position) {
 	char separators[] = " .,?";
 	int i;
 
-	for (i = position; i > 0 && strchr(separators, string[i - 1]) == NULL; i--)
+	for (i = position; i > 0 && strchr(separators, string[i - 1]) == nullptr; i--)
 		;
 	return i;
 }
@@ -542,7 +542,7 @@ void use(CONTEXT, int actor, int script) {
 	admin[actor].script = script;
 	admin[actor].step = 0;
 	step = stepOf(actor);
-	if (step != NULL && step->after != 0) {
+	if (step != nullptr && step->after != 0) {
 		FUNC1(evaluate, admin[actor].waitCount, step->after)
 	}
 
@@ -609,7 +609,7 @@ bool contains(Aptr string, Aptr substring) {
 	strlow((char *)fromAptr(string));
 	strlow((char *)fromAptr(substring));
 
-	found = (strstr((char *)fromAptr(string), (char *)fromAptr(substring)) != 0);
+	found = (strstr((char *)fromAptr(string), (char *)fromAptr(substring)) != nullptr);
 
 	return found;
 }
@@ -631,14 +631,14 @@ bool streq(char a[], char b[]) {
 
 /*======================================================================*/
 void startTranscript(void) {
-	if (logFile == NULL) {
+	if (logFile == nullptr) {
 		Common::String filename = g_vm->getTargetName() + ".log";
 
 		uint fileUsage = transcriptOption ? fileusage_Transcript : fileusage_InputRecord;
 		frefid_t logFileRef = g_vm->glk_fileref_create_by_name(fileUsage, filename.c_str(), 0);
 		logFile = g_vm->glk_stream_open_file(logFileRef, filemode_Write, 0);
 
-		if (logFile == NULL) {
+		if (logFile == nullptr) {
 			transcriptOption = FALSE;
 			logOption = FALSE;
 		} else {
@@ -650,11 +650,11 @@ void startTranscript(void) {
 
 /*======================================================================*/
 void stopTranscript(void) {
-	if (logFile != NULL) {
+	if (logFile != nullptr) {
 		if (transcriptOption || logOption)
 			delete logFile;
 
-		logFile = NULL;
+		logFile = nullptr;
 		transcriptOption = FALSE;
 		logOption = FALSE;
 	}
diff --git a/engines/glk/alan3/fnmatch.cpp b/engines/glk/alan3/fnmatch.cpp
index c30c521f02..50448dc5cf 100644
--- a/engines/glk/alan3/fnmatch.cpp
+++ b/engines/glk/alan3/fnmatch.cpp
@@ -107,12 +107,12 @@ int fnmatch(const char *pattern, const char *string, int flags) {
 			if (c == EOS)
 				if (flags & FNM_PATHNAME)
 					return ((flags & FNM_LEADING_DIR) ||
-					        strchr(string, '/') == NULL ?
+					        strchr(string, '/') == nullptr ?
 					        0 : FNM_NOMATCH);
 				else
 					return (0);
 			else if (c == '/' && flags & FNM_PATHNAME) {
-				if ((string = strchr(string, '/')) == NULL)
+				if ((string = strchr(string, '/')) == nullptr)
 					return (FNM_NOMATCH);
 				break;
 			}
diff --git a/engines/glk/alan3/glkio.cpp b/engines/glk/alan3/glkio.cpp
index 8d791cbb4a..186bae596c 100644
--- a/engines/glk/alan3/glkio.cpp
+++ b/engines/glk/alan3/glkio.cpp
@@ -41,7 +41,7 @@ GlkIO::GlkIO(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, g
 
 bool GlkIO::initialize() {
 	// first, open a window for error output
-	glkMainWin = glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
+	glkMainWin = glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 0);
 	if (glkMainWin == nullptr)
 		return false;
 
@@ -136,7 +136,7 @@ void GlkIO::statusLine(CONTEXT) {
 
 	glk_set_window(glkStatusWin);
 	glk_window_clear(glkStatusWin);
-	glk_window_get_size(glkStatusWin, &glkWidth, NULL);
+	glk_window_get_size(glkStatusWin, &glkWidth, nullptr);
 
 	onStatusLine = TRUE;
 	col = 1;
@@ -182,7 +182,7 @@ bool GlkIO::readLine(CONTEXT, char *buffer, size_t maxLen) {
 
 	} else if (readingCommands) {
 		if (glk_get_line_stream(commandFile, buffer, maxLen) == 0) {
-			glk_stream_close(commandFile, NULL);
+			glk_stream_close(commandFile, nullptr);
 			readingCommands = FALSE;
 		} else {
 			glk_set_style(style_Input);
@@ -211,7 +211,7 @@ bool GlkIO::readLine(CONTEXT, char *buffer, size_t maxLen) {
 			buffer[event.val1] = 0;
 			commandFileRef = glk_fileref_create_by_name(fileusage_InputRecord + fileusage_TextMode, &buffer[1], 0);
 			commandFile = glk_stream_open_file(commandFileRef, filemode_Read, 0);
-			if (commandFile != NULL)
+			if (commandFile != nullptr)
 				if (glk_get_line_stream(commandFile, buffer, maxLen) != 0) {
 					readingCommands = TRUE;
 					glk_set_style(style_Input);
diff --git a/engines/glk/alan3/instance.cpp b/engines/glk/alan3/instance.cpp
index 17877bca2a..72cbee167c 100644
--- a/engines/glk/alan3/instance.cpp
+++ b/engines/glk/alan3/instance.cpp
@@ -541,7 +541,7 @@ static char *wordWithCode(int classBit, int code) {
 			return (char *)pointerTo(dictionary[w].string);
 	sprintf(str, "Could not find word of class %d with code %d.", classBit, code);
 	syserr(str);
-	return NULL;
+	return nullptr;
 }
 
 
diff --git a/engines/glk/alan3/inter.cpp b/engines/glk/alan3/inter.cpp
index 6d35e2cc35..3891751a1b 100644
--- a/engines/glk/alan3/inter.cpp
+++ b/engines/glk/alan3/inter.cpp
@@ -53,9 +53,9 @@ bool fail = FALSE;
 /* PRIVATE DATA */
 
 static int pc;
-static Stack stack = NULL;
+static Stack stack = nullptr;
 
-static void (*interpreterMock)(Aaddr adr) = NULL;
+static void (*interpreterMock)(Aaddr adr) = nullptr;
 
 
 /*======================================================================*/
@@ -438,7 +438,7 @@ void interpret(CONTEXT, Aaddr adr) {
 	Aword i;
 
 	/* Check for mock implementation */
-	if (interpreterMock != NULL) {
+	if (interpreterMock != nullptr) {
 		interpreterMock(adr);
 		return;
 	}
diff --git a/engines/glk/alan3/lists.cpp b/engines/glk/alan3/lists.cpp
index 1b50896cb6..6f45449abb 100644
--- a/engines/glk/alan3/lists.cpp
+++ b/engines/glk/alan3/lists.cpp
@@ -44,7 +44,7 @@ int lengthOfArrayImplementation(void *array_of_any_type, int element_size_in_byt
 	int length;
 	int element_size = element_size_in_bytes / sizeof(Aword);
 	Aword *array = (Aword *)array_of_any_type;
-	if (array == NULL)
+	if (array == nullptr)
 		syserr("Taking length of NULL array");
 	for (length = 0; !isEndOfArray(&array[length * element_size]); length++)
 		;
diff --git a/engines/glk/alan3/main.cpp b/engines/glk/alan3/main.cpp
index 9939e3a682..3a8582aed4 100644
--- a/engines/glk/alan3/main.cpp
+++ b/engines/glk/alan3/main.cpp
@@ -167,7 +167,7 @@ static void setupHeader(ACodeHeader tmphdr) {
 static void loadAndCheckMemory(ACodeHeader tmphdr, Aword crc, char err[]) {
 	int i;
 	/* No memory allocated yet? */
-	if (memory == NULL) {
+	if (memory == nullptr) {
 		memory = (Aword *)allocate(tmphdr.size * sizeof(Aword));
 	}
 
@@ -428,12 +428,12 @@ static void initStaticData(void) {
 	}
 
 	/* Scores, if already allocated, copy initial data */
-	if (scores == NULL)
+	if (scores == nullptr)
 		scores = (Aword *)duplicate((Aword *) pointerTo(header->scores), header->scoreCount * sizeof(Aword));
 	else
 		memcpy(scores, pointerTo(header->scores), header->scoreCount * sizeof(Aword));
 
-	if (literals == NULL)
+	if (literals == nullptr)
 		literals = (LiteralEntry *)allocate(sizeof(Aword) * (MAXPARAMS + 1));
 
 	stxs = (SyntaxEntry *) pointerTo(header->syntaxTableAddress);
@@ -738,7 +738,7 @@ static void moveActor(CONTEXT, int theActor) {
 
 /*======================================================================*/
 void run(void) {
-	Stack theStack = NULL;
+	Stack theStack = nullptr;
 	Context ctx;
 
 	openFiles();
diff --git a/engines/glk/alan3/memory.cpp b/engines/glk/alan3/memory.cpp
index 030e8cfb83..ede62ab90f 100644
--- a/engines/glk/alan3/memory.cpp
+++ b/engines/glk/alan3/memory.cpp
@@ -29,7 +29,7 @@ namespace Alan3 {
 
 /* PUBLIC DATA */
 
-Aword *memory = NULL;
+Aword *memory = nullptr;
 static ACodeHeader dummyHeader; /* Dummy to use until memory allocated */
 ACodeHeader *header = &dummyHeader;
 int memTop = 0;         /* Top of load memory */
@@ -39,7 +39,7 @@ int memTop = 0;         /* Top of load memory */
 void *allocate(unsigned long lengthInBytes) {
 	void *p = (void *)calloc((size_t)lengthInBytes, 1);
 
-	if (p == NULL)
+	if (p == nullptr)
 		syserr("Out of memory.");
 
 	return p;
@@ -66,14 +66,14 @@ typedef struct {
 	void *voidp;
 } PointerMapEntry;
 
-static PointerMapEntry *pointerMap = NULL;
+static PointerMapEntry *pointerMap = nullptr;
 static int pointerMapSize = 0;
 static int nextAptr = 1;
 
 /*======================================================================*/
 void resetPointerMap(void) {
-	if (pointerMap != NULL) free(pointerMap);
-	pointerMap = NULL;
+	if (pointerMap != nullptr) free(pointerMap);
+	pointerMap = nullptr;
 	pointerMapSize = 0;
 }
 
@@ -95,12 +95,12 @@ void *fromAptr(Aptr aptr) {
 Aptr toAptr(void *ptr) {
 	int index;
 
-	if (pointerMap == NULL) {
+	if (pointerMap == nullptr) {
 		pointerMap = (PointerMapEntry *)allocate(sizeof(PointerMapEntry));
 		pointerMapSize = 1;
 	}
 
-	for (index = 0; index < pointerMapSize && pointerMap[index].voidp != NULL; index++)
+	for (index = 0; index < pointerMapSize && pointerMap[index].voidp != nullptr; index++)
 		;
 	if (index == pointerMapSize) {
 		pointerMap = (PointerMapEntry *)realloc(pointerMap, (index + 1) * sizeof(PointerMapEntry));
diff --git a/engines/glk/alan3/msg.cpp b/engines/glk/alan3/msg.cpp
index 438b58d6e2..dc0617397c 100644
--- a/engines/glk/alan3/msg.cpp
+++ b/engines/glk/alan3/msg.cpp
@@ -39,7 +39,7 @@ void printMessage(MsgKind msg) {    /* IN - message number */
 }
 
 
-static void (*errorHandler)(MsgKind msg) = NULL;
+static void (*errorHandler)(MsgKind msg) = nullptr;
 
 /*======================================================================*/
 void setErrorHandler(void (*handler)(MsgKind msg)) { /* IN - The error message number */
@@ -50,7 +50,7 @@ void setErrorHandler(void (*handler)(MsgKind msg)) { /* IN - The error message n
 
 /*======================================================================*/
 void error(CONTEXT, MsgKind msgno) { /* IN - The error message number */
-	if (errorHandler != NULL)
+	if (errorHandler != nullptr)
 		errorHandler(msgno);
 	else {
 		/* Print an error message and longjmp to main loop. */
diff --git a/engines/glk/alan3/output.cpp b/engines/glk/alan3/output.cpp
index 773d916b40..dedaaae374 100644
--- a/engines/glk/alan3/output.cpp
+++ b/engines/glk/alan3/output.cpp
@@ -69,7 +69,7 @@ void getPageSize(void) {
 /*----------------------------------------------------------------------*/
 static int updateColumn(int currentColumn, const char *string) {
 	const char *newlinePosition = strrchr(string, '\n');
-	if (newlinePosition != NULL)
+	if (newlinePosition != nullptr)
 		return &string[strlen(string)] - newlinePosition;
 	else
 		return currentColumn + strlen(string);
@@ -373,7 +373,7 @@ static bool punctuationNext(char *str) {
 	const char *punctuation = strchr(".,!?", str[0]);
 	bool end = str[1] == '\0';
 	bool space = isSpaceEquivalent(&str[1]);
-	return (punctuation != NULL && (end || space));
+	return (punctuation != nullptr && (end || space));
 }
 
 
@@ -399,7 +399,7 @@ void output(const char *original) {
 		space();            /* Output space if needed (& not inhibited) */
 
 	/* Output string up to symbol and handle the symbol */
-	while ((symptr = strchr(str, '$')) != (char *) NULL) {
+	while ((symptr = strchr(str, '$')) != (char *) nullptr) {
 		ch = *symptr;       /* Terminate before symbol */
 		*symptr = '\0';
 		if (strlen(str) > 0) {
@@ -426,7 +426,7 @@ void output(const char *original) {
 	}
 
 	if (needSpace)
-		capitalize = strchr("!?.", str[strlen(str) - 1]) != 0;
+		capitalize = strchr("!?.", str[strlen(str) - 1]) != nullptr;
 
 	anyOutput = TRUE;
 	free(copy);
diff --git a/engines/glk/alan3/params.cpp b/engines/glk/alan3/params.cpp
index 6fe9ae771d..6d6b77f645 100644
--- a/engines/glk/alan3/params.cpp
+++ b/engines/glk/alan3/params.cpp
@@ -31,13 +31,13 @@ namespace Glk {
 namespace Alan3 {
 
 /* PUBLIC DATA */
-Parameter *globalParameters = NULL;
+Parameter *globalParameters = nullptr;
 
 /*======================================================================*/
 Parameter *newParameter(int id) {
 	Parameter *parameter = NEW(Parameter);
 	parameter->instance = id;
-	parameter->candidates = NULL;
+	parameter->candidates = nullptr;
 
 	return parameter;
 }
@@ -56,7 +56,7 @@ void freeParameterArray(ParameterArray arrayPointer) {
 	Parameter *p;
 
 	for (p = arrayPointer; !isEndOfArray(p); p++)
-		if (p->candidates != NULL)
+		if (p->candidates != nullptr)
 			freeParameterArray(p->candidates);
 	deallocate(arrayPointer);
 }
@@ -64,7 +64,7 @@ void freeParameterArray(ParameterArray arrayPointer) {
 
 /*======================================================================*/
 Parameter *ensureParameterArrayAllocated(ParameterArray currentArray) {
-	if (currentArray == NULL)
+	if (currentArray == nullptr)
 		return newParameterArray();
 	else {
 		clearParameterArray(currentArray);
@@ -75,7 +75,7 @@ Parameter *ensureParameterArrayAllocated(ParameterArray currentArray) {
 
 /*======================================================================*/
 bool parameterArrayIsEmpty(ParameterArray array) {
-	return array == NULL || lengthOfParameterArray(array) == 0;
+	return array == nullptr || lengthOfParameterArray(array) == 0;
 }
 
 
@@ -84,14 +84,14 @@ void clearParameter(Parameter *parameter) {
 	Parameter *candidates = parameter->candidates;
 	memset(parameter, 0, sizeof(Parameter));
 	parameter->candidates = candidates;
-	if (parameter->candidates != NULL)
+	if (parameter->candidates != nullptr)
 		clearParameterArray(parameter->candidates);
 }
 
 
 /*======================================================================*/
 void setGlobalParameters(ParameterArray newParameters) {
-	if (globalParameters == NULL)
+	if (globalParameters == nullptr)
 		globalParameters = newParameterArray();
 	copyParameterArray(globalParameters, newParameters);
 }
@@ -99,7 +99,7 @@ void setGlobalParameters(ParameterArray newParameters) {
 
 /*======================================================================*/
 Parameter *getGlobalParameters(void) {
-	if (globalParameters == NULL)
+	if (globalParameters == nullptr)
 		globalParameters = newParameterArray();
 	return globalParameters;
 }
@@ -149,7 +149,7 @@ void compressParameterArray(Parameter theArray[]) {
 int lengthOfParameterArray(Parameter theArray[]) {
 	int i = 0;
 
-	if (theArray == NULL) return 0;
+	if (theArray == nullptr) return 0;
 
 	while (!isEndOfArray(&theArray[i]))
 		i++;
@@ -161,9 +161,9 @@ int lengthOfParameterArray(Parameter theArray[]) {
 bool equalParameterArrays(Parameter parameters1[], Parameter parameters2[]) {
 	int i;
 
-	if ((parameters1 == NULL) != (parameters2 == NULL))
+	if ((parameters1 == nullptr) != (parameters2 == nullptr))
 		return FALSE;
-	if (parameters1 == NULL) // Because then parameter2 is also NULL
+	if (parameters1 == nullptr) // Because then parameter2 is also NULL
 		return TRUE;
 	for (i = 0; !isEndOfArray(&parameters1[i]); i++) {
 		if (isEndOfArray(&parameters2[i])) return FALSE;
@@ -187,20 +187,20 @@ void copyParameter(Parameter *to, Parameter *from) {
 	Parameter *toCandidates = to->candidates;
 
 	*to = *from;
-	if (from->candidates != NULL) {
-		if (toCandidates == NULL)
+	if (from->candidates != nullptr) {
+		if (toCandidates == nullptr)
 			to->candidates = newParameterArray();
 		else
 			to->candidates = toCandidates;
 		copyParameterArray(to->candidates, from->candidates);
-	} else if (toCandidates != NULL)
+	} else if (toCandidates != nullptr)
 		freeParameterArray(toCandidates);
 }
 
 
 /*======================================================================*/
 void addParameterToParameterArray(ParameterArray theArray, Parameter *theParameter) {
-	if (theArray == NULL) syserr("Adding to null parameter array");
+	if (theArray == nullptr) syserr("Adding to null parameter array");
 
 	uint i;
 
@@ -218,9 +218,9 @@ void addParameterToParameterArray(ParameterArray theArray, Parameter *theParamet
 void copyParameterArray(ParameterArray to, ParameterArray from) {
 	int i;
 
-	if (to == NULL && from == NULL) return;
+	if (to == nullptr && from == nullptr) return;
 
-	if (to == NULL)
+	if (to == nullptr)
 		syserr("Copying to null parameter array");
 	else {
 		clearParameterArray(to);
@@ -234,7 +234,7 @@ void copyParameterArray(ParameterArray to, ParameterArray from) {
 void subtractParameterArrays(Parameter theArray[], Parameter remove[]) {
 	int i;
 
-	if (remove == NULL) return;
+	if (remove == nullptr) return;
 
 	for (i = 0; !isEndOfArray(&theArray[i]); i++)
 		if (inParameterArray(remove, theArray[i].instance))
diff --git a/engines/glk/alan3/parse.cpp b/engines/glk/alan3/parse.cpp
index 4a7129f2a7..93ac9104c7 100644
--- a/engines/glk/alan3/parse.cpp
+++ b/engines/glk/alan3/parse.cpp
@@ -68,7 +68,7 @@ typedef void (*ParameterParser)(CONTEXT, Parameter parameters[]);
 
 
 /* PRIVATE DATA */
-static Pronoun *pronouns = NULL;
+static Pronoun *pronouns = nullptr;
 
 
 /* Syntax Parameters */
@@ -94,7 +94,7 @@ static void addParameterForWord(Parameter *parameters, int wordIndex) {
 
 /*----------------------------------------------------------------------*/
 static Pronoun *allocatePronounArray(Pronoun *currentList) {
-	if (currentList == NULL)
+	if (currentList == nullptr)
 		currentList = (Pronoun *)allocate(sizeof(Pronoun) * (MAXPARAMS + 1));
 	clearPronounList(currentList);
 	return currentList;
@@ -344,7 +344,7 @@ static bool lastPossibleNoun(int wordIndex) {
 
 /*----------------------------------------------------------------------*/
 static void updateWithReferences(Parameter result[], int wordIndex, Aint * (*referenceFinder)(int wordIndex)) {
-	static Parameter *references = NULL; /* Instances referenced by a word */
+	static Parameter *references = nullptr; /* Instances referenced by a word */
 	references = ensureParameterArrayAllocated(references);
 
 	copyReferencesToParameterArray(referenceFinder(wordIndex), references);
@@ -635,7 +635,7 @@ static char *parameterNumberAndName(int parameterNumber) {
 	/* HERE SHOULD BE current.syntax */
 	char *parameterName = parameterNameInSyntax(current.syntax, parameterNumber);
 
-	if (parameterName != NULL)
+	if (parameterName != nullptr)
 		sprintf(buffer, "%s(#%d)", parameterName, parameterNumber);
 	else
 		sprintf(buffer, "#%d", parameterNumber);
@@ -754,7 +754,7 @@ static ElementEntry *elementForParameter(ElementEntry *elms) {
 	while (!isEndOfArray(elms) && elms->code != 0)
 		elms++;
 	if (isEndOfArray(elms))
-		return NULL;
+		return nullptr;
 	return elms;
 }
 
@@ -763,7 +763,7 @@ static ElementEntry *elementForEndOfSyntax(ElementEntry *elms) {
 	while (!isEndOfArray(elms) && (Aword)elms->code != EOS)
 		elms++;
 	if (isEndOfArray(elms)) /* No match for EOS! */
-		return NULL;
+		return nullptr;
 	return elms;
 }
 
@@ -772,7 +772,7 @@ static ElementEntry *elementForWord(ElementEntry *elms, Aint wordCode) {
 	while (!isEndOfArray(elms) && elms->code != wordCode)
 		elms++;
 	if (isEndOfArray(elms))
-		return NULL;
+		return nullptr;
 	return elms;
 }
 
@@ -796,7 +796,7 @@ static ElementEntry *parseInputAccordingToSyntax(CONTEXT, SyntaxEntry *syntax, P
 	ElementEntry *nextElement = currentElement;
 
 	int parameterCount = 0;
-	while (nextElement != NULL) {
+	while (nextElement != nullptr) {
 		/* Traverse the possible branches of currentElement to find a match, let the actual input control what we look for */
 		parameterPositions[parameterCount].endOfList = TRUE;
 
@@ -809,7 +809,7 @@ static ElementEntry *parseInputAccordingToSyntax(CONTEXT, SyntaxEntry *syntax, P
 		if (isInstanceReferenceWord(currentWordIndex)) {
 			/* If so, save word info for this parameterPosition */
 			nextElement = elementForParameter(currentElement);
-			if (nextElement != NULL) {
+			if (nextElement != nullptr) {
 				// Create parameter structure for the parameter position based on player words
 				// but without resolving them
 				ParameterPosition *parameterPosition = &parameterPositions[parameterCount];
@@ -828,7 +828,7 @@ static ElementEntry *parseInputAccordingToSyntax(CONTEXT, SyntaxEntry *syntax, P
 		if (isPrepositionWord(currentWordIndex) || isVerbWord(currentWordIndex)) {
 			/* A preposition? Or rather, an intermediate word? */
 			nextElement = elementForWord(currentElement, dictionary[playerWords[currentWordIndex].code].code);
-			if (nextElement != NULL) {
+			if (nextElement != nullptr) {
 				currentWordIndex++; /* Word matched, go to next */
 				currentElement = (ElementEntry *) pointerTo(nextElement->next);
 				continue;
@@ -840,9 +840,9 @@ static ElementEntry *parseInputAccordingToSyntax(CONTEXT, SyntaxEntry *syntax, P
 			R0CALL1(errorButAfterAll, currentWordIndex)
 
 		/* If we get here we couldn't match anything... */
-		nextElement = NULL;
+		nextElement = nullptr;
 	}
-	return NULL;
+	return nullptr;
 }
 
 
@@ -871,7 +871,7 @@ static bool anyAll(ParameterPosition parameterPositions[]) {
 /*----------------------------------------------------------------------*/
 static void checkRestrictedParameters(CONTEXT, ParameterPosition parameterPositions[], ElementEntry elms[]) {
 	RestrictionEntry *restriction;
-	static Parameter *localParameters = NULL;
+	static Parameter *localParameters = nullptr;
 	int i;
 
 	localParameters = ensureParameterArrayAllocated(localParameters);
@@ -911,7 +911,7 @@ static void checkRestrictedParameters(CONTEXT, ParameterPosition parameterPositi
 		parameterPositions[restriction->parameterNumber - 1].checked = TRUE;
 	}
 	freeParameterArray(localParameters);
-	localParameters = NULL;
+	localParameters = nullptr;
 }
 
 
@@ -959,7 +959,7 @@ static void restrictParametersAccordingToSyntax(CONTEXT, ParameterPosition param
 
 /*----------------------------------------------------------------------*/
 static void matchPronoun(CONTEXT, Parameter *parameter) {
-	static Parameter *pronounInstances = NULL;
+	static Parameter *pronounInstances = nullptr;
 	pronounInstances = ensureParameterArrayAllocated(pronounInstances);
 
 	int pronounCandidateCount = getPronounInstances(playerWords[parameter->firstWord].code, pronounInstances);
@@ -1022,7 +1022,7 @@ static void findCandidates(CONTEXT, Parameter parameters[], void (*instanceMatch
 
 /*----------------------------------------------------------------------*/
 static void handleFailedParse(CONTEXT, ElementEntry *elms) {
-	if (elms == NULL)
+	if (elms == nullptr)
 		error(context, M_WHAT);
 	else if (elms->next == 0) { /* No verb code, verb not declared! */
 		/* TODO Does this ever happen? */
@@ -1145,7 +1145,7 @@ static Parameter *disambiguate00N(CONTEXT, Parameter allCandidates[], Parameter
 		R0CALL1(errorWhat, allCandidates[0].firstWord)
 	else
 		R0CALL1(errorNoSuch, allCandidates[0]);
-	return NULL;
+	return nullptr;
 }
 
 static Parameter *disambiguate01N(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
@@ -1153,7 +1153,7 @@ static Parameter *disambiguate01N(CONTEXT, Parameter allCandidates[], Parameter
 		R0CALL1(errorWhat, allCandidates[0].firstWord)
 	else
 		R0CALL1(errorNoSuch, allCandidates[0])
-	return NULL;
+	return nullptr;
 }
 
 static Parameter *disambiguate0MN(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
@@ -1161,7 +1161,7 @@ static Parameter *disambiguate0MN(CONTEXT, Parameter allCandidates[], Parameter
 		R0CALL1(errorWhat, allCandidates[0].firstWord)
 	else
 		R0CALL1(errorNoSuch, allCandidates[0])
-	return NULL;
+	return nullptr;
 }
 
 static Parameter *disambiguate10N(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
@@ -1177,29 +1177,29 @@ static Parameter *disambiguate1MN(CONTEXT, Parameter allCandidates[], Parameter
 }
 static Parameter *disambiguateM0N(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	R0CALL1(errorWhichOne, presentCandidates)
-	return NULL;
+	return nullptr;
 }
 
 static Parameter *disambiguateM1N(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	R0CALL1(errorWhichOne, presentCandidates)
-	return NULL;
+	return nullptr;
 }
 
 static Parameter *disambiguateMMN(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	R0CALL1(errorWhichOne, presentCandidates)
-	return NULL;
+	return nullptr;
 }
 
 static Parameter *disambiguate00Y(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	errorNoSuch(context, allCandidates[0]);
-	return NULL;
+	return nullptr;
 }
 static Parameter *disambiguate01Y(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	return allCandidates;
 }
 static Parameter *disambiguate0MY(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	R0CALL1(errorWhichOne, allCandidates)
-	return NULL;
+	return nullptr;
 }
 static Parameter *disambiguate10Y(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	return presentCandidates;
@@ -1212,15 +1212,15 @@ static Parameter *disambiguate1MY(CONTEXT, Parameter allCandidates[], Parameter
 }
 static Parameter *disambiguateM0Y(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	R0CALL1(errorWhichOne, presentCandidates)
-	return NULL;
+	return nullptr;
 }
 static Parameter *disambiguateM1Y(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	R0CALL1(errorWhichOne, presentCandidates)
-	return NULL;
+	return nullptr;
 }
 static Parameter *disambiguateMMY(CONTEXT, Parameter allCandidates[], Parameter presentCandidates[]) {
 	R0CALL1(errorWhichOne, presentCandidates)
-	return NULL;
+	return nullptr;
 }
 
 static DisambiguationHandlerTable disambiguationHandlerTable = {
@@ -1273,7 +1273,7 @@ static DisambiguationHandlerTable disambiguationHandlerTable = {
 
 /*----------------------------------------------------------------------*/
 static void disambiguateCandidates(CONTEXT, Parameter *allCandidates, bool omnipotent, bool (*reachable)(int), DisambiguationHandlerTable handler) {
-	static Parameter *presentCandidates = NULL;
+	static Parameter *presentCandidates = nullptr;
 	int present;
 	int distant;
 	Parameter *result;
@@ -1349,8 +1349,8 @@ static void disambiguate(CONTEXT, ParameterPosition parameterPositions[], Elemen
 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 static void tryParam(CONTEXT, Parameter parameters[], Parameter multipleParameters[]) {
 	ElementEntry *element;      /* Pointer to element list */
-	static ParameterPosition *parameterPositions = NULL;
-	if (parameterPositions != NULL)
+	static ParameterPosition *parameterPositions = nullptr;
+	if (parameterPositions != nullptr)
 		deallocateParameterPositions(parameterPositions);
 
 	// TODO newParameterPositionArray()!!!! Or even reallocatePP.. or cleanPP..
@@ -1366,7 +1366,7 @@ static void tryParam(CONTEXT, Parameter parameters[], Parameter multipleParamete
 	convertMultipleCandidatesToMultipleParameters(parameterPositions, multipleParameters);
 
 	deallocateParameterPositions(parameterPositions);
-	parameterPositions = NULL;
+	parameterPositions = nullptr;
 }
 
 
@@ -1471,8 +1471,8 @@ static void parseInstanceCommand(CONTEXT, Parameter parameters[], Parameter mult
 /*======================================================================*/
 void parse(CONTEXT) {
 	/* longjmp's ahead so these need to survive to not leak memory */
-	static Parameter *parameters = NULL;
-	static Parameter *multipleParameters = NULL;
+	static Parameter *parameters = nullptr;
+	static Parameter *multipleParameters = nullptr;
 	parameters = ensureParameterArrayAllocated(parameters);
 	multipleParameters = ensureParameterArrayAllocated(multipleParameters);
 
@@ -1512,9 +1512,9 @@ void parse(CONTEXT) {
 		clearParameterArray(previousMultipleParameters);
 
 	freeParameterArray(parameters);
-	parameters = NULL;
+	parameters = nullptr;
 	freeParameterArray(multipleParameters);
-	multipleParameters = NULL;
+	multipleParameters = nullptr;
 }
 
 } // End of namespace Alan3
diff --git a/engines/glk/alan3/reverse.cpp b/engines/glk/alan3/reverse.cpp
index ead87251ea..4d70574648 100644
--- a/engines/glk/alan3/reverse.cpp
+++ b/engines/glk/alan3/reverse.cpp
@@ -37,7 +37,7 @@ extern Aword *memory;
 
 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 static Aaddr memorySize = 0;
-static Aword *addressesDone = NULL;
+static Aword *addressesDone = nullptr;
 static int numberDone = 0;
 static int doneSize = 0;
 
diff --git a/engines/glk/alan3/scan.cpp b/engines/glk/alan3/scan.cpp
index 881f08178c..45dfdfb344 100644
--- a/engines/glk/alan3/scan.cpp
+++ b/engines/glk/alan3/scan.cpp
@@ -47,7 +47,7 @@ bool continued = FALSE;
 static char buf[1000]; /* The input buffer */
 static char isobuf[1000]; /* The input buffer in ISO */
 static bool eol = TRUE; /* Looking at End of line? Yes, initially */
-static char *token = NULL;
+static char *token = nullptr;
 
 
 /*======================================================================*/
@@ -102,7 +102,7 @@ static char *gettoken(char *txtBuf) {
 	static char *marker;
 	static char oldch;
 
-	if (txtBuf == NULL)
+	if (txtBuf == nullptr)
 		*marker = oldch;
 	else
 		marker = txtBuf;
@@ -121,7 +121,7 @@ static char *gettoken(char *txtBuf) {
 			marker++;
 		marker++;
 	} else if (*marker == '\0' || *marker == '\n' || *marker == ';')
-		return NULL;
+		return nullptr;
 	else
 		marker++;
 	oldch = *marker;
@@ -169,20 +169,20 @@ static void getLine(CONTEXT) {
 
 		strcpy(isobuf, buf);
 		token = gettoken(isobuf);
-		if (token != NULL) {
+		if (token != nullptr) {
 			if (strcmp("debug", token) == 0 && header->debug) {
 				debugOption = TRUE;
 				CALL3(debug, FALSE, 0, 0)
 
-				token = NULL;
+				token = nullptr;
 			} else if (strcmp("undo", token) == 0) {
-				token = gettoken(NULL);
-				if (token != NULL) /* More tokens? */
+				token = gettoken(nullptr);
+				if (token != nullptr) /* More tokens? */
 					CALL1(error, M_WHAT)
 				CALL0(undo)
 			}
 		}
-	} while (token == NULL);
+	} while (token == nullptr);
 	eol = FALSE;
 }
 
@@ -196,8 +196,8 @@ void scan(CONTEXT) {
 	if (continued) {
 		/* Player used '.' to separate commands. Read next */
 		para();
-		token = gettoken(NULL); /* Or did he just finish the command with a full stop? */
-		if (token == NULL) {
+		token = gettoken(nullptr); /* Or did he just finish the command with a full stop? */
+		if (token == nullptr) {
 			CALL0(getLine)
 		}
 		continued = FALSE;
@@ -236,7 +236,7 @@ void scan(CONTEXT) {
 		} else
 			CALL1(unknown, token)
 		setEndOfArray(&playerWords[i]);
-		eol = (token = gettoken(NULL)) == NULL;
+		eol = (token = gettoken(nullptr)) == nullptr;
 	} while (!eol);
 }
 
diff --git a/engines/glk/alan3/set.cpp b/engines/glk/alan3/set.cpp
index c5750c455c..dc9bdd304f 100644
--- a/engines/glk/alan3/set.cpp
+++ b/engines/glk/alan3/set.cpp
@@ -159,8 +159,8 @@ bool equalSets(Set *set1, Set *set2) {
 
 /*======================================================================*/
 void freeSet(Set *theSet) {
-	if (theSet != NULL) {
-		if (theSet->members != NULL)
+	if (theSet != nullptr) {
+		if (theSet->members != nullptr)
 			deallocate(theSet->members);
 		deallocate(theSet);
 	}
diff --git a/engines/glk/alan3/stack.cpp b/engines/glk/alan3/stack.cpp
index a2a7989fa0..ca87ce088b 100644
--- a/engines/glk/alan3/stack.cpp
+++ b/engines/glk/alan3/stack.cpp
@@ -44,7 +44,7 @@ Stack createStack(int size) {
 
 /*======================================================================*/
 void deleteStack(Stack theStack) {
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("deleting a NULL stack");
 
 	deallocate(theStack->stack);
@@ -62,7 +62,7 @@ int stackDepth(Stack theStack) {
 void dumpStack(Stack theStack) {
 	int i;
 
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("NULL stack not supported anymore");
 
 	printf("[");
@@ -76,7 +76,7 @@ void dumpStack(Stack theStack) {
 
 /*======================================================================*/
 void push(Stack theStack, Aptr i) {
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("NULL stack not supported anymore");
 
 	if (theStack->stackp == theStack->stackSize)
@@ -87,7 +87,7 @@ void push(Stack theStack, Aptr i) {
 
 /*======================================================================*/
 Aptr pop(Stack theStack) {
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("NULL stack not supported anymore");
 
 	if (theStack->stackp == 0)
@@ -98,7 +98,7 @@ Aptr pop(Stack theStack) {
 
 /*======================================================================*/
 Aptr top(Stack theStack) {
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("NULL stack not supported anymore");
 
 	return theStack->stack[theStack->stackp - 1];
@@ -111,7 +111,7 @@ Aptr top(Stack theStack) {
 void newFrame(Stack theStack, Aint noOfLocals) {
 	int n;
 
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("NULL stack not supported anymore");
 
 	push(theStack, theStack->framePointer);
@@ -130,7 +130,7 @@ Aptr getLocal(Stack theStack, Aint framesBelow, Aint variableNumber) {
 	if (variableNumber < 1)
 		syserr("Reading a non-existing block-local variable.");
 
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("NULL stack not supported anymore");
 
 	frame = theStack->framePointer;
@@ -151,7 +151,7 @@ void setLocal(Stack theStack, Aint framesBelow, Aint variableNumber, Aptr value)
 	if (variableNumber < 1)
 		syserr("Writing a non-existing block-local variable.");
 
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("NULL stack not supported anymore");
 
 	frame = theStack->framePointer;
@@ -164,7 +164,7 @@ void setLocal(Stack theStack, Aint framesBelow, Aint variableNumber, Aptr value)
 
 /*======================================================================*/
 void endFrame(Stack theStack) {
-	if (theStack == NULL)
+	if (theStack == nullptr)
 		syserr("NULL stack not supported anymore");
 
 	theStack->stackp = theStack->framePointer;
diff --git a/engines/glk/alan3/state.cpp b/engines/glk/alan3/state.cpp
index 0ebf52f3a4..fa39ea503a 100644
--- a/engines/glk/alan3/state.cpp
+++ b/engines/glk/alan3/state.cpp
@@ -59,7 +59,7 @@ struct game_state {
 
 /* PRIVATE DATA */
 static GameState gameState;     /* TODO: Make pointer, then we don't have to copy to stack, we can just use the pointer */
-static StateStackP stateStack = NULL;
+static StateStackP stateStack = nullptr;
 
 static char *playerCommand;
 
@@ -116,7 +116,7 @@ void deallocateGameState(GameState *gState) {
 
 	if (gState->eventQueueTop > 0) {
 		deallocate(gState->eventQueue);
-		gState->eventQueue = NULL;
+		gState->eventQueue = nullptr;
 	}
 	if (gState->scores)
 		deallocate(gState->scores);
@@ -133,14 +133,14 @@ void forgetGameState(void) {
 	char *playerCmd;
 	popGameState(stateStack, &gameState, &playerCmd);
 	deallocateGameState(&gameState);
-	if (playerCmd != NULL)
+	if (playerCmd != nullptr)
 		deallocate(playerCmd);
 }
 
 
 /*======================================================================*/
 void initStateStack(void) {
-	if (stateStack != NULL)
+	if (stateStack != nullptr)
 		deleteStateStack(stateStack);
 	stateStack = createStateStack(sizeof(GameState));
 }
@@ -149,7 +149,7 @@ void initStateStack(void) {
 /*======================================================================*/
 void terminateStateStack(void) {
 	deleteStateStack(stateStack);
-	stateStack = NULL;
+	stateStack = nullptr;
 }
 
 
@@ -166,7 +166,7 @@ static Set **collectSets(void) {
 	Set **sets;
 	int i;
 
-	if (count == 0) return NULL;
+	if (count == 0) return nullptr;
 
 	sets = (Set **)allocate(count * sizeof(Set));
 
@@ -185,7 +185,7 @@ static char **collectStrings(void) {
 	char **strings;
 	int i;
 
-	if (count == 0) return NULL;
+	if (count == 0) return nullptr;
 
 	strings = (char **)allocate(count * sizeof(char *));
 
@@ -225,8 +225,8 @@ static void collectInstanceData(void) {
 /*----------------------------------------------------------------------*/
 static void collectScores(void) {
 	gameState.score = current.score;
-	if (scores == NULL)
-		gameState.scores = NULL;
+	if (scores == nullptr)
+		gameState.scores = nullptr;
 	else
 		gameState.scores = (Aword *)duplicate(scores, header->scoreCount * sizeof(Aword));
 }
@@ -238,7 +238,7 @@ void rememberGameState(void) {
 	collectInstanceData();
 	collectScores();
 
-	if (stateStack == NULL)
+	if (stateStack == nullptr)
 		initStateStack();
 
 	pushGameState(stateStack, &gameState);
@@ -269,7 +269,7 @@ static void recallSets(Set **sets) {
 	entry = (SetInitEntry *)pointerTo(header->setInitTable);
 	for (i = 0; i < count; i++) {
 		setAttribute(admin[entry[i].instanceCode].attributes, entry[i].attributeCode, toAptr(sets[i]));
-		sets[i] = NULL; /* Since we reuse the saved set, we need to clear the pointer */
+		sets[i] = nullptr; /* Since we reuse the saved set, we need to clear the pointer */
 	}
 }
 
@@ -297,7 +297,7 @@ static void recallStrings(char **strings) {
 	entry = (StringInitEntry *)pointerTo(header->stringInitTable);
 	for (i = 0; i < count; i++) {
 		setAttribute(admin[entry[i].instanceCode].attributes, entry[i].attributeCode, toAptr(strings[i]));
-		strings[i] = NULL;      /* Since we reuse the saved, we need to clear the state */
+		strings[i] = nullptr;      /* Since we reuse the saved, we need to clear the state */
 	}
 }
 
@@ -315,7 +315,7 @@ static void recallEvents(void) {
 /*----------------------------------------------------------------------*/
 static void recallInstances(void) {
 
-	if (admin == NULL)
+	if (admin == nullptr)
 		syserr("admin[] == NULL in recallInstances()");
 
 	memcpy(admin, gameState.admin,
diff --git a/engines/glk/alan3/state_stack.cpp b/engines/glk/alan3/state_stack.cpp
index 3c74913930..d9f6e58c1b 100644
--- a/engines/glk/alan3/state_stack.cpp
+++ b/engines/glk/alan3/state_stack.cpp
@@ -45,7 +45,7 @@ struct StateStackStructure {
 /*----------------------------------------------------------------------*/
 static void *reallocate(void *from, int newSize) {
 	void *newArea = realloc(from, newSize * sizeof(void *));
-	if (newArea == NULL)
+	if (newArea == nullptr)
 		syserr("Out of memory in 'reallocateStack()'");
 	return newArea;
 }
@@ -62,7 +62,7 @@ StateStackP createStateStack(int elementSize) {
 
 /*======================================================================*/
 void deleteStateStack(StateStackP stateStack) {
-	if (stateStack != NULL) {
+	if (stateStack != nullptr) {
 		while (stateStack->stackPointer > 0) {
 			stateStack->stackPointer--;
 			deallocateGameState((GameState *)stateStack->states[stateStack->stackPointer]);
@@ -99,7 +99,7 @@ void pushGameState(StateStackP stateStack, void *gameState) {
 	void *element = allocate(stateStack->elementSize);
 	memcpy(element, gameState, stateStack->elementSize);
 	ensureSpaceForGameState(stateStack);
-	stateStack->commands[stateStack->stackPointer] = NULL;
+	stateStack->commands[stateStack->stackPointer] = nullptr;
 	stateStack->states[stateStack->stackPointer++] = element;
 }
 
diff --git a/engines/glk/alan3/syntax.cpp b/engines/glk/alan3/syntax.cpp
index a3c44c6bb0..c28900bd7b 100644
--- a/engines/glk/alan3/syntax.cpp
+++ b/engines/glk/alan3/syntax.cpp
@@ -64,19 +64,19 @@ static SyntaxEntry *findSyntaxEntry(int verbCode) {
 			return stx;
 			break;
 		}
-	return NULL;
+	return nullptr;
 }
 
 
 /*======================================================================*/
 SyntaxEntry *findSyntaxTreeForVerb(CONTEXT, int verbCode) {
-	SyntaxEntry *foundStx = NULL;
+	SyntaxEntry *foundStx = nullptr;
 	if (isPreBeta2(header->version)) {
 		foundStx = findSyntaxEntryForPreBeta2(verbCode, foundStx);
 	} else {
 		foundStx = findSyntaxEntry(verbCode);
 	}
-	if (foundStx == NULL)
+	if (foundStx == nullptr)
 		// No matching syntax
 		R0CALL1(error, M_WHAT)
 	return foundStx;
diff --git a/engines/glk/alan3/sysdep.cpp b/engines/glk/alan3/sysdep.cpp
index 268ea9cead..499d1a7b3d 100644
--- a/engines/glk/alan3/sysdep.cpp
+++ b/engines/glk/alan3/sysdep.cpp
@@ -101,17 +101,17 @@ static const byte upperCaseCharacters[] = {
 
 
 int isSpace(unsigned int c) {
-	return (c != '\0' && strchr((const char *)spaceCharacters, c) != 0);
+	return (c != '\0' && strchr((const char *)spaceCharacters, c) != nullptr);
 }
 
 
 int isLower(unsigned int c) {
-	return (c != '\0' && strchr((const char *)lowerCaseCharacters, c) != 0);
+	return (c != '\0' && strchr((const char *)lowerCaseCharacters, c) != nullptr);
 }
 
 
 int isUpper(unsigned int c) {
-	return (c != '\0' && strchr((const char *)upperCaseCharacters, c) != 0);
+	return (c != '\0' && strchr((const char *)upperCaseCharacters, c) != nullptr);
 }
 
 int isLetter(unsigned int c) {
@@ -321,7 +321,7 @@ char *baseNameStart(char *fullPathName) {
 	int i;
 
 	for (i = strlen(fullPathName) - 1; i > 0; i--)
-		if (strchr(delimiters, fullPathName[i]) != NULL)
+		if (strchr(delimiters, fullPathName[i]) != nullptr)
 			return &fullPathName[i + 1];
 	return (fullPathName);
 }
diff --git a/engines/glk/alan3/syserr.cpp b/engines/glk/alan3/syserr.cpp
index 6ed6d0b95d..a126757cc8 100644
--- a/engines/glk/alan3/syserr.cpp
+++ b/engines/glk/alan3/syserr.cpp
@@ -68,7 +68,7 @@ void setSyserrHandler(void (*f)(const char *)) {
 // TODO Make syserr() use ... as printf()
 void syserr(const char *description) {
 	lin = 0;
-	if (handler == NULL) {
+	if (handler == nullptr) {
 		const char *blurb = "<If you are the creator of this piece of Interactive Fiction, \
 please help debug this Alan system error. Collect *all* the sources, and, if possible, an \
 exact transcript of the commands that led to this error, in a zip-file and send \
@@ -81,7 +81,7 @@ it to support at alanif.se. Thank you!>";
 
 /*======================================================================*/
 void apperr(const char *description) {
-	if (handler == NULL) {
+	if (handler == nullptr) {
 		const char *blurb = "<If you are playing this piece of Interactive Fiction, \
 please help the author to debug this programming error. Send an exact \
 transcript of the commands that led to this error to the author. Thank you! \
@@ -93,7 +93,7 @@ If you *are* the author, then you have to figure this out before releasing the g
 
 /*======================================================================*/
 void playererr(CONTEXT, const char *description) {
-	if (handler == NULL) {
+	if (handler == nullptr) {
 		const char *blurb = "<You have probably done something that is not exactly right.>";
 		runtimeError(context, "PLAYER ERROR: ", description, blurb);
 	} else
diff --git a/engines/glk/alan3/word.cpp b/engines/glk/alan3/word.cpp
index 4df82099e7..aaea55fcfb 100644
--- a/engines/glk/alan3/word.cpp
+++ b/engines/glk/alan3/word.cpp
@@ -32,7 +32,7 @@ namespace Alan3 {
 /* PUBLIC DATA */
 
 /* List of parsed words, index into dictionary */
-Word *playerWords = NULL;
+Word *playerWords = nullptr;
 int currentWordIndex; /* An index into the list of playerWords */
 int firstWord, lastWord;  /* Index for the first and last words for this command */
 
@@ -55,7 +55,7 @@ void ensureSpaceForPlayerWords(int size) {
 
 	if (playerWordsLength < size + 1) {
 		playerWords = (Word *)realloc(playerWords, newLength * sizeof(Word));
-		if (playerWords == NULL)
+		if (playerWords == nullptr)
 			syserr("Out of memory in 'ensureSpaceForPlayerWords()'");
 		playerWordsLength = newLength;
 	}
diff --git a/engines/glk/archetype/archetype.cpp b/engines/glk/archetype/archetype.cpp
index 432d6414de..22bd3fdeb2 100644
--- a/engines/glk/archetype/archetype.cpp
+++ b/engines/glk/archetype/archetype.cpp
@@ -84,7 +84,7 @@ bool Archetype::initialize() {
 	NullStr = NewConstStr("null");
 
 	// GLK window
-	_mainWindow = glk_window_open(0, 0, 0, wintype_TextBuffer);
+	_mainWindow = glk_window_open(nullptr, 0, 0, wintype_TextBuffer);
 	glk_set_window(_mainWindow);
 
 	// Check for savegame to load
diff --git a/engines/glk/comprehend/comprehend.cpp b/engines/glk/comprehend/comprehend.cpp
index e723e146c7..940e2df592 100644
--- a/engines/glk/comprehend/comprehend.cpp
+++ b/engines/glk/comprehend/comprehend.cpp
@@ -83,7 +83,7 @@ void Comprehend::runGame() {
 }
 
 void Comprehend::initialize() {
-	_bottomWindow = (TextBufferWindow *)glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
+	_bottomWindow = (TextBufferWindow *)glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 1);
 	glk_set_window(_bottomWindow);
 
 	showGraphics();
diff --git a/engines/glk/comprehend/debugger_dumper.cpp b/engines/glk/comprehend/debugger_dumper.cpp
index 6c3d74b84c..6ff3923a88 100644
--- a/engines/glk/comprehend/debugger_dumper.cpp
+++ b/engines/glk/comprehend/debugger_dumper.cpp
@@ -198,7 +198,7 @@ void DebuggerDumper::dumpFunction(uint functionNum) {
 
 	print("[%.4x] (%u instructions)\n", functionNum, func.size());
 	for (uint i = 0; i < func.size(); i++) {
-		Common::String line = dumpInstruction(_game, NULL, &func[i]);
+		Common::String line = dumpInstruction(_game, nullptr, &func[i]);
 		print("%s\n", line.c_str());
 	}
 
diff --git a/engines/glk/comprehend/dictionary.cpp b/engines/glk/comprehend/dictionary.cpp
index 1dcd8a86e0..d966d4739a 100644
--- a/engines/glk/comprehend/dictionary.cpp
+++ b/engines/glk/comprehend/dictionary.cpp
@@ -41,13 +41,13 @@ Word *dict_find_word_by_string(ComprehendGame *game,
 	uint i;
 
 	if (!string)
-		return NULL;
+		return nullptr;
 
 	for (i = 0; i < game->_words.size(); i++)
 		if (word_match(&game->_words[i], string))
 			return &game->_words[i];
 
-	return NULL;
+	return nullptr;
 }
 
 Word *dict_find_word_by_index_type(ComprehendGame *game,
@@ -60,7 +60,7 @@ Word *dict_find_word_by_index_type(ComprehendGame *game,
 			return &game->_words[i];
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 Word *find_dict_word_by_index(ComprehendGame *game,
@@ -73,7 +73,7 @@ Word *find_dict_word_by_index(ComprehendGame *game,
 			return &game->_words[i];
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 bool dict_match_index_type(ComprehendGame *game, const char *word,
diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp
index 054a921320..51ba45d5fa 100644
--- a/engines/glk/comprehend/game.cpp
+++ b/engines/glk/comprehend/game.cpp
@@ -225,7 +225,7 @@ void ComprehendGame::console_println(const char *text) {
 	while (*p) {
 		switch (*p) {
 		case '\n':
-			word = NULL;
+			word = nullptr;
 			word_len = 0;
 			g_comprehend->print("\n");
 			p++;
@@ -372,7 +372,7 @@ Item *ComprehendGame::get_item_by_noun(byte noun) {
 		if (_items[i]._word == noun)
 			return &_items[i];
 
-	return NULL;
+	return nullptr;
 }
 
 int ComprehendGame::get_item_id(byte noun) {
@@ -392,7 +392,7 @@ void ComprehendGame::update_graphics() {
 	if (!g_comprehend->isGraphicsEnabled())
 		return;
 
-	type = roomIsSpecial(_currentRoomCopy, NULL);
+	type = roomIsSpecial(_currentRoomCopy, nullptr);
 
 	switch (type) {
 	case ROOM_IS_DARK:
diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp
index 6a0ee40568..fa326726fb 100644
--- a/engines/glk/glk_api.cpp
+++ b/engines/glk/glk_api.cpp
@@ -242,7 +242,7 @@ uint GlkAPI::glk_window_get_type(winid_t win) {
 winid_t GlkAPI::glk_window_get_parent(winid_t win) {
 	if (!win) {
 		warning("window_get_parent: invalid ref");
-		return 0;
+		return nullptr;
 	}
 
 	return win->_parent;
diff --git a/engines/glk/hugo/heglk.cpp b/engines/glk/hugo/heglk.cpp
index 4eeacb6504..ea29af9029 100644
--- a/engines/glk/hugo/heglk.cpp
+++ b/engines/glk/hugo/heglk.cpp
@@ -27,7 +27,7 @@ namespace Hugo {
 
 void Hugo::hugo_init_screen() {
 	// Open the main window...
-	mainwin = currentwin = glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
+	mainwin = currentwin = glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 1);
 	assert(mainwin);
 
 	// ...and set it up for default output
diff --git a/engines/glk/hugo/hemedia.cpp b/engines/glk/hugo/hemedia.cpp
index ba7fdb23ca..8c4bbddcac 100644
--- a/engines/glk/hugo/hemedia.cpp
+++ b/engines/glk/hugo/hemedia.cpp
@@ -70,7 +70,7 @@ int Hugo::loadres(HUGO_FILE infile, int reslen, int type) {
 		reslen -= n;
 	}
 
-	glk_stream_close(stream, NULL);
+	glk_stream_close(stream, nullptr);
 
 	return idVal;
 }
diff --git a/engines/glk/jacl/encapsulate.cpp b/engines/glk/jacl/encapsulate.cpp
index 8daba293d2..96bcd0483d 100644
--- a/engines/glk/jacl/encapsulate.cpp
+++ b/engines/glk/jacl/encapsulate.cpp
@@ -120,7 +120,7 @@ encapsulate() {
 
 	/* NULL OUT ALL THE WORD POINTERS BEYOND THE LAST WORD */
 	for (index = position; index < MAX_WORDS; index++)
-		word[index] = NULL;
+		word[index] = nullptr;
 
 	wp = 0;
 }
@@ -221,7 +221,7 @@ command_encapsulate() {
 
 	// NULL OUT ALL THE WORD POINTERS BEYOND THE LAST WORD
 	for (index = position; index < MAX_WORDS; index++) {
-		word[index] = NULL;
+		word[index] = nullptr;
 	}
 
 	wp = 0;
@@ -238,19 +238,19 @@ jacl_truncate() {
 	struct filter_type *filter = filter_table;
 
 	// REMOVE ALL THE DEFINED 'filter's FROM THE PLAYER'S COMMAND
-	if (filter != NULL) {
-		while (word[position] != NULL) {
+	if (filter != nullptr) {
+		while (word[position] != nullptr) {
 			match = FALSE;
 			do {
 				if (!strcmp(word[position], filter->word)) {
-					for (index = position; word[index + 1] != NULL;
+					for (index = position; word[index + 1] != nullptr;
 					        index++)
 						word[index] = word[index + 1];
-					word[index] = NULL;
+					word[index] = nullptr;
 					match = TRUE;
 				}
 				filter = filter->next_filter;
-			} while (filter != NULL && !match);
+			} while (filter != nullptr && !match);
 			filter = filter_table;
 			if (!match)
 				position++;
@@ -258,15 +258,15 @@ jacl_truncate() {
 	}
 
 	// SUBTITUTE ALL THE DEFINED 'synonym's IN THE PLAYER'S COMMAND
-	if (synonym_table != NULL) {
-		for (counter = 0; word[counter] != NULL; counter++) {
+	if (synonym_table != nullptr) {
+		for (counter = 0; word[counter] != nullptr; counter++) {
 			synonym = synonym_table;
 			do {
 				if (!strcmp(word[counter], synonym->original)) {
 					word[counter] = synonym->standard;
 					break;
 				}
-				if (synonym->next_synonym != NULL)
+				if (synonym->next_synonym != nullptr)
 					synonym = synonym->next_synonym;
 				else
 					break;
diff --git a/engines/glk/jacl/findroute.cpp b/engines/glk/jacl/findroute.cpp
index d05dbea590..c6d09c0682 100644
--- a/engines/glk/jacl/findroute.cpp
+++ b/engines/glk/jacl/findroute.cpp
@@ -47,32 +47,32 @@ struct Queue {
 };
 
 void qInit(Queue *q) {
-	q->head = q->tail = NULL;
+	q->head = q->tail = nullptr;
 }
 
 void qDelete(Queue *q) {
 	QueueNode *node, *next;
 
-	for (node = q->head; node != NULL; node = next) {
+	for (node = q->head; node != nullptr; node = next) {
 		next = node->next;
 		free(node);
 	}
 
-	q->head = q->tail = NULL;
+	q->head = q->tail = nullptr;
 }
 
 int qIsEmpty(Queue *q) {
-	return (q->head == NULL);
+	return (q->head == nullptr);
 }
 
 void qDebug(Queue *q) {
 	debug("Queue:");
 
-	if (q->head == NULL) {
+	if (q->head == nullptr) {
 		debug(" empty");
 	} else {
 		QueueNode *node;
-		for (node = q->head; node != NULL; node = node->next) {
+		for (node = q->head; node != nullptr; node = node->next) {
 			debug(" %d (%d)", node->val, node->val2);
 		}
 	}
@@ -84,9 +84,9 @@ void qAppend(Queue *q, int val, int val2) {
 	QueueNode *node = (QueueNode *) malloc(sizeof(QueueNode));
 	node->val = val;
 	node->val2 = val2;
-	node->next = NULL;
+	node->next = nullptr;
 
-	if (q->head == NULL) {
+	if (q->head == nullptr) {
 		q->head = q->tail = node;
 	} else {
 		q->tail->next = node;
@@ -101,7 +101,7 @@ void qPop(Queue *q, int *val, int *val2) {
 	*val2 = q->head->val2;
 
 	if (q->head == q->tail) {
-		q->head = q->tail = NULL;
+		q->head = q->tail = nullptr;
 	} else {
 		q->head = q->head->next;
 	}
@@ -163,7 +163,7 @@ void setInit(Set *set) {
 	int n;
 
 	for (n = 0; n < SET_HASHSIZE; n++) {
-		set->node[n] = NULL;
+		set->node[n] = nullptr;
 	}
 }
 
@@ -173,12 +173,12 @@ void setDelete(Set *set) {
 	for (n = 0; n < SET_HASHSIZE; n++) {
 		SetNode *node, *next;
 
-		for (node = set->node[n]; node != NULL; node = next) {
+		for (node = set->node[n]; node != nullptr; node = next) {
 			next = node->next;
 			free(node);
 		}
 
-		set->node[n] = NULL;
+		set->node[n] = nullptr;
 	}
 }
 
@@ -190,7 +190,7 @@ void setDebug(Set *set) {
 	for (n = 0; n < SET_HASHSIZE; n++) {
 		SetNode *node;
 
-		for (node = set->node[n]; node != NULL; node = node->next) {
+		for (node = set->node[n]; node != nullptr; node = node->next) {
 			debug(" %d", node->val);
 		}
 	}
@@ -208,7 +208,7 @@ void setAdd(Set *set, int val) {
 
 	/* check if val is already in the set */
 
-	for (node = set->node[n]; node != NULL; node = node->next) {
+	for (node = set->node[n]; node != nullptr; node = node->next) {
 		if (node->val == val) {
 			return;
 		}
@@ -226,7 +226,7 @@ int setContains(Set *set, int val) {
 	SetNode *node;
 	int n = setHash(val);
 
-	for (node = set->node[n]; node != NULL; node = node->next) {
+	for (node = set->node[n]; node != nullptr; node = node->next) {
 		if (node->val == val) {
 			return 1;
 		}
@@ -297,7 +297,7 @@ int find_route(int fromRoom, int toRoom, int known) {
 
 			if (dest < 1 || dest > objects) continue;
 
-			if (object[dest] == NULL) continue;
+			if (object[dest] == nullptr) continue;
 
 			if (dest != NOWHERE && !setContains(&visited, dest)) {
 				if (!known || (object[dest]->attributes & KNOWN)) {
diff --git a/engines/glk/jacl/glk_saver.cpp b/engines/glk/jacl/glk_saver.cpp
index 54739d8222..7b8fb2d335 100644
--- a/engines/glk/jacl/glk_saver.cpp
+++ b/engines/glk/jacl/glk_saver.cpp
@@ -64,12 +64,12 @@ bool save_game(strid_t save) {
 	write_integer(save, functions);
 	write_integer(save, strings);
 
-	while (current_integer != NULL) {
+	while (current_integer != nullptr) {
 		write_integer(save, current_integer->value);
 		current_integer = current_integer->next_integer;
 	}
 
-	while (current_function != NULL) {
+	while (current_function != nullptr) {
 		write_integer(save, current_function->call_count);
 		current_function = current_function->next_function;
 	}
@@ -87,7 +87,7 @@ bool save_game(strid_t save) {
 	}
 
 	// Write out all the current values of the string variables
-	while (current_string != NULL) {
+	while (current_string != nullptr) {
 		for (index = 0; index < 255; index++) {
 			g_vm->glk_put_char_stream(save, current_string->value[index]);
 		}
@@ -131,16 +131,16 @@ bool restore_game(strid_t save, bool warn) {
 		if (warn == FALSE) {
 			log_error(cstring_resolve("BAD_SAVED_GAME")->value, PLUS_STDOUT);
 		}
-		g_vm->glk_stream_close(save, NULL);
+		g_vm->glk_stream_close(save, nullptr);
 		return (FALSE);
 	}
 
-	while (current_integer != NULL) {
+	while (current_integer != nullptr) {
 		current_integer->value = read_integer(save);
 		current_integer = current_integer->next_integer;
 	}
 
-	while (current_function != NULL) {
+	while (current_function != nullptr) {
 		current_function->call_count = read_integer(save);
 		current_function = current_function->next_function;
 	}
@@ -157,7 +157,7 @@ bool restore_game(strid_t save, bool warn) {
 		object[index]->user_attributes = read_integer(save);
 	}
 
-	while (current_string != NULL) {
+	while (current_string != nullptr) {
 		for (index = 0; index < 255; index++) {
 			current_string->value[index] = g_vm->glk_get_char_stream(save);
 		}
diff --git a/engines/glk/jacl/interpreter.cpp b/engines/glk/jacl/interpreter.cpp
index d758667713..a8ae09682b 100644
--- a/engines/glk/jacl/interpreter.cpp
+++ b/engines/glk/jacl/interpreter.cpp
@@ -66,7 +66,7 @@ const char *strcasestr(const char *s, const char *find) {
 		do {
 			do {
 				if ((sc = *s++) == 0)
-					return (NULL);
+					return (nullptr);
 			} while ((char)tolower((unsigned char)sc) != c);
 		} while (scumm_strnicmp(s, find, len) != 0);
 		s--;
@@ -89,7 +89,7 @@ const char *location_attributes[] = {
 	"VISITED ", "DARK ", "ON_WATER ", "UNDER_WATER ", "WITHOUT_AIR ", "OUTDOORS ",
 	"MID_AIR ", "TIGHT_ROPE ", "POLLUTED ", "SOLVED ", "MID_WATER ", "DARKNESS ",
 	"MAPPED ", "KNOWN ",
-	NULL
+	nullptr
 };
 
 const char *object_attributes[] = {
@@ -98,19 +98,19 @@ const char *object_attributes[] = {
 	"CONTAINER ", "SURFACE ", "PLURAL ", "FLAMMABLE ", "BURNING ", "LOCATION ",
 	"ON ", "DAMAGED ", "FEMALE ", "POSSESSIVE ", "OUT_OF_REACH ", "TOUCHED ",
 	"SCORED ", "SITTING ", "NPC ", "DONE ", "GAS ", "NO_TAB ",
-	"NOT_IMPORTANT ", NULL
+	"NOT_IMPORTANT ", nullptr
 };
 
 const char *object_elements[] = {
 	"parent", "capacity", "mass", "bearing", "velocity", "next", "previous",
 	"child", "index", "status", "state", "counter", "points", "class", "x", "y",
-	NULL
+	nullptr
 };
 
 const char *location_elements[] = {
 	"north", "south", "east", "west", "northeast", "northwest", "southeast",
 	"southwest", "up", "down", "in", "out", "points", "class", "x", "y",
-	NULL
+	nullptr
 };
 
 struct csv_parser               parser_csv;
@@ -127,16 +127,16 @@ int                             field_no = 0;
 struct stack_type               backup[STACK_SIZE];
 struct proxy_type               proxy_backup[STACK_SIZE];
 
-struct function_type *resolved_function = NULL;
-struct string_type *resolved_string = NULL;
+struct function_type *resolved_function = nullptr;
+struct string_type *resolved_string = nullptr;
 
-struct string_type *new_string = NULL;
-struct string_type *current_cstring = NULL;
-struct string_type *previous_cstring = NULL;
+struct string_type *new_string = nullptr;
+struct string_type *current_cstring = nullptr;
+struct string_type *previous_cstring = nullptr;
 
-struct cinteger_type *new_cinteger = NULL;
-struct cinteger_type *current_cinteger = NULL;
-struct cinteger_type *previous_cinteger = NULL;
+struct cinteger_type *new_cinteger = nullptr;
+struct cinteger_type *current_cinteger = nullptr;
+struct cinteger_type *previous_cinteger = nullptr;
 
 long                            bit_mask;
 extern int                      encrypted;
@@ -150,8 +150,8 @@ char                            csv_buffer[1024];
 int                             resolved_attribute;
 
 /* THE ITERATION VARIABLE USED FOR LOOPS */
-int                             *loop_integer = NULL;
-int                             *select_integer = NULL;
+int                             *loop_integer = nullptr;
+int                             *select_integer = nullptr;
 
 int                             criterion_value = 0;
 int                             criterion_type = 0;
@@ -281,14 +281,14 @@ void terminate(int code) {
 
 	/* CLOSE THE SOUND CHANNELS */
 	for (index = 0; index < 8; index++) {
-		if (sound_channel[index] != NULL) {
+		if (sound_channel[index] != nullptr) {
 			g_vm->glk_schannel_destroy(sound_channel[index]);
 		}
 	}
 
 	/* CLOSE THE STREAM */
-	if (game_stream != NULL) {
-		g_vm->glk_stream_close(game_stream, NULL);
+	if (game_stream != nullptr) {
+		g_vm->glk_stream_close(game_stream, nullptr);
 	}
 
 	g_vm->glk_exit();
@@ -307,7 +307,7 @@ void build_proxy() {
 
 	/* LOOP THROUGH ALL THE PARAMETERS OF THE PROXY COMMAND
 	   AND BUILD THE MOVE TO BE ISSUED ON THE PLAYER'S BEHALF */
-	for (index = 1; word[index] != NULL; index++) {
+	for (index = 1; word[index] != nullptr; index++) {
 		strcat(proxy_buffer, text_of_word(index));
 	}
 
@@ -328,7 +328,7 @@ void cb1(void *s, size_t i, void *not_used) {
 
 	sprintf(temp_buffer, "field[%d]", field_no);
 
-	if ((resolved_cstring = cstring_resolve(temp_buffer)) != NULL) {
+	if ((resolved_cstring = cstring_resolve(temp_buffer)) != nullptr) {
 		//write_text("Resolved ");
 		//write_text(temp_buffer);
 		//write_text("^");
@@ -350,7 +350,7 @@ void cb2(int c, void *not_used) {
 	// THE END OF THE RECORD HAS BEEN REACHED, EXPORT THE NUMBER OF FIELDS READ
 	struct cinteger_type *resolved_cinteger;
 
-	if ((resolved_cinteger = cinteger_resolve("field_count")) != NULL) {
+	if ((resolved_cinteger = cinteger_resolve("field_count")) != nullptr) {
 		resolved_cinteger->value = field_no;
 	}
 }
@@ -385,7 +385,7 @@ int execute(const char *funcname) {
 	/* GET THE FUNCTION OBJECT BY THE FUNCTION NAME */
 	resolved_function = function_resolve(called_name);
 
-	if (resolved_function == NULL) {
+	if (resolved_function == nullptr) {
 		//printf("--- failed to find %s\n", called_name);
 		return (FALSE);
 	}
@@ -434,7 +434,7 @@ int execute(const char *funcname) {
 
 	while (text_buffer[0] != 125 && !interrupted) {
 		encapsulate();
-		if (word[0] == NULL);
+		if (word[0] == nullptr);
 		else if (!strcmp(word[0], "endwhile")) {
 			currentLevel--;
 			if (currentLevel < executionLevel) {
@@ -540,7 +540,7 @@ int execute(const char *funcname) {
 				top_of_do_loop = ftell(file);
 #endif
 			} else if (!strcmp(word[0], "until")) {
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -557,7 +557,7 @@ int execute(const char *funcname) {
 					}
 				}
 			} else if (!strcmp(word[0], "untilall")) {
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -588,7 +588,7 @@ int execute(const char *funcname) {
 
 				// infile REMAINS OPEN DURING THE ITERATION, ONLY NEEDS
 				// OPENING THE FIRST TIME
-				if (infile == NULL) {
+				if (infile == nullptr) {
 					strcpy(temp_buffer, data_directory);
 					strcat(temp_buffer, prefix);
 					strcat(temp_buffer, "-");
@@ -597,18 +597,18 @@ int execute(const char *funcname) {
 
 					infile = File::openForReading(temp_buffer);
 
-					if (word[2] != NULL && !strcmp(word[2], "skip_header")) {
+					if (word[2] != nullptr && !strcmp(word[2], "skip_header")) {
 						assert(infile);
 						infile->read(csv_buffer, 1024);
 					}
 				}
 
-				if (infile == NULL) {
+				if (infile == nullptr) {
 					sprintf(error_buffer, "Failed to open file %s\n", temp_buffer);
 					log_error(error_buffer, LOG_ONLY);
-					infile = NULL;
+					infile = nullptr;
 				} else {
-					if (word[1] == NULL) {
+					if (word[1] == nullptr) {
 						/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 						noproprun();
 						return (exit_function(TRUE));
@@ -621,18 +621,18 @@ int execute(const char *funcname) {
 							i = strlen(csv_buffer);
 							//sprintf (temp_buffer, "Read ~%s~ with %d bytes.^", csv_buffer, i);
 							//write_text(temp_buffer);
-							if (csv_parse(&parser_csv, csv_buffer, i, cb1, cb2, (void *) NULL) != (uint)i) {
+							if (csv_parse(&parser_csv, csv_buffer, i, cb1, cb2, (void *) nullptr) != (uint)i) {
 								sprintf(error_buffer, "Error parsing file: %s\n", csv_strerror(csv_error(&parser_csv)));
 								log_error(error_buffer, PLUS_STDOUT);
 								delete infile;
-								infile = NULL;
+								infile = nullptr;
 							} else {
 								// A LINE HAS BEEN SUCCESSFULLY READ, EXECUTE THE CONTENTS OF THE LOOP
 								executionLevel++;
 							}
 						} else {
 							delete infile;
-							infile = NULL;
+							infile = nullptr;
 						}
 					}
 				}
@@ -662,7 +662,7 @@ int execute(const char *funcname) {
 
 				// infile REMAINS OPEN DURING THE ITERATION, ONLY NEEDS
 				// OPENING THE FIRST TIME
-				if (infile == NULL) {
+				if (infile == nullptr) {
 					strcpy(in_name, data_directory);
 					strcat(in_name, prefix);
 					strcat(in_name, "-");
@@ -672,7 +672,7 @@ int execute(const char *funcname) {
 					infile = File::openForReading(in_name);
 				}
 
-				if (outfile == NULL) {
+				if (outfile == nullptr) {
 					// OPEN A TEMPORARY OUTPUT FILE TO WRITE THE MODIFICATIONS TO
 					strcpy(out_name, data_directory);
 					strcat(out_name, prefix);
@@ -685,21 +685,21 @@ int execute(const char *funcname) {
 					outfile = File::openForWriting(out_name);
 				}
 
-				if (infile == NULL) {
+				if (infile == nullptr) {
 					sprintf(error_buffer, "Failed to open input CSV file ~%s\n", in_name);
 					log_error(error_buffer, LOG_ONLY);
-					if (outfile != NULL) {
+					if (outfile != nullptr) {
 						delete outfile;
-						outfile = NULL;
+						outfile = nullptr;
 					}
 					return (exit_function(TRUE));
 				} else {
-					if (outfile == NULL) {
+					if (outfile == nullptr) {
 						sprintf(error_buffer, "Failed to open output CSV file ~%s~\n", out_name);
 						log_error(error_buffer, LOG_ONLY);
-						if (infile != NULL) {
+						if (infile != nullptr) {
 							delete infile;
-							infile = NULL;
+							infile = nullptr;
 						}
 						return (exit_function(TRUE));
 					} else {
@@ -739,7 +739,7 @@ int execute(const char *funcname) {
 							}
 						}
 #endif
-						if (word[1] == NULL) {
+						if (word[1] == nullptr) {
 							/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 							noproprun();
 							return (exit_function(TRUE));
@@ -755,7 +755,7 @@ int execute(const char *funcname) {
 									read_lck.l_type = F_UNLCK;  // SETTING A READ LOCK
 									fcntl(read_fd, F_SETLK, &read_lck);
 									delete infile;
-									infile = NULL;
+									infile = nullptr;
 								} else {
 									// A LINE HAS BEEN SUCCESSFULLY READ, EXECUTE THE CONTENTS OF THE LOOP
 									executionLevel++;
@@ -771,8 +771,8 @@ int execute(const char *funcname) {
 
 								rename(out_name, in_name);
 
-								outfile = NULL;
-								infile = NULL;
+								outfile = nullptr;
+								infile = nullptr;
 							}
 						}
 					}
@@ -782,7 +782,7 @@ int execute(const char *funcname) {
 				/* THIS LOOP COMES BACK TO THE START OF THE LINE CURRENTLY
 				   EXECUTING, NOT THE LINE AFTER */
 				top_of_while = before_command;
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -794,7 +794,7 @@ int execute(const char *funcname) {
 				/* THIS LOOP COMES BACK TO THE START OF THE LINE CURRENTLY
 				   EXECUTING, NOT THE LINE AFTER */
 				top_of_while = before_command;
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -809,7 +809,7 @@ int execute(const char *funcname) {
 #else
 				top_of_loop = ftell(file);
 #endif
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					// IF NONE IS SUPPLIED DEFAULT TO noun3
 					loop_integer = &noun[2];
 				} else {
@@ -818,7 +818,7 @@ int execute(const char *funcname) {
 
 					// IF THE SUPPLIED CONTAINER CAN'T BE RESOLVED
 					// DEFAULT TO noun3
-					if (loop_integer == NULL)
+					if (loop_integer == nullptr)
 						loop_integer = &noun[2];
 				}
 
@@ -850,11 +850,11 @@ int execute(const char *funcname) {
 #else
 				top_of_select = ftell(file);
 #endif
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
-				} else if (word[2] == NULL) {
+				} else if (word[2] == nullptr) {
 					// IF NONE IS SUPPLIED DEFAULT TO noun3
 					select_integer = &noun[2];
 				} else {
@@ -863,7 +863,7 @@ int execute(const char *funcname) {
 
 					// IF THE SUPPLIED CONTAINER CAN'T BE RESOLVED
 					// DEFAULT TO noun3
-					if (select_integer == NULL) {
+					if (select_integer == nullptr) {
 						select_integer = &noun[2];
 					}
 				}
@@ -925,7 +925,7 @@ int execute(const char *funcname) {
 
 					while (text_buffer[0] != '}') {
 						encapsulate();
-						if (word[0] != NULL && !strcmp(word[0], "endselect")) {
+						if (word[0] != nullptr && !strcmp(word[0], "endselect")) {
 							break;
 						}
 #ifdef GLK
@@ -956,7 +956,7 @@ int execute(const char *funcname) {
 				executionLevel--;
 #ifdef GLK
 			} else if (!strcmp(word[0], "cursor")) {
-				if (word[2] == NULL) {
+				if (word[2] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
@@ -972,7 +972,7 @@ int execute(const char *funcname) {
 
 				if (SOUND_SUPPORTED->value) {
 					/* SET THE CHANNEL TO STOP, IF SUPPLIED */
-					if (word[1] == NULL) {
+					if (word[1] == nullptr) {
 						channel = 0;
 					} else {
 						channel = value_of(word[1], TRUE);
@@ -989,7 +989,7 @@ int execute(const char *funcname) {
 
 				if (SOUND_SUPPORTED->value) {
 					/* SET THE CHANNEL TO STOP, IF SUPPLIED */
-					if (word[2] == NULL) {
+					if (word[2] == nullptr) {
 						channel = 0;
 					} else {
 						channel = value_of(word[2], TRUE);
@@ -1000,7 +1000,7 @@ int execute(const char *funcname) {
 						}
 					}
 
-					if (word[1] == NULL) {
+					if (word[1] == nullptr) {
 						/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 						noproprun();
 						return (exit_function(TRUE));
@@ -1031,7 +1031,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "timer")) {
 				if (TIMER_SUPPORTED->value && TIMER_ENABLED->value) {
-					if (word[1] == NULL) {
+					if (word[1] == nullptr) {
 						/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 						noproprun();
 						return (exit_function(TRUE));
@@ -1054,7 +1054,7 @@ int execute(const char *funcname) {
 
 				if (SOUND_SUPPORTED->value && SOUND_ENABLED->value) {
 					/* SET THE CHANNEL TO USE, IF SUPPLIED */
-					if (word[2] == NULL) {
+					if (word[2] == nullptr) {
 						channel = 0;
 					} else {
 						channel = value_of(word[2], TRUE);
@@ -1066,13 +1066,13 @@ int execute(const char *funcname) {
 					}
 
 					/* SET THE NUMBER OF REPEATS, IF SUPPLIED */
-					if (word[3] == NULL) {
+					if (word[3] == nullptr) {
 						repeats = 1;
 					} else {
 						repeats = value_of(word[3], TRUE);
 					}
 
-					if (word[1] == NULL) {
+					if (word[1] == nullptr) {
 						/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 						noproprun();
 						return (exit_function(TRUE));
@@ -1089,7 +1089,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "image")) {
 				if (GRAPHICS_SUPPORTED->value && GRAPHICS_ENABLED->value) {
-					if (word[1] == NULL) {
+					if (word[1] == nullptr) {
 						/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 						noproprun();
 						return (exit_function(TRUE));
@@ -1101,13 +1101,13 @@ int execute(const char *funcname) {
 					}
 				}
 			} else if (!strcmp(word[0], "askstring") || !strcmp(word[0], "getstring")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
 				} else {
 					/* GET A POINTER TO THE STRING BEING MODIFIED */
-					if ((resolved_string = string_resolve(word[1])) == NULL) {
+					if ((resolved_string = string_resolve(word[1])) == nullptr) {
 						unkstrrun(word[1]);
 						return (exit_function(TRUE));
 					}
@@ -1128,9 +1128,9 @@ int execute(const char *funcname) {
 					insist = TRUE;
 				}
 
-				if (word[3] != NULL) {
+				if (word[3] != nullptr) {
 					ask_integer = container_resolve(word[1]);
-					if (ask_integer == NULL) {
+					if (ask_integer == nullptr) {
 						unkvarrun(word[1]);
 						return (exit_function(TRUE));
 					}
@@ -1149,9 +1149,9 @@ int execute(const char *funcname) {
 					return (exit_function(TRUE));
 				}
 			} else if (!strcmp(word[0], "getyesorno")) {
-				if (word[1] != NULL) {
+				if (word[1] != nullptr) {
 					ask_integer = container_resolve(word[1]);
-					if (ask_integer == NULL) {
+					if (ask_integer == nullptr) {
 						unkvarrun(word[1]);
 						return (exit_function(TRUE));
 					}
@@ -1170,7 +1170,7 @@ int execute(const char *funcname) {
 				terminate(0);
 				return 0;
 			} else if (!strcmp(word[0], "more")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					more("[MORE]");
 				} else {
 					more(word[1]);
@@ -1178,7 +1178,7 @@ int execute(const char *funcname) {
 			} else if (!strcmp(word[0], "style")) {
 				/* THIS COMMAND IS USED TO OUTPUT ANSI CODES OR SET GLK
 				 * STREAM STYLES */
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -1211,7 +1211,7 @@ int execute(const char *funcname) {
 			} else if (!strcmp(word[0], "flush")) {
 			} else if (!strcmp(word[0], "hyperlink")) {
 				/* OUTPUT LINK TEXT AS PLAIN TEXT UNDER Glk */
-				if (word[2] == NULL) {
+				if (word[2] == nullptr) {
 					noproprun();
 					pop_stack();
 					return (TRUE);
@@ -1621,7 +1621,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "execute") || !strcmp(word[0], "call")) {
 				/* CALLS ANOTHER JACL FUNCTION */
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -1629,17 +1629,17 @@ int execute(const char *funcname) {
 					/* RESOLVE ALL THE TEXT AND STORE IT IN A TEMPORARY BUFFER*/
 					string_buffer[0] = 0;
 
-					for (counter = 1; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+					for (counter = 1; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 						strcat(string_buffer, arg_text_of_word(counter));
 					}
 
-					if (function_resolve(string_buffer) == NULL && !strcmp(word[0], "execute")) {
+					if (function_resolve(string_buffer) == nullptr && !strcmp(word[0], "execute")) {
 						char *argstart;
 
 						/* REMOVE ANY PARAMETERS FROM FUNCTION NAME
 						   BEFORE DISPLAYING ERROR MESSAGE */
 						argstart = strchr(string_buffer, '<');
-						if (argstart != NULL)
+						if (argstart != nullptr)
 							*argstart = 0;
 
 						sprintf(error_buffer, UNDEFINED_FUNCTION, executing_function->name, string_buffer);
@@ -1650,7 +1650,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "points")) {
 				/* INCREASE THE PLAYER'S SCORE AND POTENTIALLY INFORM THEM OF THE INCREASE */
-				if (word[1] != NULL) {
+				if (word[1] != nullptr) {
 					SCORE->value += value_of(word[1], TRUE);
 					if (NOTIFY->value) {
 #ifdef GLK
@@ -1752,23 +1752,23 @@ int execute(const char *funcname) {
 					if (encrypted) jacl_decrypt(text_buffer);
 				}
 			} else if (!strcmp(word[0], "mesg")) {
-				for (counter = 1; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+				for (counter = 1; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 					warning("%s", text_of_word(counter));
 				}
 			} else if (!strcmp(word[0], "error")) {
 				write_text("ERROR: In function ~");
 				write_text(executing_function->name);
 				write_text("~, ");
-				for (counter = 1; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+				for (counter = 1; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 					write_text(text_of_word(counter));
 				}
 			} else if (!strcmp(word[0], "debug") && DEBUG->value) {
 				write_text("DEBUG: ");
-				for (counter = 1; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+				for (counter = 1; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 					write_text(text_of_word(counter));
 				}
 			} else if (!strcmp(word[0], "write")) {
-				for (counter = 1; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+				for (counter = 1; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 					output = text_of_word(counter);
 					if (*output != 0) {
 						// IF THE OUTPUT ISN'T AN EMPTY STRING, DISPLAY IT
@@ -1776,12 +1776,12 @@ int execute(const char *funcname) {
 					}
 				}
 			} else if (!strcmp(word[0], "length")) {
-				if (word[2] == NULL) {
+				if (word[2] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
 				} else {
-					if ((container = container_resolve(word[1])) == NULL) {
+					if ((container = container_resolve(word[1])) == nullptr) {
 						unkvarrun(word[1]);
 						return (exit_function(TRUE));
 					}
@@ -1789,12 +1789,12 @@ int execute(const char *funcname) {
 					*container = strlen(text_of(word[2]));
 				}
 			} else if (!strcmp(word[0], "savegame")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
 				} else {
-					if ((container = container_resolve(word[1])) == NULL) {
+					if ((container = container_resolve(word[1])) == nullptr) {
 						unkvarrun(word[1]);
 						return (exit_function(TRUE));
 					} else {
@@ -1802,12 +1802,12 @@ int execute(const char *funcname) {
 					}
 				}
 			} else if (!strcmp(word[0], "restoregame")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
 				} else {
-					if ((container = container_resolve(word[1])) == NULL) {
+					if ((container = container_resolve(word[1])) == nullptr) {
 						unkvarrun(word[1]);
 						return (exit_function(TRUE));
 					} else {
@@ -1836,22 +1836,22 @@ int execute(const char *funcname) {
 				char split_buffer[256] = "";
 				char container_buffer[256] = "";
 				char delimiter[256] = "";
-				char *match = NULL;
-				struct string_type *resolved_splitstring = NULL;
+				char *match = nullptr;
+				struct string_type *resolved_splitstring = nullptr;
 
 				strcpy(split_buffer, text_of_word(2));
 				strcpy(delimiter, text_of_word(3));
 
 				char *source = split_buffer;
 
-				if (word[4] == NULL) {
+				if (word[4] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
 				} else {
 					split_container = container_resolve(var_text_of_word(1));
 
-					if (split_container == NULL) {
+					if (split_container == nullptr) {
 						unkvarrun(var_text_of_word(1));
 						return (exit_function(TRUE));
 					} else {
@@ -1867,7 +1867,7 @@ int execute(const char *funcname) {
 							strcat(container_buffer, integer_buffer);
 							strcat(container_buffer, "]");
 
-							if ((resolved_splitstring = string_resolve(container_buffer)) == NULL) {
+							if ((resolved_splitstring = string_resolve(container_buffer)) == nullptr) {
 								unkstrrun(var_text_of_word(4));
 								return (exit_function(TRUE));
 							} else {
@@ -1882,7 +1882,7 @@ int execute(const char *funcname) {
 						strcat(container_buffer, integer_buffer);
 						strcat(container_buffer, "]");
 
-						if ((resolved_splitstring = string_resolve(container_buffer)) == NULL) {
+						if ((resolved_splitstring = string_resolve(container_buffer)) == nullptr) {
 							unkstrrun(word[1]);
 							return (exit_function(TRUE));
 						} else {
@@ -1894,21 +1894,21 @@ int execute(const char *funcname) {
 			} else if (!strcmp(word[0], "setstring") ||
 			           !strcmp(word[0], "addstring")) {
 				char setstring_buffer[2048] = "";
-				struct string_type *resolved_setstring = NULL;
+				struct string_type *resolved_setstring = nullptr;
 
-				if (word[2] == NULL) {
+				if (word[2] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
 				} else {
 					/* GET A POINTER TO THE STRING BEING MODIFIED */
-					if ((resolved_setstring = string_resolve(var_text_of_word(1))) == NULL) {
+					if ((resolved_setstring = string_resolve(var_text_of_word(1))) == nullptr) {
 						unkstrrun(word[1]);
 						return (exit_function(TRUE));
 					}
 
 					/* RESOLVE ALL THE TEXT AND STORE IT IN A TEMPORARY BUFFER*/
-					for (counter = 2; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+					for (counter = 2; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 						strcat(setstring_buffer, text_of_word(counter));
 					}
 
@@ -1925,16 +1925,16 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "padstring")) {
 				char setstring_buffer[2048] = "";
-				struct string_type *resolved_setstring = NULL;
+				struct string_type *resolved_setstring = nullptr;
 				string_buffer[0] = 0;
 
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
 				} else {
 					/* GET A POINTER TO THE STRING BEING MODIFIED */
-					if ((resolved_setstring = string_resolve(word[1])) == NULL) {
+					if ((resolved_setstring = string_resolve(word[1])) == nullptr) {
 						unkstrrun(word[1]);
 						return (exit_function(TRUE));
 					}
@@ -1951,7 +1951,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "return")) {
 				/* RETURN FROM THIS FUNCTION, POSSIBLY RETURNING AN INTEGER VALUE */
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					return (exit_function(TRUE));
 				} else {
 					index = value_of(word[1], TRUE);
@@ -1960,7 +1960,7 @@ int execute(const char *funcname) {
 			} else if (!strcmp(word[0], "position")) {
 				/* MOVE AN OBJECT TO ITS NEW X,Y COORDINATES BASED ON ITS CURRENT VALUES
 				 * FOR x, y, bearing, velocity */
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -1982,12 +1982,12 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "bearing")) {
 				/* CALCULATE THE BEARING BETWEEN TWO OBJECTS */
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
 				} else {
-					if ((container = container_resolve(word[1])) == NULL) {
+					if ((container = container_resolve(word[1])) == nullptr) {
 						unkvarrun(word[1]);
 						return (exit_function(TRUE));
 					}
@@ -2004,7 +2004,7 @@ int execute(const char *funcname) {
 							badptrrun(word[3], object_2);
 							return (exit_function(TRUE));
 						} else {
-							if (container != NULL
+							if (container != nullptr
 							        && object_1 != FALSE
 							        && object_2 != FALSE) {
 								*container = bearing((double) object[object_1]->X,
@@ -2017,7 +2017,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "distance")) {
 				/* CALCULATE THE DISTANCE BETWEEN TWO OBJECTS */
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -2036,7 +2036,7 @@ int execute(const char *funcname) {
 							badptrrun(word[3], object_2);
 							return (exit_function(TRUE));
 						} else {
-							if (container != NULL
+							if (container != nullptr
 							        && object_1 != FALSE
 							        && object_2 != FALSE) {
 								*container = distance((double)
@@ -2055,7 +2055,7 @@ int execute(const char *funcname) {
 			           !strcmp(word[0], "npc_to")) {
 				/* CALCULATE THE FIRST DIRECTION TO TRAVEL IN GET TO
 				 * A SPECIFIED LOCATION */
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -2074,7 +2074,7 @@ int execute(const char *funcname) {
 							badptrrun(word[3], object_2);
 							return (exit_function(TRUE));
 						} else {
-							if (container != NULL
+							if (container != nullptr
 							        && object_1 != FALSE
 							        && object_2 != FALSE) {
 								if (!strcmp(word[0], "dir_to")) {
@@ -2088,19 +2088,19 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "set")) {
 				/* SET THE VALUE OF AN ELEMENT TO A SUPPLIED INTEGER */
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
 				} else {
 					container = container_resolve(var_text_of_word(1));
 
-					if (container == NULL) {
+					if (container == nullptr) {
 						unkvarrun(word[1]);
 						return (exit_function(TRUE));
 					} else {
 						int mark = 2; // SET mark TO POINT TO THE FIRST OPERATOR
-						while (word[mark + 1] != NULL) {
+						while (word[mark + 1] != nullptr) {
 							counter = value_of(word[mark + 1], TRUE);
 
 							if (word[mark][0] == '+')
@@ -2137,7 +2137,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "ensure")) {
 				/* USED TO GIVE OR TAKE AN ATTRIBUTE TO OR FROM AND OBJECT */
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -2180,7 +2180,7 @@ int execute(const char *funcname) {
 			} else if (!strcmp(word[0], "append")) {
 				int first = TRUE;
 
-				if (word[2] == NULL) {
+				if (word[2] == nullptr) {
 					// NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND
 					noproprun();
 					return (exit_function(TRUE));
@@ -2193,11 +2193,11 @@ int execute(const char *funcname) {
 
 					outfile = File::openForWriting(temp_buffer);
 
-					if (outfile == NULL) {
+					if (outfile == nullptr) {
 						sprintf(error_buffer, "Failed to open file %s\n", temp_buffer);
 						log_error(error_buffer, PLUS_STDOUT);
 					} else {
-						for (counter = 2; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+						for (counter = 2; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 							output = text_of_word(counter);
 							if (*output != 0) {
 								if (first == FALSE) {
@@ -2216,20 +2216,20 @@ int execute(const char *funcname) {
 					}
 
 					delete outfile;
-					outfile = NULL;
+					outfile = nullptr;
 				}
 			} else if (!strcmp(word[0], "insert")) {
 				int first = TRUE;
 
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					// NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND
 					noproprun();
 					return (exit_function(TRUE));
 				} else {
-					if (outfile == NULL) {
+					if (outfile == nullptr) {
 						log_error("Insert statement not inside an 'update' loop.", PLUS_STDOUT);
 					} else {
-						for (counter = 1; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+						for (counter = 1; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 							output = text_of_word(counter);
 							if (*output != 0) {
 								if (first == FALSE) {
@@ -2245,7 +2245,7 @@ int execute(const char *funcname) {
 					}
 				}
 			} else if (!strcmp(word[0], "inspect")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					// NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND
 					noproprun();
 					return (exit_function(TRUE));
@@ -2255,7 +2255,7 @@ int execute(const char *funcname) {
 			} else if (!strcmp(word[0], "move")) {
 				/* THIS COMMAND IS USED TO MOVE AN OBJECT TO HAVE ANOTHER PARENT
 				 * INCLUDING MODIFYING ALL QUANTITY VALUES BASED ON THE OBJECTS MASS */
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun();
 					return (exit_function(TRUE));
@@ -2283,7 +2283,7 @@ int execute(const char *funcname) {
 			} else if (!strcmp(word[0], "ifstringall")) {
 				/* CHECK IF A STRING EQUALS OR CONTAINS ANOTHER STRING */
 				currentLevel++;
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
@@ -2293,7 +2293,7 @@ int execute(const char *funcname) {
 			} else if (!strcmp(word[0], "ifstring")) {
 				/* CHECK IF A STRING EQUALS OR CONTAINS ANOTHER STRING */
 				currentLevel++;
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
@@ -2302,7 +2302,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "ifexecute")) {
 				currentLevel++;
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
@@ -2310,7 +2310,7 @@ int execute(const char *funcname) {
 					/* RESOLVE ALL THE TEXT AND STORE IT IN A TEMPORARY BUFFER*/
 					string_buffer[0] = 0;
 
-					for (counter = 1; word[counter] != NULL && counter < MAX_WORDS; counter++) {
+					for (counter = 1; word[counter] != nullptr && counter < MAX_WORDS; counter++) {
 						strcat(string_buffer, arg_text_of_word(counter));
 					}
 
@@ -2320,7 +2320,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "if")) {
 				currentLevel++;
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
@@ -2329,7 +2329,7 @@ int execute(const char *funcname) {
 				}
 			} else if (!strcmp(word[0], "ifall")) {
 				currentLevel++;
-				if (word[3] == NULL) {
+				if (word[3] == nullptr) {
 					/* NOT ENOUGH PARAMETERS SUPPLIED FOR THIS COMMAND */
 					noproprun(0);
 					return (exit_function(TRUE));
@@ -2370,18 +2370,18 @@ int execute(const char *funcname) {
 }
 
 int exit_function(int return_code) {
-	if (infile != NULL) {
+	if (infile != nullptr) {
 		read_lck.l_type = F_UNLCK;  // SETTING A READ LOCK
 		fcntl(read_fd, F_SETLK, &read_lck);
 		delete infile;
-		infile = NULL;
+		infile = nullptr;
 	}
 
-	if (outfile != NULL) {
+	if (outfile != nullptr) {
 		write_lck.l_type = F_UNLCK; // SETTING A WRITE LOCK
 		fcntl(write_fd, F_SETLK, &write_lck);
 		delete outfile;
-		outfile = NULL;
+		outfile = nullptr;
 	}
 
 	/* POP THE STACK REGARDLESS OF THE RETURN CODE */
@@ -2397,7 +2397,7 @@ char *object_names(int object_index, char *names_buffer) {
 	struct name_type *current_name = object[object_index]->first_name;
 	names_buffer[0] = 0;
 
-	while (current_name != NULL) {
+	while (current_name != nullptr) {
 		strcat(names_buffer, " ");
 		strcat(names_buffer, current_name->name);
 		current_name = current_name->next_name;
@@ -2587,16 +2587,16 @@ void set_arguments(const char *function_call) {
 	argument_buffer[index] = 0;
 
 	/* CLEAR THE NEXT ARGUMENT POINTER */
-	arg_ptr[position] = NULL;
+	arg_ptr[position] = nullptr;
 
 	/* STORE THE INTEGER VALUE OF EACH ARGUMENT PASSED*/
 	index = 0;
-	while (arg_ptr[index] != NULL) {
+	while (arg_ptr[index] != nullptr) {
 		//arg_value[index] = value_of(arg_ptr[index], TRUE);
 
-		if ((resolved_integer = integer_resolve(arg_ptr[index])) != NULL) {
+		if ((resolved_integer = integer_resolve(arg_ptr[index])) != nullptr) {
 			arg_value[index] = resolved_integer->value;
-		} else if ((resolved_cinteger = cinteger_resolve(arg_ptr[index])) != NULL) {
+		} else if ((resolved_cinteger = cinteger_resolve(arg_ptr[index])) != nullptr) {
 			arg_value[index] = resolved_cinteger->value;
 		} else if (object_element_resolve(arg_ptr[index])) {
 			arg_value[index] = oec;
@@ -2625,7 +2625,7 @@ void set_arguments(const char *function_call) {
 
 	/* CREATE A CONSTANT FOR EACH ARGUMENT AFTER THE CORE FUNCTION NAME */
 	index = 0;
-	while (arg_ptr[index] != NULL) {
+	while (arg_ptr[index] != nullptr) {
 		if (index == 0) noun[3] = arg_value[index];
 		add_cinteger("arg", arg_value[index]);
 		//printf("--- %s = %s\n", arg_ptr[index], arg_text_of(arg_ptr[index]));
@@ -2680,7 +2680,7 @@ void pop_stack() {
 
 	executing_function = backup[stack].function;
 
-	if (executing_function != NULL) {
+	if (executing_function != nullptr) {
 		strncpy(function_name, executing_function->name, 80);
 		strncpy(cstring_resolve("function_name")->value, executing_function->name, 80);
 	}
@@ -2721,9 +2721,9 @@ void push_stack(int32 file_pointer) {
 		return;
 	} else {
 		backup[stack].infile = infile;
-		infile = NULL;
+		infile = nullptr;
 		backup[stack].outfile = outfile;
-		outfile = NULL;
+		outfile = nullptr;
 		backup[stack].function = executing_function;
 		backup[stack].address = file_pointer;
 		backup[stack].wp = wp;
@@ -2766,13 +2766,13 @@ void push_stack(int32 file_pointer) {
 		index = 0;
 		current_cinteger = cinteger_table;
 
-		if (current_cinteger != NULL) {
+		if (current_cinteger != nullptr) {
 			do {
 				if (!strcmp(current_cinteger->name, "arg")) {
 					backup[stack].arguments[index++] = current_cinteger->value;
 				}
 				current_cinteger = current_cinteger->next_cinteger;
-			} while (current_cinteger != NULL);
+			} while (current_cinteger != nullptr);
 		}
 
 		// STORE THE NUMBER OF ARGUMENTS PASSED TO THIS FUNCTION
@@ -2783,14 +2783,14 @@ void push_stack(int32 file_pointer) {
 		index = 0;
 		current_cstring = cstring_table;
 
-		if (current_cstring != NULL) {
+		if (current_cstring != nullptr) {
 			do {
 				if (!strcmp(current_cstring->name, "string_arg")) {
 					strncpy(backup[stack].str_arguments[index++], current_cstring->value, 255);
 				}
 
 				current_cstring = current_cstring->next_string;
-			} while (current_cstring != NULL);
+			} while (current_cstring != nullptr);
 		}
 	}
 
@@ -2876,13 +2876,13 @@ void push_proxy() {
 		/* PUSH ALL THE CURRENT COMMAND INTEGERS ONTO THE STACK */
 		counter = 0;
 
-		if (current_cinteger != NULL) {
+		if (current_cinteger != nullptr) {
 			do {
 				if (!strcmp(current_cinteger->name, "$integer")) {
 					proxy_backup[proxy_stack].integer[counter++] = current_cinteger->value;
 				}
 				current_cinteger = current_cinteger->next_cinteger;
-			} while (current_cinteger != NULL);
+			} while (current_cinteger != nullptr);
 		}
 
 		proxy_backup[proxy_stack].integercount = counter;
@@ -2891,7 +2891,7 @@ void push_proxy() {
 		text = 0;
 		command = 0;
 
-		if (current_cstring != NULL) {
+		if (current_cstring != nullptr) {
 			do {
 				if (!strcmp(current_cstring->name, "$string")) {
 					strncpy(proxy_backup[proxy_stack].text[text++], current_cstring->value, 255);
@@ -2901,7 +2901,7 @@ void push_proxy() {
 				}
 
 				current_cstring = current_cstring->next_string;
-			} while (current_cstring != NULL);
+			} while (current_cstring != nullptr);
 		}
 
 		proxy_backup[proxy_stack].textcount = counter;
@@ -2921,7 +2921,7 @@ int condition() {
 
 	first = 1;
 
-	while (word[first + 2] != NULL && ((first + 2) < MAX_WORDS)) {
+	while (word[first + 2] != nullptr && ((first + 2) < MAX_WORDS)) {
 		if (logic_test(first))
 			return (TRUE);
 		else
@@ -2937,7 +2937,7 @@ int and_condition() {
 
 	first = 1;
 
-	while (word[first + 2] != NULL && ((first + 2) < MAX_WORDS)) {
+	while (word[first + 2] != nullptr && ((first + 2) < MAX_WORDS)) {
 		if (logic_test(first) == FALSE)
 			return (FALSE);
 		else
@@ -3068,7 +3068,7 @@ int strcondition() {
 
 	first = 1;
 
-	while (word[first + 2] != NULL && ((first + 2) < MAX_WORDS)) {
+	while (word[first + 2] != nullptr && ((first + 2) < MAX_WORDS)) {
 		if (str_test(first))
 			return (TRUE);
 		else
@@ -3082,7 +3082,7 @@ int and_strcondition() {
 
 	first = 1;
 
-	while (word[first + 2] != NULL && ((first + 2) < MAX_WORDS)) {
+	while (word[first + 2] != nullptr && ((first + 2) < MAX_WORDS)) {
 		if (str_test(first) == FALSE)
 			return (FALSE);
 		else
@@ -3155,15 +3155,15 @@ void add_cinteger(const char *name, int value) {
 	/* THIS FUNCTION ADDS A NEW JACL CONSTANT TO THE LIST */
 
 	if ((new_cinteger = (struct cinteger_type *)
-	                    malloc(sizeof(struct cinteger_type))) == NULL)
+	                    malloc(sizeof(struct cinteger_type))) == nullptr)
 		outofmem();
 	else {
-		if (cinteger_table == NULL) {
+		if (cinteger_table == nullptr) {
 			cinteger_table = new_cinteger;
 		} else {
 			/* FIND LAST CONSTANT IN LIST */
 			current_cinteger = cinteger_table;
-			while (current_cinteger->next_cinteger != NULL) {
+			while (current_cinteger->next_cinteger != nullptr) {
 				current_cinteger = current_cinteger->next_cinteger;
 			}
 			current_cinteger->next_cinteger = new_cinteger;
@@ -3171,7 +3171,7 @@ void add_cinteger(const char *name, int value) {
 		strncpy(new_cinteger->name, name, 40);
 		new_cinteger->name[40] = 0;
 		new_cinteger->value = value;
-		new_cinteger->next_cinteger = NULL;
+		new_cinteger->next_cinteger = nullptr;
 	}
 }
 
@@ -3179,10 +3179,10 @@ void clear_cinteger(const char *name) {
 	/* FREE CONSTANTS THAT HAVE SUPPLIED NAME*/
 
 	//printf("--- clear integer %s\n", name);
-	if (cinteger_table != NULL) {
+	if (cinteger_table != nullptr) {
 		current_cinteger = cinteger_table;
 		previous_cinteger = cinteger_table;
-		while (current_cinteger != NULL) {
+		while (current_cinteger != nullptr) {
 			//sprintf(temp_buffer, "--- checking integer %s^", current_cinteger->name);
 			//write_text(temp_buffer);
 			if (!strcmp(current_cinteger->name, name)) {
@@ -3213,15 +3213,15 @@ void add_cstring(const char *name, const char *value) {
 	/* ADD A STRING CONSTANT WITH THE SUPPLIED NAME AND VALUE */
 
 	if ((new_string = (struct string_type *)
-	                  malloc(sizeof(struct string_type))) == NULL)
+	                  malloc(sizeof(struct string_type))) == nullptr)
 		outofmem();
 	else {
-		if (cstring_table == NULL) {
+		if (cstring_table == nullptr) {
 			cstring_table = new_string;
 		} else {
 			/* FIND LAST STRING IN LIST */
 			current_cstring = cstring_table;
-			while (current_cstring->next_string != NULL) {
+			while (current_cstring->next_string != nullptr) {
 				current_cstring = current_cstring->next_string;
 			}
 			current_cstring->next_string = new_string;
@@ -3230,16 +3230,16 @@ void add_cstring(const char *name, const char *value) {
 		new_string->name[40] = 0;
 		strncpy(new_string->value, value, 255);
 		new_string->value[255] = 0;
-		new_string->next_string = NULL;
+		new_string->next_string = nullptr;
 	}
 }
 
 void clear_cstring(const char *name) {
 	/* FREE CONSTANTS THAT HAVE SUPPLIED NAME*/
-	if (cstring_table != NULL) {
+	if (cstring_table != nullptr) {
 		current_cstring = cstring_table;
 		previous_cstring = cstring_table;
-		while (current_cstring != NULL) {
+		while (current_cstring != nullptr) {
 			if (!strcmp(current_cstring->name, name)) {
 				/* FREE THIS STRING */
 				if (previous_cstring == current_cstring) {
@@ -3280,7 +3280,7 @@ void inspect(int object_num)  {
 		write_text("^has location attributes: ");
 		index = 0;
 		attribute_value = 1;
-		while (location_attributes[index] != NULL) {
+		while (location_attributes[index] != nullptr) {
 			if (object[object_num]->attributes & attribute_value) {
 				write_text(location_attributes[index]);
 			}
@@ -3292,7 +3292,7 @@ void inspect(int object_num)  {
 		write_text("^has object attributes: ");
 		index = 0;
 		attribute_value = 1;
-		while (object_attributes[index] != NULL) {
+		while (object_attributes[index] != nullptr) {
 			if (object[object_num]->attributes & attribute_value) {
 				write_text(object_attributes[index]);
 			}
@@ -3304,7 +3304,7 @@ void inspect(int object_num)  {
 		attribute_value = 1;
 	}
 
-	if (pointer != NULL) {
+	if (pointer != nullptr) {
 		// THERE ARE USER ATTRIBUTES, SO CHECK IF THIS OBJECT OR LOCATION
 		// HAS ANY OF THEM
 		do {
@@ -3314,14 +3314,14 @@ void inspect(int object_num)  {
 			}
 
 			pointer = pointer->next_attribute;
-		} while (pointer != NULL);
+		} while (pointer != nullptr);
 	}
 
 	write_text("^");
 
 	index = 0;
 	if (object[object_num]->attributes & LOCATION) {
-		while (location_elements[index] != NULL) {
+		while (location_elements[index] != nullptr) {
 			if (index < 12) {
 				if (object[object_num]->integer[index] < 1 || object[object_num]->integer[index] > objects) {
 					sprintf(temp_buffer, "%s: nowhere (%d)^", location_elements[index], object[object_num]->integer[index]);
@@ -3335,7 +3335,7 @@ void inspect(int object_num)  {
 			index++;
 		}
 	} else {
-		while (object_elements[index] != NULL) {
+		while (object_elements[index] != nullptr) {
 			if (index == 0) {
 				sprintf(temp_buffer, "%s: %s (%d)^", object_elements[index], object[object[object_num]->integer[index]]->label, object[object_num]->integer[index]);
 			} else {
diff --git a/engines/glk/jacl/jacl_main.cpp b/engines/glk/jacl/jacl_main.cpp
index a3b99ac460..ac0a6fcea6 100644
--- a/engines/glk/jacl/jacl_main.cpp
+++ b/engines/glk/jacl/jacl_main.cpp
@@ -34,8 +34,8 @@ int convert_to_utf32(unsigned char *text);
 
 uint                status_width, status_height;
 
-schanid_t           sound_channel[8] = { NULL, NULL, NULL, NULL,
-										 NULL, NULL, NULL, NULL
+schanid_t           sound_channel[8] = { nullptr, nullptr, nullptr, nullptr,
+										 nullptr, nullptr, nullptr, nullptr
 									   };
 
 event_t             *cancelled_event;
@@ -89,7 +89,7 @@ char            oops_buffer[1024];
 char            oopsed_current[1024];
 char            last_command[1024];
 const char      *blank_command = "blankjacl\0";
-const char      *current_command = (const char *)NULL;
+const char      *current_command = (const char *)nullptr;
 char            command_buffer[1024];
 #ifndef NOUNICODE
 glui32          command_buffer_uni[1024];
@@ -105,15 +105,15 @@ int             objects, integers, functions, strings;
 int             jpp_error = FALSE;
 
 /* A STREAM FOR THE GAME FILE, WHEN IT'S OPEN. */
-strid_t         game_stream = NULL;
+strid_t         game_stream = nullptr;
 
 /* THE STREAM FOR OPENING UP THE ARCHIVE CONTAINING GRAPHICS AND SOUND */
 strid_t             blorb_stream;
 
 /* A FILE REFERENCE FOR THE TRANSCRIPT FILE. */
-static frefid_t script_fref = NULL;
+static frefid_t script_fref = nullptr;
 /* A STREAM FOR THE TRANSCRIPT FILE, WHEN IT'S OPEN. */
-static strid_t script_stream = NULL;
+static strid_t script_stream = nullptr;
 
 int             noun[4];
 int             player = 0;
@@ -133,17 +133,17 @@ int             delay = 0;
 /* START OF GLK STUFF */
 
 /* POINTERS TO THE GLK WINDOWS */
-winid_t mainwin = NULL;
-winid_t statuswin = NULL;
-winid_t promptwin = NULL;
-winid_t inputwin = NULL;
-winid_t current_window = NULL;
+winid_t mainwin = nullptr;
+winid_t statuswin = nullptr;
+winid_t promptwin = nullptr;
+winid_t inputwin = nullptr;
+winid_t current_window = nullptr;
 
 /* POINTERS TO THE WINDOWS STREAMS */
-strid_t mainstr = NULL;
-strid_t statusstr = NULL;
-strid_t promptstr = NULL;
-strid_t inputstr = NULL;
+strid_t mainstr = nullptr;
+strid_t statusstr = nullptr;
+strid_t promptstr = nullptr;
+strid_t inputstr = nullptr;
 
 /* END OF GLK STUFF */
 
@@ -155,18 +155,18 @@ char            game_file[256] = "\0";
 char            processed_file[256] = "\0";
 
 struct object_type *object[MAX_OBJECTS];
-struct integer_type *integer_table = NULL;
-struct cinteger_type *cinteger_table = NULL;
-struct window_type *window_table = NULL;
-struct attribute_type *attribute_table = NULL;
-struct string_type *string_table = NULL;
-struct string_type *cstring_table = NULL;
-struct function_type *function_table = NULL;
-struct function_type *executing_function = NULL;
-struct command_type *completion_list = NULL;
-struct word_type *grammar_table = NULL;
-struct synonym_type *synonym_table = NULL;
-struct filter_type *filter_table = NULL;
+struct integer_type *integer_table = nullptr;
+struct cinteger_type *cinteger_table = nullptr;
+struct window_type *window_table = nullptr;
+struct attribute_type *attribute_table = nullptr;
+struct string_type *string_table = nullptr;
+struct string_type *cstring_table = nullptr;
+struct function_type *function_table = nullptr;
+struct function_type *executing_function = nullptr;
+struct command_type *completion_list = nullptr;
+struct word_type *grammar_table = nullptr;
+struct synonym_type *synonym_table = nullptr;
+struct filter_type *filter_table = nullptr;
 
 // Forward declarations
 static void word_check();
@@ -179,7 +179,7 @@ void glk_main() {
 	override_[0] = 0;
 
 	/* ALLOC AN EVENT TO STORE A CANCELLED EVENT IN */
-	if ((cancelled_event = (event_t *) malloc(sizeof(event_t))) == NULL)
+	if ((cancelled_event = (event_t *) malloc(sizeof(event_t))) == nullptr)
 		outofmem();
 
 	/* CREATE style_User1 FOR USE IN THE STATUS LINE */
@@ -187,7 +187,7 @@ void glk_main() {
 	g_vm->glk_stylehint_set(wintype_TextBuffer, style_User2, stylehint_ReverseColor, 1);
 
 	/* OPEN THE MAIN WINDOW THE GLK WINDOWS */
-	mainwin = g_vm->glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
+	mainwin = g_vm->glk_window_open(nullptr, 0, 0, wintype_TextBuffer, 1);
 
 	if (!mainwin) {
 		/* IT'S POSSIBLE THAT THE MAIN WINDOW FAILED TO OPEN. THERE's
@@ -232,7 +232,7 @@ void glk_main() {
 	                                  0, wintype_TextGrid, 0);
 
 	// GET A REFERENCE TO statuswin's STREAM
-	if (statuswin != NULL) {
+	if (statuswin != nullptr) {
 		statusstr = g_vm->glk_window_get_stream(statuswin);
 	}
 
@@ -256,7 +256,7 @@ void glk_main() {
 
 	execute("+intro");
 
-	if (object[2] == NULL) {
+	if (object[2] == nullptr) {
 		log_error(CANT_RUN, PLUS_STDERR);
 		terminate(43);
 		return;
@@ -283,7 +283,7 @@ void glk_main() {
 
 		status_line();
 
-		if (current_command != NULL) {
+		if (current_command != nullptr) {
 			strcpy(last_command, current_command);
 		}
 
@@ -420,7 +420,7 @@ void glk_main() {
 
 		interrupted = FALSE;
 
-		if (word[0] != NULL) {
+		if (word[0] != nullptr) {
 			if (strcmp(word[0], "undo")) {
 				/* COMMAND DOES NOT EQUAL undo */
 				save_game_state();
@@ -451,7 +451,7 @@ void preparse() {
 
 	// THE INTERRUPTED VARIABLE IS USED TO STOP LATER ACTIONS IN A COMMAND
 	// IF ANY ONE
-	while (word[wp] != NULL && INTERRUPTED->value == FALSE) {
+	while (word[wp] != nullptr && INTERRUPTED->value == FALSE) {
 		//printf("--- preparse %s\n", word[wp]);
 		// PROCESS THE CURRENT COMMAND
 		// CREATE THE command STRINGS FROM THIS POINT ONWARDS SO THE VERB OF
@@ -461,7 +461,7 @@ void preparse() {
 
 		position = wp;
 
-		while (word[position] != NULL && strcmp(word[position], cstring_resolve("THEN_WORD")->value)) {
+		while (word[position] != nullptr && strcmp(word[position], cstring_resolve("THEN_WORD")->value)) {
 			add_cstring("command", word[position]);
 			position++;
 		};
@@ -470,8 +470,8 @@ void preparse() {
 		word_check();
 
 		/* THE PREVIOUS COMMAND HAS FINISHED, LOOK FOR ANOTHER COMMAND */
-		while (word[wp] != NULL) {
-			if (word[wp] != NULL && !strcmp(word[wp], cstring_resolve("THEN_WORD")->value)) {
+		while (word[wp] != nullptr) {
+			if (word[wp] != nullptr && !strcmp(word[wp], cstring_resolve("THEN_WORD")->value)) {
 				wp++;
 				break;
 			}
@@ -521,7 +521,7 @@ void word_check() {
 		}
 	} else if (!strcmp(word[wp], cstring_resolve("OOPS_WORD")->value) || !strcmp(word[wp], "o")) {
 		//printf("--- oops word is %d\n", oops_word);
-		if (word[++wp] != NULL) {
+		if (word[++wp] != nullptr) {
 			if (oops_word == -1) {
 				if (TOTAL_MOVES->value == 0) {
 					write_text(cstring_resolve("NO_MOVES")->value);
@@ -542,7 +542,7 @@ void word_check() {
 				oopsed_current[0] = 0;
 				index = 0;
 
-				while (word[index] != NULL) {
+				while (word[index] != nullptr) {
 					if (oopsed_current[0] != 0) {
 						strcat(oopsed_current, " ");
 					}
@@ -587,9 +587,9 @@ void word_check() {
 		} else {
 			/* Close the file. */
 			g_vm->glk_put_string_stream(script_stream, "\nEND OF A TRANSCRIPT\n");
-			g_vm->glk_stream_close(script_stream, NULL);
+			g_vm->glk_stream_close(script_stream, nullptr);
 			write_text(cstring_resolve("SCRIPTING_OFF")->value);
-			script_stream = NULL;
+			script_stream = nullptr;
 		}
 	} else if (!strcmp(word[wp], cstring_resolve("WALKTHRU_WORD")->value)) {
 		walking_thru();
@@ -645,12 +645,12 @@ void save_game_state() {
 	do {
 		current_function->call_count_backup = current_function->call_count;
 		current_function = current_function->next_function;
-	} while (current_function != NULL);
+	} while (current_function != nullptr);
 
 	do {
 		current_integer->value_backup = current_integer->value;
 		current_integer = current_integer->next_integer;
-	} while (current_integer != NULL);
+	} while (current_integer != nullptr);
 
 	for (index = 1; index <= objects; index++) {
 		if (object[index]->nosave)
@@ -690,13 +690,13 @@ void restore_game_state() {
 	do {
 		current_function->call_count = current_function->call_count_backup;
 		current_function = current_function->next_function;
-	} while (current_function != NULL);
+	} while (current_function != nullptr);
 
 
 	do {
 		current_integer->value = current_integer->value_backup;
 		current_integer = current_integer->next_integer;
-	} while (current_integer != NULL);
+	} while (current_integer != nullptr);
 
 	for (index = 1; index <= objects; index++) {
 		if (object[index]->nosave)
@@ -1096,7 +1096,7 @@ strid_t open_glk_file(uint usage, uint mode, char *filename) {
 		}
 	}
 
-	return (strid_t) NULL;
+	return (strid_t) nullptr;
 }
 
 void scripting() {
@@ -1147,10 +1147,10 @@ void walking_thru() {
 	char script_line[81];
 
 	/* A FILE REFERENCE FOR THE WALKTHRU FILE. */
-	frefid_t walkthru_fref = NULL;
+	frefid_t walkthru_fref = nullptr;
 
 	/* A STREAM FOR THE WALKTHRU FILE, WHEN IT'S OPEN. */
-	strid_t walkthru_stream = NULL;
+	strid_t walkthru_stream = nullptr;
 
 	walkthru_fref = g_vm->glk_fileref_create_by_prompt(fileusage_Data | fileusage_TextMode, filemode_Read, 0);
 
@@ -1195,7 +1195,7 @@ void walking_thru() {
 		g_vm->glk_tick();
 		command_encapsulate();
 		jacl_truncate();
-		if (word[0] != NULL) {
+		if (word[0] != nullptr) {
 			custom_error = FALSE;
 
 			execute("+bottom");
@@ -1227,7 +1227,7 @@ void walking_thru() {
 	}
 
 	/* CLOSE THE STREAM */
-	g_vm->glk_stream_close(walkthru_stream, NULL);
+	g_vm->glk_stream_close(walkthru_stream, nullptr);
 
 	/* FINISH UP */
 	walkthru_running = FALSE;
@@ -1288,7 +1288,7 @@ const char *object_generator(const char *text, int state) {
 	static int len;
 	static struct command_type *now;
 	struct command_type *to_send;
-	struct name_type *current_name = (struct name_type *) NULL;
+	struct name_type *current_name = (struct name_type *) nullptr;
 
 	/* IF THIS IS A NEW WORD TO COMPLETE, INITIALIZE NOW. THIS INCLUDES
 	SAVING THE LENGTH OF TEXT FOR EFFICIENCY, AND INITIALIZING THE INDEX
@@ -1297,7 +1297,7 @@ const char *object_generator(const char *text, int state) {
 	if (!state) {
 		/* BUILD THE LIST */
 		int index;
-		completion_list = NULL;
+		completion_list = nullptr;
 
 		/* LOOP THROUGH ALL THE OBJECTS AND SEE IF THEY ARE IN
 		   THE CURRENT LOCATION */
@@ -1316,7 +1316,7 @@ const char *object_generator(const char *text, int state) {
 		len = strlen(text);
 	}
 
-	while (now != NULL) {
+	while (now != nullptr) {
 		if (!strncmp(text, now->word, len)) {
 			to_send = now;
 			now = now->next;
@@ -1325,7 +1325,7 @@ const char *object_generator(const char *text, int state) {
 		now = now->next;
 	}
 
-	return (const char *)NULL;
+	return (const char *)nullptr;
 }
 
 const char *verb_generator(const char *text, int state) {
@@ -1340,10 +1340,10 @@ const char *verb_generator(const char *text, int state) {
 
 	if (!state) {
 		/* BUILD THE LIST */
-		completion_list = NULL;
+		completion_list = nullptr;
 
 		pointer = grammar_table;
-		while (pointer != NULL) {
+		while (pointer != nullptr) {
 			add_word(pointer->word);
 			pointer = pointer->next_sibling;
 		}
@@ -1354,7 +1354,7 @@ const char *verb_generator(const char *text, int state) {
 		len = strlen(text);
 	}
 
-	while (now != NULL) {
+	while (now != nullptr) {
 		if (!strncmp(text, now->word, len)) {
 			to_send = now;
 			now = now->next;
@@ -1365,34 +1365,34 @@ const char *verb_generator(const char *text, int state) {
 		now = now->next;
 	}
 
-	return (const char *)NULL;
+	return (const char *)nullptr;
 }
 
 /* ADD A COPY OF STRING TO A LIST OF STRINGS IF IT IS NOT
    ALREADY IN THE LIST. THIS IS FOR THE USE OF READLINE */
 void add_word(const char *newWord) {
-	static struct command_type *current_word = NULL;
-	struct command_type *previous_word = NULL;
+	static struct command_type *current_word = nullptr;
+	struct command_type *previous_word = nullptr;
 
 	/* DON'T ADD WORDS SUCH AS *present TO THE LIST*/
 	if (*newWord == '*')
 		return;
 
-	if (current_word != NULL)
+	if (current_word != nullptr)
 		previous_word = current_word;
 
 	current_word = (struct command_type *) malloc(sizeof(struct command_type));
 
-	if (current_word != NULL) {
-		if (completion_list == NULL) {
+	if (current_word != nullptr) {
+		if (completion_list == nullptr) {
 			completion_list = current_word;
 		}
 
 		strncpy(current_word->word, newWord, 40);
 		current_word->word[40] = 0;
-		current_word->next = NULL;
+		current_word->next = nullptr;
 
-		if (previous_word != NULL) {
+		if (previous_word != nullptr) {
 			previous_word->next = current_word;
 		}
 	}
diff --git a/engines/glk/jacl/jpp.cpp b/engines/glk/jacl/jpp.cpp
index 3e7f44a4d7..5e1a2b6405 100644
--- a/engines/glk/jacl/jpp.cpp
+++ b/engines/glk/jacl/jpp.cpp
@@ -48,8 +48,8 @@ extern char         error_buffer[];
 
 int                 lines_written;
 
-Common::WriteStream *outputFile = NULL;
-Common::SeekableReadStream *inputFile = NULL;
+Common::WriteStream *outputFile = nullptr;
+Common::SeekableReadStream *inputFile = nullptr;
 
 char                *stripped_line;
 
@@ -142,8 +142,8 @@ int jpp() {
 int process_file(const char *sourceFile1, char *sourceFile2) {
 	char            temp_buffer1[1025];
 	char            temp_buffer2[1025];
-	Common::File *srcFile = NULL;
-	char           *includeFile = NULL;
+	Common::File *srcFile = nullptr;
+	char           *includeFile = nullptr;
 
 	/* THIS FUNCTION WILL CREATE A PROCESSED FILE THAT HAS HAD ALL
 	 * LEADING AND TRAILING WHITE SPACE REMOVED AND ALL INCLUDED
@@ -151,7 +151,7 @@ int process_file(const char *sourceFile1, char *sourceFile2) {
 	srcFile = File::openForReading(sourceFile1);
 
 	if (!srcFile) {
-		if (sourceFile2 != NULL) {
+		if (sourceFile2 != nullptr) {
 			srcFile = File::openForReading(sourceFile2);
 			if (!srcFile) {
 				sprintf(error_buffer, CANT_OPEN_OR, sourceFile1, sourceFile2);
@@ -177,12 +177,12 @@ int process_file(const char *sourceFile1, char *sourceFile2) {
 		        (!strncmp(text_buffer, "#debug", 6) & !release)) {
 			includeFile = strrchr(text_buffer, '"');
 
-			if (includeFile != NULL)
+			if (includeFile != nullptr)
 				*includeFile = 0;
 
 			includeFile = strchr(text_buffer, '"');
 
-			if (includeFile != NULL) {
+			if (includeFile != nullptr) {
 				strcpy(temp_buffer1, game_path);
 				strcat(temp_buffer1, includeFile + 1);
 				strcpy(temp_buffer2, include_directory);
diff --git a/engines/glk/jacl/libcsv.cpp b/engines/glk/jacl/libcsv.cpp
index 21dbc5380f..f4fc5e56ea 100644
--- a/engines/glk/jacl/libcsv.cpp
+++ b/engines/glk/jacl/libcsv.cpp
@@ -93,7 +93,7 @@ const char *csv_strerror(int status) {
 
 int csv_get_opts(struct csv_parser *p) {
 	/* Return the currently set options of parser */
-	if (p == NULL)
+	if (p == nullptr)
 		return -1;
 
 	return p->options;
@@ -101,7 +101,7 @@ int csv_get_opts(struct csv_parser *p) {
 
 int csv_set_opts(struct csv_parser *p, unsigned char options) {
 	/* Set the options */
-	if (p == NULL)
+	if (p == nullptr)
 		return -1;
 
 	p->options = options;
@@ -110,10 +110,10 @@ int csv_set_opts(struct csv_parser *p, unsigned char options) {
 
 int csv_init(struct csv_parser *p, unsigned char options) {
 	/* Initialize a csv_parser object returns 0 on success, -1 on error */
-	if (p == NULL)
+	if (p == nullptr)
 		return -1;
 
-	p->entry_buf = NULL;
+	p->entry_buf = nullptr;
 	p->pstate = ROW_NOT_BEGUN;
 	p->quoted = 0;
 	p->spaces = 0;
@@ -123,10 +123,10 @@ int csv_init(struct csv_parser *p, unsigned char options) {
 	p->options = options;
 	p->quote_char = CSV_QUOTE;
 	p->delim_char = CSV_COMMA;
-	p->is_space = NULL;
-	p->is_term = NULL;
+	p->is_space = nullptr;
+	p->is_term = nullptr;
 	p->blk_size = MEM_BLK_SIZE;
-	p->malloc_func = NULL;
+	p->malloc_func = nullptr;
 	p->realloc_func = realloc;
 	p->free_func = free;
 
@@ -135,13 +135,13 @@ int csv_init(struct csv_parser *p, unsigned char options) {
 
 void csv_free(struct csv_parser *p) {
 	/* Free the entry_buffer of csv_parser object */
-	if (p == NULL)
+	if (p == nullptr)
 		return;
 
 	if (p->entry_buf)
 		p->free_func(p->entry_buf);
 
-	p->entry_buf = NULL;
+	p->entry_buf = nullptr;
 	p->entry_size = 0;
 
 	return;
@@ -154,7 +154,7 @@ int csv_fini(struct csv_parser *p, void (*cb1)(void *, size_t, void *), void (*c
 	size_t spaces = p->spaces;
 	size_t entry_pos = p->entry_pos;
 
-	if (p == NULL)
+	if (p == nullptr)
 		return -1;
 
 
@@ -258,7 +258,7 @@ static int csv_increase_buffer(struct csv_parser *p) {
 		return -1;
 	}
 
-	while ((vp = p->realloc_func(p->entry_buf, p->entry_size + to_add)) == NULL) {
+	while ((vp = p->realloc_func(p->entry_buf, p->entry_size + to_add)) == nullptr) {
 		to_add /= 2;
 		if (!to_add) {
 			p->status = CSV_ENOMEM;
@@ -423,10 +423,10 @@ size_t csv_write(void *dest, size_t dest_size, const void *src, size_t src_size)
 	const unsigned char *csrc = (const unsigned char *)src;
 	size_t chars = 0;
 
-	if (src == NULL)
+	if (src == nullptr)
 		return 0;
 
-	if (cdest == NULL)
+	if (cdest == nullptr)
 		dest_size = 0;
 
 	if (dest_size > 0)
@@ -456,7 +456,7 @@ size_t csv_write(void *dest, size_t dest_size, const void *src, size_t src_size)
 int csv_fwrite(Common::WriteStream *fp, const void *src, size_t src_size) {
 	const unsigned char *csrc = (const unsigned char *)src;
 
-	if (fp == NULL || src == NULL)
+	if (fp == nullptr || src == nullptr)
 		return 0;
 
 	fp->writeByte('"');
@@ -479,10 +479,10 @@ size_t csv_write2(void *dest, size_t dest_size, const void *src, size_t src_size
 	const unsigned char *csrc = (const unsigned char *)src;
 	size_t chars = 0;
 
-	if (src == NULL)
+	if (src == nullptr)
 		return 0;
 
-	if (dest == NULL)
+	if (dest == nullptr)
 		dest_size = 0;
 
 	if (dest_size > 0)
@@ -512,7 +512,7 @@ size_t csv_write2(void *dest, size_t dest_size, const void *src, size_t src_size
 int csv_fwrite2(Common::WriteStream *fp, const void *src, size_t src_size, unsigned char quote) {
 	const unsigned char *csrc = (const unsigned char *)src;
 
-	if (fp == NULL || src == NULL)
+	if (fp == nullptr || src == nullptr)
 		return 0;
 
 	fp->writeByte(quote);
diff --git a/engines/glk/jacl/loader.cpp b/engines/glk/jacl/loader.cpp
index 6af3b76c79..e30294a00e 100644
--- a/engines/glk/jacl/loader.cpp
+++ b/engines/glk/jacl/loader.cpp
@@ -59,9 +59,9 @@ extern struct synonym_type      *synonym_table;
 extern struct filter_type       *filter_table;
 
 
-struct string_type *current_string = NULL;
-struct integer_type *current_integer = NULL;
-struct integer_type *last_system_integer = NULL;
+struct string_type *current_string = nullptr;
+struct integer_type *current_integer = nullptr;
+struct integer_type *last_system_integer = nullptr;
 
 extern struct string_type *current_cstring;
 extern struct cinteger_type *current_cinteger;
@@ -97,15 +97,15 @@ void read_gamefile() {
 	long            start_of_file = 0;
 	long            bit_mask;
 
-	filter_type *current_filter = NULL;
-	filter_type *new_filter = NULL;
-	attribute_type *current_attribute = NULL;
-	attribute_type *new_attribute = NULL;
-	cinteger_type *resolved_cinteger = NULL;
-	synonym_type *current_synonym = NULL;
-	synonym_type *new_synonym = NULL;
-	function_type *current_function = NULL;
-	name_type *current_name = NULL;
+	filter_type *current_filter = nullptr;
+	filter_type *new_filter = nullptr;
+	attribute_type *current_attribute = nullptr;
+	attribute_type *new_attribute = nullptr;
+	cinteger_type *resolved_cinteger = nullptr;
+	synonym_type *current_synonym = nullptr;
+	synonym_type *new_synonym = nullptr;
+	function_type *current_function = nullptr;
+	name_type *current_name = nullptr;
 
 	char            function_name[81];
 
@@ -235,7 +235,7 @@ void read_gamefile() {
 	/* CREATE A DUMMY FUNCTION TO BE USED WHEN AN ERROR MESSAGE
 	   IS PRINTED AS A RESULT OF CODE CALLED BY THE INTERPRETER */
 	if ((function_table = (struct function_type *)
-	                      malloc(sizeof(struct function_type))) == NULL)
+	                      malloc(sizeof(struct function_type))) == nullptr)
 		outofmem();
 	else {
 		current_function = function_table;
@@ -244,7 +244,7 @@ void read_gamefile() {
 		current_function->self = 0;
 		current_function->call_count = 0;
 		current_function->call_count_backup = 0;
-		current_function->next_function = NULL;
+		current_function->next_function = nullptr;
 	}
 
 	executing_function = function_table;
@@ -271,7 +271,7 @@ void read_gamefile() {
 
 	while (result) {
 		encapsulate();
-		if (word[0] == NULL);
+		if (word[0] == nullptr);
 		else if (text_buffer[0] == '{') {
 			while (result) {
 				result = glk_get_bin_line_stream(game_stream, text_buffer, (glui32) 1024);
@@ -288,19 +288,19 @@ void read_gamefile() {
 			}
 		} else {
 			if (!strcmp(word[0], "grammar")) {
-				if (word[++wp] == NULL) {
+				if (word[++wp] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else {
-					if (grammar_table == NULL) {
+					if (grammar_table == nullptr) {
 						if ((grammar_table = (struct word_type *)
-						                     malloc(sizeof(struct word_type))) == NULL)
+						                     malloc(sizeof(struct word_type))) == nullptr)
 							outofmem();
 						else {
 							strncpy(grammar_table->word, word[wp], 40);
 							grammar_table->word[40] = 0;
-							grammar_table->next_sibling = NULL;
-							grammar_table->first_child = NULL;
+							grammar_table->next_sibling = nullptr;
+							grammar_table->first_child = nullptr;
 							build_grammar_table(grammar_table);
 						}
 					} else
@@ -308,7 +308,7 @@ void read_gamefile() {
 				}
 			} else if (!strcmp(word[0], "object")
 			           || !strcmp(word[0], "location")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else if (legal_label_check(word[1], line, OBJ_TYPE)) {
@@ -322,13 +322,13 @@ void read_gamefile() {
 						return;
 					} else {
 						if ((object[objects] = (struct object_type *)
-						                       malloc(sizeof(struct object_type))) == NULL)
+						                       malloc(sizeof(struct object_type))) == nullptr)
 							outofmem();
 
 						strncpy(object[objects]->label, word[1], 40);
 
 						object[objects]->label[40] = 0;
-						object[objects]->first_plural = NULL;
+						object[objects]->first_plural = nullptr;
 
 						strcpy(object[objects]->described, object[objects]->label);
 						strcpy(object[objects]->inventory, object[objects]->label);
@@ -343,15 +343,15 @@ void read_gamefile() {
 					object[objects]->nosave = FALSE;
 				}
 			} else if (!strcmp(word[0], "synonym")) {
-				if (word[++wp] == NULL) {
+				if (word[++wp] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else {
 					if ((new_synonym = (struct synonym_type *)
-					                   malloc(sizeof(struct synonym_type))) == NULL)
+					                   malloc(sizeof(struct synonym_type))) == nullptr)
 						outofmem();
 					else {
-						if (synonym_table == NULL) {
+						if (synonym_table == nullptr) {
 							synonym_table = new_synonym;
 						} else {
 							current_synonym->next_synonym = new_synonym;
@@ -360,14 +360,14 @@ void read_gamefile() {
 					current_synonym = new_synonym;
 					strncpy(current_synonym->original, word[wp], 40);
 					current_synonym->original[40] = 0;
-					if (word[++wp] == NULL) {
+					if (word[++wp] == nullptr) {
 						noproperr(line);
 						errors++;
 					} else {
 						strncpy(current_synonym->standard, word[wp], 40);
 						current_synonym->standard[40] = 0;
 					}
-					current_synonym->next_synonym = NULL;
+					current_synonym->next_synonym = nullptr;
 				}
 			} else if (!strcmp(word[0], "parameter")) {
 #ifdef UNUSED
@@ -413,7 +413,7 @@ void read_gamefile() {
 				warning("parameter");
 #endif
 			} else if (!strcmp(word[0], "constant")) {
-				if (word[2] == NULL) {
+				if (word[2] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else {
@@ -421,7 +421,7 @@ void read_gamefile() {
 					   ADDITIONAL CONSTANTS IF REQUIRED */
 					index = 2;
 
-					while (word[index] != NULL && index < MAX_WORDS) {
+					while (word[index] != nullptr && index < MAX_WORDS) {
 						if (quoted[index] == TRUE || !validate(word[index])) {
 							if (legal_label_check(word[1], line, CSTR_TYPE)) {
 								errors++;
@@ -443,20 +443,20 @@ void read_gamefile() {
 					}
 				}
 			} else if (!strcmp(word[0], "attribute")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else if (legal_label_check(word[1], line, ATT_TYPE)) {
 					errors++;
-				} else if (current_attribute != NULL && current_attribute->value == 1073741824) {
+				} else if (current_attribute != nullptr && current_attribute->value == 1073741824) {
 					maxatterr(line, 1);
 					errors++;
 				} else {
 					if ((new_attribute = (struct attribute_type *)
-					                     malloc(sizeof(struct attribute_type))) == NULL)
+					                     malloc(sizeof(struct attribute_type))) == nullptr)
 						outofmem();
 					else {
-						if (attribute_table == NULL) {
+						if (attribute_table == nullptr) {
 							attribute_table = new_attribute;
 							new_attribute->value = 1;
 						} else {
@@ -466,21 +466,21 @@ void read_gamefile() {
 						current_attribute = new_attribute;
 						strncpy(current_attribute->name, word[1], 40);
 						current_attribute->name[40] = 0;
-						current_attribute->next_attribute = NULL;
+						current_attribute->next_attribute = nullptr;
 					}
 
 					/* CHECK IF MORE THAN ONE VALUE IS SUPPLIED AND CREATE
 					   ADDITIONAL CONSTANTS IF REQUIRED */
 					index = 2;
-					while (word[index] != NULL && index < MAX_WORDS) {
+					while (word[index] != nullptr && index < MAX_WORDS) {
 						if (legal_label_check(word[index], line, ATT_TYPE)) {
 							errors++;
-						} else if (current_attribute != NULL && current_attribute->value == 1073741824) {
+						} else if (current_attribute != nullptr && current_attribute->value == 1073741824) {
 							maxatterr(line, index);
 							errors++;
 						} else {
 							if ((new_attribute = (struct attribute_type *)
-							                     malloc(sizeof(struct attribute_type))) == NULL)
+							                     malloc(sizeof(struct attribute_type))) == nullptr)
 								outofmem();
 							else {
 								current_attribute->next_attribute = new_attribute;
@@ -488,40 +488,40 @@ void read_gamefile() {
 								current_attribute = new_attribute;
 								strncpy(current_attribute->name, word[index], 40);
 								current_attribute->name[40] = 0;
-								current_attribute->next_attribute = NULL;
+								current_attribute->next_attribute = nullptr;
 							}
 						}
 						index++;
 					}
 				}
 			} else if (!strcmp(word[0], "string")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else if (legal_label_check(word[1], line, STR_TYPE)) {
 					errors++;
 				} else {
-					if (word[2] == NULL) {
+					if (word[2] == nullptr) {
 						create_string(word[1], "");
 					} else {
 						create_string(word[1], word[2]);
 						index = 3;
-						while (word[index] != NULL && index < MAX_WORDS) {
+						while (word[index] != nullptr && index < MAX_WORDS) {
 							create_string(word[1], word[index]);
 							index++;
 						}
 					}
 				}
 			} else if (!strcmp(word[0], "filter")) {
-				if (word[++wp] == NULL) {
+				if (word[++wp] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else {
 					if ((new_filter = (struct filter_type *)
-					                  malloc(sizeof(struct filter_type))) == NULL)
+					                  malloc(sizeof(struct filter_type))) == nullptr)
 						outofmem();
 					else {
-						if (filter_table == NULL) {
+						if (filter_table == nullptr) {
 							filter_table = new_filter;
 						} else {
 							current_filter->next_filter = new_filter;
@@ -529,11 +529,11 @@ void read_gamefile() {
 						current_filter = new_filter;
 						strncpy(current_filter->word, word[wp], 40);
 						current_filter->word[40] = 0;
-						current_filter->next_filter = NULL;
+						current_filter->next_filter = nullptr;
 					}
 				}
 			} else if (!strcmp(word[0], "string_array")) {
-				if (word[2] == NULL) {
+				if (word[2] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else if (legal_label_check(word[1], line, STR_TYPE)) {
@@ -552,7 +552,7 @@ void read_gamefile() {
 					}
 				}
 			} else if (!strcmp(word[0], "integer_array")) {
-				if (word[2] == NULL) {
+				if (word[2] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else if (legal_label_check(word[1], line, INT_TYPE)) {
@@ -560,7 +560,7 @@ void read_gamefile() {
 				} else {
 					int default_value, x;
 
-					if (word[3] != NULL) {
+					if (word[3] != nullptr) {
 						default_value = value_of(word[3], FALSE);
 						if (!value_resolved) {
 							unkvalerr(line, 3);
@@ -582,7 +582,7 @@ void read_gamefile() {
 					}
 				}
 			} else if (!strcmp(word[0], "integer")) {
-				if (word[1] == NULL) {
+				if (word[1] == nullptr) {
 					noproperr(line);
 					errors++;
 				} else if (legal_label_check(word[1], line, INT_TYPE)) {
@@ -593,7 +593,7 @@ void read_gamefile() {
 					/* CHECK IF MORE THAN ONE VALUE IS SUPPLIED AND CREATE
 					   ADDITIONAL VARIABLES IF REQUIRED */
 					index = 3;
-					while (word[index] != NULL && index < MAX_WORDS) {
+					while (word[index] != nullptr && index < MAX_WORDS) {
 						create_integer(word[1], 0);
 						index++;
 					}
@@ -623,17 +623,17 @@ void read_gamefile() {
 	 *************************************************************************/
 
 	/* IF NO SIZE IS SPECIFIED FOR THE STATUS WINDOW, SET IT TO 1 */
-	if (integer_resolve("status_window") == NULL) {
+	if (integer_resolve("status_window") == nullptr) {
 		create_integer("status_window", 1);
 	}
 
 	/* IF NO STRING IS SPECIFIED FOR THE COMMAND PROMPT, SET IT TO "^> " */
-	if (string_resolve("command_prompt") == NULL) {
+	if (string_resolve("command_prompt") == nullptr) {
 		create_string("command_prompt", "^> ");
 	}
 
 	/* IF NO STRING IS SPECIFIED FOR THE GAME_TITLE, SET IT TO THE FILENAME */
-	if (cstring_resolve("game_title") == NULL) {
+	if (cstring_resolve("game_title") == nullptr) {
 		create_cstring("game_title", prefix);
 	}
 
@@ -661,7 +661,7 @@ void read_gamefile() {
 
 	while (result) {
 		encapsulate();
-		if (word[0] == NULL);
+		if (word[0] == nullptr);
 		else if (text_buffer[0] == '{') {
 			word[wp]++;         /* MOVE THE START OF THE FIRST WORD ONLY
 								 * TO PAST THE '{'. */
@@ -669,13 +669,13 @@ void read_gamefile() {
 				nofnamerr(line);
 				errors++;
 			} else {
-				while (word[wp] != NULL && wp < MAX_WORDS) {
+				while (word[wp] != nullptr && wp < MAX_WORDS) {
 					if (word[wp][0] == '+') {
 						strncpy(function_name, word[wp], 80);
 						function_name[80] = 0;
 						self_parent = 0;
 					} else if (word[wp][0] == '*') {
-						const char *last_underscore = (char *)NULL;
+						const char *last_underscore = (char *)nullptr;
 
 						/* ALLOW MANUAL NAMING OF ASSOCIATED FUNCTIONS */
 						/* TO GIVE CLASS-LIKE BEHAVIOR */
@@ -685,7 +685,7 @@ void read_gamefile() {
 						/* LOOK FOR THE FINAL UNDERSCORE AND SEE IF */
 						/* IT IS FOLLOWED BY AN OBJECT LABEL */
 						last_underscore = strrchr(word[wp], '_');
-						if (last_underscore != NULL) {
+						if (last_underscore != nullptr) {
 							self_parent = object_resolve(last_underscore + 1);
 						} else {
 							self_parent = 0;
@@ -699,9 +699,9 @@ void read_gamefile() {
 						strcat(function_name, object[object_count]->label);
 						self_parent = object_count;
 					}
-					if (function_table == NULL) {
+					if (function_table == nullptr) {
 						if ((function_table = (struct function_type *)
-						                      malloc(sizeof(struct function_type))) == NULL)
+						                      malloc(sizeof(struct function_type))) == nullptr)
 							outofmem();
 						else {
 							// STORE THE NUMBER OF FUNCTION DEFINED TO
@@ -715,12 +715,12 @@ void read_gamefile() {
 							current_function->call_count = 0;
 							current_function->call_count_backup = 0;
 							current_function->self = self_parent;
-							current_function->next_function = NULL;
+							current_function->next_function = nullptr;
 						}
 					} else {
 						if ((current_function->next_function =
 						            (struct function_type *)
-						            malloc(sizeof(struct function_type))) == NULL)
+						            malloc(sizeof(struct function_type))) == nullptr)
 							outofmem();
 						else {
 							// STORE THE NUMBER OF FUNCTION DEFINED TO
@@ -734,7 +734,7 @@ void read_gamefile() {
 							current_function->call_count = 0;
 							current_function->call_count_backup = 0;
 							current_function->self = self_parent;
-							current_function->next_function = NULL;
+							current_function->next_function = nullptr;
 						}
 					}
 					wp++;
@@ -757,7 +757,7 @@ void read_gamefile() {
 		}
 		else if (!strcmp(word[0], "string_array")) {
 		} else if (!strcmp(word[0], "integer_array")) {
-			if (word[2] == NULL) {
+			if (word[2] == nullptr) {
 				noproperr(line);
 				errors++;
 			} else {
@@ -775,7 +775,7 @@ void read_gamefile() {
 				}
 			}
 		} else if (!strcmp(word[0], "integer")) {
-			if (word[2] != NULL) {
+			if (word[2] != nullptr) {
 				current_integer = current_integer->next_integer;
 				current_integer->value = value_of(word[2], FALSE);
 				if (!value_resolved) {
@@ -783,7 +783,7 @@ void read_gamefile() {
 					errors++;
 				}
 				index = 3;
-				while (word[index] != NULL && index < MAX_WORDS) {
+				while (word[index] != nullptr && index < MAX_WORDS) {
 					current_integer = current_integer->next_integer;
 					current_integer->value = value_of(word[index], FALSE);
 					if (!value_resolved) {
@@ -807,14 +807,14 @@ void read_gamefile() {
 		else if (!strcmp(word[0], "grammar"));
 		else if (!strcmp(word[0], "filter"));
 		else if (!strcmp(word[0], "has")) {
-			if (word[1] == NULL) {
+			if (word[1] == nullptr) {
 				noproperr(line);
 				errors++;
 			} else if (object_count == 0) {
 				noobjerr(line);
 				errors++;
 			} else {
-				for (index = 1; word[index] != NULL && index < MAX_WORDS; index++) {
+				for (index = 1; word[index] != nullptr && index < MAX_WORDS; index++) {
 					if ((bit_mask = attribute_resolve(word[index]))) {
 						object[object_count]->attributes = object[object_count]->attributes | bit_mask;
 					} else if ((bit_mask = user_attribute_resolve(word[index]))) {
@@ -845,60 +845,60 @@ void read_gamefile() {
 
 			if ((object[object_count]->first_name =
 			            (struct name_type *) malloc(sizeof(struct name_type)))
-			        == NULL)
+			        == nullptr)
 				outofmem();
 			else {
 				current_name = object[object_count]->first_name;
-				if (word[2] != NULL) {
+				if (word[2] != nullptr) {
 					strncpy(current_name->name, word[2], 40);
 				} else {
 					strncpy(current_name->name, object[object_count]->label, 40);
 				}
 				current_name->name[40] = 0;
-				current_name->next_name = NULL;
+				current_name->next_name = nullptr;
 			}
 
 			wp = 3;
 
-			while (word[wp] != NULL && wp < MAX_WORDS) {
+			while (word[wp] != nullptr && wp < MAX_WORDS) {
 				if ((current_name->next_name = (struct name_type *)
-				                               malloc(sizeof(struct name_type))) == NULL)
+				                               malloc(sizeof(struct name_type))) == nullptr)
 					outofmem();
 				else {
 					current_name = current_name->next_name;
 					strncpy(current_name->name, word[wp], 40);
 					current_name->name[40] = 0;
-					current_name->next_name = NULL;
+					current_name->next_name = nullptr;
 				}
 				wp++;
 			}
 		} else if (!strcmp(word[0], "plural")) {
-			if (word[1] == NULL) {
+			if (word[1] == nullptr) {
 				noproperr(line);
 				errors++;
 			} else {
 				if ((object[object_count]->first_plural =
 				            (struct name_type *) malloc(sizeof(struct name_type)))
-				        == NULL)
+				        == nullptr)
 					outofmem();
 				else {
 					current_name = object[object_count]->first_plural;
 					strncpy(current_name->name, word[1], 40);
 					current_name->name[40] = 0;
-					current_name->next_name = NULL;
+					current_name->next_name = nullptr;
 				}
 
 				wp = 2;
 
-				while (word[wp] != NULL && wp < MAX_WORDS) {
+				while (word[wp] != nullptr && wp < MAX_WORDS) {
 					if ((current_name->next_name = (struct name_type *)
-					                               malloc(sizeof(struct name_type))) == NULL)
+					                               malloc(sizeof(struct name_type))) == nullptr)
 						outofmem();
 					else {
 						current_name = current_name->next_name;
 						strncpy(current_name->name, word[wp], 40);
 						current_name->name[40] = 0;
-						current_name->next_name = NULL;
+						current_name->next_name = nullptr;
 					}
 					wp++;
 				}
@@ -916,7 +916,7 @@ void read_gamefile() {
 			} else
 				player = object_count;
 		} else if (!strcmp(word[0], "short")) {
-			if (word[2] == NULL) {
+			if (word[2] == nullptr) {
 				noproperr(line);
 				errors++;
 			} else if (object_count == 0) {
@@ -929,7 +929,7 @@ void read_gamefile() {
 				object[object_count]->inventory[40] = 0;
 			}
 		} else if (!strcmp(word[0], "definite")) {
-			if (word[1] == NULL) {
+			if (word[1] == nullptr) {
 				noproperr(line);
 				errors++;
 			} else if (object_count == 0) {
@@ -940,7 +940,7 @@ void read_gamefile() {
 				object[object_count]->definite[10] = 0;
 			}
 		} else if (!strcmp(word[0], "long")) {
-			if (word[1] == NULL) {
+			if (word[1] == nullptr) {
 				noproperr(line);
 				errors++;
 			} else if (object_count == 0) {
@@ -950,9 +950,9 @@ void read_gamefile() {
 				strncpy(object[object_count]->described, word[1], 80);
 				object[object_count]->described[80] = 0;
 			}
-		} else if ((resolved_cinteger = cinteger_resolve(word[0])) != NULL) {
+		} else if ((resolved_cinteger = cinteger_resolve(word[0])) != nullptr) {
 			index = resolved_cinteger->value;
-			if (word[1] == NULL) {
+			if (word[1] == nullptr) {
 				noproperr(line);
 				errors++;
 			} else if (object_count == 0) {
@@ -1004,39 +1004,39 @@ void read_gamefile() {
 void build_grammar_table(struct word_type *pointer) {
 	do {
 		if (!strcmp(word[wp], pointer->word)) {
-			if (pointer->first_child == NULL && word[wp + 1] != NULL) {
+			if (pointer->first_child == nullptr && word[wp + 1] != nullptr) {
 				if ((pointer->first_child = (struct word_type *)
 				                            malloc(sizeof(struct word_type)))
-				        == NULL)
+				        == nullptr)
 					outofmem();
 				else {
 					pointer = pointer->first_child;
 					strncpy(pointer->word, word[++wp], 40);
 					pointer->word[40] = 0;
-					pointer->next_sibling = NULL;
-					pointer->first_child = NULL;
+					pointer->next_sibling = nullptr;
+					pointer->first_child = nullptr;
 				}
 			} else {
 				pointer = pointer->first_child;
 				wp++;
 			}
 		} else {
-			if (pointer->next_sibling == NULL) {
+			if (pointer->next_sibling == nullptr) {
 				if ((pointer->next_sibling = (struct word_type *)
 				                             malloc(sizeof(struct word_type)))
-				        == NULL)
+				        == nullptr)
 					outofmem();
 				else {
 					pointer = pointer->next_sibling;
 					strncpy(pointer->word, word[wp], 40);
 					pointer->word[40] = 0;
-					pointer->next_sibling = NULL;
-					pointer->first_child = NULL;
+					pointer->next_sibling = nullptr;
+					pointer->first_child = nullptr;
 				}
 			} else
 				pointer = pointer->next_sibling;
 		}
-	} while (word[wp] != NULL && wp < MAX_WORDS);
+	} while (word[wp] != nullptr && wp < MAX_WORDS);
 }
 
 int legal_label_check(const char *label_word, int line, int type) {
@@ -1078,7 +1078,7 @@ int legal_label_check(const char *label_word, int line, int type) {
 		}
 	}
 
-	while (integer_pointer != NULL && type != INT_TYPE) {
+	while (integer_pointer != nullptr && type != INT_TYPE) {
 		if (!strcmp(label_word, integer_pointer->name)) {
 			sprintf(error_buffer, USED_LABEL_INT, line, label_word);
 			log_error(error_buffer, PLUS_STDERR);
@@ -1089,7 +1089,7 @@ int legal_label_check(const char *label_word, int line, int type) {
 	}
 
 
-	while (cinteger_pointer != NULL && type != CINT_TYPE) {
+	while (cinteger_pointer != nullptr && type != CINT_TYPE) {
 		if (!strcmp(label_word, cinteger_pointer->name)) {
 			sprintf(error_buffer, USED_LABEL_CINT, line, label_word);
 			log_error(error_buffer, PLUS_STDERR);
@@ -1099,7 +1099,7 @@ int legal_label_check(const char *label_word, int line, int type) {
 			cinteger_pointer = cinteger_pointer->next_cinteger;
 	}
 
-	while (string_pointer != NULL && type != STR_TYPE) {
+	while (string_pointer != nullptr && type != STR_TYPE) {
 		if (!strcmp(label_word, string_pointer->name)) {
 			sprintf(error_buffer, USED_LABEL_STR, line, label_word);
 			log_error(error_buffer, PLUS_STDERR);
@@ -1109,7 +1109,7 @@ int legal_label_check(const char *label_word, int line, int type) {
 			string_pointer = string_pointer->next_string;
 	}
 
-	while (cstring_pointer != NULL && type != CSTR_TYPE) {
+	while (cstring_pointer != nullptr && type != CSTR_TYPE) {
 		if (!strcmp(label_word, cstring_pointer->name)) {
 			sprintf(error_buffer, USED_LABEL_CSTR, line, label_word);
 			log_error(error_buffer, PLUS_STDERR);
@@ -1120,7 +1120,7 @@ int legal_label_check(const char *label_word, int line, int type) {
 	}
 
 	/* DON'T CHECK FOR ATT_TYPE AS YOU CAN'T HAVE ATTRIBUTE ARRAYS. */
-	while (attribute_pointer != NULL) {
+	while (attribute_pointer != nullptr) {
 		if (!strcmp(label_word, attribute_pointer->name)) {
 			sprintf(error_buffer, USED_LABEL_ATT, line, label_word);
 			write_text(error_buffer);
@@ -1178,7 +1178,7 @@ void restart_game() {
 	/* FREE ALL OBJECTS */
 	for (index = 1; index <= objects; index++) {
 		current_name = object[index]->first_name;
-		while (current_name->next_name != NULL) {
+		while (current_name->next_name != nullptr) {
 			next_name = current_name->next_name;
 			free(current_name);
 			current_name = next_name;
@@ -1189,157 +1189,157 @@ void restart_game() {
 
 	/* FREE ALL VARIABLES */
 
-	if (integer_table != NULL) {
-		if (integer_table->next_integer != NULL) {
+	if (integer_table != nullptr) {
+		if (integer_table->next_integer != nullptr) {
 			do {
 				curr_integer = integer_table;
 				previous_integer = integer_table;
-				while (curr_integer->next_integer != NULL) {
+				while (curr_integer->next_integer != nullptr) {
 					previous_integer = curr_integer;
 					curr_integer = curr_integer->next_integer;
 				}
 				free(curr_integer);
-				previous_integer->next_integer = NULL;
+				previous_integer->next_integer = nullptr;
 			} while (previous_integer != integer_table);
 		}
 
 		free(integer_table);
-		integer_table = NULL;
+		integer_table = nullptr;
 	}
 
 	/* FREE ALL FUNCTIONS */
-	if (function_table != NULL) {
-		if (function_table->next_function != NULL) {
+	if (function_table != nullptr) {
+		if (function_table->next_function != nullptr) {
 			do {
 				current_function = function_table;
 				previous_function = function_table;
-				while (current_function->next_function != NULL) {
+				while (current_function->next_function != nullptr) {
 					previous_function = current_function;
 					current_function = current_function->next_function;
 				}
 				free(current_function);
-				previous_function->next_function = NULL;
+				previous_function->next_function = nullptr;
 			} while (previous_function != function_table);
 		}
 
 		free(function_table);
-		function_table = NULL;
+		function_table = nullptr;
 	}
 
 	/* FREE ALL FILTERS */
-	if (filter_table != NULL) {
-		if (filter_table->next_filter != NULL) {
+	if (filter_table != nullptr) {
+		if (filter_table->next_filter != nullptr) {
 			do {
 				current_filter = filter_table;
 				previous_filter = filter_table;
-				while (current_filter->next_filter != NULL) {
+				while (current_filter->next_filter != nullptr) {
 					previous_filter = current_filter;
 					current_filter = current_filter->next_filter;
 				}
 				free(current_filter);
-				previous_filter->next_filter = NULL;
+				previous_filter->next_filter = nullptr;
 			} while (previous_filter != filter_table);
 		}
 
 		free(filter_table);
-		filter_table = NULL;
+		filter_table = nullptr;
 	}
 
 	/* FREE ALL STRINGS */
-	if (string_table != NULL) {
-		if (string_table->next_string != NULL) {
+	if (string_table != nullptr) {
+		if (string_table->next_string != nullptr) {
 			do {
 				curr_string = string_table;
 				previous_string = string_table;
-				while (curr_string->next_string != NULL) {
+				while (curr_string->next_string != nullptr) {
 					previous_string = curr_string;
 					curr_string = curr_string->next_string;
 				}
 				free(curr_string);
-				previous_string->next_string = NULL;
+				previous_string->next_string = nullptr;
 			} while (previous_string != string_table);
 		}
 
 		free(string_table);
-		string_table = NULL;
+		string_table = nullptr;
 	}
 
 	/* FREE ALL ATTRIBUTES */
-	if (attribute_table != NULL) {
-		if (attribute_table->next_attribute != NULL) {
+	if (attribute_table != nullptr) {
+		if (attribute_table->next_attribute != nullptr) {
 			do {
 				current_attribute = attribute_table;
 				previous_attribute = attribute_table;
-				while (current_attribute->next_attribute != NULL) {
+				while (current_attribute->next_attribute != nullptr) {
 					previous_attribute = current_attribute;
 					current_attribute = current_attribute->next_attribute;
 				}
 				free(current_attribute);
-				previous_attribute->next_attribute = NULL;
+				previous_attribute->next_attribute = nullptr;
 			} while (previous_attribute != attribute_table);
 		}
 
 		free(attribute_table);
-		attribute_table = NULL;
+		attribute_table = nullptr;
 	}
 
 	/* FREE ALL CONSTANTS */
-	if (cinteger_table != NULL) {
-		if (cinteger_table->next_cinteger != NULL) {
+	if (cinteger_table != nullptr) {
+		if (cinteger_table->next_cinteger != nullptr) {
 			do {
 				current_cinteger = cinteger_table;
 				previous_cinteger = cinteger_table;
-				while (current_cinteger->next_cinteger != NULL) {
+				while (current_cinteger->next_cinteger != nullptr) {
 					previous_cinteger = current_cinteger;
 					current_cinteger = current_cinteger->next_cinteger;
 				}
 				free(current_cinteger);
-				previous_cinteger->next_cinteger = NULL;
+				previous_cinteger->next_cinteger = nullptr;
 			} while (previous_cinteger != cinteger_table);
 		}
 
 		free(cinteger_table);
-		cinteger_table = NULL;
+		cinteger_table = nullptr;
 	}
 
-	if (cstring_table != NULL) {
-		if (cstring_table->next_string != NULL) {
+	if (cstring_table != nullptr) {
+		if (cstring_table->next_string != nullptr) {
 			do {
 				curr_string = cstring_table;
 				previous_string = cstring_table;
-				while (curr_string->next_string != NULL) {
+				while (curr_string->next_string != nullptr) {
 					previous_string = curr_string;
 					curr_string = curr_string->next_string;
 				}
 				free(curr_string);
-				previous_string->next_string = NULL;
+				previous_string->next_string = nullptr;
 			} while (previous_string != cstring_table);
 		}
 
 		free(cstring_table);
-		cstring_table = NULL;
+		cstring_table = nullptr;
 	}
 
 	/* FREE ALL SYNONYMS */
-	if (synonym_table != NULL) {
-		if (synonym_table->next_synonym != NULL) {
+	if (synonym_table != nullptr) {
+		if (synonym_table->next_synonym != nullptr) {
 			do {
 				current_synonym = synonym_table;
 				previous_synonym = synonym_table;
-				while (current_synonym->next_synonym != NULL) {
+				while (current_synonym->next_synonym != nullptr) {
 					previous_synonym = current_synonym;
 					current_synonym = current_synonym->next_synonym;
 				}
 				free(current_synonym);
-				previous_synonym->next_synonym = NULL;
+				previous_synonym->next_synonym = nullptr;
 			} while (previous_synonym != synonym_table);
 		}
 		free(synonym_table);
-		synonym_table = NULL;
+		synonym_table = nullptr;
 	}
 
 	free_from(grammar_table);
-	grammar_table = NULL;
+	grammar_table = nullptr;
 
 	read_gamefile();
 }
@@ -1361,13 +1361,13 @@ void set_defaults() {
 }
 
 void create_cinteger(const char *name, int value) {
-	struct cinteger_type *new_cinteger = NULL;
+	struct cinteger_type *new_cinteger = nullptr;
 
 	if ((new_cinteger = (struct cinteger_type *)
-	                    malloc(sizeof(struct cinteger_type))) == NULL) {
+	                    malloc(sizeof(struct cinteger_type))) == nullptr) {
 		outofmem();
 	} else {
-		if (cinteger_table == NULL) {
+		if (cinteger_table == nullptr) {
 			cinteger_table = new_cinteger;
 		} else {
 			current_cinteger->next_cinteger = new_cinteger;
@@ -1377,22 +1377,22 @@ void create_cinteger(const char *name, int value) {
 		strncpy(current_cinteger->name, name, 40);
 		current_cinteger->name[40] = 0;
 		current_cinteger->value = value;
-		current_cinteger->next_cinteger = NULL;
+		current_cinteger->next_cinteger = nullptr;
 	}
 }
 
 void create_integer(const char *name, int value) {
-	struct integer_type *new_integer = NULL;
+	struct integer_type *new_integer = nullptr;
 
 	if ((new_integer = (struct integer_type *)
-	                   malloc(sizeof(struct integer_type))) == NULL) {
+	                   malloc(sizeof(struct integer_type))) == nullptr) {
 		outofmem();
 	} else {
 		/* KEEP A COUNT OF HOW MANY INTEGERS ARE DEFINED TO
 		 * VALIDATE SAVED GAMES */
 		integers++;
 
-		if (integer_table == NULL) {
+		if (integer_table == nullptr) {
 			integer_table = new_integer;
 		} else {
 			current_integer->next_integer = new_integer;
@@ -1401,22 +1401,22 @@ void create_integer(const char *name, int value) {
 		strncpy(current_integer->name, name, 40);
 		current_integer->name[40] = 0;
 		current_integer->value = value;
-		current_integer->next_integer = NULL;
+		current_integer->next_integer = nullptr;
 	}
 }
 
 void create_string(const char *name, const char *value) {
-	struct string_type *new_string = NULL;
+	struct string_type *new_string = nullptr;
 
 	if ((new_string = (struct string_type *)
-	                  malloc(sizeof(struct string_type))) == NULL) {
+	                  malloc(sizeof(struct string_type))) == nullptr) {
 		outofmem();
 	} else {
 		/* KEEP A COUNT OF HOW MANY STRINGS ARE DEFINED TO
 		 * VALIDATE SAVED GAMES */
 		strings++;
 
-		if (string_table == NULL) {
+		if (string_table == nullptr) {
 			string_table = new_string;
 		} else {
 			current_string->next_string = new_string;
@@ -1425,7 +1425,7 @@ void create_string(const char *name, const char *value) {
 		strncpy(current_string->name, name, 40);
 		current_string->name[40] = 0;
 


Commit: 882eb43608aca545ca5c0433322dce026133797a
    https://github.com/scummvm/scummvm/commit/882eb43608aca545ca5c0433322dce026133797a
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
GNAP: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/gnap/datarchive.cpp
    engines/gnap/detection.cpp
    engines/gnap/menu.cpp


diff --git a/engines/gnap/datarchive.cpp b/engines/gnap/datarchive.cpp
index 3a586c58ba..9b4312ee67 100644
--- a/engines/gnap/datarchive.cpp
+++ b/engines/gnap/datarchive.cpp
@@ -93,7 +93,7 @@ void DatManager::close(int index) {
 byte *DatManager::loadResource(int resourceId) {
 	const int datIndex = ridToDatIndex(resourceId);
 	const int entryIndex = ridToEntryIndex(resourceId);
-	return _datArchives[datIndex] ? _datArchives[datIndex]->load(entryIndex) : 0;
+	return _datArchives[datIndex] ? _datArchives[datIndex]->load(entryIndex) : nullptr;
 }
 
 uint32 DatManager::getResourceType(int resourceId) {
diff --git a/engines/gnap/detection.cpp b/engines/gnap/detection.cpp
index ec71106161..e99ee7536e 100644
--- a/engines/gnap/detection.cpp
+++ b/engines/gnap/detection.cpp
@@ -31,7 +31,7 @@
 
 static const PlainGameDescriptor gnapGames[] = {
 	{ "gnap", "Gnap" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/gnap/menu.cpp b/engines/gnap/menu.cpp
index d3978a03b3..c5c91f2431 100644
--- a/engines/gnap/menu.cpp
+++ b/engines/gnap/menu.cpp
@@ -161,7 +161,7 @@ void GnapEngine::insertInventorySprites() {
 	for (int i = 0; i < 9; ++i) {
 		_menuInventoryIndices[i] = -1;
 		_gameSys->removeSpriteDrawItem(_menuInventorySprites[_sceneClickedHotspot], 261);
-		_menuInventorySprites[i] = 0;
+		_menuInventorySprites[i] = nullptr;
 	}
 
 	_menuSpritesIndex = 0;
@@ -192,7 +192,7 @@ void GnapEngine::removeInventorySprites() {
 	for (int j = 0; j < _menuSpritesIndex; ++j) {
 		if (_menuInventorySprites[j]) {
 			deleteSurface(&_menuInventorySprites[j]);
-			_menuInventorySprites[j] = 0;
+			_menuInventorySprites[j] = nullptr;
 			_menuInventoryIndices[j] = -1;
 		}
 	}


Commit: 8d91d66a15dd973791ea008568c6b00a826887b4
    https://github.com/scummvm/scummvm/commit/8d91d66a15dd973791ea008568c6b00a826887b4
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
GOB: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/gob/aniobject.cpp
    engines/gob/backbuffer.cpp
    engines/gob/cmpfile.cpp
    engines/gob/console.cpp
    engines/gob/dataio.cpp
    engines/gob/dbase.cpp
    engines/gob/decfile.cpp
    engines/gob/detection/detection.cpp
    engines/gob/draw.cpp
    engines/gob/draw_fascin.cpp
    engines/gob/draw_playtoons.cpp
    engines/gob/draw_v1.cpp
    engines/gob/draw_v2.cpp
    engines/gob/expression.cpp
    engines/gob/game.cpp
    engines/gob/global.cpp
    engines/gob/gob.cpp
    engines/gob/goblin.cpp
    engines/gob/goblin_v1.cpp
    engines/gob/goblin_v2.cpp
    engines/gob/goblin_v3.cpp
    engines/gob/goblin_v4.cpp
    engines/gob/hotspots.cpp
    engines/gob/iniconfig.cpp
    engines/gob/init.cpp
    engines/gob/inter.cpp
    engines/gob/inter_bargon.cpp
    engines/gob/inter_geisha.cpp
    engines/gob/inter_playtoons.cpp
    engines/gob/inter_v1.cpp
    engines/gob/inter_v2.cpp
    engines/gob/inter_v5.cpp
    engines/gob/inter_v6.cpp
    engines/gob/inter_v7.cpp
    engines/gob/map.cpp
    engines/gob/map_v1.cpp
    engines/gob/map_v2.cpp
    engines/gob/metaengine.cpp
    engines/gob/minigames/geisha/diving.cpp
    engines/gob/minigames/geisha/meter.cpp
    engines/gob/minigames/geisha/penetration.cpp
    engines/gob/mult.cpp
    engines/gob/mult_v1.cpp
    engines/gob/mult_v2.cpp
    engines/gob/palanim.cpp
    engines/gob/pregob/onceupon/onceupon.cpp
    engines/gob/pregob/onceupon/parents.cpp
    engines/gob/pregob/onceupon/title.cpp
    engines/gob/pregob/pregob.cpp
    engines/gob/pregob/seqfile.cpp
    engines/gob/resources.cpp
    engines/gob/save/saveconverter.cpp
    engines/gob/save/saveconverter_v2.cpp
    engines/gob/save/saveconverter_v3.cpp
    engines/gob/save/saveconverter_v4.cpp
    engines/gob/save/savefile.cpp
    engines/gob/save/savehandler.cpp
    engines/gob/save/saveload.cpp
    engines/gob/save/saveload_ajworld.cpp
    engines/gob/save/saveload_fascin.cpp
    engines/gob/save/saveload_geisha.cpp
    engines/gob/save/saveload_inca2.cpp
    engines/gob/save/saveload_playtoons.cpp
    engines/gob/save/saveload_v2.cpp
    engines/gob/save/saveload_v3.cpp
    engines/gob/save/saveload_v4.cpp
    engines/gob/save/saveload_v6.cpp
    engines/gob/save/saveload_v7.cpp
    engines/gob/scenery.cpp
    engines/gob/script.cpp
    engines/gob/sound/adlib.cpp
    engines/gob/sound/adlplayer.cpp
    engines/gob/sound/cdrom.cpp
    engines/gob/sound/infogrames.cpp
    engines/gob/sound/musplayer.cpp
    engines/gob/sound/protracker.cpp
    engines/gob/sound/sound.cpp
    engines/gob/sound/soundblaster.cpp
    engines/gob/sound/sounddesc.cpp
    engines/gob/sound/soundmixer.cpp
    engines/gob/surface.cpp
    engines/gob/totfile.cpp
    engines/gob/util.cpp
    engines/gob/variables.cpp
    engines/gob/video.cpp
    engines/gob/video_v6.cpp


diff --git a/engines/gob/aniobject.cpp b/engines/gob/aniobject.cpp
index 4678ac19bc..3e79a255e3 100644
--- a/engines/gob/aniobject.cpp
+++ b/engines/gob/aniobject.cpp
@@ -27,14 +27,14 @@
 
 namespace Gob {
 
-ANIObject::ANIObject(const ANIFile &ani) : _ani(&ani), _cmp(0),
+ANIObject::ANIObject(const ANIFile &ani) : _ani(&ani), _cmp(nullptr),
 	_visible(false), _paused(false), _mode(kModeContinuous), _x(0), _y(0) {
 
 	setAnimation(0);
 	setPosition();
 }
 
-ANIObject::ANIObject(const CMPFile &cmp) : _ani(0), _cmp(&cmp),
+ANIObject::ANIObject(const CMPFile &cmp) : _ani(nullptr), _cmp(&cmp),
 	_visible(false), _paused(false), _mode(kModeContinuous), _x(0), _y(0) {
 
 	setAnimation(0);
diff --git a/engines/gob/backbuffer.cpp b/engines/gob/backbuffer.cpp
index cee5db5a41..9c1d27ff5b 100644
--- a/engines/gob/backbuffer.cpp
+++ b/engines/gob/backbuffer.cpp
@@ -27,7 +27,7 @@
 
 namespace Gob {
 
-BackBuffer::BackBuffer() : _background(0), _saved(false) {
+BackBuffer::BackBuffer() : _background(nullptr), _saved(false) {
 }
 
 BackBuffer::~BackBuffer() {
@@ -35,7 +35,7 @@ BackBuffer::~BackBuffer() {
 }
 
 bool BackBuffer::hasBuffer() const {
-	return _background != 0;
+	return _background != nullptr;
 }
 
 bool BackBuffer::hasSavedBackground() const {
diff --git a/engines/gob/cmpfile.cpp b/engines/gob/cmpfile.cpp
index 293091dcd3..439695ff39 100644
--- a/engines/gob/cmpfile.cpp
+++ b/engines/gob/cmpfile.cpp
@@ -37,7 +37,7 @@ namespace Gob {
 CMPFile::CMPFile(GobEngine *vm, const Common::String &baseName,
 				 uint16 width, uint16 height, uint8 bpp) :
 	_vm(vm), _width(width), _height(height), _bpp(bpp), _maxWidth(0), _maxHeight(0),
-	_surface(0), _coordinates(0) {
+	_surface(nullptr), _coordinates(nullptr) {
 
 	if (baseName.empty())
 		return;
@@ -57,7 +57,7 @@ CMPFile::CMPFile(GobEngine *vm, const Common::String &baseName,
 CMPFile::CMPFile(GobEngine *vm, const Common::String &cmpFile, const Common::String &rxyFile,
 				 uint16 width, uint16 height, uint8 bpp) :
 	_vm(vm), _width(width), _height(height), _bpp(bpp), _maxWidth(0), _maxHeight(0),
-	_surface(0), _coordinates(0) {
+	_surface(nullptr), _coordinates(nullptr) {
 
 	if (cmpFile.empty() || !_vm->_dataIO->hasFile(cmpFile))
 		return;
@@ -71,7 +71,7 @@ CMPFile::CMPFile(GobEngine *vm, const Common::String &cmpFile, const Common::Str
 CMPFile::CMPFile(GobEngine *vm, Common::SeekableReadStream &cmp, Common::SeekableReadStream &rxy,
 				 uint16 width, uint16 height, uint8 bpp) :
 	_vm(vm), _width(width), _height(height), _bpp(bpp), _maxWidth(0), _maxHeight(0),
-	_surface(0), _coordinates(0) {
+	_surface(nullptr), _coordinates(nullptr) {
 
 	loadRXY(rxy);
 	createSurface();
@@ -82,7 +82,7 @@ CMPFile::CMPFile(GobEngine *vm, Common::SeekableReadStream &cmp, Common::Seekabl
 CMPFile::CMPFile(GobEngine *vm, Common::SeekableReadStream &cmp,
 				 uint16 width, uint16 height, uint8 bpp) :
 	_vm(vm), _width(width), _height(height), _bpp(bpp), _maxWidth(0), _maxHeight(0),
-	_surface(0), _coordinates(0) {
+	_surface(nullptr), _coordinates(nullptr) {
 
 	createRXY();
 	createSurface();
@@ -96,7 +96,7 @@ CMPFile::~CMPFile() {
 }
 
 bool CMPFile::empty() const {
-	return (_surface == 0) || (_coordinates == 0);
+	return (_surface == nullptr) || (_coordinates == nullptr);
 }
 
 uint16 CMPFile::getSpriteCount() const {
@@ -117,7 +117,7 @@ void CMPFile::loadCMP(const Common::String &cmp) {
 }
 
 void CMPFile::loadRXY(const Common::String &rxy) {
-	Common::SeekableReadStream *dataRXY = 0;
+	Common::SeekableReadStream *dataRXY = nullptr;
 	if (!rxy.empty())
 		dataRXY = _vm->_dataIO->getFile(rxy);
 
diff --git a/engines/gob/console.cpp b/engines/gob/console.cpp
index 2252606243..52347039a7 100644
--- a/engines/gob/console.cpp
+++ b/engines/gob/console.cpp
@@ -28,7 +28,7 @@
 
 namespace Gob {
 
-GobConsole::GobConsole(GobEngine *vm) : GUI::Debugger(), _vm(vm), _cheater(0) {
+GobConsole::GobConsole(GobEngine *vm) : GUI::Debugger(), _vm(vm), _cheater(nullptr) {
 	registerCmd("varSize",      WRAP_METHOD(GobConsole, cmd_varSize));
 	registerCmd("dumpVars",     WRAP_METHOD(GobConsole, cmd_dumpVars));
 	registerCmd("var8",         WRAP_METHOD(GobConsole, cmd_var8));
@@ -47,7 +47,7 @@ void GobConsole::registerCheater(Cheater *cheater) {
 }
 
 void GobConsole::unregisterCheater() {
-	_cheater = 0;
+	_cheater = nullptr;
 }
 
 bool GobConsole::cmd_varSize(int argc, const char **argv) {
diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp
index 443d262fb4..40492a7348 100644
--- a/engines/gob/dataio.cpp
+++ b/engines/gob/dataio.cpp
@@ -29,7 +29,7 @@
 
 namespace Gob {
 
-DataIO::File::File() : size(0), offset(0), compression(0), archive(0) {
+DataIO::File::File() : size(0), offset(0), compression(0), archive(nullptr) {
 }
 
 DataIO::File::File(const Common::String &n, uint32 s, uint32 o, uint8 c, Archive &a) :
@@ -100,7 +100,7 @@ byte *DataIO::unpack(Common::SeekableReadStream &src, int32 &size, uint8 compres
 
 	assert(size > 0);
 
-	byte *data = 0;
+	byte *data = nullptr;
 	if (useMalloc)
 		data = (byte *) malloc(size);
 	else
@@ -125,7 +125,7 @@ Common::SeekableReadStream *DataIO::unpack(Common::SeekableReadStream &src, uint
 
 	byte *data = unpack(src, size, compression, true);
 	if (!data)
-		return 0;
+		return nullptr;
 
 	return new Common::MemoryReadStream(data, size, DisposeAfterUse::YES);
 }
@@ -207,7 +207,7 @@ void DataIO::unpackChunk(Common::SeekableReadStream &src, byte *dest, uint32 siz
 
 bool DataIO::openArchive(Common::String name, bool base) {
 	// Look for a free archive slot
-	Archive **archive = 0;
+	Archive **archive = nullptr;
 	int i = 0;
 	for (Common::Array<Archive *>::iterator it = _archives.begin(); it != _archives.end(); ++it, i++) {
 		if (!*it) {
@@ -249,7 +249,7 @@ DataIO::Archive *DataIO::openArchive(const Common::String &name) {
 	Archive *archive = new Archive;
 	if (!archive->file.open(name)) {
 		delete archive;
-		return 0;
+		return nullptr;
 	}
 
 	archive->name = name;
@@ -360,7 +360,7 @@ Common::SeekableReadStream *DataIO::getFile(const Common::String &name) {
 	// Else, try to open a matching plain file
 	Common::File f;
 	if (!f.open(name))
-		return 0;
+		return nullptr;
 
 	return f.readStream(f.size());
 }
@@ -377,14 +377,14 @@ byte *DataIO::getFile(const Common::String &name, int32 &size) {
 	// Else, try to open a matching plain file
 	Common::File f;
 	if (!f.open(name))
-		return 0;
+		return nullptr;
 
 	size = f.size();
 
 	byte *data = new byte[size];
 	if (f.read(data, size) != ((uint32) size)) {
 		delete[] data;
-		return 0;
+		return nullptr;
 	}
 
 	return data;
@@ -403,18 +403,18 @@ DataIO::File *DataIO::findFile(const Common::String &name) {
 			return &file->_value;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 Common::SeekableReadStream *DataIO::getFile(File &file) {
 	if (!file.archive)
-		return 0;
+		return nullptr;
 
 	if (!file.archive->file.isOpen())
-		return 0;
+		return nullptr;
 
 	if (!file.archive->file.seek(file.offset))
-		return 0;
+		return nullptr;
 
 	Common::SeekableReadStream *rawData =
 		new Common::SafeSeekableSubReadStream(&file.archive->file, file.offset, file.offset + file.size);
@@ -431,20 +431,20 @@ Common::SeekableReadStream *DataIO::getFile(File &file) {
 
 byte *DataIO::getFile(File &file, int32 &size) {
 	if (!file.archive)
-		return 0;
+		return nullptr;
 
 	if (!file.archive->file.isOpen())
-		return 0;
+		return nullptr;
 
 	if (!file.archive->file.seek(file.offset))
-		return 0;
+		return nullptr;
 
 	size = file.size;
 
 	byte *rawData = new byte[file.size];
 	if (file.archive->file.read(rawData, file.size) != file.size) {
 		delete[] rawData;
-		return 0;
+		return nullptr;
 	}
 
 	if (file.compression == 0)
diff --git a/engines/gob/dbase.cpp b/engines/gob/dbase.cpp
index 5e44ec133e..d04920537a 100644
--- a/engines/gob/dbase.cpp
+++ b/engines/gob/dbase.cpp
@@ -24,7 +24,7 @@
 
 namespace Gob {
 
-dBase::dBase() : _recordData(0) {
+dBase::dBase() : _recordData(nullptr) {
 	clear();
 }
 
@@ -136,7 +136,7 @@ void dBase::clear() {
 	_records.clear();
 
 	delete[] _recordData;
-	_recordData = 0;
+	_recordData = nullptr;
 }
 
 byte dBase::getVersion() const {
diff --git a/engines/gob/decfile.cpp b/engines/gob/decfile.cpp
index 3952c93b37..a25bcf90a5 100644
--- a/engines/gob/decfile.cpp
+++ b/engines/gob/decfile.cpp
@@ -36,7 +36,7 @@ namespace Gob {
 
 DECFile::DECFile(GobEngine *vm, const Common::String &fileName,
 				 uint16 width, uint16 height, uint8 bpp) : _vm(vm),
-	_width(width), _height(height), _bpp(bpp), _hasPadding(false), _backdrop(0) {
+	_width(width), _height(height), _bpp(bpp), _hasPadding(false), _backdrop(nullptr) {
 
 	bool bigEndian = false;
 	Common::String endianFileName = fileName;
diff --git a/engines/gob/detection/detection.cpp b/engines/gob/detection/detection.cpp
index 46da262b5c..b721495ade 100644
--- a/engines/gob/detection/detection.cpp
+++ b/engines/gob/detection/detection.cpp
@@ -104,7 +104,7 @@ const Gob::GOBGameDescription *GobMetaEngineDetection::detectOnceUponATime(const
 	    !dataIO.openArchive("stk3.stk", true)) {
 
 		SearchMan.clear();
-		return 0;
+		return nullptr;
 	}
 
 	Gob::OnceUponATime gameType         = Gob::kOnceUponATimeInvalid;
@@ -163,7 +163,7 @@ const Gob::GOBGameDescription *GobMetaEngineDetection::detectOnceUponATime(const
 	if ((gameType == Gob::kOnceUponATimeInvalid) || (platform == Gob::kOnceUponATimePlatformInvalid)) {
 		warning("GobMetaEngineDetection::detectOnceUponATime(): Detection failed (%d, %d)",
 		        (int)gameType, (int)platform);
-		return 0;
+		return nullptr;
 	}
 
 	return &Gob::fallbackOnceUpon[gameType][platform];
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index 88076764de..d857d25d59 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -55,14 +55,14 @@ Draw::Draw(GobEngine *vm) : _vm(vm) {
 	_destSurface = 0;
 
 	_letterToPrint = 0;
-	_textToPrint = 0;
-	_hotspotText = 0;
+	_textToPrint = nullptr;
+	_hotspotText = nullptr;
 
 	_backDeltaX = 0;
 	_backDeltaY = 0;
 
 	for (int i = 0; i < kFontCount; i++)
-		_fonts[i] = 0;
+		_fonts[i] = nullptr;
 
 	_spritesArray.resize(kSpriteCount);
 
@@ -113,13 +113,13 @@ Draw::Draw(GobEngine *vm) : _vm(vm) {
 	}
 
 	_cursorCount         = 0;
-	_doCursorPalettes    = 0;
-	_cursorPalettes      = 0;
-	_cursorKeyColors     = 0;
-	_cursorPaletteStarts = 0;
-	_cursorPaletteCounts = 0;
-	_cursorHotspotsX     = 0;
-	_cursorHotspotsY     = 0;
+	_doCursorPalettes    = nullptr;
+	_cursorPalettes      = nullptr;
+	_cursorKeyColors     = nullptr;
+	_cursorPaletteStarts = nullptr;
+	_cursorPaletteCounts = nullptr;
+	_cursorHotspotsX     = nullptr;
+	_cursorHotspotsY     = nullptr;
 
 	_palLoadData1[0] = 0;
 	_palLoadData1[1] = 17;
@@ -474,7 +474,7 @@ void Draw::printTextCentered(int16 id, int16 left, int16 top, int16 right,
 	else
 		width = strlen(str) * font.getCharWidth();
 
-	adjustCoords(1, &width, 0);
+	adjustCoords(1, &width, nullptr);
 	_destSpriteX += (right - left + 1 - width) / 2;
 
 	spriteOperation(DRAW_PRINTTEXT);
@@ -552,7 +552,7 @@ void Draw::oPlaytoons_sub_F_1B(uint16 id, int16 left, int16 top, int16 right, in
 				_destSpriteY = offY;
 				_textToPrint = str;
 				width = stringLength(str, fontIndex);
-				adjustCoords(1, &width, NULL);
+				adjustCoords(1, &width, nullptr);
 				_destSpriteX += (top - left + 1 - width) / 2;
 				spriteOperation(DRAW_PRINTTEXT);
 				offY += deltaY + _fonts[fontIndex]->getCharHeight();
@@ -565,7 +565,7 @@ void Draw::oPlaytoons_sub_F_1B(uint16 id, int16 left, int16 top, int16 right, in
 				_destSpriteY = right;
 			_textToPrint = paramStr;
 			width = stringLength(paramStr, fontIndex);
-			adjustCoords(1, &width, NULL);
+			adjustCoords(1, &width, nullptr);
 			_destSpriteX += (top - left + 1 - width) / 2;
 			spriteOperation(DRAW_PRINTTEXT);
 		}
@@ -687,7 +687,7 @@ void Draw::wobble(Surface &surfDesc) {
 
 Font *Draw::loadFont(const char *path) const {
 	if (!_vm->_dataIO->hasFile(path))
-		return 0;
+		return nullptr;
 
 	int32 size;
 	byte *data = _vm->_dataIO->getFile(path, size);
@@ -705,7 +705,7 @@ bool Draw::loadFont(uint16 fontIndex, const char *path) {
 
 	_fonts[fontIndex] = loadFont(path);
 
-	return _fonts[fontIndex] != 0;
+	return _fonts[fontIndex] != nullptr;
 }
 
 } // End of namespace Gob
diff --git a/engines/gob/draw_fascin.cpp b/engines/gob/draw_fascin.cpp
index fbf97d55af..78b2af8f24 100644
--- a/engines/gob/draw_fascin.cpp
+++ b/engines/gob/draw_fascin.cpp
@@ -315,7 +315,7 @@ void Draw_Fascination::spriteOperation(int16 operation) {
 
 	if (operation == DRAW_PRINTTEXT) {
 		len = _fonts[_fontIndex]->getCharWidth();
-		adjustCoords(1, &len, 0);
+		adjustCoords(1, &len, nullptr);
 		_destSpriteX += len * strlen(_textToPrint);
 	}
 
@@ -983,7 +983,7 @@ void Draw_Fascination::activeWin(int16 id) {
 		nextId = id;
 
 		for (int j = 0; j < 10; j++) {
-			if (oldSrf[j] != 0)
+			if (oldSrf[j] != nullptr)
 				_fascinWin[j].savedSurface = oldSrf[j];
 		}
 	}
diff --git a/engines/gob/draw_playtoons.cpp b/engines/gob/draw_playtoons.cpp
index 5fe5657270..026f86004b 100644
--- a/engines/gob/draw_playtoons.cpp
+++ b/engines/gob/draw_playtoons.cpp
@@ -381,7 +381,7 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
 
 	if (operation == DRAW_PRINTTEXT) {
 		len = _fonts[_fontIndex]->getCharWidth();
-		adjustCoords(1, &len, 0);
+		adjustCoords(1, &len, nullptr);
 		_destSpriteX += len * strlen(_textToPrint);
 	}
 
diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp
index daf28fceaa..be00a838e6 100644
--- a/engines/gob/draw_v1.cpp
+++ b/engines/gob/draw_v1.cpp
@@ -342,7 +342,7 @@ void Draw_v1::spriteOperation(int16 operation) {
 		}
 	}
 
-	Font *font = 0;
+	Font *font = nullptr;
 	switch (operation) {
 	case DRAW_BLITSURF:
 		_spritesArray[_destSurface]->blit(*_spritesArray[_sourceSurface],
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index bac5e19957..d8c0dc1f10 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -145,7 +145,7 @@ void Draw_v2::animateCursor(int16 cursor) {
 		} else if (_cursorHotspotX != -1) {
 			hotspotX = _cursorHotspotX;
 			hotspotY = _cursorHotspotY;
-		} else if (_cursorHotspotsX != 0) {
+		} else if (_cursorHotspotsX != nullptr) {
 			hotspotX = _cursorHotspotsX[_cursorIndex];
 			hotspotY = _cursorHotspotsY[_cursorIndex];
 		}
@@ -403,14 +403,14 @@ void Draw_v2::printTotText(int16 id) {
 			str[MAX(strPos, strPos2)] = 0;
 			strPosBak = strPos;
 			width = strlen(str) * _fonts[fontIndex]->getCharWidth();
-			adjustCoords(1, &width, 0);
+			adjustCoords(1, &width, nullptr);
 
 			if (colCmd & 0x0F) {
 				rectLeft = offX - 2;
 				rectTop = offY - 2;
 				rectRight = offX + width + 1;
 				rectBottom = _fonts[fontIndex]->getCharHeight();
-				adjustCoords(1, &rectBottom, 0);
+				adjustCoords(1, &rectBottom, nullptr);
 				rectBottom += offY + 1;
 				adjustCoords(0, &rectLeft, &rectTop);
 				adjustCoords(2, &rectRight, &rectBottom);
@@ -470,7 +470,7 @@ void Draw_v2::printTotText(int16 id) {
 			for (int i = 0; i < strPosBak; i++)
 				rectLeft += _fonts[_fontIndex]->getCharWidth(str[i]);
 
-			adjustCoords(1, &rectLeft, 0);
+			adjustCoords(1, &rectLeft, nullptr);
 			offX += rectLeft;
 			strPos = 0;
 			strPos2 = -1;
diff --git a/engines/gob/expression.cpp b/engines/gob/expression.cpp
index 3be2b2456d..b53a785084 100644
--- a/engines/gob/expression.cpp
+++ b/engines/gob/expression.cpp
@@ -651,7 +651,7 @@ int16 Expression::parseVarIndex(uint16 *size, uint16 *type) {
 }
 
 int16 Expression::parseValExpr(byte stopToken) {
-	parseExpr(stopToken, 0);
+	parseExpr(stopToken, nullptr);
 
 	return _resultInt;
 }
@@ -757,7 +757,7 @@ void Expression::loadValue(byte operation, uint32 varBase, const StackFrame &sta
 
 	case OP_FUNC:
 		operation = _vm->_game->_script->readByte();
-		parseExpr(OP_END_EXPR, 0);
+		parseExpr(OP_END_EXPR, nullptr);
 
 		switch (operation) {
 		case FUNC_SQRT1:
@@ -983,12 +983,12 @@ bool Expression::complexArithmetic(Stack &stack, StackFrame &stackFrame, int16 b
 
 // Assign the result to the appropriate _result variable
 void Expression::getResult(byte operation, int32 value, byte *type) {
-	if (type != 0)
+	if (type != nullptr)
 		*type = operation;
 
 	switch (operation) {
 	case OP_NOT:
-		if (type != 0)
+		if (type != nullptr)
 			*type ^= 1;
 		break;
 
@@ -1007,7 +1007,7 @@ void Expression::getResult(byte operation, int32 value, byte *type) {
 
 	default:
 		_resultInt = 0;
-		if (type != 0)
+		if (type != nullptr)
 			*type = OP_LOAD_IMM_INT16;
 		break;
 	}
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index 86fb207379..f53e0efb89 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -47,12 +47,12 @@ Environments::Environments(GobEngine *vm) : _vm(vm) {
 
 		e.cursorHotspotX = 0;
 		e.cursorHotspotY = 0;
-		e.variables      = 0;
-		e.script         = 0;
-		e.resources      = 0;
+		e.variables      = nullptr;
+		e.script         = nullptr;
+		e.resources      = nullptr;
 
 		for (int j = 0; j < 17; j++)
-			m.fonts[j] = 0;
+			m.fonts[j] = nullptr;
 	}
 }
 
@@ -170,7 +170,7 @@ bool Environments::has(Resources *resources, uint8 startEnv, int16 except) const
 void Environments::deleted(Variables *variables) {
 	for (uint i = 0; i < kEnvironmentCount; i++) {
 		if (_environments[i].variables == variables)
-			_environments[i].variables = 0;
+			_environments[i].variables = nullptr;
 	}
 }
 
@@ -188,7 +188,7 @@ bool Environments::clearMedia(uint8 env) {
 
 	for (int i = 0; i < 17; i++) {
 		delete m.fonts[i];
-		m.fonts[i] = 0;
+		m.fonts[i] = nullptr;
 	}
 
 	return true;
@@ -216,7 +216,7 @@ bool Environments::setMedia(uint8 env) {
 	int n = MIN(Draw::kFontCount, 17);
 	for (int i = 0; i < n; i++) {
 		m.fonts[i] = _vm->_draw->_fonts[i];
-		_vm->_draw->_fonts[i] = 0;
+		_vm->_draw->_fonts[i] = nullptr;
 	}
 
 	return true;
@@ -244,7 +244,7 @@ bool Environments::getMedia(uint8 env) {
 	for (int i = 0; i < n; i++) {
 		delete _vm->_draw->_fonts[i];
 		_vm->_draw->_fonts[i] = m.fonts[i];
-		m.fonts[i]= 0;
+		m.fonts[i]= nullptr;
 	}
 
 	return true;
@@ -253,8 +253,8 @@ bool Environments::getMedia(uint8 env) {
 
 TotFunctions::TotFunctions(GobEngine *vm) : _vm(vm) {
 	for (uint8 i = 0; i < kTotCount; i++) {
-		_tots[i].script    = 0;
-		_tots[i].resources = 0;
+		_tots[i].script    = nullptr;
+		_tots[i].resources = nullptr;
 	}
 }
 
@@ -279,8 +279,8 @@ void TotFunctions::freeTot(Tot &tot) {
 	delete tot.script;
 	delete tot.resources;
 
-	tot.script    = 0;
-	tot.resources = 0;
+	tot.script    = nullptr;
+	tot.resources = nullptr;
 
 	tot.file.clear();
 	tot.functions.clear();
@@ -382,9 +382,9 @@ bool TotFunctions::unload(const Common::String &totFile) {
 	Tot &tot = _tots[index];
 
 	if (_vm->_game->_script == tot.script)
-		_vm->_game->_script = 0;
+		_vm->_game->_script = nullptr;
 	if (_vm->_game->_resources == tot.resources)
-		_vm->_game->_resources = 0;
+		_vm->_game->_resources = nullptr;
 
 	freeTot(tot);
 
@@ -862,7 +862,7 @@ void Game::totSub(int8 flags, const Common::String &totFile) {
 		warning("Addy Stub: Game::totSub(), flags & 0x80");
 
 	if (flags & 5)
-		_vm->_inter->_variables = 0;
+		_vm->_inter->_variables = nullptr;
 
 	_curTotFile = totFile + ".TOT";
 
@@ -961,11 +961,11 @@ void Game::deletedVars(Variables *variables) {
 void Game::clearUnusedEnvironment() {
 	if (!_environments.has(_script)) {
 		delete _script;
-		_script = 0;
+		_script = nullptr;
 	}
 	if (!_environments.has(_resources)) {
 		delete _resources;
-		_resources = 0;
+		_resources = nullptr;
 	}
 }
 
diff --git a/engines/gob/global.cpp b/engines/gob/global.cpp
index e943e1f023..54b5e825c9 100644
--- a/engines/gob/global.cpp
+++ b/engines/gob/global.cpp
@@ -105,7 +105,7 @@ Global::Global(GobEngine *vm) : _vm(vm) {
 	_vgaPalette[14].red = 0x3F; _vgaPalette[14].green = 0x3F; _vgaPalette[14].blue = 0x15;
 	_vgaPalette[15].red = 0x3F; _vgaPalette[15].green = 0x3F; _vgaPalette[15].blue = 0x3F;
 
-	_pPaletteDesc = 0;
+	_pPaletteDesc = nullptr;
 
 	_setAllPalette  = false;
 	_dontSetPalette = false;
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 2a36f314c1..d11ae784ee 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -116,12 +116,12 @@ void PauseDialog::handleKeyDown(Common::KeyState state) {
 
 
 GobEngine::GobEngine(OSystem *syst) : Engine(syst), _rnd("gob") {
-	_sound     = 0; _mult     = 0; _game    = 0;
-	_global    = 0; _dataIO   = 0; _goblin  = 0;
-	_vidPlayer = 0; _init     = 0; _inter   = 0;
-	_map       = 0; _palAnim  = 0; _scenery = 0;
-	_draw      = 0; _util     = 0; _video   = 0;
-	_saveLoad  = 0; _preGob   = 0;
+	_sound     = nullptr; _mult     = nullptr; _game    = nullptr;
+	_global    = nullptr; _dataIO   = nullptr; _goblin  = nullptr;
+	_vidPlayer = nullptr; _init     = nullptr; _inter   = nullptr;
+	_map       = nullptr; _palAnim  = nullptr; _scenery = nullptr;
+	_draw      = nullptr; _util     = nullptr; _video   = nullptr;
+	_saveLoad  = nullptr; _preGob   = nullptr;
 
 	_pauseStart = 0;
 
@@ -684,23 +684,23 @@ Common::Error GobEngine::initGameParts() {
 }
 
 void GobEngine::deinitGameParts() {
-	delete _preGob;    _preGob = 0;
-	delete _saveLoad;  _saveLoad = 0;
-	delete _mult;      _mult = 0;
-	delete _vidPlayer; _vidPlayer = 0;
-	delete _game;      _game = 0;
-	delete _global;    _global = 0;
-	delete _goblin;    _goblin = 0;
-	delete _init;      _init = 0;
-	delete _inter;     _inter = 0;
-	delete _map;       _map = 0;
-	delete _palAnim;   _palAnim = 0;
-	delete _scenery;   _scenery = 0;
-	delete _draw;      _draw = 0;
-	delete _util;      _util = 0;
-	delete _video;     _video = 0;
-	delete _sound;     _sound = 0;
-	delete _dataIO;    _dataIO = 0;
+	delete _preGob;    _preGob = nullptr;
+	delete _saveLoad;  _saveLoad = nullptr;
+	delete _mult;      _mult = nullptr;
+	delete _vidPlayer; _vidPlayer = nullptr;
+	delete _game;      _game = nullptr;
+	delete _global;    _global = nullptr;
+	delete _goblin;    _goblin = nullptr;
+	delete _init;      _init = nullptr;
+	delete _inter;     _inter = nullptr;
+	delete _map;       _map = nullptr;
+	delete _palAnim;   _palAnim = nullptr;
+	delete _scenery;   _scenery = nullptr;
+	delete _draw;      _draw = nullptr;
+	delete _util;      _util = nullptr;
+	delete _video;     _video = nullptr;
+	delete _sound;     _sound = nullptr;
+	delete _dataIO;    _dataIO = nullptr;
 }
 
 Common::Error GobEngine::initGraphics() {
diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp
index cd2f983011..609f109f0f 100644
--- a/engines/gob/goblin.cpp
+++ b/engines/gob/goblin.cpp
@@ -45,7 +45,7 @@ Goblin::Goblin(GobEngine *vm) : _vm(vm) {
 	_itemByteFlag = 0;
 	_destItemId = -1;
 	_destActionItem = 0;
-	_actDestItemDesc = 0;
+	_actDestItemDesc = nullptr;
 	_forceNextState[0] = -1;
 	_forceNextState[1] = -1;
 	_forceNextState[2] = -1;
@@ -61,10 +61,10 @@ Goblin::Goblin(GobEngine *vm) : _vm(vm) {
 	_positionedGob = 5;
 
 	_noPick = 0;
-	_objList = 0;
+	_objList = nullptr;
 
 	for (int i = 0; i < 4; i++)
-		_goblins[i] = 0;
+		_goblins[i] = nullptr;
 	for (int i = 0; i < 3; i++) {
 		_gobPositions[i].x = 0;
 		_gobPositions[i].y = 0;
@@ -81,7 +81,7 @@ Goblin::Goblin(GobEngine *vm) : _vm(vm) {
 	_destItemState = 0;
 	for (int i = 0; i < 20; i++) {
 		_itemToObject[i] = 0;
-		_objects[i] = 0;
+		_objects[i] = nullptr;
 	}
 	_objCount = 0;
 	_gobsCount = 0;
@@ -146,7 +146,7 @@ int16 Goblin::peekGoblin(Gob_Object *_curGob) {
 
 	ptr = _objList->pHead;
 	index = 0;
-	while (ptr != 0) {
+	while (ptr != nullptr) {
 		desc = (Gob_Object *)ptr->pData;
 		if (desc != _curGob) {
 			for (i = 0; i < 3; i++) {
@@ -168,8 +168,8 @@ int16 Goblin::peekGoblin(Gob_Object *_curGob) {
 
 void Goblin::initList() {
 	_objList = new Util::List;
-	_objList->pHead = 0;
-	_objList->pTail = 0;
+	_objList->pHead = nullptr;
+	_objList->pTail = nullptr;
 }
 
 void Goblin::sortByOrder(Util::List *list) {
@@ -177,8 +177,8 @@ void Goblin::sortByOrder(Util::List *list) {
 	Util::ListNode *ptr2;
 
 	ptr = list->pHead;
-	while (ptr->pNext != 0) {
-		for (ptr2 = ptr->pNext; ptr2 != 0; ptr2 = ptr2->pNext) {
+	while (ptr->pNext != nullptr) {
+		for (ptr2 = ptr->pNext; ptr2 != nullptr; ptr2 = ptr2->pNext) {
 			Gob_Object *objDesc = (Gob_Object *)ptr->pData;
 			Gob_Object *objDesc2 = (Gob_Object *)ptr2->pData;
 
@@ -217,7 +217,7 @@ void Goblin::drawObjects() {
 	int16 layer;
 
 	ptr = _objList->pHead;
-	for (ptr = _objList->pHead; ptr != 0; ptr = ptr->pNext) {
+	for (ptr = _objList->pHead; ptr != nullptr; ptr = ptr->pNext) {
 		objDesc = (Gob_Object *)ptr->pData;
 
 		if (objDesc->type == 3)
@@ -226,7 +226,7 @@ void Goblin::drawObjects() {
 			objDesc->toRedraw = 0;
 	}
 
-	for (ptr = _objList->pHead; ptr != 0; ptr = ptr->pNext) {
+	for (ptr = _objList->pHead; ptr != nullptr; ptr = ptr->pNext) {
 		objDesc = (Gob_Object *)ptr->pData;
 		if (objDesc->toRedraw == 0)
 			continue;
@@ -270,7 +270,7 @@ void Goblin::drawObjects() {
 	}
 
 	sortByOrder(_objList);
-	for (ptr = _objList->pHead; ptr != 0; ptr = ptr->pNext) {
+	for (ptr = _objList->pHead; ptr != nullptr; ptr = ptr->pNext) {
 		objDesc = (Gob_Object *)ptr->pData;
 		if (objDesc->toRedraw) {
 			layer =
@@ -318,7 +318,7 @@ void Goblin::drawObjects() {
 		}
 
 		if ((objDesc->type == 0) && (objDesc->visible != 0)) {
-			for (ptr2 = _objList->pHead; ptr2 != 0; ptr2 = ptr2->pNext) {
+			for (ptr2 = _objList->pHead; ptr2 != nullptr; ptr2 = ptr2->pNext) {
 				gobDesc2 = (Gob_Object *)ptr2->pData;
 
 				if (gobDesc2->toRedraw == 0)
@@ -354,7 +354,7 @@ void Goblin::drawObjects() {
 		}
 	}
 
-	for (ptr = _objList->pHead; ptr != 0; ptr = ptr->pNext) {
+	for (ptr = _objList->pHead; ptr != nullptr; ptr = ptr->pNext) {
 		objDesc = (Gob_Object *)ptr->pData;
 		if ((objDesc->toRedraw == 0) || (objDesc->type == 1))
 			continue;
@@ -414,7 +414,7 @@ void Goblin::animateObjects() {
 	Scenery::AnimLayer *pLayer;
 	int16 layer;
 
-	for (node = _objList->pHead; node != 0; node = node->pNext) {
+	for (node = _objList->pHead; node != nullptr; node = node->pNext) {
 		objDesc = (Gob_Object *)node->pData;
 		if ((objDesc->doAnim != 1) || (objDesc->type != 0))
 			continue;
@@ -907,7 +907,7 @@ void Goblin::moveFindItem(int16 posX, int16 posY) {
 	int16 i;
 	if ((_gobAction == 3) || (_gobAction == 4)) {
 		for (i = 0; i < 20; i++) {
-			if (_objects[i] == 0)
+			if (_objects[i] == nullptr)
 				continue;
 
 			if (_objects[i]->type != 0)
@@ -1050,7 +1050,7 @@ void Goblin::moveInitStep(int16 framesCount, int16 action, int16 cont,
 		targetDummyItem(gobDesc);
 
 		targetItem();
-		initiateMove(0);
+		initiateMove(nullptr);
 
 		moveCheckSelect(framesCount, gobDesc, pGobIndex, pNextAct);
 	} else {
@@ -1158,17 +1158,17 @@ int16 Goblin::doMove(Gob_Object *gobDesc, int16 cont, int16 action) {
 
 	moveInitStep(framesCount, action, cont, gobDesc, &gobIndex, &nextAct);
 	moveTreatRopeStairs(gobDesc);
-	moveAdvance(0, gobDesc, nextAct, framesCount);
+	moveAdvance(nullptr, gobDesc, nextAct, framesCount);
 
 	return gobIndex;
 }
 
 void Goblin::zeroObjects() {
 	for (int i = 0; i < 4; i++)
-		_goblins[i] = 0;
+		_goblins[i] = nullptr;
 
 	for (int i = 0; i < 20; i++)
-		_objects[i] = 0;
+		_objects[i] = nullptr;
 
 	for (int i = 0; i < 16; i++)
 		_vm->_sound->sampleFree(&_soundData[i]);
@@ -1176,7 +1176,7 @@ void Goblin::zeroObjects() {
 
 void Goblin::freeAllObjects() {
 	_vm->_util->deleteList(_objList);
-	_objList = 0;
+	_objList = nullptr;
 	freeObjects();
 }
 
@@ -1199,7 +1199,7 @@ void Goblin::loadObjects(const char *source) {
 		placeObject(_objects[i], 1, 0, 0, 0, 0);
 
 	initVarPointers();
-	_actDestItemDesc = 0;
+	_actDestItemDesc = nullptr;
 }
 
 void Goblin::saveGobDataToVars(int16 xPos, int16 yPos, int16 someVal) {
@@ -1233,7 +1233,7 @@ void Goblin::saveGobDataToVars(int16 xPos, int16 yPos, int16 someVal) {
 	_curGobRelaxVarPtr = (uint32) obj->relaxTime;
 	_curGobMaxFrameVarPtr = (uint32) getObjMaxFrame(obj);
 
-	if (_actDestItemDesc == 0)
+	if (_actDestItemDesc == nullptr)
 		return;
 
 	obj = _actDestItemDesc;
@@ -1345,7 +1345,7 @@ void Goblin::loadGobDataFromVars() {
 	obj->pickable = (int32) _curGobPickableVarPtr;
 	obj->relaxTime = (int32) _curGobRelaxVarPtr;
 
-	if (_actDestItemDesc == 0)
+	if (_actDestItemDesc == nullptr)
 		return;
 
 	obj = _actDestItemDesc;
@@ -1631,7 +1631,7 @@ int16 Goblin::treatItem(int16 action) {
 
 		if ((_itemToObject[_destActionItem] != 100) && (_destActionItem != 0)) {
 			if (_itemToObject[_destActionItem] == -1)
-				_actDestItemDesc = 0;
+				_actDestItemDesc = nullptr;
 			else
 				_actDestItemDesc = _objects[_itemToObject[_destActionItem]];
 		}
@@ -1691,7 +1691,7 @@ void Goblin::setState(int16 index, int16 state) {
 	obj = &_vm->_mult->_objects[index];
 	animData = obj->pAnimData;
 
-	if (obj->goblinStates[state] == 0)
+	if (obj->goblinStates[state] == nullptr)
 		return;
 
 	layer = obj->goblinStates[state][0].layer;
diff --git a/engines/gob/goblin_v1.cpp b/engines/gob/goblin_v1.cpp
index 01c287778b..1e4e9e5489 100644
--- a/engines/gob/goblin_v1.cpp
+++ b/engines/gob/goblin_v1.cpp
@@ -47,7 +47,7 @@ void Goblin_v1::freeObjects() {
 		_vm->_sound->sampleFree(&_soundData[i]);
 
 	for (int i = 0; i < 4; i++) {
-		if (_goblins[i] == 0)
+		if (_goblins[i] == nullptr)
 			continue;
 
 		_goblins[i]->stateMach = _goblins[i]->realStateMach;
@@ -55,24 +55,24 @@ void Goblin_v1::freeObjects() {
 		for (state = 0; state < 40; state++) {
 			for (col = 0; col < 6; col++) {
 				delete _goblins[i]->stateMach[state][col];
-				_goblins[i]->stateMach[state][col] = 0;
+				_goblins[i]->stateMach[state][col] = nullptr;
 			}
 		}
 
 		if (i == 3) {
 			for (state = 40; state < 70; state++) {
 				delete _goblins[3]->stateMach[state][0];
-				_goblins[3]->stateMach[state][0] = 0;
+				_goblins[3]->stateMach[state][0] = nullptr;
 			}
 		}
 
 		delete[] _goblins[i]->stateMach;
 		delete _goblins[i];
-		_goblins[i] = 0;
+		_goblins[i] = nullptr;
 	}
 
 	for (int i = 0; i < 20; i++) {
-		if (_objects[i] == 0)
+		if (_objects[i] == nullptr)
 			continue;
 
 		_objects[i]->stateMach = _objects[i]->realStateMach;
@@ -80,13 +80,13 @@ void Goblin_v1::freeObjects() {
 		for (state = 0; state < 40; state++) {
 			for (col = 0; col < 6; col++) {
 				delete _objects[i]->stateMach[state][col];
-				_objects[i]->stateMach[state][col] = 0;
+				_objects[i]->stateMach[state][col] = nullptr;
 			}
 		}
 
 		delete[] _objects[i]->stateMach;
 		delete _objects[i];
-		_objects[i] = 0;
+		_objects[i] = nullptr;
 	}
 }
 
@@ -94,7 +94,7 @@ void Goblin_v1::placeObject(Gob_Object *objDesc, char animated,
 		int16 index, int16 x, int16 y, int16 state) {
 	int16 layer;
 
-	if (objDesc->stateMach[objDesc->state][0] != 0) {
+	if (objDesc->stateMach[objDesc->state][0] != nullptr) {
 		objDesc->animation = objDesc->stateMach[objDesc->state][0]->animation;
 
 		objDesc->noTick = 0;
@@ -137,11 +137,11 @@ void Goblin_v1::placeObject(Gob_Object *objDesc, char animated,
 }
 
 void Goblin_v1::initiateMove(Mult::Mult_Object *obj) {
-	_vm->_map->findNearestToDest(0);
-	_vm->_map->findNearestToGob(0);
-	_vm->_map->optimizePoints(0, 0, 0);
+	_vm->_map->findNearestToDest(nullptr);
+	_vm->_map->findNearestToGob(nullptr);
+	_vm->_map->optimizePoints(nullptr, 0, 0);
 
-	_pathExistence = _vm->_map->checkDirectPath(0,
+	_pathExistence = _vm->_map->checkDirectPath(nullptr,
 			_vm->_map->_curGoblinX, _vm->_map->_curGoblinY,
 	    _pressedMapX, _pressedMapY);
 
@@ -188,7 +188,7 @@ void Goblin_v1::movePathFind(Mult::Mult_Object *obj,
 			_vm->_map->_destY = _pressedMapY;
 		} else {
 
-			if (_vm->_map->checkDirectPath(0, _vm->_map->_curGoblinX,
+			if (_vm->_map->checkDirectPath(nullptr, _vm->_map->_curGoblinX,
 						_vm->_map->_curGoblinY, _gobDestX, _gobDestY) == 1) {
 				_vm->_map->_destX = _gobDestX;
 				_vm->_map->_destY = _gobDestY;
@@ -196,7 +196,7 @@ void Goblin_v1::movePathFind(Mult::Mult_Object *obj,
 					(_vm->_map->_curGoblinY == _vm->_map->_destY)) {
 
 				if (_vm->_map->_nearestWayPoint > _vm->_map->_nearestDest) {
-					_vm->_map->optimizePoints(0, 0, 0);
+					_vm->_map->optimizePoints(nullptr, 0, 0);
 
 					const WayPoint &wayPoint = _vm->_map->getWayPoint(_vm->_map->_nearestWayPoint);
 
@@ -206,7 +206,7 @@ void Goblin_v1::movePathFind(Mult::Mult_Object *obj,
 					if (_vm->_map->_nearestWayPoint > _vm->_map->_nearestDest)
 						_vm->_map->_nearestWayPoint--;
 				} else if (_vm->_map->_nearestWayPoint < _vm->_map->_nearestDest) {
-					_vm->_map->optimizePoints(0, 0, 0);
+					_vm->_map->optimizePoints(nullptr, 0, 0);
 
 					const WayPoint &wayPoint = _vm->_map->getWayPoint(_vm->_map->_nearestWayPoint);
 
@@ -216,7 +216,7 @@ void Goblin_v1::movePathFind(Mult::Mult_Object *obj,
 					if (_vm->_map->_nearestWayPoint < _vm->_map->_nearestDest)
 						_vm->_map->_nearestWayPoint++;
 				} else {
-					if ((_vm->_map->checkDirectPath(0, _vm->_map->_curGoblinX,
+					if ((_vm->_map->checkDirectPath(nullptr, _vm->_map->_curGoblinX,
 						_vm->_map->_curGoblinY, _gobDestX, _gobDestY) == 3) &&
 							(_vm->_map->getPass(_pressedMapX, _pressedMapY) != 0)) {
 
@@ -436,7 +436,7 @@ void Goblin_v1::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc,
 	int16 newY;
 	int16 flag;
 
-	movePathFind(0, gobDesc, nextAct);
+	movePathFind(nullptr, gobDesc, nextAct);
 
 	gobDesc->curFrame++;
 	if (gobDesc->curFrame == 1)
diff --git a/engines/gob/goblin_v2.cpp b/engines/gob/goblin_v2.cpp
index 9ce757df90..94880ff17c 100644
--- a/engines/gob/goblin_v2.cpp
+++ b/engines/gob/goblin_v2.cpp
@@ -87,7 +87,7 @@ void Goblin_v2::placeObject(Gob_Object *objDesc, char animated,
 				(_vm->_scenery->_animBottom - _vm->_scenery->_animTop) - (y + 1) / 2;
 		*obj->pPosX = x * _vm->_map->getTilesWidth();
 	} else {
-		if ((obj->goblinStates != 0) && (obj->goblinStates[state] != 0)) {
+		if ((obj->goblinStates != nullptr) && (obj->goblinStates[state] != nullptr)) {
 			layer = obj->goblinStates[state][0].layer;
 			animation = obj->goblinStates[state][0].animation;
 			objAnim->state = state;
@@ -329,7 +329,7 @@ void Goblin_v2::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc,
 	if (!obj->goblinStates)
 		return;
 
-	movePathFind(obj, 0, 0);
+	movePathFind(obj, nullptr, 0);
 	playSounds(obj);
 
 	Mult::Mult_AnimData *animData = obj->pAnimData;
diff --git a/engines/gob/goblin_v3.cpp b/engines/gob/goblin_v3.cpp
index b84f53c6f8..b120275f41 100644
--- a/engines/gob/goblin_v3.cpp
+++ b/engines/gob/goblin_v3.cpp
@@ -118,7 +118,7 @@ void Goblin_v3::placeObject(Gob_Object *objDesc, char animated,
 	if (!obj.goblinStates)
 		return;
 
-	if ((state != -1) && (obj.goblinStates[state] != 0)) {
+	if ((state != -1) && (obj.goblinStates[state] != nullptr)) {
 		if (state == 8)
 			objAnim.curLookDir = 0;
 		else if (state == 9)
diff --git a/engines/gob/goblin_v4.cpp b/engines/gob/goblin_v4.cpp
index 46dd024436..3092b21ef4 100644
--- a/engines/gob/goblin_v4.cpp
+++ b/engines/gob/goblin_v4.cpp
@@ -396,7 +396,7 @@ void Goblin_v4::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc,
 	if (!obj->goblinStates)
 		return;
 
-	movePathFind(obj, 0, 0);
+	movePathFind(obj, nullptr, 0);
 	playSounds(obj);
 
 	animData = obj->pAnimData;
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp
index b314484fdf..bb57e39d41 100644
--- a/engines/gob/hotspots.cpp
+++ b/engines/gob/hotspots.cpp
@@ -49,7 +49,7 @@ Hotspots::Hotspot::Hotspot(uint16 i,
 	funcEnter = enter;
 	funcLeave = leave;
 	funcPos   = pos;
-	script    = 0;
+	script    = nullptr;
 }
 
 void Hotspots::Hotspot::clear() {
@@ -63,7 +63,7 @@ void Hotspots::Hotspot::clear() {
 	funcEnter = 0;
 	funcLeave = 0;
 	funcPos   = 0;
-	script    = 0;
+	script    = nullptr;
 }
 
 Hotspots::Type Hotspots::Hotspot::getType() const {
@@ -1331,7 +1331,7 @@ void Hotspots::evaluateNew(uint16 i, uint16 *ids, InputDesc *inputs,
 
 	int16 key   = 0;
 	int16 flags = 0;
-	Font *font = 0;
+	Font *font = nullptr;
 	uint32 funcEnter = 0, funcLeave = 0;
 
 	if ((windowNum != 0) && (type != 0) && (type != 2))
@@ -1387,7 +1387,7 @@ void Hotspots::evaluateNew(uint16 i, uint16 *ids, InputDesc *inputs,
 		inputs[inputCount].backColor  = _vm->_game->_script->readByte();
 		inputs[inputCount].frontColor = _vm->_game->_script->readByte();
 		inputs[inputCount].length     = 0;
-		inputs[inputCount].str        = 0;
+		inputs[inputCount].str        = nullptr;
 
 		if ((type >= kTypeInput2NoLeave) && (type <= kTypeInput3Leave)) {
 			inputs[inputCount].length = _vm->_game->_script->readUint16();
@@ -1579,7 +1579,7 @@ void Hotspots::evaluate() {
 
 	_vm->_game->_script->skip(6);
 
-	setCurrentHotspot(0, 0);
+	setCurrentHotspot(nullptr, 0);
 
 	bool finishedDuration = false;
 
@@ -1642,7 +1642,7 @@ void Hotspots::evaluate() {
 		if (_hotspots[index].funcEnter != 0)
 			call(_hotspots[index].funcEnter);
 
-		setCurrentHotspot(0, 0);
+		setCurrentHotspot(nullptr, 0);
 		id = 0;
 	}
 
@@ -1765,7 +1765,7 @@ void Hotspots::oPlaytoons_F_1B() {
 	shortId = _vm->_game->_script->readValExpr();
 	var2 = _vm->_game->_script->readValExpr();
 
-	_vm->_game->_script->evalExpr(0);
+	_vm->_game->_script->evalExpr(nullptr);
 
 	fontIndex = _vm->_game->_script->readValExpr();
 	var4 = _vm->_game->_script->readValExpr();
diff --git a/engines/gob/iniconfig.cpp b/engines/gob/iniconfig.cpp
index 885495d640..f4d7cbe6bb 100644
--- a/engines/gob/iniconfig.cpp
+++ b/engines/gob/iniconfig.cpp
@@ -78,7 +78,7 @@ bool INIConfig::openConfig(const Common::String &file, Config &config) {
 
 	if (!config.config->loadFromFile(file)) {
 		delete config.config;
-		config.config = 0;
+		config.config = nullptr;
 		return false;
 	}
 
diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp
index a986d696f2..f0de969dfc 100644
--- a/engines/gob/init.cpp
+++ b/engines/gob/init.cpp
@@ -47,7 +47,7 @@ namespace Gob {
 const char *const Init::_fontNames[] = { "jeulet1.let", "jeulet2.let", "jeucar1.let", "jeumath.let" };
 
 Init::Init(GobEngine *vm) : _vm(vm) {
-	_palDesc = 0;
+	_palDesc = nullptr;
 }
 
 Init::~Init() {
@@ -112,7 +112,7 @@ void Init::initGame() {
 	_vm->_draw->_winCount = 0;
 
 	for (int i = 0; i < 8; i++)
-		_vm->_draw->_fonts[i] = 0;
+		_vm->_draw->_fonts[i] = nullptr;
 
 	if (_vm->isDemo()) {
 		doDemo();
diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp
index 2a8539846c..a0bda48a72 100644
--- a/engines/gob/inter.cpp
+++ b/engines/gob/inter.cpp
@@ -46,8 +46,8 @@ Inter::Inter(GobEngine *vm) : _vm(vm), _varStack(600) {
 		_animPalDir[i] = 0;
 	}
 
-	_breakFromLevel = 0;
-	_nestLevel = 0;
+	_breakFromLevel = nullptr;
+	_nestLevel = nullptr;
 
 	_soundEndTimeKey = 0;
 	_soundStopVal = 0;
@@ -55,7 +55,7 @@ Inter::Inter(GobEngine *vm) : _vm(vm), _varStack(600) {
 	_lastBusyWait = 0;
 	_noBusyWait = false;
 
-	_variables = 0;
+	_variables = nullptr;
 }
 
 Inter::~Inter() {
@@ -92,7 +92,7 @@ void Inter::executeOpcodeGob(int i, OpGobParams &params) {
 	debugC(1, kDebugGobOp, "opcodeGoblin %d [0x%X] (%s)",
 			i, i, getDescOpcodeGob(i));
 
-	OpcodeEntry<OpcodeGob> *op = 0;
+	OpcodeEntry<OpcodeGob> *op = nullptr;
 
 	if (_opcodesGob.contains(i))
 		op = &_opcodesGob.getVal(i);
@@ -363,7 +363,7 @@ void Inter::delocateVars() {
 		_vm->_game->deletedVars(_variables);
 
 	delete _variables;
-	_variables = 0;
+	_variables = nullptr;
 }
 
 void Inter::storeValue(uint16 index, uint16 type, uint32 value) {
@@ -386,7 +386,7 @@ void Inter::storeValue(uint16 index, uint16 type, uint32 value) {
 
 void Inter::storeValue(uint32 value) {
 	uint16 type;
-	uint16 index = _vm->_game->_script->readVarIndex(0, &type);
+	uint16 index = _vm->_game->_script->readVarIndex(nullptr, &type);
 
 	storeValue(index, type, value);
 }
@@ -431,7 +431,7 @@ void Inter::storeString(uint16 index, uint16 type, const char *value) {
 
 void Inter::storeString(const char *value) {
 	uint16 type;
-	uint16 varIndex = _vm->_game->_script->readVarIndex(0, &type);
+	uint16 varIndex = _vm->_game->_script->readVarIndex(nullptr, &type);
 
 	storeString(varIndex, type, value);
 }
diff --git a/engines/gob/inter_bargon.cpp b/engines/gob/inter_bargon.cpp
index f4a62a6a25..54b0ccdd09 100644
--- a/engines/gob/inter_bargon.cpp
+++ b/engines/gob/inter_bargon.cpp
@@ -136,7 +136,7 @@ void Inter_Bargon::oBargon_intro2(OpGobParams &params) {
 		_vm->_video->dirtyRectsAll();
 		if ((_vm->_game->checkKeys(&mouseX, &mouseY, &buttons, 0) == kKeyEscape) ||
 				_vm->shouldQuit()) {
-			_vm->_palAnim->fade(0, -2, 0);
+			_vm->_palAnim->fade(nullptr, -2, 0);
 			_vm->_draw->_frontSurface->clear();
 			memset((char *)_vm->_draw->_vgaPalette, 0, 768);
 			WRITE_VAR(4, buttons);
@@ -157,7 +157,7 @@ void Inter_Bargon::oBargon_intro2(OpGobParams &params) {
 		_vm->_sound->sampleLoad(&samples[i], SOUND_SND, sndFiles[i]);
 	_vm->_sound->blasterPlayComposition(comp, 0, samples, 4);
 	_vm->_sound->blasterWaitEndPlay(true, false);
-	_vm->_palAnim->fade(0, 0, 0);
+	_vm->_palAnim->fade(nullptr, 0, 0);
 	_vm->_draw->_frontSurface->clear();
 }
 
@@ -190,7 +190,7 @@ void Inter_Bargon::oBargon_intro3(OpGobParams &params) {
 		if ((_vm->_game->checkKeys(&mouseX, &mouseY, &buttons, 0) == kKeyEscape) ||
 				_vm->shouldQuit()) {
 			_vm->_sound->blasterStop(10);
-			_vm->_palAnim->fade(0, -2, 0);
+			_vm->_palAnim->fade(nullptr, -2, 0);
 			_vm->_draw->_frontSurface->clear();
 			memset(_vm->_draw->_vgaPalette, 0, 768);
 			WRITE_VAR(4, buttons);
diff --git a/engines/gob/inter_geisha.cpp b/engines/gob/inter_geisha.cpp
index 34d0ebcadb..390ef1da39 100644
--- a/engines/gob/inter_geisha.cpp
+++ b/engines/gob/inter_geisha.cpp
@@ -50,7 +50,7 @@ namespace Gob {
 #define OPCODEGOB(i, x)   _opcodesGob[i]._OPCODEGOB(OPCODEVER, x)
 
 Inter_Geisha::Inter_Geisha(GobEngine *vm) : Inter_v1(vm),
-	_diving(0), _penetration(0) {
+	_diving(nullptr), _penetration(nullptr) {
 
 	_diving      = new Geisha::Diving(vm);
 	_penetration = new Geisha::Penetration(vm);
diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp
index 7910bd2a62..8ad0d96088 100644
--- a/engines/gob/inter_playtoons.cpp
+++ b/engines/gob/inter_playtoons.cpp
@@ -191,7 +191,7 @@ void Inter_Playtoons::oPlaytoons_putPixel(OpFuncParams &params) {
 	_vm->_draw->_destSpriteX = _vm->_game->_script->readValExpr();
 	_vm->_draw->_destSpriteY = _vm->_game->_script->readValExpr();
 
-	_vm->_game->_script->readExpr(99, 0);
+	_vm->_game->_script->readExpr(99, nullptr);
 
 	//unk_var is always set to 0 in Playtoons
 	_vm->_draw->_frontColor = _vm->_game->_script->getResultInt() & 0xFFFF; // + unk_var;
@@ -350,7 +350,7 @@ void Inter_Playtoons::oPlaytoons_getObjAnimSize() {
 	_vm->_game->_script->evalExpr(&objIndex);
 
 	for (int i = 0; i < 4; i++)
-		readVar[i] = _vm->_game->_script->readVarIndex(0, &types[0]);
+		readVar[i] = _vm->_game->_script->readVarIndex(nullptr, &types[0]);
 
 	if (objIndex == -1) {
 		warning("oPlaytoons_getObjAnimSize case -1 not implemented");
@@ -419,7 +419,7 @@ void Inter_Playtoons::oPlaytoons_getObjAnimSize() {
 }
 
 void Inter_Playtoons::oPlaytoons_CD_20_23() {
-	_vm->_game->_script->evalExpr(0);
+	_vm->_game->_script->evalExpr(nullptr);
 }
 
 void Inter_Playtoons::oPlaytoons_CD_25() {
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index b189b1440b..8296a3b297 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -252,7 +252,7 @@ void Inter_v1::checkSwitchTable(uint32 &offset) {
 	len = _vm->_game->_script->readInt8();
 	while (len != -5) {
 		for (int i = 0; i < len; i++) {
-			_vm->_game->_script->evalExpr(0);
+			_vm->_game->_script->evalExpr(nullptr);
 
 			if (_terminate)
 				return;
@@ -471,12 +471,12 @@ void Inter_v1::o1_initMult() {
 		delete[] _vm->_mult->_objects;
 		delete[] _vm->_mult->_renderData;
 
-		_vm->_mult->_objects = 0;
-		_vm->_mult->_renderObjs = 0;
+		_vm->_mult->_objects = nullptr;
+		_vm->_mult->_renderObjs = nullptr;
 
 	}
 
-	if (_vm->_mult->_objects == 0) {
+	if (_vm->_mult->_objects == nullptr) {
 		_vm->_mult->_renderData = new int16[_vm->_mult->_objCount * 9];
 		memset(_vm->_mult->_renderData, 0,
 				_vm->_mult->_objCount * 9 * sizeof(int16));
@@ -1335,7 +1335,7 @@ void Inter_v1::o1_goblinFunc(OpFuncParams &params) {
 	int16 cmd;
 
 	gobParams.extraData = 0;
-	gobParams.objDesc = 0;
+	gobParams.objDesc = nullptr;
 	gobParams.retVarPtr.set(*_variables, 236);
 
 	cmd = _vm->_game->_script->readInt16();
@@ -1631,7 +1631,7 @@ void Inter_v1::o1_insertStr(OpFuncParams &params) {
 	int16 strVar;
 
 	strVar = _vm->_game->_script->readVarIndex();
-	_vm->_game->_script->evalExpr(0);
+	_vm->_game->_script->evalExpr(nullptr);
 	pos = _vm->_game->_script->readValExpr();
 
 	char *str = GET_VARO_FSTR(strVar);
@@ -1655,7 +1655,7 @@ void Inter_v1::o1_strstr(OpFuncParams &params) {
 	int16 pos;
 
 	strVar = _vm->_game->_script->readVarIndex();
-	_vm->_game->_script->evalExpr(0);
+	_vm->_game->_script->evalExpr(nullptr);
 	resVar = _vm->_game->_script->readVarIndex();
 
 	char *res = strstr(GET_VARO_STR(strVar), _vm->_game->_script->getResultStr());
@@ -1723,7 +1723,7 @@ void Inter_v1::o1_freeFont(OpFuncParams &params) {
 	}
 
 	delete _vm->_draw->_fonts[index];
-	_vm->_draw->_fonts[index] = 0;
+	_vm->_draw->_fonts[index] = nullptr;
 }
 
 void Inter_v1::o1_readData(OpFuncParams &params) {
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index a036cd2f69..980866b1ba 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -211,7 +211,7 @@ void Inter_v2::checkSwitchTable(uint32 &offset) {
 
 			default:
 				if (!found) {
-					_vm->_game->_script->evalExpr(0);
+					_vm->_game->_script->evalExpr(nullptr);
 					if (value == _vm->_game->_script->getResultInt())
 						found = true;
 				} else
@@ -312,12 +312,12 @@ void Inter_v2::o2_initMult() {
 		delete[] _vm->_mult->_renderObjs;
 		delete[] _vm->_mult->_orderArray;
 
-		_vm->_mult->_objects = 0;
-		_vm->_mult->_renderObjs = 0;
-		_vm->_mult->_orderArray = 0;
+		_vm->_mult->_objects = nullptr;
+		_vm->_mult->_renderObjs = nullptr;
+		_vm->_mult->_orderArray = nullptr;
 	}
 
-	if (_vm->_mult->_objects == 0) {
+	if (_vm->_mult->_objects == nullptr) {
 		_vm->_mult->_renderObjs = new Mult::Mult_Object*[_vm->_mult->_objCount];
 		memset(_vm->_mult->_renderObjs, 0,
 				_vm->_mult->_objCount * sizeof(Mult::Mult_Object*));
@@ -624,7 +624,7 @@ void Inter_v2::o2_popVars() {
 }
 
 void Inter_v2::o2_loadMapObjects() {
-	_vm->_map->loadMapObjects(0);
+	_vm->_map->loadMapObjects(nullptr);
 }
 
 void Inter_v2::o2_freeGoblins() {
@@ -773,7 +773,7 @@ void Inter_v2::o2_placeGoblin() {
 	y = _vm->_game->_script->readValExpr();
 	state = _vm->_game->_script->readValExpr();
 
-	_vm->_goblin->placeObject(0, 0, index, x, y, state);
+	_vm->_goblin->placeObject(nullptr, 0, index, x, y, state);
 }
 
 void Inter_v2::o2_initScreen() {
diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp
index 91342cf326..abefb76dc7 100644
--- a/engines/gob/inter_v5.cpp
+++ b/engines/gob/inter_v5.cpp
@@ -223,14 +223,14 @@ void Inter_v5::o5_istrlen(OpFuncParams &params) {
 		_vm->_game->_script->skip(1);
 
 		strVar1 = _vm->_game->_script->readVarIndex();
-		strVar2 = _vm->_game->_script->readVarIndex(0, &type);
+		strVar2 = _vm->_game->_script->readVarIndex(nullptr, &type);
 
 		len = _vm->_draw->stringLength(GET_VARO_STR(strVar1), READ_VARO_UINT16(strVar2));
 
 	} else {
 
 		strVar1 = _vm->_game->_script->readVarIndex();
-		strVar2 = _vm->_game->_script->readVarIndex(0, &type);
+		strVar2 = _vm->_game->_script->readVarIndex(nullptr, &type);
 
 		if (_vm->_global->_language == 10) {
 			// Extra handling for Japanese strings
diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp
index 8ba7e8f19f..246d3deb2c 100644
--- a/engines/gob/inter_v6.cpp
+++ b/engines/gob/inter_v6.cpp
@@ -264,7 +264,7 @@ void Inter_v6::o6_assign(OpFuncParams &params) {
 
 		_vm->_game->_script->push();
 
-		src = _vm->_game->_script->readVarIndex(&size, 0);
+		src = _vm->_game->_script->readVarIndex(&size, nullptr);
 
 		memcpy(_vm->_inter->_variables->getAddressOff8(dest),
 				_vm->_inter->_variables->getAddressOff8((uint16) src), size * 4);
diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp
index efc281b10c..9cf4373816 100644
--- a/engines/gob/inter_v7.cpp
+++ b/engines/gob/inter_v7.cpp
@@ -46,7 +46,7 @@ namespace Gob {
 #define OPCODEFUNC(i, x)  _opcodesFunc[i]._OPCODEFUNC(OPCODEVER, x)
 #define OPCODEGOB(i, x)   _opcodesGob[i]._OPCODEGOB(OPCODEVER, x)
 
-Inter_v7::Inter_v7(GobEngine *vm) : Inter_Playtoons(vm), _cursors(0) {
+Inter_v7::Inter_v7(GobEngine *vm) : Inter_Playtoons(vm), _cursors(nullptr) {
 }
 
 Inter_v7::~Inter_v7() {
@@ -175,15 +175,15 @@ void Inter_v7::o7_loadCursor() {
 		return;
 	}
 
-	Graphics::WinCursorGroup *cursorGroup = 0;
-	Graphics::Cursor *defaultCursor = 0;
+	Graphics::WinCursorGroup *cursorGroup = nullptr;
+	Graphics::Cursor *defaultCursor = nullptr;
 
 	// Load the cursor file and cursor group
 	if (loadCursorFile())
 		cursorGroup = Graphics::WinCursorGroup::createCursorGroup(_cursors, Common::WinResourceID(cursorName));
 
 	// If the requested cursor does not exist, create a default one
-	const Graphics::Cursor *cursor = 0;
+	const Graphics::Cursor *cursor = nullptr;
 	if (!cursorGroup || cursorGroup->cursors.empty() || !cursorGroup->cursors[0].cursor) {
 		defaultCursor = Graphics::makeDefaultWinCursor();
 
@@ -650,7 +650,7 @@ bool Inter_v7::loadCursorFile() {
 		return true;
 
 	delete _cursors;
-	_cursors = 0;
+	_cursors = nullptr;
 
 	return false;
 }
diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp
index 1015a779b2..6b693c95b8 100644
--- a/engines/gob/map.cpp
+++ b/engines/gob/map.cpp
@@ -34,7 +34,7 @@ Map::Map(GobEngine *vm) : _vm(vm) {
 	_passWidth =  0;
 	_mapWidth  = -1;
 	_mapHeight = -1;
-	_passMap   =  0;
+	_passMap   =  nullptr;
 
 	_screenWidth  = 0;
 	_screenHeight = 0;
@@ -47,12 +47,12 @@ Map::Map(GobEngine *vm) : _vm(vm) {
 	_mapUnknownBool = false;
 
 	_wayPointCount = 0;
-	_wayPoints = 0;
+	_wayPoints = nullptr;
 
 	_nearestWayPoint = 0;
 	_nearestDest     = 0;
 
-	_itemsMap = 0;
+	_itemsMap = nullptr;
 
 	for (int i = 0; i < 40; i++) {
 		_itemPoses[i].x      = 0;
@@ -514,7 +514,7 @@ int16 Map::checkLongPath(int16 x0, int16 y0, int16 x1, int16 y1, int16 i0, int16
 			nextLink = 1;
 
 		if (nextLink != 0) {
-			if (checkDirectPath(0, x0, y0, x1, y1) == 1)
+			if (checkDirectPath(nullptr, x0, y0, x1, y1) == 1)
 				return 1;
 
 			nextLink = 0;
@@ -533,7 +533,7 @@ int16 Map::checkLongPath(int16 x0, int16 y0, int16 x1, int16 y1, int16 i0, int16
 		}
 		if ((i0 == i1) && (_wayPoints[i0].x == x0) &&
 		    (_wayPoints[i0].y == y0)) {
-			if (checkDirectPath(0, x0, y0, x1, y1) == 1)
+			if (checkDirectPath(nullptr, x0, y0, x1, y1) == 1)
 				return 1;
 			return 0;
 		}
diff --git a/engines/gob/map_v1.cpp b/engines/gob/map_v1.cpp
index 0de0abfd1b..945537a2ea 100644
--- a/engines/gob/map_v1.cpp
+++ b/engines/gob/map_v1.cpp
@@ -191,7 +191,7 @@ void Map_v1::loadGoblins(Common::SeekableReadStream &data, uint32 gobsPos) {
 				new Goblin::Gob_StateLine[linesCount];
 		for (int state = 0; state < linesCount; ++state)
 			for (int col = 0; col < 6; ++col)
-				_vm->_goblin->_goblins[i]->stateMach[state][col] = 0;
+				_vm->_goblin->_goblins[i]->stateMach[state][col] = nullptr;
 
 		for (int state = 0; state < 40; ++state)
 			for (int col = 0; col < 6; ++col)
@@ -206,7 +206,7 @@ void Map_v1::loadGoblins(Common::SeekableReadStream &data, uint32 gobsPos) {
 		for (int state = 0; state < 40; state++) {
 			for (int col = 0; col < 6; col++) {
 				if (tmpStateData[state * 6 + col] == 0) {
-					_vm->_goblin->_goblins[i]->stateMach[state][col] = 0;
+					_vm->_goblin->_goblins[i]->stateMach[state][col] = nullptr;
 					continue;
 				}
 
@@ -265,7 +265,7 @@ void Map_v1::loadGoblins(Common::SeekableReadStream &data, uint32 gobsPos) {
 		pState = new Goblin::Gob_State;
 		memset(pState, 0, sizeof(Goblin::Gob_State));
 		_vm->_goblin->_goblins[3]->stateMach[state][0] = pState;
-		_vm->_goblin->_goblins[3]->stateMach[state][1] = 0;
+		_vm->_goblin->_goblins[3]->stateMach[state][1] = nullptr;
 
 		pState->animation = 9;
 		pState->layer = state - 40;
@@ -295,7 +295,7 @@ void Map_v1::loadObjects(Common::SeekableReadStream &data, uint32 objsPos) {
 		_vm->_goblin->_objects[i]->stateMach = new Goblin::Gob_StateLine[40];
 		for (int state = 0; state < 40; ++state) {
 			for (int col = 0; col < 6; ++col) {
-				_vm->_goblin->_objects[i]->stateMach[state][col] = 0;
+				_vm->_goblin->_objects[i]->stateMach[state][col] = nullptr;
 				tmpStateData[state * 6 + col] = data.readUint32LE();
 			}
 		}
@@ -309,7 +309,7 @@ void Map_v1::loadObjects(Common::SeekableReadStream &data, uint32 objsPos) {
 		for (int state = 0; state < 40; state++) {
 			for (int col = 0; col < 6; col++) {
 				if (tmpStateData[state * 6 + col] == 0) {
-					_vm->_goblin->_objects[i]->stateMach[state][col] = 0;
+					_vm->_goblin->_objects[i]->stateMach[state][col] = nullptr;
 					continue;
 				}
 
@@ -343,7 +343,7 @@ void Map_v1::loadObjects(Common::SeekableReadStream &data, uint32 objsPos) {
 	_vm->_goblin->_objects[10]->stateMach = new Goblin::Gob_StateLine[40];
 	for (int state = 0; state < 40; ++state)
 		for (int col = 0; col < 6; ++col)
-			_vm->_goblin->_objects[10]->stateMach[state][col] = 0;
+			_vm->_goblin->_objects[10]->stateMach[state][col] = nullptr;
 
 	pState = new Goblin::Gob_State;
 	memset(pState, 0, sizeof(Goblin::Gob_State));
@@ -379,13 +379,13 @@ void Map_v1::loadItemToObject(Common::SeekableReadStream &data) {
 void Map_v1::optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y) {
 	if (_nearestWayPoint < _nearestDest) {
 		for (int i = _nearestWayPoint; i <= _nearestDest; i++) {
-			if (checkDirectPath(0, _curGoblinX, _curGoblinY,
+			if (checkDirectPath(nullptr, _curGoblinX, _curGoblinY,
 				_wayPoints[i].x, _wayPoints[i].y) == 1)
 				_nearestWayPoint = i;
 		}
 	} else if (_nearestWayPoint > _nearestDest) {
 		for (int i = _nearestWayPoint; i >= _nearestDest; i--) {
-			if (checkDirectPath(0, _curGoblinX, _curGoblinY,
+			if (checkDirectPath(nullptr, _curGoblinX, _curGoblinY,
 				_wayPoints[i].x, _wayPoints[i].y) == 1)
 				_nearestWayPoint = i;
 		}
diff --git a/engines/gob/map_v2.cpp b/engines/gob/map_v2.cpp
index 370e62c88f..e6d87204ce 100644
--- a/engines/gob/map_v2.cpp
+++ b/engines/gob/map_v2.cpp
@@ -39,7 +39,7 @@ Map_v2::Map_v2(GobEngine *vm) : Map_v1(vm) {
 }
 
 Map_v2::~Map_v2() {
-	_passMap = 0;
+	_passMap = nullptr;
 }
 
 void Map_v2::loadMapObjects(const char *avjFile) {
@@ -156,7 +156,7 @@ void Map_v2::loadMapObjects(const char *avjFile) {
 	// In the original asm, this writes byte-wise into the variables-array
 	tmpPos = mapData.pos();
 	mapData.seek(passPos);
-	if ((variables != 0) &&
+	if ((variables != nullptr) &&
 	    (variables != _vm->_inter->_variables->getAddressOff8(0))) {
 
 		_passMap = (int8 *)variables;
diff --git a/engines/gob/metaengine.cpp b/engines/gob/metaengine.cpp
index 1d99d2b92e..bce3dd3455 100644
--- a/engines/gob/metaengine.cpp
+++ b/engines/gob/metaengine.cpp
@@ -64,12 +64,12 @@ Common::Error GobMetaEngine::createInstance(OSystem *syst, Engine **engine, cons
 namespace Gob {
 
 void GobEngine::initGame(const GOBGameDescription *gd) {
-	if (gd->startTotBase == 0)
+	if (gd->startTotBase == nullptr)
 		_startTot = "intro.tot";
 	else
 		_startTot = gd->startTotBase;
 
-	if (gd->startStkBase == 0)
+	if (gd->startStkBase == nullptr)
 		_startStk = "intro.stk";
 	else
 		_startStk = gd->startStkBase;
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp
index 37ef291a93..b1902aad97 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -90,9 +90,9 @@ const Diving::PlantLevel Diving::kPlantLevels[] = {
 };
 
 
-Diving::Diving(GobEngine *vm) : _vm(vm), _background(0),
-	_objects(0), _gui(0), _okoAnim(0), _water(0), _lungs(0), _heart(0),
-	_blackPearl(0), _airMeter(0), _healthMeter(0), _isPlaying(false) {
+Diving::Diving(GobEngine *vm) : _vm(vm), _background(nullptr),
+	_objects(nullptr), _gui(nullptr), _okoAnim(nullptr), _water(nullptr), _lungs(nullptr), _heart(nullptr),
+	_blackPearl(nullptr), _airMeter(nullptr), _healthMeter(nullptr), _isPlaying(false) {
 
 	_blackPearl = new Surface(11, 8, 1);
 
@@ -100,20 +100,20 @@ Diving::Diving(GobEngine *vm) : _vm(vm), _background(0),
 	_healthMeter = new Meter(275, 195, 40, 2, 6, 7,  4, Meter::kFillToLeft);
 
 	for (uint i = 0; i < kEvilFishCount; i++)
-		_evilFish[i].evilFish = 0;
+		_evilFish[i].evilFish = nullptr;
 
 	for (uint i = 0; i < kDecorFishCount; i++)
-		_decorFish[i].decorFish = 0;
+		_decorFish[i].decorFish = nullptr;
 
 	for (uint i = 0; i < kPlantCount; i++)
-		_plant[i].plant = 0;
+		_plant[i].plant = nullptr;
 
 	for (uint i = 0; i < kMaxShotCount; i++)
-		_shot[i] = 0;
+		_shot[i] = nullptr;
 
-	_pearl.pearl = 0;
+	_pearl.pearl = nullptr;
 
-	_oko = 0;
+	_oko = nullptr;
 }
 
 Diving::~Diving() {
@@ -130,7 +130,7 @@ bool Diving::play(uint16 playerCount, bool hasPearlLocation) {
 	_isPlaying = true;
 
 	// Fade to black
-	_vm->_palAnim->fade(0, 0, 0);
+	_vm->_palAnim->fade(nullptr, 0, 0);
 
 	// Initialize our playing field
 	init();
@@ -338,32 +338,32 @@ void Diving::deinit() {
 	for (uint i = 0; i < kMaxShotCount; i++) {
 		delete _shot[i];
 
-		_shot[i] = 0;
+		_shot[i] = nullptr;
 	}
 
 	for (uint i = 0; i < kEvilFishCount; i++) {
 		delete _evilFish[i].evilFish;
 
-		_evilFish[i].evilFish = 0;
+		_evilFish[i].evilFish = nullptr;
 	}
 
 	for (uint i = 0; i < kDecorFishCount; i++) {
 		delete _decorFish[i].decorFish;
 
-		_decorFish[i].decorFish = 0;
+		_decorFish[i].decorFish = nullptr;
 	}
 
 	for (uint i = 0; i < kPlantCount; i++) {
 		delete _plant[i].plant;
 
-		_plant[i].plant = 0;
+		_plant[i].plant = nullptr;
 	}
 
 	delete _pearl.pearl;
-	_pearl.pearl = 0;
+	_pearl.pearl = nullptr;
 
 	delete _oko;
-	_oko = 0;
+	_oko = nullptr;
 
 	delete _heart;
 	delete _lungs;
@@ -374,14 +374,14 @@ void Diving::deinit() {
 	delete _objects;
 	delete _background;
 
-	_water = 0;
-	_heart = 0;
-	_lungs = 0;
+	_water = nullptr;
+	_heart = nullptr;
+	_lungs = nullptr;
 
-	_okoAnim    = 0;
-	_gui        = 0;
-	_objects    = 0;
-	_background = 0;
+	_okoAnim    = nullptr;
+	_gui        = nullptr;
+	_objects    = nullptr;
+	_background = nullptr;
 }
 
 void Diving::initScreen() {
diff --git a/engines/gob/minigames/geisha/meter.cpp b/engines/gob/minigames/geisha/meter.cpp
index b7a3bc6cd3..33290b21eb 100644
--- a/engines/gob/minigames/geisha/meter.cpp
+++ b/engines/gob/minigames/geisha/meter.cpp
@@ -34,7 +34,7 @@ Meter::Meter(int16 x, int16 y, int16 width, int16 height, uint8 frontColor,
 			 uint8 backColor, int32 maxValue, Direction direction) :
 	_x(x), _y(y), _width(width), _height(height), _frontColor(frontColor),
 	_backColor(backColor), _value(0), _maxValue(maxValue), _direction(direction),
-	_needUpdate(true), _surface(0) {
+	_needUpdate(true), _surface(nullptr) {
 
 }
 
diff --git a/engines/gob/minigames/geisha/penetration.cpp b/engines/gob/minigames/geisha/penetration.cpp
index 549dfc6e2e..d11c2029f4 100644
--- a/engines/gob/minigames/geisha/penetration.cpp
+++ b/engines/gob/minigames/geisha/penetration.cpp
@@ -412,7 +412,7 @@ bool Penetration::MapObject::isIn(const MapObject &obj) const {
 
 
 Penetration::ManagedMouth::ManagedMouth(uint16 tX, uint16 tY, MouthType t) :
-	MapObject(tX, tY, 0, 0), mouth(0), type(t) {
+	MapObject(tX, tY, 0, 0), mouth(nullptr), type(t) {
 
 }
 
@@ -422,7 +422,7 @@ Penetration::ManagedMouth::~ManagedMouth() {
 
 
 Penetration::ManagedSub::ManagedSub(uint16 tX, uint16 tY) :
-	MapObject(tX, tY, kMapTileWidth, kMapTileHeight), sub(0) {
+	MapObject(tX, tY, kMapTileWidth, kMapTileHeight), sub(nullptr) {
 
 }
 
@@ -431,7 +431,7 @@ Penetration::ManagedSub::~ManagedSub() {
 }
 
 
-Penetration::ManagedEnemy::ManagedEnemy() : MapObject(0, 0, 0, 0), enemy(0), dead(false) {
+Penetration::ManagedEnemy::ManagedEnemy() : MapObject(0, 0, 0, 0), enemy(nullptr), dead(false) {
 }
 
 Penetration::ManagedEnemy::~ManagedEnemy() {
@@ -441,11 +441,11 @@ Penetration::ManagedEnemy::~ManagedEnemy() {
 void Penetration::ManagedEnemy::clear() {
 	delete enemy;
 
-	enemy = 0;
+	enemy = nullptr;
 }
 
 
-Penetration::ManagedBullet::ManagedBullet() : MapObject(0, 0, 0, 0), bullet(0) {
+Penetration::ManagedBullet::ManagedBullet() : MapObject(0, 0, 0, 0), bullet(nullptr) {
 }
 
 Penetration::ManagedBullet::~ManagedBullet() {
@@ -455,12 +455,12 @@ Penetration::ManagedBullet::~ManagedBullet() {
 void Penetration::ManagedBullet::clear() {
 	delete bullet;
 
-	bullet = 0;
+	bullet = nullptr;
 }
 
 
-Penetration::Penetration(GobEngine *vm) : _vm(vm), _background(0), _sprites(0), _objects(0), _sub(0),
-	_shieldMeter(0), _healthMeter(0), _floor(0), _isPlaying(false) {
+Penetration::Penetration(GobEngine *vm) : _vm(vm), _background(nullptr), _sprites(nullptr), _objects(nullptr), _sub(nullptr),
+	_shieldMeter(nullptr), _healthMeter(nullptr), _floor(0), _isPlaying(false) {
 
 	_background = new Surface(320, 200, 1);
 
@@ -587,8 +587,8 @@ void Penetration::deinit() {
 	delete _objects;
 	delete _sprites;
 
-	_objects = 0;
-	_sprites = 0;
+	_objects = nullptr;
+	_sprites = nullptr;
 }
 
 void Penetration::clearMap() {
@@ -609,7 +609,7 @@ void Penetration::clearMap() {
 
 	delete _sub;
 
-	_sub = 0;
+	_sub = nullptr;
 
 	_map->fill(kColorBlack);
 }
@@ -773,7 +773,7 @@ void Penetration::drawFloorText() {
 
 	const char **strings = kStrings[getLanguage()];
 
-	const char *floorString = 0;
+	const char *floorString = nullptr;
 	if      (_floor == 0)
 		floorString = strings[kString3rdBasement];
 	else if (_floor == 1)
@@ -840,7 +840,7 @@ void Penetration::fadeIn() {
 
 void Penetration::setPalette() {
 	// Fade to black
-	_vm->_palAnim->fade(0, 0, 0);
+	_vm->_palAnim->fade(nullptr, 0, 0);
 
 	// Set palette
 	memcpy(_vm->_draw->_vgaPalette, kPalettes[_floor], 3 * kPaletteSize);
@@ -1049,7 +1049,7 @@ bool Penetration::isBlocked(const MapObject &self, int16 x, int16 y, MapObject *
 
 void Penetration::findPath(MapObject &obj, int x, int y, MapObject **blockedBy) {
 	if (blockedBy)
-		*blockedBy = 0;
+		*blockedBy = nullptr;
 
 	while ((x != 0) || (y != 0)) {
 		uint16 oldX = obj.mapX;
diff --git a/engines/gob/mult.cpp b/engines/gob/mult.cpp
index d4e3067c4e..054da089d2 100644
--- a/engines/gob/mult.cpp
+++ b/engines/gob/mult.cpp
@@ -39,33 +39,33 @@
 namespace Gob {
 
 Mult::Mult(GobEngine *vm) : _vm(vm) {
-	_multData = 0;
+	_multData = nullptr;
 
 	_frame = 0;
 
 	_objCount = 0;
-	_objects = 0;
+	_objects = nullptr;
 
-	_renderData = 0;
-	_renderObjs = 0;
+	_renderData = nullptr;
+	_renderObjs = nullptr;
 
-	_orderArray = 0;
+	_orderArray = nullptr;
 
 	_index = 0;
 	_counter = 0;
 	_animDataAllocated = false;
 
 	for (int i = 0; i < 8; i++)
-		_multDatas[i] = 0;
+		_multDatas[i] = nullptr;
 
 	_doPalSubst = false;
 
-	_animArrayX = 0;
-	_animArrayY = 0;
-	_animArrayData = 0;
+	_animArrayX = nullptr;
+	_animArrayY = nullptr;
+	_animArrayData = nullptr;
 
 	_palKeyIndex = 0;
-	_oldPalette = 0;
+	_oldPalette = nullptr;
 	for (int i = 0; i < 256; i++) {
 		_palAnimPalette[i].red = 0;
 		_palAnimPalette[i].green = 0;
@@ -107,9 +107,9 @@ Mult::~Mult() {
 }
 
 void Mult::initAll() {
-	_objects = 0;
+	_objects = nullptr;
 	_animSurf.reset();
-	_renderData = 0;
+	_renderData = nullptr;
 
 	_vm->_scenery->init();
 }
@@ -137,10 +137,10 @@ void Mult::freeMult() {
 	delete[] _renderObjs;
 	delete[] _orderArray;
 
-	_objects = 0;
-	_renderData = 0;
-	_renderObjs = 0;
-	_orderArray = 0;
+	_objects = nullptr;
+	_renderData = nullptr;
+	_renderObjs = nullptr;
+	_orderArray = nullptr;
 
 	_animSurf.reset();
 	_vm->_draw->freeSprite(Draw::kAnimSurface);
@@ -152,7 +152,7 @@ void Mult::checkFreeMult() {
 }
 
 void Mult::zeroMultData() {
-	_multData = 0;
+	_multData = nullptr;
 }
 
 void Mult::playMult(int16 startFrame, int16 endFrame, char checkEscape,
@@ -226,13 +226,13 @@ void Mult::playMult(int16 startFrame, int16 endFrame, char checkEscape,
 			delete[] _animArrayData;
 			delete[] _orderArray;
 
-			_objects = 0;
-			_renderObjs = 0;
-			_renderData = 0;
-			_animArrayX = 0;
-			_animArrayY = 0;
-			_animArrayData = 0;
-			_orderArray = 0;
+			_objects = nullptr;
+			_renderObjs = nullptr;
+			_renderData = nullptr;
+			_animArrayX = nullptr;
+			_animArrayY = nullptr;
+			_animArrayData = nullptr;
+			_orderArray = nullptr;
 
 			_animSurf.reset();
 			_vm->_draw->freeSprite(Draw::kAnimSurface);
diff --git a/engines/gob/mult_v1.cpp b/engines/gob/mult_v1.cpp
index b09ea0533c..53afacbcca 100644
--- a/engines/gob/mult_v1.cpp
+++ b/engines/gob/mult_v1.cpp
@@ -229,11 +229,11 @@ void Mult_v1::freeMultKeys() {
 		delete _animArrayY;
 		delete[] _animArrayData;
 
-		_objects = 0;
-		_renderData = 0;
-		_animArrayX = 0;
-		_animArrayY = 0;
-		_animArrayData = 0;
+		_objects = nullptr;
+		_renderData = nullptr;
+		_animArrayX = nullptr;
+		_animArrayY = nullptr;
+		_animArrayData = nullptr;
 
 		_animSurf.reset();
 		_vm->_draw->freeSprite(Draw::kAnimSurface);
@@ -242,7 +242,7 @@ void Mult_v1::freeMultKeys() {
 	}
 
 	delete _multData;
-	_multData = 0;
+	_multData = nullptr;
 }
 
 bool Mult_v1::hasMultData(uint16 multIndex) {
diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp
index 4ba76b2367..fe8dd65c9a 100644
--- a/engines/gob/mult_v2.cpp
+++ b/engines/gob/mult_v2.cpp
@@ -41,10 +41,10 @@
 namespace Gob {
 
 Mult_v2::Mult_v2(GobEngine *vm) : Mult_v1(vm) {
-	_renderObjs = 0;
-	_multData = 0;
+	_renderObjs = nullptr;
+	_multData = nullptr;
 	for (int i = 0; i < 8; i++)
-		_multDatas[i] = 0;
+		_multDatas[i] = nullptr;
 }
 
 Mult_v2::~Mult_v2() {
@@ -127,7 +127,7 @@ void Mult_v2::loadMult(int16 resId) {
 
 	for (int i = 0; i < 4; i++) {
 		_multData->imdKeysCount[i] = 0;
-		_multData->imdKeys[i] = 0;
+		_multData->imdKeys[i] = nullptr;
 		_multData->imdIndices[i] = -1;
 
 		for (int j = 0; j < 4; j++) {
@@ -237,8 +237,8 @@ void Mult_v2::loadMult(int16 resId) {
 		}
 	}
 
-	_multData->imdFiles = 0;
-	_multData->somepointer10 = 0;
+	_multData->imdFiles = nullptr;
+	_multData->somepointer10 = nullptr;
 
 	if (hasImds)
 		loadImds(data);
@@ -346,26 +346,26 @@ void Mult_v2::freeMultKeys() {
 		delete _animArrayY;
 		delete[] _animArrayData;
 
-		_animArrayX = 0;
-		_animArrayY = 0;
-		_animArrayData = 0;
+		_animArrayX = nullptr;
+		_animArrayY = nullptr;
+		_animArrayData = nullptr;
 
 		_animDataAllocated = false;
 	}
 
 	for (int i = 0; i < 8; i++)
 		if (_multDatas[i] == _multData)
-			_multDatas[i] = 0;
+			_multDatas[i] = nullptr;
 
 	delete _multData;
-	_multData = 0;
+	_multData = nullptr;
 }
 
 bool Mult_v2::hasMultData(uint16 multIndex) {
 	if (multIndex > 7)
 		error("Multindex out of range");
 
-	return _multDatas[multIndex] != 0;
+	return _multDatas[multIndex] != nullptr;
 }
 
 void Mult_v2::setMultData(uint16 multIndex) {
@@ -380,7 +380,7 @@ void Mult_v2::zeroMultData(uint16 multIndex) {
 	if (multIndex > 7)
 		error("Multindex out of range");
 
-	_multDatas[multIndex] = 0;
+	_multDatas[multIndex] = nullptr;
 }
 
 void Mult_v2::multSub(uint16 multIndex) {
@@ -689,7 +689,7 @@ void Mult_v2::drawAnims(bool &stop) {
 
 void Mult_v2::newCycleAnim(Mult_Object &animObj) {
 	Mult_AnimData &animData = *(animObj.pAnimData);
-	Scenery::AnimLayer *animLayer = 0;
+	Scenery::AnimLayer *animLayer = nullptr;
 
 	if (animData.animation >= 0) {
 		int nAnim = animData.animation, nLayer = animData.layer;
@@ -817,7 +817,7 @@ void Mult_v2::animate() {
 			return;
 		orderArray = _orderArray;
 	} else
-		orderArray = 0;
+		orderArray = nullptr;
 
 	advanceAllObjects();
 
@@ -1066,7 +1066,7 @@ void Mult_v2::animate() {
 			if ((animData.animType < 100) || (_vm->_goblin->_gobsCount < 0))
 				newCycleAnim(animObj);
 			else if (animData.animType == 100)
-				_vm->_goblin->moveAdvance(&animObj, 0, 0, 0);
+				_vm->_goblin->moveAdvance(&animObj, nullptr, 0, 0);
 			else if (animData.animType == 101)
 				_vm->_goblin->animate(&animObj);
 		} else
diff --git a/engines/gob/palanim.cpp b/engines/gob/palanim.cpp
index eed97ecaa6..72d6cb213d 100644
--- a/engines/gob/palanim.cpp
+++ b/engines/gob/palanim.cpp
@@ -114,9 +114,9 @@ void PalAnim::fade(Video::PalDesc *palDesc, int16 fadeV, int16 allColors) {
 	int colorCount = _vm->_global->_setAllPalette ? _vm->_global->_colorCount : 256;
 
 	for (int i = 0; i < colorCount; i++) {
-		_toFadeRed  [i] = (palDesc == 0) ? 0 : palDesc->vgaPal[i].red;
-		_toFadeGreen[i] = (palDesc == 0) ? 0 : palDesc->vgaPal[i].green;
-		_toFadeBlue [i] = (palDesc == 0) ? 0 : palDesc->vgaPal[i].blue;
+		_toFadeRed  [i] = (palDesc == nullptr) ? 0 : palDesc->vgaPal[i].red;
+		_toFadeGreen[i] = (palDesc == nullptr) ? 0 : palDesc->vgaPal[i].green;
+		_toFadeBlue [i] = (palDesc == nullptr) ? 0 : palDesc->vgaPal[i].blue;
 	}
 
 	if (allColors == 0) {
diff --git a/engines/gob/pregob/onceupon/onceupon.cpp b/engines/gob/pregob/onceupon/onceupon.cpp
index d53dea83bd..9df09c010c 100644
--- a/engines/gob/pregob/onceupon/onceupon.cpp
+++ b/engines/gob/pregob/onceupon/onceupon.cpp
@@ -169,7 +169,7 @@ OnceUpon::ScreenBackup::~ScreenBackup() {
 
 
 OnceUpon::OnceUpon(GobEngine *vm) : PreGob(vm), _openedArchives(false),
-	_jeudak(0), _lettre(0), _plettre(0), _glettre(0) {
+	_jeudak(nullptr), _lettre(nullptr), _plettre(nullptr), _glettre(nullptr) {
 
 }
 
@@ -200,7 +200,7 @@ void OnceUpon::init() {
 
 	if (!_jeudak || !_lettre || !_plettre || !_glettre)
 		error("OnceUpon::OnceUpon(): Failed to fonts (%d, %d, %d, %d)",
-		      _jeudak != 0, _lettre != 0, _plettre != 0, _glettre != 0);
+		      _jeudak != nullptr, _lettre != nullptr, _plettre != nullptr, _glettre != nullptr);
 
 	// Verify the language
 
@@ -250,10 +250,10 @@ void OnceUpon::deinit() {
 	delete _plettre;
 	delete _glettre;
 
-	_jeudak  = 0;
-	_lettre  = 0;
-	_plettre = 0;
-	_glettre = 0;
+	_jeudak  = nullptr;
+	_lettre  = nullptr;
+	_plettre = nullptr;
+	_glettre = nullptr;
 
 	// Close archives
 
diff --git a/engines/gob/pregob/onceupon/parents.cpp b/engines/gob/pregob/onceupon/parents.cpp
index 4858e2750a..45c1984443 100644
--- a/engines/gob/pregob/onceupon/parents.cpp
+++ b/engines/gob/pregob/onceupon/parents.cpp
@@ -59,7 +59,7 @@ Parents::Parents(GobEngine *vm, const Common::String &seq, const Common::String
 				 const Common::String &childName, uint8 house, const Font &font,
 				 const byte *normalPalette, const byte *brightPalette, uint paletteSize) :
 	SEQFile(vm, seq),
-	_gct(0), _house(house), _font(&font),
+	_gct(nullptr), _house(house), _font(&font),
 	_paletteSize(paletteSize), _normalPalette(normalPalette), _brightPalette(brightPalette) {
 
 	// Load sounds
@@ -96,7 +96,7 @@ void Parents::play() {
 
 	// After playback, fade out
 	if (!_vm->shouldQuit())
-		_vm->_palAnim->fade(0, 0, 0);
+		_vm->_palAnim->fade(nullptr, 0, 0);
 }
 
 void Parents::handleFrameEvent() {
diff --git a/engines/gob/pregob/onceupon/title.cpp b/engines/gob/pregob/onceupon/title.cpp
index 2e8fed80b3..a31a59141b 100644
--- a/engines/gob/pregob/onceupon/title.cpp
+++ b/engines/gob/pregob/onceupon/title.cpp
@@ -44,7 +44,7 @@ void Title::play() {
 
 	// After playback, fade out and stop the music
 	if (!_vm->shouldQuit())
-		_vm->_palAnim->fade(0, 0, 0);
+		_vm->_palAnim->fade(nullptr, 0, 0);
 
 	stopMusic();
 }
diff --git a/engines/gob/pregob/pregob.cpp b/engines/gob/pregob/pregob.cpp
index 78afa85768..d3ee5ec5cc 100644
--- a/engines/gob/pregob/pregob.cpp
+++ b/engines/gob/pregob/pregob.cpp
@@ -55,7 +55,7 @@ void PreGob::fadeOut() {
 		return;
 
 	// Fade to black
-	_vm->_palAnim->fade(0, 0, 0);
+	_vm->_palAnim->fade(nullptr, 0, 0);
 
 	_fadedOut = true;
 }
@@ -104,7 +104,7 @@ void PreGob::setPalette(const byte *palette, uint16 size) {
 }
 
 void PreGob::addCursor() {
-	CursorMan.pushCursor(0, 0, 0, 0, 0, 0);
+	CursorMan.pushCursor(nullptr, 0, 0, 0, 0, 0);
 }
 
 void PreGob::removeCursor() {
diff --git a/engines/gob/pregob/seqfile.cpp b/engines/gob/pregob/seqfile.cpp
index 7cf5b16724..9abd800697 100644
--- a/engines/gob/pregob/seqfile.cpp
+++ b/engines/gob/pregob/seqfile.cpp
@@ -36,7 +36,7 @@ namespace Gob {
 
 SEQFile::SEQFile(GobEngine *vm, const Common::String &fileName) : _vm(vm) {
 	for (uint i = 0; i < kObjectCount; i++)
-		_objects[i].object = 0;
+		_objects[i].object = nullptr;
 
 	Common::SeekableReadStream *seq = _vm->_dataIO->getFile(Util::setExtension(fileName, ".SEQ"));
 	if (!seq) {
@@ -137,7 +137,7 @@ const ANIFile *SEQFile::findANI(uint16 index, uint16 &animation) {
 
 	// 0xFFFF = remove animation
 	if (index == 0xFFFF)
-		return 0;
+		return nullptr;
 
 	for (Animations::const_iterator a = _animations.begin(); a != _animations.end(); ++a) {
 		if (index < (*a)->getAnimationCount()) {
@@ -148,7 +148,7 @@ const ANIFile *SEQFile::findANI(uint16 index, uint16 &animation) {
 		index -= (*a)->getAnimationCount();
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void SEQFile::play(bool abortable, uint16 endFrame, uint16 frameRate) {
@@ -164,7 +164,7 @@ void SEQFile::play(bool abortable, uint16 endFrame, uint16 frameRate) {
 	for (uint i = 0; i < kObjectCount; i++) {
 		delete _objects[i].object;
 
-		_objects[i].object = 0;
+		_objects[i].object = nullptr;
 		_objects[i].order  = 0;
 	}
 
@@ -253,7 +253,7 @@ void SEQFile::playFrame() {
 		Object &object = _objects[a->object];
 
 		delete object.object;
-		object.object = 0;
+		object.object = nullptr;
 
 		// No valid animation => remove
 		if ((a->animation == 0xFFFF) || !a->ani)
diff --git a/engines/gob/resources.cpp b/engines/gob/resources.cpp
index 9755bf9db1..e9db1c92dc 100644
--- a/engines/gob/resources.cpp
+++ b/engines/gob/resources.cpp
@@ -100,7 +100,7 @@ Common::SeekableReadStream *TextItem::stream() const {
 Resources::TOTResourceTable::TOTResourceTable() {
 	itemsCount = 0;
 	unknown    = (byte)0;
-	items      = NULL;
+	items      = nullptr;
 	dataOffset = 0u;
 }
 
@@ -112,7 +112,7 @@ Resources::TOTResourceTable::~TOTResourceTable() {
 Resources::EXTResourceTable::EXTResourceTable() {
 	itemsCount = 0;
 	unknown    = 0;
-	items      = 0;
+	items      = nullptr;
 }
 
 Resources::EXTResourceTable::~EXTResourceTable() {
@@ -123,9 +123,9 @@ Resources::EXTResourceTable::~EXTResourceTable() {
 Resources::TOTTextTable::TOTTextTable() {
 	needFree   = false;
 	itemsCount = 0;
-	data       = NULL;
+	data       = nullptr;
 	size       = 0;
-	items      = NULL;
+	items      = nullptr;
 }
 
 Resources::TOTTextTable::~TOTTextTable() {
@@ -163,12 +163,12 @@ bool Resources::load(const Common::String &fileName) {
 
 	if (!hasTOTRes) {
 		delete _totResourceTable;
-		_totResourceTable = 0;
+		_totResourceTable = nullptr;
 	}
 
 	if (!hasEXTRes) {
 		delete _extResourceTable;
-		_extResourceTable = 0;
+		_extResourceTable = nullptr;
 	}
 
 	if (!hasTOTRes && !hasEXTRes)
@@ -211,18 +211,18 @@ void Resources::unload(bool del) {
 		_exFile.clear();
 	}
 
-	_totResourceTable = 0;
-	_extResourceTable = 0;
-	_totTextTable = 0;
+	_totResourceTable = nullptr;
+	_extResourceTable = nullptr;
+	_totTextTable = nullptr;
 	_totResStart = 0;
-	_totData = 0;
+	_totData = nullptr;
 	_totSize = 0;
-	_imData = 0;
+	_imData = nullptr;
 	_imSize = 0;
 }
 
 bool Resources::isLoaded() const {
-	return (_totResourceTable != 0);
+	return (_totResourceTable != nullptr);
 }
 
 bool Resources::loadTOTResourceTable() {
@@ -414,7 +414,7 @@ bool Resources::loadIMFile() {
 	_imData = new byte[_imSize];
 	if (stream->read(_imData, _imSize) != _imSize) {
 		delete[] _imData;
-		_imData = 0;
+		_imData = nullptr;
 		_imSize = 0;
 	}
 
@@ -527,7 +527,7 @@ byte *Resources::loadTOTLocTexts(const Common::String &fileBase, int32 &size) {
 			_vm->_global->_language, _totFile.c_str());
 
 	if (locTextFile.empty())
-		return 0;
+		return nullptr;
 
 	return _vm->_dataIO->getFile(locTextFile, size);
 }
@@ -535,17 +535,17 @@ byte *Resources::loadTOTLocTexts(const Common::String &fileBase, int32 &size) {
 Resource *Resources::getResource(uint16 id, int16 *width, int16 *height) const {
 	if (_hasLOM) {
 		warning("Stub: Resources::getResource(): Has LOM");
-		return 0;
+		return nullptr;
 	}
 
-	Resource *resource = 0;
+	Resource *resource = nullptr;
 	if (id >= 30000)
 		resource = getEXTResource(id - 30000);
 	else
 		resource = getTOTResource(id);
 
 	if (!resource)
-		return 0;
+		return nullptr;
 
 	if (width)
 		*width  = resource->getWidth();
@@ -557,22 +557,22 @@ Resource *Resources::getResource(uint16 id, int16 *width, int16 *height) const {
 
 TextItem *Resources::getTextItem(uint16 id) const {
 	if (!_totTextTable || !_totTextTable->data)
-		return 0;
+		return nullptr;
 
 	if (id >= _totTextTable->itemsCount)
-		return 0;
+		return nullptr;
 
 	assert(_totTextTable->items);
 
 	TOTTextItem &totItem = _totTextTable->items[id];
 
 	if ((totItem.offset == 0xFFFF) || (totItem.size == 0))
-		return 0;
+		return nullptr;
 
 	if ((totItem.offset + totItem.size) > (_totTextTable->size)) {
 		warning("TOT text %d offset %d out of range (%s, %d, %d)",
 			id, totItem.offset, _totFile.c_str(), _totSize, totItem.size);
-		return 0;
+		return nullptr;
 	}
 
 	return new TextItem(_totTextTable->data + totItem.offset, totItem.size);
@@ -580,7 +580,7 @@ TextItem *Resources::getTextItem(uint16 id) const {
 
 byte *Resources::getTexts() const {
 	if (!_totTextTable)
-		return 0;
+		return nullptr;
 
 	return _totTextTable->data;
 }
@@ -622,14 +622,14 @@ Resource *Resources::getTOTResource(uint16 id) const {
 		warning("Trying to load non-existent TOT resource (%s, %d/%d)",
 				_totFile.c_str(), id,
 				_totResourceTable ? (_totResourceTable->itemsCount - 1) : -1);
-		return 0;
+		return nullptr;
 	}
 
 	assert(_totResourceTable->items);
 
 	TOTResourceItem &totItem = _totResourceTable->items[id];
 
-	byte *data = 0;
+	byte *data = nullptr;
 	if (totItem.type == kResourceIM)
 		data = getIMData(totItem);
 	if (totItem.type == kResourceTOT)
@@ -638,7 +638,7 @@ Resource *Resources::getTOTResource(uint16 id) const {
 	if (!data) {
 		warning("Failed to load TOT resource (%s, %d/%d, %d)",
 				_totFile.c_str(), id, _totResourceTable->itemsCount - 1, totItem.type);
-		return 0;
+		return nullptr;
 	}
 
 	return new Resource(data, totItem.size, false, totItem.width, totItem.height);
@@ -649,7 +649,7 @@ Resource *Resources::getEXTResource(uint16 id) const {
 		warning("Trying to load non-existent EXT resource (%s, %d/%d)",
 				_totFile.c_str(), id,
 				_extResourceTable ? (_extResourceTable->itemsCount - 1) : -1);
-		return 0;
+		return nullptr;
 	}
 
 	assert(_extResourceTable->items);
@@ -667,7 +667,7 @@ Resource *Resources::getEXTResource(uint16 id) const {
 	if (extItem.height == 0)
 		size += extItem.width << 16;
 
-	byte *data = 0;
+	byte *data = nullptr;
 	if (extItem.type == kResourceEXT)
 		data = getEXTData(extItem, size);
 	if (extItem.type == kResourceEX)
@@ -676,7 +676,7 @@ Resource *Resources::getEXTResource(uint16 id) const {
 	if (!data) {
 		warning("Failed to load EXT resource (%s, %d/%d, %d)",
 				_totFile.c_str(), id, _extResourceTable->itemsCount - 1, extItem.type);
-		return 0;
+		return nullptr;
 	}
 
 	if (extItem.packed) {
@@ -695,14 +695,14 @@ Resource *Resources::getEXTResource(uint16 id) const {
 
 byte *Resources::getTOTData(TOTResourceItem &totItem) const {
 	if (totItem.size == 0)
-		return 0;
+		return nullptr;
 
 	int32 offset = _totResourceTable->dataOffset + totItem.offset - _totResStart;
 
 	if ((offset < 0) || (((uint32) (offset + totItem.size)) > _totSize)) {
 		warning("TOT data %d offset %d out of range (%s, %d, %d)",
 				totItem.index, totItem.offset, _totFile.c_str(), _totSize, totItem.size);
-		return 0;
+		return nullptr;
 	}
 
 	return _totData + offset;
@@ -710,15 +710,15 @@ byte *Resources::getTOTData(TOTResourceItem &totItem) const {
 
 byte *Resources::getIMData(TOTResourceItem &totItem) const {
 	if (totItem.size == 0)
-		return 0;
+		return nullptr;
 
 	int32 indexOffset = totItem.index * 4;
 	if ((indexOffset < 0) || (((uint32) indexOffset) >= _imSize))
-		return 0;
+		return nullptr;
 
 	uint32 offset = READ_LE_UINT32(_imData + indexOffset);
 	if ((offset + totItem.size) > _imSize)
-		return 0;
+		return nullptr;
 
 	return _imData + offset;
 }
@@ -726,11 +726,11 @@ byte *Resources::getIMData(TOTResourceItem &totItem) const {
 byte *Resources::getEXTData(EXTResourceItem &extItem, uint32 &size) const {
 	Common::SeekableReadStream *stream = _vm->_dataIO->getFile(_extFile);
 	if (!stream)
-		return 0;
+		return nullptr;
 
 	if (!stream->seek(extItem.offset)) {
 		delete stream;
-		return 0;
+		return nullptr;
 	}
 
 	// If that workaround is active, limit the resource size instead of throwing an error
@@ -741,7 +741,7 @@ byte *Resources::getEXTData(EXTResourceItem &extItem, uint32 &size) const {
 	if (stream->read(data, size) != size) {
 		delete[] data;
 		delete stream;
-		return 0;
+		return nullptr;
 	}
 
 	delete stream;
@@ -751,11 +751,11 @@ byte *Resources::getEXTData(EXTResourceItem &extItem, uint32 &size) const {
 byte *Resources::getEXData(EXTResourceItem &extItem, uint32 &size) const {
 	Common::SeekableReadStream *stream = _vm->_dataIO->getFile(_exFile);
 	if (!stream)
-		return 0;
+		return nullptr;
 
 	if (!stream->seek(extItem.offset)) {
 		delete stream;
-		return 0;
+		return nullptr;
 	}
 
 	// If that workaround is active, limit the resource size instead of throwing an error
@@ -766,7 +766,7 @@ byte *Resources::getEXData(EXTResourceItem &extItem, uint32 &size) const {
 	if (stream->read(data, size) != size) {
 		delete[] data;
 		delete stream;
-		return 0;
+		return nullptr;
 	}
 
 	delete stream;
diff --git a/engines/gob/save/saveconverter.cpp b/engines/gob/save/saveconverter.cpp
index 3365395aec..0f5c14911e 100644
--- a/engines/gob/save/saveconverter.cpp
+++ b/engines/gob/save/saveconverter.cpp
@@ -34,8 +34,8 @@ namespace Gob {
 SaveConverter::SaveConverter(GobEngine *vm, const Common::String &fileName)
 : _vm(vm), _fileName(fileName) {
 
-	_data = 0;
-	_stream = 0;
+	_data = nullptr;
+	_stream = nullptr;
 }
 
 SaveConverter::~SaveConverter() {
@@ -47,8 +47,8 @@ void SaveConverter::clear() {
 	delete[] _data;
 	delete _stream;
 
-	_data = 0;
-	_stream = 0;
+	_data = nullptr;
+	_stream = nullptr;
 }
 
 void SaveConverter::setFileName(const Common::String &fileName) {
@@ -58,7 +58,7 @@ void SaveConverter::setFileName(const Common::String &fileName) {
 
 Common::InSaveFile *SaveConverter::openSave() const {
 	if (_fileName.empty())
-		return 0;
+		return nullptr;
 
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	return saveMan->openForLoading(_fileName);
@@ -79,7 +79,7 @@ char *SaveConverter::getDescription() const {
 
 	// Test if it's an old savd
 	if (!isOldSave(&save) || !save)
-		return 0;
+		return nullptr;
 
 	char *desc = getDescription(*save);
 
@@ -139,17 +139,17 @@ SavePartInfo *SaveConverter::readInfo(Common::SeekableReadStream &stream,
 
 	uint32 varSize = SaveHandler::getVarSize(_vm);
 	if (varSize == 0)
-		return 0;
+		return nullptr;
 
 	char *desc = getDescription(stream);
 	if (!desc)
-		return 0;
+		return nullptr;
 
 	// If it has sizes, skip them
 	if (hasSizes)
 		if (!stream.skip(descLength)) {
 			delete[] desc;
-			return 0;
+			return nullptr;
 		}
 
 	SavePartInfo *info = new SavePartInfo(descLength, (uint32) _vm->getGameType(),
@@ -170,7 +170,7 @@ byte *SaveConverter::readData(Common::SeekableReadStream &stream,
 	// Read variable data
 	if (stream.read(data, count) != count) {
 		delete[] data;
-		return 0;
+		return nullptr;
 	}
 
 	/* Check the endianness. The old save data was always written
@@ -184,14 +184,14 @@ byte *SaveConverter::readData(Common::SeekableReadStream &stream,
 		if (stream.read(sizes, count) != count) {
 			delete[] data;
 			delete[] sizes;
-			return 0;
+			return nullptr;
 		}
 
 		// Swap bytes
 		if (!swapDataEndian(data, sizes, count)) {
 			delete[] data;
 			delete[] sizes;
-			return 0;
+			return nullptr;
 		}
 
 		delete[] sizes;
@@ -201,7 +201,7 @@ byte *SaveConverter::readData(Common::SeekableReadStream &stream,
 
 		if (!stream.skip(count)) {
 			delete[] data;
-			return 0;
+			return nullptr;
 		}
 	}
 
@@ -213,7 +213,7 @@ SavePartVars *SaveConverter::readVars(Common::SeekableReadStream &stream,
 
 	byte *data = readData(stream, count, endian);
 	if (!data)
-		return 0;
+		return nullptr;
 
 	SavePartVars *vars = new SavePartVars(_vm, count);
 
@@ -221,7 +221,7 @@ SavePartVars *SaveConverter::readVars(Common::SeekableReadStream &stream,
 	if (!vars->readFromRaw(data, count)) {
 		delete[] data;
 		delete vars;
-		return 0;
+		return nullptr;
 	}
 
 	delete[] data;
@@ -233,7 +233,7 @@ SavePartMem *SaveConverter::readMem(Common::SeekableReadStream &stream,
 
 	byte *data = readData(stream, count, endian);
 	if (!data)
-		return 0;
+		return nullptr;
 
 	SavePartMem *mem = new SavePartMem(count);
 
@@ -241,7 +241,7 @@ SavePartMem *SaveConverter::readMem(Common::SeekableReadStream &stream,
 	if (!mem->readFrom(data, 0, count)) {
 		delete[] data;
 		delete mem;
-		return 0;
+		return nullptr;
 	}
 
 	delete[] data;
@@ -258,14 +258,14 @@ SavePartSprite *SaveConverter::readSprite(Common::SeekableReadStream &stream,
 	byte pal[768];
 	if (palette)
 		if (stream.read(pal, 768) != 768)
-			return 0;
+			return nullptr;
 
 	byte *data = new byte[spriteSize];
 
 	// Read variable data
 	if (stream.read(data, spriteSize) != spriteSize) {
 		delete[] data;
-		return 0;
+		return nullptr;
 	}
 
 	SavePartSprite *sprite = new SavePartSprite(width, height);
@@ -273,14 +273,14 @@ SavePartSprite *SaveConverter::readSprite(Common::SeekableReadStream &stream,
 	if (!sprite->readSpriteRaw(data, spriteSize)) {
 		delete[] data;
 		delete sprite;
-		return 0;
+		return nullptr;
 	}
 
 	delete[] data;
 
 	if (palette)
 		if (!sprite->readPalette(pal))
-			return 0;
+			return nullptr;
 
 	return sprite;
 }
@@ -378,14 +378,14 @@ int SaveConverter_Notes::isOldSave(Common::InSaveFile **save) const {
 	// Not an old save, clean up
 	if (save) {
 		delete *save;
-		*save = 0;
+		*save = nullptr;
 	}
 
 	return 0;
 }
 
 char *SaveConverter_Notes::getDescription(Common::SeekableReadStream &save) const  {
-	return 0;
+	return nullptr;
 }
 
 bool SaveConverter_Notes::loadFail(SavePartVars *vars, Common::InSaveFile *save) {
@@ -414,21 +414,21 @@ bool SaveConverter_Notes::load() {
 
 	SavePartVars *vars = readVars(*save, _size, false);
 	if (!vars)
-		return loadFail(0, save);
+		return loadFail(nullptr, save);
 
 	// We don't need the save anymore
 	delete save;
 
 	// Write all parts
 	if (!writer.writePart(0, vars))
-		return loadFail(0, 0);
+		return loadFail(nullptr, nullptr);
 
 	// We don't need this anymore
 	delete vars;
 
 	// Create the final read stream
 	if (!createStream(writer))
-		return loadFail(0, 0);
+		return loadFail(nullptr, nullptr);
 
 	return true;
 }
diff --git a/engines/gob/save/saveconverter_v2.cpp b/engines/gob/save/saveconverter_v2.cpp
index 762f6e906a..5344e4eeb9 100644
--- a/engines/gob/save/saveconverter_v2.cpp
+++ b/engines/gob/save/saveconverter_v2.cpp
@@ -53,7 +53,7 @@ int SaveConverter_v2::isOldSave(Common::InSaveFile **save) const {
 	// Not an old save, clean up
 	if (save) {
 		delete *save;
-		*save = 0;
+		*save = nullptr;
 	}
 
 	return 0;
@@ -65,7 +65,7 @@ char *SaveConverter_v2::getDescription(Common::SeekableReadStream &save) const {
 	// Read the description
 	if (save.read(desc, kSlotNameLength) != kSlotNameLength) {
 		delete[] desc;
-		return 0;
+		return nullptr;
 	}
 
 	return desc;
@@ -103,20 +103,20 @@ bool SaveConverter_v2::load() {
 
 	SavePartInfo *info = readInfo(*save, kSlotNameLength);
 	if (!info)
-		return loadFail(0, 0, save);
+		return loadFail(nullptr, nullptr, save);
 
 	SavePartVars *vars = readVars(*save, varSize, true);
 	if (!vars)
-		return loadFail(info, 0, save);
+		return loadFail(info, nullptr, save);
 
 	// We don't need the save anymore
 	delete save;
 
 	// Write all parts
 	if (!writer.writePart(0, info))
-		return loadFail(info, vars, 0);
+		return loadFail(info, vars, nullptr);
 	if (!writer.writePart(1, vars))
-		return loadFail(info, vars, 0);
+		return loadFail(info, vars, nullptr);
 
 	// We don't need those anymore
 	delete info;
@@ -124,7 +124,7 @@ bool SaveConverter_v2::load() {
 
 	// Create the final read stream
 	if (!createStream(writer))
-		return loadFail(0, 0, 0);
+		return loadFail(nullptr, nullptr, nullptr);
 
 	return true;
 }
diff --git a/engines/gob/save/saveconverter_v3.cpp b/engines/gob/save/saveconverter_v3.cpp
index 0e045178ad..1896ef0897 100644
--- a/engines/gob/save/saveconverter_v3.cpp
+++ b/engines/gob/save/saveconverter_v3.cpp
@@ -57,7 +57,7 @@ int SaveConverter_v3::isOldSave(Common::InSaveFile **save) const {
 	// Not an old save, clean up
 	if (save) {
 		delete *save;
-		*save = 0;
+		*save = nullptr;
 	}
 
 	return 0;
@@ -66,14 +66,14 @@ int SaveConverter_v3::isOldSave(Common::InSaveFile **save) const {
 char *SaveConverter_v3::getDescription(Common::SeekableReadStream &save) const {
 	// The description starts at 1000
 	if (!save.seek(1000))
-		return 0;
+		return nullptr;
 
 	char *desc = new char[kSlotNameLength];
 
 	// Read the description
 	if (save.read(desc, kSlotNameLength) != kSlotNameLength) {
 		delete[] desc;
-		return 0;
+		return nullptr;
 	}
 
 	return desc;
@@ -144,17 +144,17 @@ bool SaveConverter_v3::load() {
 
 	SavePartInfo *info = readInfo(*save, kSlotNameLength, false);
 	if (!info)
-		return loadFail(0, 0, 0, save);
+		return loadFail(nullptr, nullptr, nullptr, save);
 
 	SavePartVars *vars = readVars(*save, varSize, true);
 	if (!vars)
-		return loadFail(info, 0, 0, save);
+		return loadFail(info, nullptr, nullptr, save);
 
 	if (screenShot) {
 		SavePartSprite *sprite = readSprite(*save, screenShotWidth, screenShotHeight, true);
 
 		if (!sprite)
-			return loadFail(info, vars, 0, save);
+			return loadFail(info, vars, nullptr, save);
 
 		if (!writer.writePart(2, sprite))
 			return loadFail(info, vars, sprite, save);
@@ -167,9 +167,9 @@ bool SaveConverter_v3::load() {
 
 	// Write all parts
 	if (!writer.writePart(0, info))
-		return loadFail(info, vars, 0, 0);
+		return loadFail(info, vars, nullptr, nullptr);
 	if (!writer.writePart(1, vars))
-		return loadFail(info, vars, 0, 0);
+		return loadFail(info, vars, nullptr, nullptr);
 
 	// We don't need those anymore
 	delete info;
@@ -177,7 +177,7 @@ bool SaveConverter_v3::load() {
 
 	// Create the final read stream
 	if (!createStream(writer))
-		return loadFail(0, 0, 0, 0);
+		return loadFail(nullptr, nullptr, nullptr, nullptr);
 
 	return true;
 }
diff --git a/engines/gob/save/saveconverter_v4.cpp b/engines/gob/save/saveconverter_v4.cpp
index 24e70c7fdb..6acb81e832 100644
--- a/engines/gob/save/saveconverter_v4.cpp
+++ b/engines/gob/save/saveconverter_v4.cpp
@@ -53,7 +53,7 @@ int SaveConverter_v4::isOldSave(Common::InSaveFile **save) const {
 	// Not an old save, clean up
 	if (save) {
 		delete *save;
-		*save = 0;
+		*save = nullptr;
 	}
 
 	return 0;
@@ -62,14 +62,14 @@ int SaveConverter_v4::isOldSave(Common::InSaveFile **save) const {
 char *SaveConverter_v4::getDescription(Common::SeekableReadStream &save) const {
 	// The description starts at 1000
 	if (!save.seek(1000))
-		return 0;
+		return nullptr;
 
 	char *desc = new char[kSlotNameLength];
 
 	// Read the description
 	if (save.read(desc, kSlotNameLength) != kSlotNameLength) {
 		delete[] desc;
-		return 0;
+		return nullptr;
 	}
 
 	return desc;
@@ -108,26 +108,26 @@ bool SaveConverter_v4::load() {
 
 	SavePartInfo *info = readInfo(*save, kSlotNameLength, false);
 	if (!info)
-		return loadFail(0, 0, 0, save);
+		return loadFail(nullptr, nullptr, nullptr, save);
 
 	SavePartVars *vars = readVars(*save, varSize, true);
 	if (!vars)
-		return loadFail(info, 0, 0, save);
+		return loadFail(info, nullptr, nullptr, save);
 
 	SavePartMem *props = readMem(*save, 256000, true);
 	if (!props)
-		return loadFail(info, vars, 0, save);
+		return loadFail(info, vars, nullptr, save);
 
 	// We don't need the save anymore
 	delete save;
 
 	// Write all parts
 	if (!writer.writePart(0, info))
-		return loadFail(info, vars, props, 0);
+		return loadFail(info, vars, props, nullptr);
 	if (!writer.writePart(1, vars))
-		return loadFail(info, vars, props, 0);
+		return loadFail(info, vars, props, nullptr);
 	if (!writer.writePart(2, props))
-		return loadFail(info, vars, props, 0);
+		return loadFail(info, vars, props, nullptr);
 
 	// We don't need those anymore
 	delete info;
@@ -136,7 +136,7 @@ bool SaveConverter_v4::load() {
 
 	// Create the final read stream
 	if (!createStream(writer))
-		return loadFail(0, 0, 0, 0);
+		return loadFail(nullptr, nullptr, nullptr, nullptr);
 
 	return true;
 }
diff --git a/engines/gob/save/savefile.cpp b/engines/gob/save/savefile.cpp
index 87e1b15d9d..002159a696 100644
--- a/engines/gob/save/savefile.cpp
+++ b/engines/gob/save/savefile.cpp
@@ -604,7 +604,7 @@ void SaveContainer::clear() {
 		Part *&p = *it;
 
 		delete p;
-		p = 0;
+		p = nullptr;
 	}
 }
 
@@ -626,7 +626,7 @@ bool SaveContainer::writePart(uint32 partN, const SavePart *part) {
 	// Write
 	if (!part->write(*pStream)) {
 		delete p;
-		p = 0;
+		p = nullptr;
 
 		delete pStream;
 		return false;
@@ -767,7 +767,7 @@ bool SaveContainer::write(Common::WriteStream &stream) const {
 }
 
 Common::Array<SaveContainer::PartInfo> *SaveContainer::getPartsInfo(Common::SeekableReadStream &stream) {
-	Common::Array<PartInfo> *parts = 0;
+	Common::Array<PartInfo> *parts = nullptr;
 
 	// Remember the stream's position to seek back to
 	uint32 startPos = stream.pos();
@@ -781,7 +781,7 @@ Common::Array<SaveContainer::PartInfo> *SaveContainer::getPartsInfo(Common::Seek
 	if (!header.verifyReadSize(stream)) {
 		// Seek back
 		stream.seek(startPos);
-		return 0;
+		return nullptr;
 	}
 
 	// Read the part count
@@ -807,7 +807,7 @@ Common::Array<SaveContainer::PartInfo> *SaveContainer::getPartsInfo(Common::Seek
 			// Seek back
 			stream.seek(startPos);
 			delete parts;
-			return 0;
+			return nullptr;
 		}
 
 		// Fill in the ID
@@ -819,7 +819,7 @@ Common::Array<SaveContainer::PartInfo> *SaveContainer::getPartsInfo(Common::Seek
 
 	if (stream.err()) {
 		delete parts;
-		parts = 0;
+		parts = nullptr;
 	}
 
 	// Seek back
@@ -849,7 +849,7 @@ bool SaveContainer::isSave(Common::SeekableReadStream &stream) {
 SaveReader::SaveReader(uint32 partCount, uint32 slot, const Common::String &fileName) :
 	SaveContainer(partCount, slot), _fileName(fileName) {
 
-	_stream = 0;
+	_stream = nullptr;
 
 	_loaded = false;
 }
@@ -868,7 +868,7 @@ SaveReader::~SaveReader() {
 // Open the save and read it
 bool SaveReader::load() {
 
-	Common::InSaveFile *in = 0;
+	Common::InSaveFile *in = nullptr;
 	Common::SeekableReadStream *stream;
 
 	if (!_fileName.empty()) {
@@ -914,7 +914,7 @@ bool SaveReader::readPart(uint32 partN, SavePart *part) const {
 
 Common::InSaveFile *SaveReader::openSave(const Common::String &fileName) {
 	if (fileName.empty())
-		return 0;
+		return nullptr;
 
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	return saveMan->openForLoading(fileName);
@@ -1024,7 +1024,7 @@ bool SaveWriter::canSave() const {
 
 Common::OutSaveFile *SaveWriter::openSave(const Common::String &fileName) {
 	if (fileName.empty())
-		return 0;
+		return nullptr;
 
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	return saveMan->openForSaving(fileName);
diff --git a/engines/gob/save/savehandler.cpp b/engines/gob/save/savehandler.cpp
index 7a64582201..2b0e234b49 100644
--- a/engines/gob/save/savehandler.cpp
+++ b/engines/gob/save/savehandler.cpp
@@ -86,7 +86,7 @@ void SlotFileIndexed::buildIndex(byte *buffer, SavePartInfo &info,
 		Common::String slotFile = build(i);
 
 		if (!slotFile.empty()) {
-			char *desc = 0;
+			char *desc = nullptr;
 
 			if (converter && (desc = converter->getDescription(slotFile)))
 				// Old style save
@@ -117,7 +117,7 @@ void SlotFileIndexed::buildIndex(byte *buffer, SavePartInfo &info,
 
 bool SlotFileIndexed::exists(int slot) const {
 	Common::InSaveFile *in = openRead(slot);
-	bool result = (in != 0);
+	bool result = (in != nullptr);
 	delete in;
 	return result;
 }
@@ -125,7 +125,7 @@ bool SlotFileIndexed::exists(int slot) const {
 Common::InSaveFile *SlotFileIndexed::openRead(int slot) const {
 	Common::String name = build(slot);
 	if (name.empty())
-		return 0;
+		return nullptr;
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	Common::InSaveFile *result = saveMan->openForLoading(name);
 	return result;
@@ -134,7 +134,7 @@ Common::InSaveFile *SlotFileIndexed::openRead(int slot) const {
 Common::OutSaveFile *SlotFileIndexed::openWrite(int slot) const {
 	Common::String name = build(slot);
 	if (name.empty())
-		return 0;
+		return nullptr;
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	Common::OutSaveFile *result = saveMan->openForSaving(name);
 	return result;
@@ -182,7 +182,7 @@ Common::String SlotFileStatic::build() const {
 
 bool SlotFileStatic::exists() const {
 	Common::InSaveFile *in = openRead();
-	bool result = (in != 0);
+	bool result = (in != nullptr);
 	delete in;
 	return result;
 }
@@ -190,7 +190,7 @@ bool SlotFileStatic::exists() const {
 Common::InSaveFile *SlotFileStatic::openRead() const {
 	Common::String name = build();
 	if (name.empty())
-		return 0;
+		return nullptr;
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	Common::InSaveFile *result = saveMan->openForLoading(name);
 	return result;
@@ -199,7 +199,7 @@ Common::InSaveFile *SlotFileStatic::openRead() const {
 Common::OutSaveFile *SlotFileStatic::openWrite() const {
 	Common::String name = build();
 	if (name.empty())
-		return 0;
+		return nullptr;
 	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
 	Common::OutSaveFile *result = saveMan->openForSaving(name);
 	return result;
@@ -226,7 +226,7 @@ bool SaveHandler::deleteFile() {
 
 
 TempSpriteHandler::TempSpriteHandler(GobEngine *vm) : SaveHandler(vm) {
-	_sprite = 0;
+	_sprite = nullptr;
 }
 
 TempSpriteHandler::~TempSpriteHandler() {
@@ -308,7 +308,7 @@ bool TempSpriteHandler::save(int16 dataVar, int32 size, int32 offset) {
 
 bool TempSpriteHandler::create(uint32 width, uint32 height, bool trueColor) {
 	delete _sprite;
-	_sprite = 0;
+	_sprite = nullptr;
 
 	// Create a new temporary sprite
 	_sprite = new SavePartSprite(width, height, trueColor);
@@ -317,7 +317,7 @@ bool TempSpriteHandler::create(uint32 width, uint32 height, bool trueColor) {
 }
 
 bool TempSpriteHandler::createFromSprite(int16 dataVar, int32 size, int32 offset) {
-	return createSprite(dataVar, size, offset) != 0;
+	return createSprite(dataVar, size, offset) != nullptr;
 }
 
 SurfacePtr TempSpriteHandler::createSprite(int16 dataVar, int32 size, int32 offset) {
diff --git a/engines/gob/save/saveload.cpp b/engines/gob/save/saveload.cpp
index f6967a79ad..8c0ed0eacf 100644
--- a/engines/gob/save/saveload.cpp
+++ b/engines/gob/save/saveload.cpp
@@ -140,11 +140,11 @@ SaveLoad::SaveMode SaveLoad::getSaveMode(const char *fileName) const {
 }
 
 SaveHandler *SaveLoad::getHandler(const char *fileName) const {
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad::getDescription(const char *fileName) const {
-	return 0;
+	return nullptr;
 }
 
 } // End of namespace Gob
diff --git a/engines/gob/save/saveload_ajworld.cpp b/engines/gob/save/saveload_ajworld.cpp
index 307a1783a3..17549914e9 100644
--- a/engines/gob/save/saveload_ajworld.cpp
+++ b/engines/gob/save/saveload_ajworld.cpp
@@ -28,7 +28,7 @@
 namespace Gob {
 
 SaveLoad_AJWorld::SaveFile SaveLoad_AJWorld::_saveFiles[] = {
-	{ "menu.inf", kSaveModeSave, 0, "temporary sprite"}
+	{ "menu.inf", kSaveModeSave, nullptr, "temporary sprite"}
 };
 
 
@@ -51,7 +51,7 @@ const SaveLoad_AJWorld::SaveFile *SaveLoad_AJWorld::getSaveFile(const char *file
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_AJWorld::SaveFile *SaveLoad_AJWorld::getSaveFile(const char *fileName) {
@@ -61,7 +61,7 @@ SaveLoad_AJWorld::SaveFile *SaveLoad_AJWorld::getSaveFile(const char *fileName)
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_AJWorld::getHandler(const char *fileName) const {
@@ -70,7 +70,7 @@ SaveHandler *SaveLoad_AJWorld::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_AJWorld::getDescription(const char *fileName) const {
@@ -79,7 +79,7 @@ const char *SaveLoad_AJWorld::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_AJWorld::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_fascin.cpp b/engines/gob/save/saveload_fascin.cpp
index 26a7f978ad..e22d85221b 100644
--- a/engines/gob/save/saveload_fascin.cpp
+++ b/engines/gob/save/saveload_fascin.cpp
@@ -28,22 +28,22 @@
 namespace Gob {
 
 SaveLoad_Fascination::SaveFile SaveLoad_Fascination::_saveFiles[] = {
-	{ "cat.cat",    kSaveModeSave, -1, 0, "savegame catalog"},
-	{ "save0.inf",  kSaveModeSave,  0, 0, "savegame"},
-	{ "save1.inf",  kSaveModeSave,  1, 0, "savegame"},
-	{ "save2.inf",  kSaveModeSave,  2, 0, "savegame"},
-	{ "save3.inf",  kSaveModeSave,  3, 0, "savegame"},
-	{ "save4.inf",  kSaveModeSave,  4, 0, "savegame"},
-	{ "save5.inf",  kSaveModeSave,  5, 0, "savegame"},
-	{ "save6.inf",  kSaveModeSave,  6, 0, "savegame"},
-	{ "save7.inf",  kSaveModeSave,  7, 0, "savegame"},
-	{ "save8.inf",  kSaveModeSave,  8, 0, "savegame"},
-	{ "save9.inf",  kSaveModeSave,  9, 0, "savegame"},
-	{ "save10.inf", kSaveModeSave, 10, 0, "savegame"},
-	{ "save11.inf", kSaveModeSave, 11, 0, "savegame"},
-	{ "save12.inf", kSaveModeSave, 12, 0, "savegame"},
-	{ "save13.inf", kSaveModeSave, 13, 0, "savegame"},
-	{ "save14.inf", kSaveModeSave, 14, 0, "savegame"},
+	{ "cat.cat",    kSaveModeSave, -1, nullptr, "savegame catalog"},
+	{ "save0.inf",  kSaveModeSave,  0, nullptr, "savegame"},
+	{ "save1.inf",  kSaveModeSave,  1, nullptr, "savegame"},
+	{ "save2.inf",  kSaveModeSave,  2, nullptr, "savegame"},
+	{ "save3.inf",  kSaveModeSave,  3, nullptr, "savegame"},
+	{ "save4.inf",  kSaveModeSave,  4, nullptr, "savegame"},
+	{ "save5.inf",  kSaveModeSave,  5, nullptr, "savegame"},
+	{ "save6.inf",  kSaveModeSave,  6, nullptr, "savegame"},
+	{ "save7.inf",  kSaveModeSave,  7, nullptr, "savegame"},
+	{ "save8.inf",  kSaveModeSave,  8, nullptr, "savegame"},
+	{ "save9.inf",  kSaveModeSave,  9, nullptr, "savegame"},
+	{ "save10.inf", kSaveModeSave, 10, nullptr, "savegame"},
+	{ "save11.inf", kSaveModeSave, 11, nullptr, "savegame"},
+	{ "save12.inf", kSaveModeSave, 12, nullptr, "savegame"},
+	{ "save13.inf", kSaveModeSave, 13, nullptr, "savegame"},
+	{ "save14.inf", kSaveModeSave, 14, nullptr, "savegame"},
 };
 
 
@@ -130,7 +130,7 @@ bool SaveLoad_Fascination::GameHandler::load(int16 dataVar, int32 size, int32 of
 
 		Common::String slotFile = _slotFile->build(slot);
 
-		SaveReader *reader = 0;
+		SaveReader *reader = nullptr;
 
 		// New save, load directly
 		reader = new SaveReader(2, slot, slotFile);
@@ -250,7 +250,7 @@ void SaveLoad_Fascination::GameHandler::buildIndex(byte *buffer) const {
 	SavePartInfo info(kSlotNameLength, (uint32) _vm->getGameType(),
 			0, _vm->getEndianness(), varSize);
 
-	_slotFile->buildIndex(buffer, info, 0);
+	_slotFile->buildIndex(buffer, info, nullptr);
 }
 
 
@@ -276,7 +276,7 @@ const SaveLoad_Fascination::SaveFile *SaveLoad_Fascination::getSaveFile(const ch
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_Fascination::SaveFile *SaveLoad_Fascination::getSaveFile(const char *fileName) {
@@ -286,7 +286,7 @@ SaveLoad_Fascination::SaveFile *SaveLoad_Fascination::getSaveFile(const char *fi
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_Fascination::getHandler(const char *fileName) const {
@@ -295,7 +295,7 @@ SaveHandler *SaveLoad_Fascination::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_Fascination::getDescription(const char *fileName) const {
@@ -304,7 +304,7 @@ const char *SaveLoad_Fascination::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_Fascination::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_geisha.cpp b/engines/gob/save/saveload_geisha.cpp
index 5ad9424e89..c3720f4742 100644
--- a/engines/gob/save/saveload_geisha.cpp
+++ b/engines/gob/save/saveload_geisha.cpp
@@ -28,7 +28,7 @@
 namespace Gob {
 
 SaveLoad_Geisha::SaveFile SaveLoad_Geisha::_saveFiles[] = {
-	{"save.inf", kSaveModeSave, 0, "savegame"}
+	{"save.inf", kSaveModeSave, nullptr, "savegame"}
 };
 
 
@@ -172,7 +172,7 @@ const SaveLoad_Geisha::SaveFile *SaveLoad_Geisha::getSaveFile(const char *fileNa
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_Geisha::SaveFile *SaveLoad_Geisha::getSaveFile(const char *fileName) {
@@ -182,7 +182,7 @@ SaveLoad_Geisha::SaveFile *SaveLoad_Geisha::getSaveFile(const char *fileName) {
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_Geisha::getHandler(const char *fileName) const {
@@ -191,7 +191,7 @@ SaveHandler *SaveLoad_Geisha::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_Geisha::getDescription(const char *fileName) const {
@@ -200,7 +200,7 @@ const char *SaveLoad_Geisha::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_Geisha::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_inca2.cpp b/engines/gob/save/saveload_inca2.cpp
index 533875e44c..9a273415fb 100644
--- a/engines/gob/save/saveload_inca2.cpp
+++ b/engines/gob/save/saveload_inca2.cpp
@@ -28,11 +28,11 @@
 namespace Gob {
 
 SaveLoad_Inca2::SaveFile SaveLoad_Inca2::_saveFiles[] = {
-	{"speak.inf", kSaveModeExists, 0, 0}, // Exists = speech enabled
-	{"voice.inf", kSaveModeSave  , 0, 0}, // Contains the language of the voices
-	{"intro.$$$", kSaveModeSave  , 0, "temporary sprite"},
-	{  "cat.inf", kSaveModeSave  , 0, "savegame"},
-	{  "ima.inf", kSaveModeSave  , 0, "screenshot"},
+	{"speak.inf", kSaveModeExists, nullptr, nullptr}, // Exists = speech enabled
+	{"voice.inf", kSaveModeSave  , nullptr, nullptr}, // Contains the language of the voices
+	{"intro.$$$", kSaveModeSave  , nullptr, "temporary sprite"},
+	{  "cat.inf", kSaveModeSave  , nullptr, "savegame"},
+	{  "ima.inf", kSaveModeSave  , nullptr, "screenshot"},
 };
 
 
@@ -74,8 +74,8 @@ SaveLoad_Inca2::GameHandler::GameHandler(GobEngine *vm, const char *target) :
 
 	buildIndex();
 
-	_writer = 0;
-	_reader = 0;
+	_writer = nullptr;
+	_reader = nullptr;
 }
 
 SaveLoad_Inca2::GameHandler::~GameHandler() {
@@ -201,7 +201,7 @@ void SaveLoad_Inca2::GameHandler::buildIndex() {
 bool SaveLoad_Inca2::GameHandler::createReader(int slot) {
 	// If slot < 0, just check if a reader exists
 	if (slot < 0)
-		return (_reader != 0);
+		return (_reader != nullptr);
 
 	if (!_reader || (_reader->getSlot() != ((uint32) slot))) {
 		Common::String slotFile = _slotFile->build(slot);
@@ -215,7 +215,7 @@ bool SaveLoad_Inca2::GameHandler::createReader(int slot) {
 
 		if (!_reader->load()) {
 			delete _reader;
-			_reader = 0;
+			_reader = nullptr;
 			return false;
 		}
 	}
@@ -226,7 +226,7 @@ bool SaveLoad_Inca2::GameHandler::createReader(int slot) {
 bool SaveLoad_Inca2::GameHandler::createWriter(int slot) {
 	// If slot < 0, just check if a writer exists
 	if (slot < 0)
-		return (_writer != 0);
+		return (_writer != nullptr);
 
 	if (!_writer || (_writer->getSlot() != ((uint32) slot))) {
 		Common::String slotFile = _slotFile->build(slot);
@@ -406,7 +406,7 @@ const SaveLoad_Inca2::SaveFile *SaveLoad_Inca2::getSaveFile(const char *fileName
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_Inca2::SaveFile *SaveLoad_Inca2::getSaveFile(const char *fileName) {
@@ -416,7 +416,7 @@ SaveLoad_Inca2::SaveFile *SaveLoad_Inca2::getSaveFile(const char *fileName) {
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_Inca2::getHandler(const char *fileName) const {
@@ -425,7 +425,7 @@ SaveHandler *SaveLoad_Inca2::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_Inca2::getDescription(const char *fileName) const {
@@ -434,7 +434,7 @@ const char *SaveLoad_Inca2::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_Inca2::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp
index 406e5eb705..0295d0308a 100644
--- a/engines/gob/save/saveload_playtoons.cpp
+++ b/engines/gob/save/saveload_playtoons.cpp
@@ -27,40 +27,40 @@
 namespace Gob {
 
 SaveLoad_Playtoons::SaveFile SaveLoad_Playtoons::_saveFiles[] = {
-	{   "did.inf", kSaveModeSave,   0, 0}, // Purpose ignored at the moment, intensively used to save things.
-	{   "dan.itk", kSaveModeNone,   0, 0}, // Playtoons CK detection file
-	{   "cat.inf", kSaveModeNone,   0, 0},
-	{ "titre.009", kSaveModeIgnore, 0, 0}, // Playtoons theoritical title files that are checked for nothing
-	{ "titre.010", kSaveModeIgnore, 0, 0},
-	{ "titre.011", kSaveModeIgnore, 0, 0},
-	{ "titre.012", kSaveModeIgnore, 0, 0},
-	{ "titre.013", kSaveModeIgnore, 0, 0},
-	{ "titre.014", kSaveModeIgnore, 0, 0},
-	{ "titre.015", kSaveModeIgnore, 0, 0},
-	{ "titre.016", kSaveModeIgnore, 0, 0},
-	{ "titre.017", kSaveModeIgnore, 0, 0},
-	{ "titre.018", kSaveModeIgnore, 0, 0},
-	{ "titre.019", kSaveModeIgnore, 0, 0},
-	{ "titre.020", kSaveModeIgnore, 0, 0},
-	{ "titre.021", kSaveModeIgnore, 0, 0},
-	{ "titre.022", kSaveModeIgnore, 0, 0},
-	{ "titre.023", kSaveModeIgnore, 0, 0},
-	{ "titre.024", kSaveModeIgnore, 0, 0},
-	{ "titre.025", kSaveModeIgnore, 0, 0},
-	{ "titre.026", kSaveModeIgnore, 0, 0},
-	{ "titre.027", kSaveModeIgnore, 0, 0},
-	{ "titre.028", kSaveModeIgnore, 0, 0},
-	{ "titre.029", kSaveModeIgnore, 0, 0},
-	{ "titre.030", kSaveModeIgnore, 0, 0},
-	{ "titre.031", kSaveModeIgnore, 0, 0},
-	{ "titre.032", kSaveModeIgnore, 0, 0},
-	{ "titre.033", kSaveModeIgnore, 0, 0},
-	{ "titre.034", kSaveModeIgnore, 0, 0},
-	{ "titre.035", kSaveModeIgnore, 0, 0},
-	{ "titre.036", kSaveModeIgnore, 0, 0},
-	{ "titre.037", kSaveModeIgnore, 0, 0},
-	{ "titre.038", kSaveModeIgnore, 0, 0},
-	{ "titre.039", kSaveModeIgnore, 0, 0},
+	{   "did.inf", kSaveModeSave,   nullptr, nullptr}, // Purpose ignored at the moment, intensively used to save things.
+	{   "dan.itk", kSaveModeNone,   nullptr, nullptr}, // Playtoons CK detection file
+	{   "cat.inf", kSaveModeNone,   nullptr, nullptr},
+	{ "titre.009", kSaveModeIgnore, nullptr, nullptr}, // Playtoons theoritical title files that are checked for nothing
+	{ "titre.010", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.011", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.012", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.013", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.014", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.015", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.016", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.017", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.018", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.019", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.020", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.021", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.022", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.023", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.024", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.025", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.026", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.027", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.028", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.029", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.030", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.031", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.032", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.033", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.034", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.035", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.036", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.037", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.038", kSaveModeIgnore, nullptr, nullptr},
+	{ "titre.039", kSaveModeIgnore, nullptr, nullptr},
 };
 
 SaveLoad_Playtoons::GameHandler::File::File(GobEngine *vm, const char *base) :
@@ -169,7 +169,7 @@ bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offs
 
 		Common::String slotFile = _slotFile->build(slot);
 
-		SaveReader *reader = 0;
+		SaveReader *reader = nullptr;
 
 		// New save, load directly
 		reader = new SaveReader(2, slot, slotFile);
@@ -293,7 +293,7 @@ void SaveLoad_Playtoons::GameHandler::buildIndex(byte *buffer) const {
 	SavePartInfo info(kSlotNameLength, (uint32) _vm->getGameType(),
 			0, _vm->getEndianness(), varSize);
 
-	_slotFile->buildIndex(buffer, info, 0);
+	_slotFile->buildIndex(buffer, info, nullptr);
 }
 
 
@@ -316,7 +316,7 @@ const SaveLoad_Playtoons::SaveFile *SaveLoad_Playtoons::getSaveFile(const char *
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_Playtoons::SaveFile *SaveLoad_Playtoons::getSaveFile(const char *fileName) {
@@ -326,7 +326,7 @@ SaveLoad_Playtoons::SaveFile *SaveLoad_Playtoons::getSaveFile(const char *fileNa
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_Playtoons::getHandler(const char *fileName) const {
@@ -335,7 +335,7 @@ SaveHandler *SaveLoad_Playtoons::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_Playtoons::getDescription(const char *fileName) const {
@@ -344,7 +344,7 @@ const char *SaveLoad_Playtoons::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_Playtoons::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_v2.cpp b/engines/gob/save/saveload_v2.cpp
index 6f05d15803..a7f7f8eacb 100644
--- a/engines/gob/save/saveload_v2.cpp
+++ b/engines/gob/save/saveload_v2.cpp
@@ -28,10 +28,10 @@
 namespace Gob {
 
 SaveLoad_v2::SaveFile SaveLoad_v2::_saveFiles[] = {
-	{  "cat.inf", kSaveModeSave, 0, "savegame"},
-	{  "cat.cat", kSaveModeSave, 0, "savegame"}, // Alternative file
-	{ "save.inf", kSaveModeSave, 0, "temporary sprite"},
-	{ "bloc.inf", kSaveModeSave, 0, "notes"}
+	{  "cat.inf", kSaveModeSave, nullptr, "savegame"},
+	{  "cat.cat", kSaveModeSave, nullptr, "savegame"}, // Alternative file
+	{ "save.inf", kSaveModeSave, nullptr, "temporary sprite"},
+	{ "bloc.inf", kSaveModeSave, nullptr, "notes"}
 };
 
 
@@ -122,7 +122,7 @@ bool SaveLoad_v2::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
 
 		Common::String slotFile = _slotFile->build(slot);
 
-		SaveReader *reader = 0;
+		SaveReader *reader = nullptr;
 		SaveConverter_v2 converter(_vm, slotFile);
 
 		if (converter.isOldSave()) {
@@ -277,7 +277,7 @@ const SaveLoad_v2::SaveFile *SaveLoad_v2::getSaveFile(const char *fileName) cons
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_v2::SaveFile *SaveLoad_v2::getSaveFile(const char *fileName) {
@@ -287,7 +287,7 @@ SaveLoad_v2::SaveFile *SaveLoad_v2::getSaveFile(const char *fileName) {
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_v2::getHandler(const char *fileName) const {
@@ -296,7 +296,7 @@ SaveHandler *SaveLoad_v2::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_v2::getDescription(const char *fileName) const {
@@ -305,7 +305,7 @@ const char *SaveLoad_v2::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_v2::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_v3.cpp b/engines/gob/save/saveload_v3.cpp
index 1eb0730a3b..8577c2849e 100644
--- a/engines/gob/save/saveload_v3.cpp
+++ b/engines/gob/save/saveload_v3.cpp
@@ -28,12 +28,12 @@
 namespace Gob {
 
 SaveLoad_v3::SaveFile SaveLoad_v3::_saveFiles[] = {
-	{    "cat.inf", kSaveModeSave  , 0, "savegame"},
-	{    "ima.inf", kSaveModeSave  , 0, "screenshot"},
-	{  "intro.$$$", kSaveModeSave  , 0, "temporary sprite"},
-	{   "bloc.inf", kSaveModeSave  , 0, "notes"},
-	{   "prot",     kSaveModeIgnore, 0, 0},
-	{ "config",     kSaveModeIgnore, 0, 0}
+	{    "cat.inf", kSaveModeSave  , nullptr, "savegame"},
+	{    "ima.inf", kSaveModeSave  , nullptr, "screenshot"},
+	{  "intro.$$$", kSaveModeSave  , nullptr, "temporary sprite"},
+	{   "bloc.inf", kSaveModeSave  , nullptr, "notes"},
+	{   "prot",     kSaveModeIgnore, nullptr, nullptr},
+	{ "config",     kSaveModeIgnore, nullptr, nullptr}
 };
 
 
@@ -79,8 +79,8 @@ SaveLoad_v3::GameHandler::GameHandler(GobEngine *vm, const char *target,
 	memset(_index, 0, kIndexSize);
 	_hasIndex = false;
 
-	_writer = 0;
-	_reader = 0;
+	_writer = nullptr;
+	_reader = nullptr;
 }
 
 SaveLoad_v3::GameHandler::~GameHandler() {
@@ -295,7 +295,7 @@ void SaveLoad_v3::GameHandler::buildIndex(byte *buffer) const {
 bool SaveLoad_v3::GameHandler::createReader(int slot) {
 	// If slot < 0, just check if a reader exists
 	if (slot < 0)
-		return (_reader != 0);
+		return (_reader != nullptr);
 
 	if (!_reader || (_reader->getSlot() != ((uint32) slot))) {
 		Common::String slotFile = _slotFile->build(slot);
@@ -319,7 +319,7 @@ bool SaveLoad_v3::GameHandler::createReader(int slot) {
 
 		if (!_reader->load()) {
 			delete _reader;
-			_reader = 0;
+			_reader = nullptr;
 			return false;
 		}
 	}
@@ -330,7 +330,7 @@ bool SaveLoad_v3::GameHandler::createReader(int slot) {
 bool SaveLoad_v3::GameHandler::createWriter(int slot) {
 	// If slot < 0, just check if a writer exists
 	if (slot < 0)
-		return (_writer != 0);
+		return (_writer != nullptr);
 
 	if (!_writer || (_writer->getSlot() != ((uint32) slot))) {
 		Common::String slotFile = _slotFile->build(slot);
@@ -487,7 +487,7 @@ SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName, ScreenshotType s
 	// The Amiga version doesn't use screenshots
 	if (_vm->getPlatform() == Common::kPlatformAmiga) {
 		_gameHandler = new GameHandler(vm, targetName, false);
-		_screenshotHandler = 0;
+		_screenshotHandler = nullptr;
 	} else {
 		_gameHandler = new GameHandler(vm, targetName, true);
 		_screenshotHandler = new ScreenshotHandler(vm, _gameHandler, sShotType);
@@ -516,7 +516,7 @@ const SaveLoad_v3::SaveFile *SaveLoad_v3::getSaveFile(const char *fileName) cons
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_v3::SaveFile *SaveLoad_v3::getSaveFile(const char *fileName) {
@@ -526,7 +526,7 @@ SaveLoad_v3::SaveFile *SaveLoad_v3::getSaveFile(const char *fileName) {
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_v3::getHandler(const char *fileName) const {
@@ -535,7 +535,7 @@ SaveHandler *SaveLoad_v3::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_v3::getDescription(const char *fileName) const {
@@ -544,7 +544,7 @@ const char *SaveLoad_v3::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_v3::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_v4.cpp b/engines/gob/save/saveload_v4.cpp
index 3fd142c071..6a12f0eae5 100644
--- a/engines/gob/save/saveload_v4.cpp
+++ b/engines/gob/save/saveload_v4.cpp
@@ -28,18 +28,18 @@
 namespace Gob {
 
 SaveLoad_v4::SaveFile SaveLoad_v4::_saveFiles[] = {
-	{   "cat.inf", kSaveModeSave, 0, "savegame"},
-	{  "save.tmp", kSaveModeSave, 0, "current screen properties"},
-	{ "save0.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 0
-	{ "save1.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 1
-	{ "save2.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 2
-	{ "save3.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 3
-	{ "save4.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 4
-	{ "save5.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 5
-	{ "save6.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 6
-	{ "save7.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 7
-	{ "save8.tmp", kSaveModeSave, 0, "savegame screen properties"}, // Slot 8
-	{ "save9.tmp", kSaveModeSave, 0, "savegame screen properties"}  // Slot 9
+	{   "cat.inf", kSaveModeSave, nullptr, "savegame"},
+	{  "save.tmp", kSaveModeSave, nullptr, "current screen properties"},
+	{ "save0.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 0
+	{ "save1.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 1
+	{ "save2.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 2
+	{ "save3.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 3
+	{ "save4.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 4
+	{ "save5.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 5
+	{ "save6.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 6
+	{ "save7.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 7
+	{ "save8.tmp", kSaveModeSave, nullptr, "savegame screen properties"}, // Slot 8
+	{ "save9.tmp", kSaveModeSave, nullptr, "savegame screen properties"}  // Slot 9
 };
 
 
@@ -83,8 +83,8 @@ SaveLoad_v4::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveH
 
 	_lastSlot = -1;
 
-	_writer = 0;
-	_reader = 0;
+	_writer = nullptr;
+	_reader = nullptr;
 }
 
 SaveLoad_v4::GameHandler::~GameHandler() {
@@ -318,7 +318,7 @@ void SaveLoad_v4::GameHandler::buildIndex(byte *buffer) const {
 bool SaveLoad_v4::GameHandler::createReader(int slot) {
 	// If slot < 0, just check if a reader exists
 	if (slot < 0)
-		return (_reader != 0);
+		return (_reader != nullptr);
 
 	if (!_reader || (_reader->getSlot() != ((uint32) slot))) {
 		Common::String slotFile = _slotFile->build(slot);
@@ -342,7 +342,7 @@ bool SaveLoad_v4::GameHandler::createReader(int slot) {
 
 		if (!_reader->load()) {
 			delete _reader;
-			_reader = 0;
+			_reader = nullptr;
 			return false;
 		}
 	}
@@ -353,7 +353,7 @@ bool SaveLoad_v4::GameHandler::createReader(int slot) {
 bool SaveLoad_v4::GameHandler::createWriter(int slot) {
 	// If slot < 0, just check if a writer exists
 	if (slot < 0)
-		return (_writer != 0);
+		return (_writer != nullptr);
 
 	if (!_writer || (_writer->getSlot() != ((uint32) slot))) {
 		Common::String slotFile = _slotFile->build(slot);
@@ -518,7 +518,7 @@ const SaveLoad_v4::SaveFile *SaveLoad_v4::getSaveFile(const char *fileName) cons
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_v4::SaveFile *SaveLoad_v4::getSaveFile(const char *fileName) {
@@ -528,7 +528,7 @@ SaveLoad_v4::SaveFile *SaveLoad_v4::getSaveFile(const char *fileName) {
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_v4::getHandler(const char *fileName) const {
@@ -537,7 +537,7 @@ SaveHandler *SaveLoad_v4::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_v4::getDescription(const char *fileName) const {
@@ -546,7 +546,7 @@ const char *SaveLoad_v4::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_v4::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_v6.cpp b/engines/gob/save/saveload_v6.cpp
index b6376df022..0a2f859858 100644
--- a/engines/gob/save/saveload_v6.cpp
+++ b/engines/gob/save/saveload_v6.cpp
@@ -28,196 +28,196 @@
 namespace Gob {
 
 SaveLoad_v6::SaveFile SaveLoad_v6::_saveFiles[] = {
-	{    "cat.inf", kSaveModeSave,   0, "savegame"   }, // Save file
-	{  "cata1.inf", kSaveModeSave,   0, "autosave"   }, // Autosave file
-	{    "mdo.def", kSaveModeExists, 0, 0            },
-	{  "no_cd.txt", kSaveModeExists, 0, 0            },
-	{   "vide.inf", kSaveModeIgnore, 0, 0            },
-	{"fenetre.txt", kSaveModeIgnore, 0, 0            },
-	{  "music.txt", kSaveModeIgnore, 0, 0            },
-	{  "cata2.inf", kSaveModeSave,   0, "temp save"  },
-	{  "cata3.inf", kSaveModeSave,   0, "temp save"  },
-	{  "cata2.000", kSaveModeSave,   0, "extra save" }, // Slot 00
-	{  "cata2.001", kSaveModeSave,   0, "extra save" }, // Slot 01
-	{  "cata2.002", kSaveModeSave,   0, "extra save" }, // Slot 02
-	{  "cata2.003", kSaveModeSave,   0, "extra save" }, // Slot 03
-	{  "cata2.004", kSaveModeSave,   0, "extra save" }, // Slot 04
-	{  "cata2.005", kSaveModeSave,   0, "extra save" }, // Slot 05
-	{  "cata2.006", kSaveModeSave,   0, "extra save" }, // Slot 06
-	{  "cata2.007", kSaveModeSave,   0, "extra save" }, // Slot 07
-	{  "cata2.008", kSaveModeSave,   0, "extra save" }, // Slot 08
-	{  "cata2.009", kSaveModeSave,   0, "extra save" }, // Slot 09
-	{  "cata2.010", kSaveModeSave,   0, "extra save" }, // Slot 10
-	{  "cata2.011", kSaveModeSave,   0, "extra save" }, // Slot 11
-	{  "cata2.012", kSaveModeSave,   0, "extra save" }, // Slot 12
-	{  "cata2.013", kSaveModeSave,   0, "extra save" }, // Slot 13
-	{  "cata2.014", kSaveModeSave,   0, "extra save" }, // Slot 14
-	{  "cata2.015", kSaveModeSave,   0, "extra save" }, // Slot 15
-	{  "cata2.016", kSaveModeSave,   0, "extra save" }, // Slot 16
-	{  "cata2.017", kSaveModeSave,   0, "extra save" }, // Slot 17
-	{  "cata2.018", kSaveModeSave,   0, "extra save" }, // Slot 18
-	{  "cata2.019", kSaveModeSave,   0, "extra save" }, // Slot 19
-	{  "cata2.020", kSaveModeSave,   0, "extra save" }, // Slot 20
-	{  "cata2.021", kSaveModeSave,   0, "extra save" }, // Slot 21
-	{  "cata2.022", kSaveModeSave,   0, "extra save" }, // Slot 22
-	{  "cata2.023", kSaveModeSave,   0, "extra save" }, // Slot 23
-	{  "cata2.024", kSaveModeSave,   0, "extra save" }, // Slot 24
-	{  "cata2.025", kSaveModeSave,   0, "extra save" }, // Slot 25
-	{  "cata2.026", kSaveModeSave,   0, "extra save" }, // Slot 26
-	{  "cata2.027", kSaveModeSave,   0, "extra save" }, // Slot 27
-	{  "cata2.028", kSaveModeSave,   0, "extra save" }, // Slot 28
-	{  "cata2.029", kSaveModeSave,   0, "extra save" }, // Slot 29
-	{  "cata2.030", kSaveModeSave,   0, "extra save" }, // Slot 30
-	{  "cata2.031", kSaveModeSave,   0, "extra save" }, // Slot 31
-	{  "cata2.032", kSaveModeSave,   0, "extra save" }, // Slot 32
-	{  "cata2.033", kSaveModeSave,   0, "extra save" }, // Slot 33
-	{  "cata2.034", kSaveModeSave,   0, "extra save" }, // Slot 34
-	{  "cata2.035", kSaveModeSave,   0, "extra save" }, // Slot 35
-	{  "cata2.036", kSaveModeSave,   0, "extra save" }, // Slot 36
-	{  "cata2.037", kSaveModeSave,   0, "extra save" }, // Slot 37
-	{  "cata2.038", kSaveModeSave,   0, "extra save" }, // Slot 38
-	{  "cata2.039", kSaveModeSave,   0, "extra save" }, // Slot 39
-	{  "cata2.040", kSaveModeSave,   0, "extra save" }, // Slot 40
-	{  "cata2.041", kSaveModeSave,   0, "extra save" }, // Slot 41
-	{  "cata2.042", kSaveModeSave,   0, "extra save" }, // Slot 42
-	{  "cata2.043", kSaveModeSave,   0, "extra save" }, // Slot 43
-	{  "cata2.044", kSaveModeSave,   0, "extra save" }, // Slot 44
-	{  "cata2.045", kSaveModeSave,   0, "extra save" }, // Slot 45
-	{  "cata2.046", kSaveModeSave,   0, "extra save" }, // Slot 46
-	{  "cata2.047", kSaveModeSave,   0, "extra save" }, // Slot 47
-	{  "cata2.048", kSaveModeSave,   0, "extra save" }, // Slot 48
-	{  "cata2.049", kSaveModeSave,   0, "extra save" }, // Slot 49
-	{  "cata2.050", kSaveModeSave,   0, "extra save" }, // Slot 50
-	{  "cata2.051", kSaveModeSave,   0, "extra save" }, // Slot 51
-	{  "cata2.052", kSaveModeSave,   0, "extra save" }, // Slot 52
-	{  "cata2.053", kSaveModeSave,   0, "extra save" }, // Slot 53
-	{  "cata2.054", kSaveModeSave,   0, "extra save" }, // Slot 54
-	{  "cata2.055", kSaveModeSave,   0, "extra save" }, // Slot 55
-	{  "cata2.056", kSaveModeSave,   0, "extra save" }, // Slot 56
-	{  "cata2.057", kSaveModeSave,   0, "extra save" }, // Slot 57
-	{  "cata2.058", kSaveModeSave,   0, "extra save" }, // Slot 58
-	{  "cata2.059", kSaveModeSave,   0, "extra save" }, // Slot 59
-	{  "cata3.000", kSaveModeSave,   0, "extra save" }, // Slot 00
-	{  "cata3.001", kSaveModeSave,   0, "extra save" }, // Slot 01
-	{  "cata3.002", kSaveModeSave,   0, "extra save" }, // Slot 02
-	{  "cata3.003", kSaveModeSave,   0, "extra save" }, // Slot 03
-	{  "cata3.004", kSaveModeSave,   0, "extra save" }, // Slot 04
-	{  "cata3.005", kSaveModeSave,   0, "extra save" }, // Slot 05
-	{  "cata3.006", kSaveModeSave,   0, "extra save" }, // Slot 06
-	{  "cata3.007", kSaveModeSave,   0, "extra save" }, // Slot 07
-	{  "cata3.008", kSaveModeSave,   0, "extra save" }, // Slot 08
-	{  "cata3.009", kSaveModeSave,   0, "extra save" }, // Slot 09
-	{  "cata3.010", kSaveModeSave,   0, "extra save" }, // Slot 10
-	{  "cata3.011", kSaveModeSave,   0, "extra save" }, // Slot 11
-	{  "cata3.012", kSaveModeSave,   0, "extra save" }, // Slot 12
-	{  "cata3.013", kSaveModeSave,   0, "extra save" }, // Slot 13
-	{  "cata3.014", kSaveModeSave,   0, "extra save" }, // Slot 14
-	{  "cata3.015", kSaveModeSave,   0, "extra save" }, // Slot 15
-	{  "cata3.016", kSaveModeSave,   0, "extra save" }, // Slot 16
-	{  "cata3.017", kSaveModeSave,   0, "extra save" }, // Slot 17
-	{  "cata3.018", kSaveModeSave,   0, "extra save" }, // Slot 18
-	{  "cata3.019", kSaveModeSave,   0, "extra save" }, // Slot 19
-	{  "cata3.020", kSaveModeSave,   0, "extra save" }, // Slot 20
-	{  "cata3.021", kSaveModeSave,   0, "extra save" }, // Slot 21
-	{  "cata3.022", kSaveModeSave,   0, "extra save" }, // Slot 22
-	{  "cata3.023", kSaveModeSave,   0, "extra save" }, // Slot 23
-	{  "cata3.024", kSaveModeSave,   0, "extra save" }, // Slot 24
-	{  "cata3.025", kSaveModeSave,   0, "extra save" }, // Slot 25
-	{  "cata3.026", kSaveModeSave,   0, "extra save" }, // Slot 26
-	{  "cata3.027", kSaveModeSave,   0, "extra save" }, // Slot 27
-	{  "cata3.028", kSaveModeSave,   0, "extra save" }, // Slot 28
-	{  "cata3.029", kSaveModeSave,   0, "extra save" }, // Slot 29
-	{  "cata3.030", kSaveModeSave,   0, "extra save" }, // Slot 30
-	{  "cata3.031", kSaveModeSave,   0, "extra save" }, // Slot 31
-	{  "cata3.032", kSaveModeSave,   0, "extra save" }, // Slot 32
-	{  "cata3.033", kSaveModeSave,   0, "extra save" }, // Slot 33
-	{  "cata3.034", kSaveModeSave,   0, "extra save" }, // Slot 34
-	{  "cata3.035", kSaveModeSave,   0, "extra save" }, // Slot 35
-	{  "cata3.036", kSaveModeSave,   0, "extra save" }, // Slot 36
-	{  "cata3.037", kSaveModeSave,   0, "extra save" }, // Slot 37
-	{  "cata3.038", kSaveModeSave,   0, "extra save" }, // Slot 38
-	{  "cata3.039", kSaveModeSave,   0, "extra save" }, // Slot 39
-	{  "cata3.040", kSaveModeSave,   0, "extra save" }, // Slot 40
-	{  "cata3.041", kSaveModeSave,   0, "extra save" }, // Slot 41
-	{  "cata3.042", kSaveModeSave,   0, "extra save" }, // Slot 42
-	{  "cata3.043", kSaveModeSave,   0, "extra save" }, // Slot 43
-	{  "cata3.044", kSaveModeSave,   0, "extra save" }, // Slot 44
-	{  "cata3.045", kSaveModeSave,   0, "extra save" }, // Slot 45
-	{  "cata3.046", kSaveModeSave,   0, "extra save" }, // Slot 46
-	{  "cata3.047", kSaveModeSave,   0, "extra save" }, // Slot 47
-	{  "cata3.048", kSaveModeSave,   0, "extra save" }, // Slot 48
-	{  "cata3.049", kSaveModeSave,   0, "extra save" }, // Slot 49
-	{  "cata3.050", kSaveModeSave,   0, "extra save" }, // Slot 50
-	{  "cata3.051", kSaveModeSave,   0, "extra save" }, // Slot 51
-	{  "cata3.052", kSaveModeSave,   0, "extra save" }, // Slot 52
-	{  "cata3.053", kSaveModeSave,   0, "extra save" }, // Slot 53
-	{  "cata3.054", kSaveModeSave,   0, "extra save" }, // Slot 54
-	{  "cata3.055", kSaveModeSave,   0, "extra save" }, // Slot 55
-	{  "cata3.056", kSaveModeSave,   0, "extra save" }, // Slot 56
-	{  "cata3.057", kSaveModeSave,   0, "extra save" }, // Slot 57
-	{  "cata3.058", kSaveModeSave,   0, "extra save" }, // Slot 58
-	{  "cata3.059", kSaveModeSave,   0, "extra save" }, // Slot 59
-	{  "intro.0xx", kSaveModeSave,   0, "temp sprite"}, // Autosave sprite
-	{  "intro.000", kSaveModeSave,   0, "temp sprite"}, // Slot 00
-	{  "intro.001", kSaveModeSave,   0, "temp sprite"}, // Slot 01
-	{  "intro.002", kSaveModeSave,   0, "temp sprite"}, // Slot 02
-	{  "intro.003", kSaveModeSave,   0, "temp sprite"}, // Slot 03
-	{  "intro.004", kSaveModeSave,   0, "temp sprite"}, // Slot 04
-	{  "intro.005", kSaveModeSave,   0, "temp sprite"}, // Slot 05
-	{  "intro.006", kSaveModeSave,   0, "temp sprite"}, // Slot 06
-	{  "intro.007", kSaveModeSave,   0, "temp sprite"}, // Slot 07
-	{  "intro.008", kSaveModeSave,   0, "temp sprite"}, // Slot 08
-	{  "intro.009", kSaveModeSave,   0, "temp sprite"}, // Slot 09
-	{  "intro.010", kSaveModeSave,   0, "temp sprite"}, // Slot 10
-	{  "intro.011", kSaveModeSave,   0, "temp sprite"}, // Slot 11
-	{  "intro.012", kSaveModeSave,   0, "temp sprite"}, // Slot 12
-	{  "intro.013", kSaveModeSave,   0, "temp sprite"}, // Slot 13
-	{  "intro.014", kSaveModeSave,   0, "temp sprite"}, // Slot 14
-	{  "intro.015", kSaveModeSave,   0, "temp sprite"}, // Slot 15
-	{  "intro.016", kSaveModeSave,   0, "temp sprite"}, // Slot 16
-	{  "intro.017", kSaveModeSave,   0, "temp sprite"}, // Slot 17
-	{  "intro.018", kSaveModeSave,   0, "temp sprite"}, // Slot 18
-	{  "intro.019", kSaveModeSave,   0, "temp sprite"}, // Slot 19
-	{  "intro.020", kSaveModeSave,   0, "temp sprite"}, // Slot 20
-	{  "intro.021", kSaveModeSave,   0, "temp sprite"}, // Slot 21
-	{  "intro.022", kSaveModeSave,   0, "temp sprite"}, // Slot 22
-	{  "intro.023", kSaveModeSave,   0, "temp sprite"}, // Slot 23
-	{  "intro.024", kSaveModeSave,   0, "temp sprite"}, // Slot 24
-	{  "intro.025", kSaveModeSave,   0, "temp sprite"}, // Slot 25
-	{  "intro.026", kSaveModeSave,   0, "temp sprite"}, // Slot 26
-	{  "intro.027", kSaveModeSave,   0, "temp sprite"}, // Slot 27
-	{  "intro.028", kSaveModeSave,   0, "temp sprite"}, // Slot 28
-	{  "intro.029", kSaveModeSave,   0, "temp sprite"}, // Slot 29
-	{  "intro.030", kSaveModeSave,   0, "temp sprite"}, // Slot 30
-	{  "intro.031", kSaveModeSave,   0, "temp sprite"}, // Slot 31
-	{  "intro.032", kSaveModeSave,   0, "temp sprite"}, // Slot 32
-	{  "intro.033", kSaveModeSave,   0, "temp sprite"}, // Slot 33
-	{  "intro.034", kSaveModeSave,   0, "temp sprite"}, // Slot 34
-	{  "intro.035", kSaveModeSave,   0, "temp sprite"}, // Slot 35
-	{  "intro.036", kSaveModeSave,   0, "temp sprite"}, // Slot 36
-	{  "intro.037", kSaveModeSave,   0, "temp sprite"}, // Slot 37
-	{  "intro.038", kSaveModeSave,   0, "temp sprite"}, // Slot 38
-	{  "intro.039", kSaveModeSave,   0, "temp sprite"}, // Slot 39
-	{  "intro.040", kSaveModeSave,   0, "temp sprite"}, // Slot 40
-	{  "intro.041", kSaveModeSave,   0, "temp sprite"}, // Slot 41
-	{  "intro.042", kSaveModeSave,   0, "temp sprite"}, // Slot 42
-	{  "intro.043", kSaveModeSave,   0, "temp sprite"}, // Slot 43
-	{  "intro.044", kSaveModeSave,   0, "temp sprite"}, // Slot 44
-	{  "intro.045", kSaveModeSave,   0, "temp sprite"}, // Slot 45
-	{  "intro.046", kSaveModeSave,   0, "temp sprite"}, // Slot 46
-	{  "intro.047", kSaveModeSave,   0, "temp sprite"}, // Slot 47
-	{  "intro.048", kSaveModeSave,   0, "temp sprite"}, // Slot 48
-	{  "intro.049", kSaveModeSave,   0, "temp sprite"}, // Slot 49
-	{  "intro.050", kSaveModeSave,   0, "temp sprite"}, // Slot 50
-	{  "intro.051", kSaveModeSave,   0, "temp sprite"}, // Slot 51
-	{  "intro.052", kSaveModeSave,   0, "temp sprite"}, // Slot 52
-	{  "intro.053", kSaveModeSave,   0, "temp sprite"}, // Slot 53
-	{  "intro.054", kSaveModeSave,   0, "temp sprite"}, // Slot 54
-	{  "intro.055", kSaveModeSave,   0, "temp sprite"}, // Slot 55
-	{  "intro.056", kSaveModeSave,   0, "temp sprite"}, // Slot 56
-	{  "intro.057", kSaveModeSave,   0, "temp sprite"}, // Slot 57
-	{  "intro.058", kSaveModeSave,   0, "temp sprite"}, // Slot 58
-	{  "intro.059", kSaveModeSave,   0, "temp sprite"}  // Slot 59
+	{    "cat.inf", kSaveModeSave,   nullptr, "savegame"   }, // Save file
+	{  "cata1.inf", kSaveModeSave,   nullptr, "autosave"   }, // Autosave file
+	{    "mdo.def", kSaveModeExists, nullptr, nullptr      },
+	{  "no_cd.txt", kSaveModeExists, nullptr, nullptr      },
+	{   "vide.inf", kSaveModeIgnore, nullptr, nullptr      },
+	{"fenetre.txt", kSaveModeIgnore, nullptr, nullptr      },
+	{  "music.txt", kSaveModeIgnore, nullptr, nullptr      },
+	{  "cata2.inf", kSaveModeSave,   nullptr, "temp save"  },
+	{  "cata3.inf", kSaveModeSave,   nullptr, "temp save"  },
+	{  "cata2.000", kSaveModeSave,   nullptr, "extra save" }, // Slot 00
+	{  "cata2.001", kSaveModeSave,   nullptr, "extra save" }, // Slot 01
+	{  "cata2.002", kSaveModeSave,   nullptr, "extra save" }, // Slot 02
+	{  "cata2.003", kSaveModeSave,   nullptr, "extra save" }, // Slot 03
+	{  "cata2.004", kSaveModeSave,   nullptr, "extra save" }, // Slot 04
+	{  "cata2.005", kSaveModeSave,   nullptr, "extra save" }, // Slot 05
+	{  "cata2.006", kSaveModeSave,   nullptr, "extra save" }, // Slot 06
+	{  "cata2.007", kSaveModeSave,   nullptr, "extra save" }, // Slot 07
+	{  "cata2.008", kSaveModeSave,   nullptr, "extra save" }, // Slot 08
+	{  "cata2.009", kSaveModeSave,   nullptr, "extra save" }, // Slot 09
+	{  "cata2.010", kSaveModeSave,   nullptr, "extra save" }, // Slot 10
+	{  "cata2.011", kSaveModeSave,   nullptr, "extra save" }, // Slot 11
+	{  "cata2.012", kSaveModeSave,   nullptr, "extra save" }, // Slot 12
+	{  "cata2.013", kSaveModeSave,   nullptr, "extra save" }, // Slot 13
+	{  "cata2.014", kSaveModeSave,   nullptr, "extra save" }, // Slot 14
+	{  "cata2.015", kSaveModeSave,   nullptr, "extra save" }, // Slot 15
+	{  "cata2.016", kSaveModeSave,   nullptr, "extra save" }, // Slot 16
+	{  "cata2.017", kSaveModeSave,   nullptr, "extra save" }, // Slot 17
+	{  "cata2.018", kSaveModeSave,   nullptr, "extra save" }, // Slot 18
+	{  "cata2.019", kSaveModeSave,   nullptr, "extra save" }, // Slot 19
+	{  "cata2.020", kSaveModeSave,   nullptr, "extra save" }, // Slot 20
+	{  "cata2.021", kSaveModeSave,   nullptr, "extra save" }, // Slot 21
+	{  "cata2.022", kSaveModeSave,   nullptr, "extra save" }, // Slot 22
+	{  "cata2.023", kSaveModeSave,   nullptr, "extra save" }, // Slot 23
+	{  "cata2.024", kSaveModeSave,   nullptr, "extra save" }, // Slot 24
+	{  "cata2.025", kSaveModeSave,   nullptr, "extra save" }, // Slot 25
+	{  "cata2.026", kSaveModeSave,   nullptr, "extra save" }, // Slot 26
+	{  "cata2.027", kSaveModeSave,   nullptr, "extra save" }, // Slot 27
+	{  "cata2.028", kSaveModeSave,   nullptr, "extra save" }, // Slot 28
+	{  "cata2.029", kSaveModeSave,   nullptr, "extra save" }, // Slot 29
+	{  "cata2.030", kSaveModeSave,   nullptr, "extra save" }, // Slot 30
+	{  "cata2.031", kSaveModeSave,   nullptr, "extra save" }, // Slot 31
+	{  "cata2.032", kSaveModeSave,   nullptr, "extra save" }, // Slot 32
+	{  "cata2.033", kSaveModeSave,   nullptr, "extra save" }, // Slot 33
+	{  "cata2.034", kSaveModeSave,   nullptr, "extra save" }, // Slot 34
+	{  "cata2.035", kSaveModeSave,   nullptr, "extra save" }, // Slot 35
+	{  "cata2.036", kSaveModeSave,   nullptr, "extra save" }, // Slot 36
+	{  "cata2.037", kSaveModeSave,   nullptr, "extra save" }, // Slot 37
+	{  "cata2.038", kSaveModeSave,   nullptr, "extra save" }, // Slot 38
+	{  "cata2.039", kSaveModeSave,   nullptr, "extra save" }, // Slot 39
+	{  "cata2.040", kSaveModeSave,   nullptr, "extra save" }, // Slot 40
+	{  "cata2.041", kSaveModeSave,   nullptr, "extra save" }, // Slot 41
+	{  "cata2.042", kSaveModeSave,   nullptr, "extra save" }, // Slot 42
+	{  "cata2.043", kSaveModeSave,   nullptr, "extra save" }, // Slot 43
+	{  "cata2.044", kSaveModeSave,   nullptr, "extra save" }, // Slot 44
+	{  "cata2.045", kSaveModeSave,   nullptr, "extra save" }, // Slot 45
+	{  "cata2.046", kSaveModeSave,   nullptr, "extra save" }, // Slot 46
+	{  "cata2.047", kSaveModeSave,   nullptr, "extra save" }, // Slot 47
+	{  "cata2.048", kSaveModeSave,   nullptr, "extra save" }, // Slot 48
+	{  "cata2.049", kSaveModeSave,   nullptr, "extra save" }, // Slot 49
+	{  "cata2.050", kSaveModeSave,   nullptr, "extra save" }, // Slot 50
+	{  "cata2.051", kSaveModeSave,   nullptr, "extra save" }, // Slot 51
+	{  "cata2.052", kSaveModeSave,   nullptr, "extra save" }, // Slot 52
+	{  "cata2.053", kSaveModeSave,   nullptr, "extra save" }, // Slot 53
+	{  "cata2.054", kSaveModeSave,   nullptr, "extra save" }, // Slot 54
+	{  "cata2.055", kSaveModeSave,   nullptr, "extra save" }, // Slot 55
+	{  "cata2.056", kSaveModeSave,   nullptr, "extra save" }, // Slot 56
+	{  "cata2.057", kSaveModeSave,   nullptr, "extra save" }, // Slot 57
+	{  "cata2.058", kSaveModeSave,   nullptr, "extra save" }, // Slot 58
+	{  "cata2.059", kSaveModeSave,   nullptr, "extra save" }, // Slot 59
+	{  "cata3.000", kSaveModeSave,   nullptr, "extra save" }, // Slot 00
+	{  "cata3.001", kSaveModeSave,   nullptr, "extra save" }, // Slot 01
+	{  "cata3.002", kSaveModeSave,   nullptr, "extra save" }, // Slot 02
+	{  "cata3.003", kSaveModeSave,   nullptr, "extra save" }, // Slot 03
+	{  "cata3.004", kSaveModeSave,   nullptr, "extra save" }, // Slot 04
+	{  "cata3.005", kSaveModeSave,   nullptr, "extra save" }, // Slot 05
+	{  "cata3.006", kSaveModeSave,   nullptr, "extra save" }, // Slot 06
+	{  "cata3.007", kSaveModeSave,   nullptr, "extra save" }, // Slot 07
+	{  "cata3.008", kSaveModeSave,   nullptr, "extra save" }, // Slot 08
+	{  "cata3.009", kSaveModeSave,   nullptr, "extra save" }, // Slot 09
+	{  "cata3.010", kSaveModeSave,   nullptr, "extra save" }, // Slot 10
+	{  "cata3.011", kSaveModeSave,   nullptr, "extra save" }, // Slot 11
+	{  "cata3.012", kSaveModeSave,   nullptr, "extra save" }, // Slot 12
+	{  "cata3.013", kSaveModeSave,   nullptr, "extra save" }, // Slot 13
+	{  "cata3.014", kSaveModeSave,   nullptr, "extra save" }, // Slot 14
+	{  "cata3.015", kSaveModeSave,   nullptr, "extra save" }, // Slot 15
+	{  "cata3.016", kSaveModeSave,   nullptr, "extra save" }, // Slot 16
+	{  "cata3.017", kSaveModeSave,   nullptr, "extra save" }, // Slot 17
+	{  "cata3.018", kSaveModeSave,   nullptr, "extra save" }, // Slot 18
+	{  "cata3.019", kSaveModeSave,   nullptr, "extra save" }, // Slot 19
+	{  "cata3.020", kSaveModeSave,   nullptr, "extra save" }, // Slot 20
+	{  "cata3.021", kSaveModeSave,   nullptr, "extra save" }, // Slot 21
+	{  "cata3.022", kSaveModeSave,   nullptr, "extra save" }, // Slot 22
+	{  "cata3.023", kSaveModeSave,   nullptr, "extra save" }, // Slot 23
+	{  "cata3.024", kSaveModeSave,   nullptr, "extra save" }, // Slot 24
+	{  "cata3.025", kSaveModeSave,   nullptr, "extra save" }, // Slot 25
+	{  "cata3.026", kSaveModeSave,   nullptr, "extra save" }, // Slot 26
+	{  "cata3.027", kSaveModeSave,   nullptr, "extra save" }, // Slot 27
+	{  "cata3.028", kSaveModeSave,   nullptr, "extra save" }, // Slot 28
+	{  "cata3.029", kSaveModeSave,   nullptr, "extra save" }, // Slot 29
+	{  "cata3.030", kSaveModeSave,   nullptr, "extra save" }, // Slot 30
+	{  "cata3.031", kSaveModeSave,   nullptr, "extra save" }, // Slot 31
+	{  "cata3.032", kSaveModeSave,   nullptr, "extra save" }, // Slot 32
+	{  "cata3.033", kSaveModeSave,   nullptr, "extra save" }, // Slot 33
+	{  "cata3.034", kSaveModeSave,   nullptr, "extra save" }, // Slot 34
+	{  "cata3.035", kSaveModeSave,   nullptr, "extra save" }, // Slot 35
+	{  "cata3.036", kSaveModeSave,   nullptr, "extra save" }, // Slot 36
+	{  "cata3.037", kSaveModeSave,   nullptr, "extra save" }, // Slot 37
+	{  "cata3.038", kSaveModeSave,   nullptr, "extra save" }, // Slot 38
+	{  "cata3.039", kSaveModeSave,   nullptr, "extra save" }, // Slot 39
+	{  "cata3.040", kSaveModeSave,   nullptr, "extra save" }, // Slot 40
+	{  "cata3.041", kSaveModeSave,   nullptr, "extra save" }, // Slot 41
+	{  "cata3.042", kSaveModeSave,   nullptr, "extra save" }, // Slot 42
+	{  "cata3.043", kSaveModeSave,   nullptr, "extra save" }, // Slot 43
+	{  "cata3.044", kSaveModeSave,   nullptr, "extra save" }, // Slot 44
+	{  "cata3.045", kSaveModeSave,   nullptr, "extra save" }, // Slot 45
+	{  "cata3.046", kSaveModeSave,   nullptr, "extra save" }, // Slot 46
+	{  "cata3.047", kSaveModeSave,   nullptr, "extra save" }, // Slot 47
+	{  "cata3.048", kSaveModeSave,   nullptr, "extra save" }, // Slot 48
+	{  "cata3.049", kSaveModeSave,   nullptr, "extra save" }, // Slot 49
+	{  "cata3.050", kSaveModeSave,   nullptr, "extra save" }, // Slot 50
+	{  "cata3.051", kSaveModeSave,   nullptr, "extra save" }, // Slot 51
+	{  "cata3.052", kSaveModeSave,   nullptr, "extra save" }, // Slot 52
+	{  "cata3.053", kSaveModeSave,   nullptr, "extra save" }, // Slot 53
+	{  "cata3.054", kSaveModeSave,   nullptr, "extra save" }, // Slot 54
+	{  "cata3.055", kSaveModeSave,   nullptr, "extra save" }, // Slot 55
+	{  "cata3.056", kSaveModeSave,   nullptr, "extra save" }, // Slot 56
+	{  "cata3.057", kSaveModeSave,   nullptr, "extra save" }, // Slot 57
+	{  "cata3.058", kSaveModeSave,   nullptr, "extra save" }, // Slot 58
+	{  "cata3.059", kSaveModeSave,   nullptr, "extra save" }, // Slot 59
+	{  "intro.0xx", kSaveModeSave,   nullptr, "temp sprite"}, // Autosave sprite
+	{  "intro.000", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 00
+	{  "intro.001", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 01
+	{  "intro.002", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 02
+	{  "intro.003", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 03
+	{  "intro.004", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 04
+	{  "intro.005", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 05
+	{  "intro.006", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 06
+	{  "intro.007", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 07
+	{  "intro.008", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 08
+	{  "intro.009", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 09
+	{  "intro.010", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 10
+	{  "intro.011", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 11
+	{  "intro.012", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 12
+	{  "intro.013", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 13
+	{  "intro.014", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 14
+	{  "intro.015", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 15
+	{  "intro.016", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 16
+	{  "intro.017", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 17
+	{  "intro.018", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 18
+	{  "intro.019", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 19
+	{  "intro.020", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 20
+	{  "intro.021", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 21
+	{  "intro.022", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 22
+	{  "intro.023", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 23
+	{  "intro.024", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 24
+	{  "intro.025", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 25
+	{  "intro.026", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 26
+	{  "intro.027", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 27
+	{  "intro.028", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 28
+	{  "intro.029", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 29
+	{  "intro.030", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 30
+	{  "intro.031", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 31
+	{  "intro.032", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 32
+	{  "intro.033", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 33
+	{  "intro.034", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 34
+	{  "intro.035", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 35
+	{  "intro.036", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 36
+	{  "intro.037", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 37
+	{  "intro.038", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 38
+	{  "intro.039", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 39
+	{  "intro.040", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 40
+	{  "intro.041", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 41
+	{  "intro.042", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 42
+	{  "intro.043", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 43
+	{  "intro.044", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 44
+	{  "intro.045", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 45
+	{  "intro.046", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 46
+	{  "intro.047", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 47
+	{  "intro.048", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 48
+	{  "intro.049", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 49
+	{  "intro.050", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 50
+	{  "intro.051", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 51
+	{  "intro.052", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 52
+	{  "intro.053", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 53
+	{  "intro.054", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 54
+	{  "intro.055", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 55
+	{  "intro.056", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 56
+	{  "intro.057", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 57
+	{  "intro.058", kSaveModeSave,   nullptr, "temp sprite"}, // Slot 58
+	{  "intro.059", kSaveModeSave,   nullptr, "temp sprite"}  // Slot 59
 };
 
 
@@ -271,7 +271,7 @@ int SaveLoad_v6::GameHandler::File::getSlotRemainder(int32 offset) const {
 
 SaveLoad_v6::GameHandler::GameHandler(GobEngine *vm, const char *target,
 		SpriteHandler &spriteHandler) : SaveHandler(vm), _spriteHandler(&spriteHandler),
-		_reader(0), _writer(0), _hasExtra(false) {
+		_reader(nullptr), _writer(nullptr), _hasExtra(false) {
 
 	memset(_props, 0, kPropsSize);
 	memset(_index, 0, kIndexSize);
@@ -547,7 +547,7 @@ void SaveLoad_v6::GameHandler::buildIndex(byte *buffer) const {
 	SavePartInfo info(kSlotNameLength, (uint32) _vm->getGameType(),
 			0, _vm->getEndianness(), varSize);
 
-	_slotFile->buildIndex(buffer, info, 0, true);
+	_slotFile->buildIndex(buffer, info, nullptr, true);
 }
 
 void SaveLoad_v6::GameHandler::refreshProps() {
@@ -561,7 +561,7 @@ void SaveLoad_v6::GameHandler::refreshProps() {
 bool SaveLoad_v6::GameHandler::createReader(int slot) {
 	// If slot < 0, just check if a reader exists
 	if (slot < 0)
-		return (_reader != 0);
+		return (_reader != nullptr);
 
 	if (!_reader || (_reader->getSlot() != ((uint32) slot))) {
 		Common::String slotFile = _slotFile->build(slot);
@@ -574,7 +574,7 @@ bool SaveLoad_v6::GameHandler::createReader(int slot) {
 		_reader = new SaveReader(5, slot, slotFile);
 		if (!_reader->load()) {
 			delete _reader;
-			_reader = 0;
+			_reader = nullptr;
 			return false;
 		}
 	}
@@ -585,7 +585,7 @@ bool SaveLoad_v6::GameHandler::createReader(int slot) {
 bool SaveLoad_v6::GameHandler::createWriter(int slot) {
 	// If slot < 0, just check if a writer exists
 	if (slot < 0)
-		return (_writer != 0);
+		return (_writer != nullptr);
 
 	if (!_writer || (_writer->getSlot() != ((uint32) slot))) {
 		Common::String slotFile = _slotFile->build(slot);
@@ -764,7 +764,7 @@ bool SaveLoad_v6::AutoSpriteHandler::save(int16 dataVar, int32 size, int32 offse
 
 
 SaveLoad_v6::TempHandler::TempHandler(GobEngine *vm) : SaveHandler(vm),
-	_empty(true), _size(0), _data(0) {
+	_empty(true), _size(0), _data(nullptr) {
 }
 
 SaveLoad_v6::TempHandler::~TempHandler() {
@@ -815,7 +815,7 @@ bool SaveLoad_v6::TempHandler::deleteFile() {
 
 	_empty = true;
 	_size  = 0;
-	_data  = 0;
+	_data  = nullptr;
 
 	return true;
 }
@@ -894,7 +894,7 @@ const SaveLoad_v6::SaveFile *SaveLoad_v6::getSaveFile(const char *fileName) cons
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_v6::SaveFile *SaveLoad_v6::getSaveFile(const char *fileName) {
@@ -904,7 +904,7 @@ SaveLoad_v6::SaveFile *SaveLoad_v6::getSaveFile(const char *fileName) {
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_v6::getHandler(const char *fileName) const {
@@ -913,7 +913,7 @@ SaveHandler *SaveLoad_v6::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_v6::getDescription(const char *fileName) const {
@@ -922,7 +922,7 @@ const char *SaveLoad_v6::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_v6::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/save/saveload_v7.cpp b/engines/gob/save/saveload_v7.cpp
index aced4f50ba..499ceefce7 100644
--- a/engines/gob/save/saveload_v7.cpp
+++ b/engines/gob/save/saveload_v7.cpp
@@ -29,40 +29,40 @@ namespace Gob {
 
 SaveLoad_v7::SaveFile SaveLoad_v7::_saveFiles[] = {
 	// Addy Junior Base
-	{"visage01.inf", kSaveModeSave, 0, "face"         }, // Child 01
-	{"visage02.inf", kSaveModeSave, 0, "face"         }, // Child 02
-	{"visage03.inf", kSaveModeSave, 0, "face"         }, // Child 03
-	{"visage04.inf", kSaveModeSave, 0, "face"         }, // Child 04
-	{"visage05.inf", kSaveModeSave, 0, "face"         }, // Child 05
-	{"visage06.inf", kSaveModeSave, 0, "face"         }, // Child 06
-	{"visage07.inf", kSaveModeSave, 0, "face"         }, // Child 07
-	{"visage08.inf", kSaveModeSave, 0, "face"         }, // Child 08
-	{"visage09.inf", kSaveModeSave, 0, "face"         }, // Child 09
-	{"visage10.inf", kSaveModeSave, 0, "face"         }, // Child 10
-	{"visage11.inf", kSaveModeSave, 0, "face"         }, // Child 11
-	{"visage12.inf", kSaveModeSave, 0, "face"         }, // Child 12
-	{"visage13.inf", kSaveModeSave, 0, "face"         }, // Child 13
-	{"visage14.inf", kSaveModeSave, 0, "face"         }, // Child 14
-	{"visage15.inf", kSaveModeSave, 0, "face"         }, // Child 15
-	{"visage16.inf", kSaveModeSave, 0, "face"         }, // Child 16
-	{  "enfant.inf", kSaveModeSave, 0, "children"     },
-	{   "debil.tmp", kSaveModeSave, 0, 0              },
-	{  "config.inf", kSaveModeSave, 0, "configuration"},
+	{"visage01.inf", kSaveModeSave, nullptr, "face"         }, // Child 01
+	{"visage02.inf", kSaveModeSave, nullptr, "face"         }, // Child 02
+	{"visage03.inf", kSaveModeSave, nullptr, "face"         }, // Child 03
+	{"visage04.inf", kSaveModeSave, nullptr, "face"         }, // Child 04
+	{"visage05.inf", kSaveModeSave, nullptr, "face"         }, // Child 05
+	{"visage06.inf", kSaveModeSave, nullptr, "face"         }, // Child 06
+	{"visage07.inf", kSaveModeSave, nullptr, "face"         }, // Child 07
+	{"visage08.inf", kSaveModeSave, nullptr, "face"         }, // Child 08
+	{"visage09.inf", kSaveModeSave, nullptr, "face"         }, // Child 09
+	{"visage10.inf", kSaveModeSave, nullptr, "face"         }, // Child 10
+	{"visage11.inf", kSaveModeSave, nullptr, "face"         }, // Child 11
+	{"visage12.inf", kSaveModeSave, nullptr, "face"         }, // Child 12
+	{"visage13.inf", kSaveModeSave, nullptr, "face"         }, // Child 13
+	{"visage14.inf", kSaveModeSave, nullptr, "face"         }, // Child 14
+	{"visage15.inf", kSaveModeSave, nullptr, "face"         }, // Child 15
+	{"visage16.inf", kSaveModeSave, nullptr, "face"         }, // Child 16
+	{  "enfant.inf", kSaveModeSave, nullptr, "children"     },
+	{   "debil.tmp", kSaveModeSave, nullptr, nullptr              },
+	{  "config.inf", kSaveModeSave, nullptr, "configuration"},
 // Addy 4 Base
-	{"config00.inf", kSaveModeSave, 0, 0              },
-	{"statev00.inf", kSaveModeSave, 0, 0              },
+	{"config00.inf", kSaveModeSave, nullptr, nullptr              },
+	{"statev00.inf", kSaveModeSave, nullptr, nullptr              },
 	// Addy 4 Grundschule
-	{ "premier.dep", kSaveModeSave, 0, 0              },
-	{ "quitter.dep", kSaveModeSave, 0, 0              },
-	{   "appel.dep", kSaveModeSave, 0, 0              },
-	{  "parole.dep", kSaveModeSave, 0, 0              },
-	{    "ado4.inf", kSaveModeSave, 0, 0              },
-	{"mcurrent.inf", kSaveModeSave, 0, 0              },
-	{   "perso.dep", kSaveModeSave, 0, 0              },
-	{ "nouveau.dep", kSaveModeSave, 0, 0              },
-	{     "adi.tmp", kSaveModeSave, 0, 0              },
-	{     "adi.inf", kSaveModeSave, 0, 0              },
-	{    "adi4.tmp", kSaveModeSave, 0, 0              }
+	{ "premier.dep", kSaveModeSave, nullptr, nullptr              },
+	{ "quitter.dep", kSaveModeSave, nullptr, nullptr              },
+	{   "appel.dep", kSaveModeSave, nullptr, nullptr              },
+	{  "parole.dep", kSaveModeSave, nullptr, nullptr              },
+	{    "ado4.inf", kSaveModeSave, nullptr, nullptr              },
+	{"mcurrent.inf", kSaveModeSave, nullptr, nullptr              },
+	{   "perso.dep", kSaveModeSave, nullptr, nullptr              },
+	{ "nouveau.dep", kSaveModeSave, nullptr, nullptr              },
+	{     "adi.tmp", kSaveModeSave, nullptr, nullptr              },
+	{     "adi.inf", kSaveModeSave, nullptr, nullptr              },
+	{    "adi4.tmp", kSaveModeSave, nullptr, nullptr              }
 };
 
 
@@ -105,7 +105,7 @@ const SaveLoad_v7::SaveFile *SaveLoad_v7::getSaveFile(const char *fileName) cons
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad_v7::SaveFile *SaveLoad_v7::getSaveFile(const char *fileName) {
@@ -115,7 +115,7 @@ SaveLoad_v7::SaveFile *SaveLoad_v7::getSaveFile(const char *fileName) {
 		if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
 			return &_saveFiles[i];
 
-	return 0;
+	return nullptr;
 }
 
 SaveHandler *SaveLoad_v7::getHandler(const char *fileName) const {
@@ -124,7 +124,7 @@ SaveHandler *SaveLoad_v7::getHandler(const char *fileName) const {
 	if (saveFile)
 		return saveFile->handler;
 
-	return 0;
+	return nullptr;
 }
 
 const char *SaveLoad_v7::getDescription(const char *fileName) const {
@@ -133,7 +133,7 @@ const char *SaveLoad_v7::getDescription(const char *fileName) const {
 	if (saveFile)
 		return saveFile->description;
 
-	return 0;
+	return nullptr;
 }
 
 SaveLoad::SaveMode SaveLoad_v7::getSaveMode(const char *fileName) const {
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index 2d9021805a..5c1a144d66 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -60,7 +60,7 @@ Scenery::Scenery(GobEngine *vm) : _vm(vm) {
 	_animTop  = 0;
 	_animLeft = 0;
 
-	_pCaptureCounter = 0;
+	_pCaptureCounter = nullptr;
 
 	for (int i = 0; i < 70; i++) {
 		_staticPictToSprite[i] = 0;
@@ -160,7 +160,7 @@ int16 Scenery::loadStatic(char search) {
 				ptr->layers[i].planes[j].transp     = layerData.readSByte();
 			}
 		} else
-			ptr->layers[i].planes = 0;
+			ptr->layers[i].planes = nullptr;
 
 		ptr->layers[i].backResId = (int16) READ_LE_UINT16(backsPtr);
 		backsPtr += 2;
@@ -186,7 +186,7 @@ int16 Scenery::loadStatic(char search) {
 			_staticPictToSprite[7 * sceneryIndex + i] = sprIndex;
 			_spriteRefs[sprIndex]++;
 		} else {
-			for (sprIndex = 19; _vm->_draw->_spritesArray[sprIndex] != 0; sprIndex--) { }
+			for (sprIndex = 19; _vm->_draw->_spritesArray[sprIndex] != nullptr; sprIndex--) { }
 
 			_staticPictToSprite[7 * sceneryIndex + i] = sprIndex;
 			_spriteRefs[sprIndex] = 1;
diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp
index ce077f723a..d70abb1c56 100644
--- a/engines/gob/script.cpp
+++ b/engines/gob/script.cpp
@@ -36,11 +36,11 @@ Script::Script(GobEngine *vm) : _vm(vm) {
 
 	_finished = true;
 
-	_totData = 0;
-	_totPtr = 0;
+	_totData = nullptr;
+	_totPtr = nullptr;
 	_totSize = 0;
 
-	_lom = 0;
+	_lom = nullptr;
 
 	memset(&_totProperties, 0, sizeof(TOTFile::Properties));
 }
@@ -140,9 +140,9 @@ int32 Script::getOffset(byte *ptr) const {
 
 byte *Script::getData(int32 offset) const {
 	if (!_totData)
-		return 0;
+		return nullptr;
 	if ((offset < 0) || (((uint32) offset) >= _totSize))
-		return 0;
+		return nullptr;
 
 	return _totData + offset;
 }
@@ -322,12 +322,12 @@ bool Script::evalBool() {
 }
 
 int32 Script::evalInt() {
-	evalExpr(0);
+	evalExpr(nullptr);
 	return getResultInt();
 }
 
 const char *Script::evalString() {
-	evalExpr(0);
+	evalExpr(nullptr);
 	return getResultStr();
 }
 
@@ -410,7 +410,7 @@ void Script::unload() {
 
 void Script::unloadTOT() {
 	delete _lom;
-	_lom = 0;
+	_lom = nullptr;
 
 	// Unwind the call stack
 	while (!_callStack.empty())
@@ -418,16 +418,16 @@ void Script::unloadTOT() {
 
 	delete[] _totData;
 
-	_totData = 0;
+	_totData = nullptr;
 	_totSize = 0;
-	_totPtr = 0;
+	_totPtr = nullptr;
 	_totFile.clear();
 
 	_finished = true;
 }
 
 bool Script::isLoaded() const {
-	return _totData != 0;
+	return _totData != nullptr;
 }
 
 void Script::setFinished(bool finished) {
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index 2a9a716058..1268d1fa0b 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -115,7 +115,7 @@ const uint16 AdLib::kHihatParams    [kParamCount] = {
 	  0,  1,  0, 15, 11,  0,  7,  5,  0,  0,  0,  0,  0,  0   };
 
 
-AdLib::AdLib(int callbackFreq) : _opl(0),
+AdLib::AdLib(int callbackFreq) : _opl(nullptr),
 	_toPoll(0), _repCount(0), _first(true), _playing(false), _ended(true), _volume(0) {
 
 	initFreqs();
diff --git a/engines/gob/sound/adlplayer.cpp b/engines/gob/sound/adlplayer.cpp
index 5a279970cc..c6a0638f16 100644
--- a/engines/gob/sound/adlplayer.cpp
+++ b/engines/gob/sound/adlplayer.cpp
@@ -29,7 +29,7 @@
 namespace Gob {
 
 ADLPlayer::ADLPlayer() : AdLib(1000),
-	_songData(0), _songDataSize(0), _playPos(0) {
+	_songData(nullptr), _songDataSize(0), _playPos(nullptr) {
 
 }
 
@@ -44,10 +44,10 @@ void ADLPlayer::unload() {
 
 	delete[] _songData;
 
-	_songData     = 0;
+	_songData     = nullptr;
 	_songDataSize = 0;
 
-	_playPos = 0;
+	_playPos = nullptr;
 }
 
 uint32 ADLPlayer::pollMusic(bool first) {
diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp
index b862ca96fb..14cf3c47dd 100644
--- a/engines/gob/sound/cdrom.cpp
+++ b/engines/gob/sound/cdrom.cpp
@@ -36,7 +36,7 @@ namespace Gob {
 CDROM::CDROM() {
 	_cdPlaying = false;
 
-	_LICbuffer = 0;
+	_LICbuffer = nullptr;
 	for (int i = 0; i < 16; i++)
 		_curTrack[i] = 0;
 	_numTracks = 0;
@@ -78,7 +78,7 @@ void CDROM::readLIC(Common::SeekableReadStream &stream) {
 
 void CDROM::freeLICBuffer() {
 	delete[] _LICbuffer;
-	_LICbuffer = 0;
+	_LICbuffer = nullptr;
 }
 
 void CDROM::startTrack(const char *trackName) {
@@ -162,7 +162,7 @@ void CDROM::stopPlaying() {
 }
 
 void CDROM::stop() {
-	_curTrackBuffer = 0;
+	_curTrackBuffer = nullptr;
 	g_system->getAudioCDManager()->stop();
 	_cdPlaying = false;
 }
@@ -173,7 +173,7 @@ void CDROM::testCD(int trySubst, const char *label) {
 		return;
 	}
 
-	_LICbuffer = 0;
+	_LICbuffer = nullptr;
 	_cdPlaying = false;
 
 	// Original checked CD label here
@@ -183,9 +183,9 @@ void CDROM::testCD(int trySubst, const char *label) {
 
 byte *CDROM::getTrackBuffer(const char *trackName) const {
 	if (!_LICbuffer || !trackName)
-		return 0;
+		return nullptr;
 
-	byte *matchPtr = 0;
+	byte *matchPtr = nullptr;
 	byte *curPtr = _LICbuffer;
 
 	for (int i = 0; i < _numTracks; i++) {
diff --git a/engines/gob/sound/infogrames.cpp b/engines/gob/sound/infogrames.cpp
index 016bbfb1ff..96eb35c857 100644
--- a/engines/gob/sound/infogrames.cpp
+++ b/engines/gob/sound/infogrames.cpp
@@ -27,8 +27,8 @@
 namespace Gob {
 
 Infogrames::Infogrames(Audio::Mixer &mixer) : _mixer(&mixer) {
-	_instruments = 0;
-	_song = 0;
+	_instruments = nullptr;
+	_song = nullptr;
 }
 
 Infogrames::~Infogrames() {
@@ -76,7 +76,7 @@ void Infogrames::stop() {
 
 void Infogrames::clearInstruments() {
 	delete _instruments;
-	_instruments = 0;
+	_instruments = nullptr;
 }
 
 void Infogrames::clearSong() {
@@ -84,7 +84,7 @@ void Infogrames::clearSong() {
 		_mixer->stopHandle(_handle);
 
 		delete _song;
-		_song = 0;
+		_song = nullptr;
 	}
 }
 
diff --git a/engines/gob/sound/musplayer.cpp b/engines/gob/sound/musplayer.cpp
index b0f7e6dad5..3b81eab497 100644
--- a/engines/gob/sound/musplayer.cpp
+++ b/engines/gob/sound/musplayer.cpp
@@ -28,7 +28,7 @@
 namespace Gob {
 
 MUSPlayer::MUSPlayer() : AdLib(60),
-	_songData(0), _songDataSize(0), _playPos(0), _songID(0) {
+	_songData(nullptr), _songDataSize(0), _playPos(nullptr), _songID(0) {
 
 }
 
@@ -363,10 +363,10 @@ void MUSPlayer::unloadSND() {
 void MUSPlayer::unloadMUS() {
 	delete[] _songData;
 
-	_songData     = 0;
+	_songData     = nullptr;
 	_songDataSize = 0;
 
-	_playPos = 0;
+	_playPos = nullptr;
 }
 
 uint32 MUSPlayer::getSongID() const {
diff --git a/engines/gob/sound/protracker.cpp b/engines/gob/sound/protracker.cpp
index 7cf8dbb37c..e44d81b62a 100644
--- a/engines/gob/sound/protracker.cpp
+++ b/engines/gob/sound/protracker.cpp
@@ -30,7 +30,7 @@
 namespace Gob {
 
 Protracker::Protracker(Audio::Mixer &mixer) : _mixer(&mixer) {
-	_protrackerStream = 0;
+	_protrackerStream = nullptr;
 }
 
 Protracker::~Protracker() {
@@ -61,7 +61,7 @@ void Protracker::stop() {
 		_mixer->stopHandle(_handle);
 
 		delete _protrackerStream;
-		_protrackerStream = 0;
+		_protrackerStream = nullptr;
 	}
 }
 
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
index 4c358f5c31..087b4539a2 100644
--- a/engines/gob/sound/sound.cpp
+++ b/engines/gob/sound/sound.cpp
@@ -43,12 +43,12 @@ Sound::Sound(GobEngine *vm) : _vm(vm) {
 	_pcspeaker = new PCSpeaker(*_vm->_mixer);
 	_blaster = new SoundBlaster(*_vm->_mixer);
 
-	_adlPlayer = 0;
-	_mdyPlayer = 0;
-	_infogrames = 0;
-	_protracker = 0;
-	_cdrom = 0;
-	_bgatmos = 0;
+	_adlPlayer = nullptr;
+	_mdyPlayer = nullptr;
+	_infogrames = nullptr;
+	_protracker = nullptr;
+	_cdrom = nullptr;
+	_bgatmos = nullptr;
 
 	_hasAdLib = (!_vm->_noMusic && _vm->hasAdLib());
 
@@ -90,14 +90,14 @@ void Sound::convToSigned(byte *buffer, int length) {
 
 SoundDesc *Sound::sampleGetBySlot(int slot) {
 	if ((slot < 0) || (slot >= kSoundsCount))
-		return 0;
+		return nullptr;
 
 	return &_sounds[slot];
 }
 
 const SoundDesc *Sound::sampleGetBySlot(int slot) const {
 	if ((slot < 0) || (slot >= kSoundsCount))
-		return 0;
+		return nullptr;
 
 	return &_sounds[slot];
 }
@@ -354,7 +354,7 @@ void Sound::adlibPlayBgMusic() {
 		"musmac5.mid"
 	};
 
-	const char *track = 0;
+	const char *track = nullptr;
 	if (_vm->getPlatform() == Common::kPlatformWindows)
 		track = tracksWin[_vm->_util->getRandom(ARRAYSIZE(tracksWin))];
 	else
@@ -754,7 +754,7 @@ void Sound::createMDYPlayer() {
 		return;
 
 	delete _adlPlayer;
-	_adlPlayer = 0;
+	_adlPlayer = nullptr;
 
 	_mdyPlayer = new MUSPlayer();
 }
@@ -764,7 +764,7 @@ void Sound::createADLPlayer() {
 		return;
 
 	delete _mdyPlayer;
-	_mdyPlayer= 0;
+	_mdyPlayer= nullptr;
 
 	_adlPlayer = new ADLPlayer();
 }
diff --git a/engines/gob/sound/soundblaster.cpp b/engines/gob/sound/soundblaster.cpp
index 9514e93210..c6cd5c55f5 100644
--- a/engines/gob/sound/soundblaster.cpp
+++ b/engines/gob/sound/soundblaster.cpp
@@ -26,9 +26,9 @@
 namespace Gob {
 
 SoundBlaster::SoundBlaster(Audio::Mixer &mixer) : SoundMixer(mixer, Audio::Mixer::kSFXSoundType) {
-	_curSoundDesc = 0;
+	_curSoundDesc = nullptr;
 
-	_compositionSamples = 0;
+	_compositionSamples = nullptr;
 	_compositionSampleCount = 0;
 	_compositionPos = -1;
 
@@ -52,7 +52,7 @@ void SoundBlaster::stopSound(int16 fadeLength, SoundDesc *sndDesc) {
 	_compositionRepCount = 0;
 
 	if (fadeLength <= 0)
-		_curSoundDesc = 0;
+		_curSoundDesc = nullptr;
 
 	SoundMixer::stop(fadeLength);
 }
@@ -136,7 +136,7 @@ void SoundBlaster::checkEndSample() {
 void SoundBlaster::endFade() {
 	if (_fadeVolStep > 0) {
 		_compositionPos = -1;
-		_curSoundDesc = 0;
+		_curSoundDesc = nullptr;
 	}
 
 	SoundMixer::endFade();
diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp
index 5997c994b9..0170cffcdd 100644
--- a/engines/gob/sound/sounddesc.cpp
+++ b/engines/gob/sound/sounddesc.cpp
@@ -33,9 +33,9 @@
 namespace Gob {
 
 SoundDesc::SoundDesc() {
-	_resource = 0;
+	_resource = nullptr;
 
-	_data = _dataPtr = 0;
+	_data = _dataPtr = nullptr;
 	_size = 0;
 
 	_type = SOUND_SND;
@@ -73,7 +73,7 @@ void SoundDesc::set(SoundType type, byte *data, uint32 dSize) {
 }
 
 void SoundDesc::set(SoundType type, Resource *resource) {
-	byte *data = 0;
+	byte *data = nullptr;
 	uint32 dSize = 0;
 
 	if (resource && (resource->getSize() > 0)) {
@@ -117,14 +117,14 @@ bool SoundDesc::load(SoundType type, Resource *resource) {
 void SoundDesc::free() {
 	if (_resource) {
 		delete _resource;
-		_data = 0;
+		_data = nullptr;
 	}
 
 	delete[] _data;
 
-	_resource = 0;
-	_data = 0;
-	_dataPtr = 0;
+	_resource = nullptr;
+	_data = nullptr;
+	_dataPtr = nullptr;
 	_id = 0;
 }
 
@@ -174,7 +174,7 @@ bool SoundDesc::loadWAV(byte *data, uint32 dSize) {
 	byte wavFlags;
 	uint16 wavtype;
 
-	if (!Audio::loadWAVFromStream(stream, wavSize, wavRate, wavFlags, &wavtype, 0))
+	if (!Audio::loadWAVFromStream(stream, wavSize, wavRate, wavFlags, &wavtype, nullptr))
 		return false;
 
 	if (wavFlags & Audio::FLAG_16BITS) {
diff --git a/engines/gob/sound/soundmixer.cpp b/engines/gob/sound/soundmixer.cpp
index ef073e564b..919383b6a5 100644
--- a/engines/gob/sound/soundmixer.cpp
+++ b/engines/gob/sound/soundmixer.cpp
@@ -34,7 +34,7 @@ SoundMixer::SoundMixer(Audio::Mixer &mixer, Audio::Mixer::SoundType type) : _mix
 
 	_rate = _mixer->getOutputRate();
 	_end = true;
-	_data = 0;
+	_data = nullptr;
 	_length = 0;
 	_freq = 0;
 	_repCount = 0;
@@ -78,7 +78,7 @@ void SoundMixer::stop(int16 fadeLength) {
 	Common::StackLock slock(_mutex);
 
 	if (fadeLength <= 0) {
-		_data = 0;
+		_data = nullptr;
 		_end = true;
 		_playingSound = 0;
 		return;
@@ -204,7 +204,7 @@ int SoundMixer::readBuffer(int16 *buffer, const int numSamples) {
 
 void SoundMixer::endFade() {
 	if (_fadeVolStep > 0) {
-		_data = 0;
+		_data = nullptr;
 		_end = true;
 		_playingSound = 0;
 	} else {
diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp
index 9cc0f944a7..fc0a45091d 100644
--- a/engines/gob/surface.cpp
+++ b/engines/gob/surface.cpp
@@ -189,7 +189,7 @@ Surface::Surface(uint16 width, uint16 height, uint8 bpp, byte *vidMem) :
 }
 
 Surface::Surface(uint16 width, uint16 height, uint8 bpp, const byte *vidMem) :
-	_width(width), _height(height), _bpp(bpp), _vidMem(0) {
+	_width(width), _height(height), _bpp(bpp), _vidMem(nullptr) {
 
 	assert((_width > 0) && (_height > 0));
 	assert((_bpp == 1) || (_bpp == 2) || (_bpp == 4));
diff --git a/engines/gob/totfile.cpp b/engines/gob/totfile.cpp
index 04c744d965..286365d72b 100644
--- a/engines/gob/totfile.cpp
+++ b/engines/gob/totfile.cpp
@@ -31,7 +31,7 @@
 namespace Gob {
 
 TOTFile::TOTFile(GobEngine *vm) : _vm(vm) {
-	_stream = 0;
+	_stream = nullptr;
 
 	memset(_header, 0, 128);
 }
@@ -62,7 +62,7 @@ bool TOTFile::load(const Common::String &fileName) {
 void TOTFile::unload() {
 	delete _stream;
 
-	_stream = 0;
+	_stream = nullptr;
 }
 
 Common::SeekableReadStream *TOTFile::getStream() const {
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 6d32e4c262..7deead6b25 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -357,7 +357,7 @@ void Util::getMouseState(int16 *pX, int16 *pY, MouseButtons *pButtons) {
 	*pX = mouse.x + _vm->_video->_scrollOffsetX - _vm->_video->_screenDeltaX;
 	*pY = mouse.y + _vm->_video->_scrollOffsetY - _vm->_video->_screenDeltaY;
 
-	if (pButtons != 0)
+	if (pButtons != nullptr)
 		*pButtons = _mouseButtons;
 }
 
@@ -560,7 +560,7 @@ void Util::cleanupStr(char *str) {
 		}
 
 		end = strchr(start + 1, ' ');
-		start = end ? end + 1 : 0;
+		start = end ? end + 1 : nullptr;
 	}
 }
 
@@ -571,23 +571,23 @@ void Util::listInsertFront(List *list, void *data) {
 	if (list->pHead) {
 		node->pData = data;
 		node->pNext = list->pHead;
-		node->pPrev = 0;
+		node->pPrev = nullptr;
 		list->pHead->pPrev = node;
 		list->pHead = node;
 	} else {
 		list->pHead = node;
 		list->pTail = node;
 		node->pData = data;
-		node->pNext = 0;
-		node->pPrev = 0;
+		node->pNext = nullptr;
+		node->pPrev = nullptr;
 	}
 }
 
 void Util::listInsertBack(List *list, void *data) {
 	ListNode *node;
 
-	if (list->pHead != 0) {
-		if (list->pTail == 0) {
+	if (list->pHead != nullptr) {
+		if (list->pTail == nullptr) {
 			list->pTail = list->pHead;
 			warning("Util::listInsertBack(): Broken list");
 		}
@@ -595,7 +595,7 @@ void Util::listInsertBack(List *list, void *data) {
 		node = new ListNode;
 		node->pData = data;
 		node->pPrev = list->pTail;
-		node->pNext = 0;
+		node->pNext = nullptr;
 		list->pTail->pNext = node;
 		list->pTail = node;
 	} else
@@ -603,14 +603,14 @@ void Util::listInsertBack(List *list, void *data) {
 }
 
 void Util::listDropFront(List *list) {
-	if (list->pHead->pNext == 0) {
+	if (list->pHead->pNext == nullptr) {
 		delete list->pHead;
-		list->pHead = 0;
-		list->pTail = 0;
+		list->pHead = nullptr;
+		list->pTail = nullptr;
 	} else {
 		list->pHead = list->pHead->pNext;
 		delete list->pHead->pPrev;
-		list->pHead->pPrev = 0;
+		list->pHead->pPrev = nullptr;
 	}
 }
 
diff --git a/engines/gob/variables.cpp b/engines/gob/variables.cpp
index b74c18fb2f..26667edacf 100644
--- a/engines/gob/variables.cpp
+++ b/engines/gob/variables.cpp
@@ -243,7 +243,7 @@ uint32 VariablesBE::read32(const byte *buf) const {
 }
 
 VariableReference::VariableReference() {
-	_vars = 0;
+	_vars = nullptr;
 	_offset = 0;
 }
 
diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp
index 0a7f8cb91c..0e59d1493f 100644
--- a/engines/gob/video.cpp
+++ b/engines/gob/video.cpp
@@ -47,7 +47,7 @@ Font::Font(const byte *data) : _dataPtr(data) {
 	_itemHeight = _dataPtr[1];
 	_startItem  = _dataPtr[2];
 	_endItem    = _dataPtr[3];
-	_charWidths = 0;
+	_charWidths = nullptr;
 
 	uint8 rowAlignedBits = (_itemWidth - 1) / 8 + 1;
 
@@ -89,7 +89,7 @@ bool Font::hasChar(uint8 c) const {
 }
 
 bool Font::isMonospaced() const {
-	return _charWidths == 0;
+	return _charWidths == nullptr;
 }
 
 void Font::drawLetter(Surface &surf, uint8 c, uint16 x, uint16 y,
@@ -158,11 +158,11 @@ void Font::drawString(const Common::String &str, int16 x, int16 y, int16 color1,
 const byte *Font::getCharData(uint8 c) const {
 	if (_endItem == 0) {
 		warning("Font::getCharData(): _endItem == 0");
-		return 0;
+		return nullptr;
 	}
 
 	if ((c < _startItem) || (c > _endItem))
-		return 0;
+		return nullptr;
 
 	return _data + (c - _startItem) * _itemSize;
 }
diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp
index bbc2f457c2..a8db233983 100644
--- a/engines/gob/video_v6.cpp
+++ b/engines/gob/video_v6.cpp
@@ -70,7 +70,7 @@ void Video_v6::drawPacked(const byte *sprBuf, int16 x, int16 y, Surface &surfDes
 	data += 4;
 
 	const byte *srcData = data;
-	byte *uncBuf = 0;
+	byte *uncBuf = nullptr;
 
 	if (*srcData++ != 0) {
 		uint32 size = READ_LE_UINT32(data);


Commit: 3162ad4dfbd39ad87d22f248fbfce2b008790cd0
    https://github.com/scummvm/scummvm/commit/3162ad4dfbd39ad87d22f248fbfce2b008790cd0
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
GRIFFON: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/griffon/detection.cpp
    engines/griffon/sound.cpp


diff --git a/engines/griffon/detection.cpp b/engines/griffon/detection.cpp
index 87c1650b85..51fa3cb515 100644
--- a/engines/griffon/detection.cpp
+++ b/engines/griffon/detection.cpp
@@ -28,7 +28,7 @@
 
 static const PlainGameDescriptor griffonGames[] = {
 	{"griffon", "The Griffon Legend"},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 #define GAMEOPTION_TTS_NARRATOR 	GUIO_GAMEOPTIONS1
@@ -51,7 +51,7 @@ namespace Griffon {
 static const ADGameDescription gameDescriptions[] = {
 	{
 		"griffon",
-		NULL,
+		nullptr,
 		AD_ENTRY1s("objectdb.dat", "ec5371da28f01ccf88980b32d9de2232", 27754),
 		Common::EN_ANY,
 		Common::kPlatformWindows,
diff --git a/engines/griffon/sound.cpp b/engines/griffon/sound.cpp
index c15f6e7567..e6d76160fb 100644
--- a/engines/griffon/sound.cpp
+++ b/engines/griffon/sound.cpp
@@ -191,7 +191,7 @@ void GriffonEngine::setupAudio() {
 void GriffonEngine::updateMusic() {
 	static int loopseta = 0;
 
-	DataChunk *iplaysound = NULL;
+	DataChunk *iplaysound = nullptr;
 
 	if (config.music) {
 		// if(_curmap > 5 && _curmap < 42) iplaysound = macademy;
@@ -201,11 +201,11 @@ void GriffonEngine::updateMusic() {
 			iplaysound = _musicBoss;
 
 		if (iplaysound == _musicBoss && _playingBoss)
-			iplaysound = NULL;
+			iplaysound = nullptr;
 		if (iplaysound == _musicGardens1 && _playingGardens)
-			iplaysound = NULL;
+			iplaysound = nullptr;
 
-		if (iplaysound != NULL) {
+		if (iplaysound != nullptr) {
 			haltSoundChannel(_musicChannel);
 
 			_playingBoss = (iplaysound == _musicBoss);


Commit: 415986010ef8dd2bcec511ec3f9b65072022a762
    https://github.com/scummvm/scummvm/commit/415986010ef8dd2bcec511ec3f9b65072022a762
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
GRIM: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/grim/gfx_opengl_shaders.cpp
    engines/grim/remastered/overlay.cpp


diff --git a/engines/grim/gfx_opengl_shaders.cpp b/engines/grim/gfx_opengl_shaders.cpp
index 92f3f665dc..c30d29451d 100644
--- a/engines/grim/gfx_opengl_shaders.cpp
+++ b/engines/grim/gfx_opengl_shaders.cpp
@@ -211,7 +211,7 @@ GfxOpenGLS::GfxOpenGLS() {
 	_fov = -1.0;
 	_nclip = -1;
 	_fclip = -1;
-	_selectedTexture = NULL;
+	_selectedTexture = nullptr;
 	_emergTexture = 0;
 	_maxLights = 8;
 	_lights = new GLSLight[_maxLights];
@@ -272,7 +272,7 @@ void GfxOpenGLS::setupZBuffer() {
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-	glTexImage2D(GL_TEXTURE_2D, 0, format, nextHigher2((int)width), nextHigher2((int)height), 0, format, type, NULL);
+	glTexImage2D(GL_TEXTURE_2D, 0, format, nextHigher2((int)width), nextHigher2((int)height), 0, format, type, nullptr);
 	glActiveTexture(GL_TEXTURE0);
 
 	_zBufTexCrop = Math::Vector2d(width / nextHigher2((int)width), height / nextHigher2((int)height));
@@ -322,7 +322,7 @@ void GfxOpenGLS::setupPrimitives() {
 	_currentPrimitive = 0;
 	for (uint32 i = 0; i < numVBOs; ++i) {
 		glBindBuffer(GL_ARRAY_BUFFER, _primitiveVBOs[i]);
-		glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(float), NULL, GL_DYNAMIC_DRAW);
+		glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(float), nullptr, GL_DYNAMIC_DRAW);
 	}
 
 	if (g_grim->getGameType() == GType_MONKEY4)
@@ -330,7 +330,7 @@ void GfxOpenGLS::setupPrimitives() {
 
 	glGenBuffers(1, &_irisVBO);
 	glBindBuffer(GL_ARRAY_BUFFER, _irisVBO);
-	glBufferData(GL_ARRAY_BUFFER, 20 * sizeof(float), NULL, GL_DYNAMIC_DRAW);
+	glBufferData(GL_ARRAY_BUFFER, 20 * sizeof(float), nullptr, GL_DYNAMIC_DRAW);
 
 	_irisProgram->enableVertexAttribute("position", _irisVBO, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), 0);
 
@@ -371,18 +371,18 @@ GLuint GfxOpenGLS::nextPrimitive() {
 void GfxOpenGLS::setupShaders() {
 	bool isEMI = g_grim->getGameType() == GType_MONKEY4;
 
-	static const char* commonAttributes[] = {"position", "texcoord", NULL};
+	static const char* commonAttributes[] = {"position", "texcoord", nullptr};
 	_backgroundProgram = OpenGL::ShaderGL::fromFiles(isEMI ? "emi_background" : "grim_background", commonAttributes);
 	_smushProgram = OpenGL::ShaderGL::fromFiles("grim_smush", commonAttributes);
 	_textProgram = OpenGL::ShaderGL::fromFiles("grim_text", commonAttributes);
 	_emergProgram = OpenGL::ShaderGL::fromFiles("grim_emerg", commonAttributes);
 
-	static const char* actorAttributes[] = {"position", "texcoord", "color", "normal", NULL};
+	static const char* actorAttributes[] = {"position", "texcoord", "color", "normal", nullptr};
 	_actorProgram = OpenGL::ShaderGL::fromFiles(isEMI ? "emi_actor" : "grim_actor", actorAttributes);
 	_actorLightsProgram = OpenGL::ShaderGL::fromFiles(isEMI ? "emi_actorlights" : "grim_actorlights", actorAttributes);
 	_spriteProgram = OpenGL::ShaderGL::fromFiles(isEMI ? "emi_sprite" : "grim_actor", actorAttributes);
 
-	static const char* primAttributes[] = { "position", NULL };
+	static const char* primAttributes[] = { "position", nullptr };
 	_shadowPlaneProgram = OpenGL::ShaderGL::fromFiles("grim_shadowplane", primAttributes);
 	_primitiveProgram = OpenGL::ShaderGL::fromFiles("grim_primitive", primAttributes);
 
@@ -401,7 +401,7 @@ void GfxOpenGLS::setupShaders() {
 	setupPrimitives();
 
 	if (!isEMI) {
-		_blastVBO = OpenGL::ShaderGL::createBuffer(GL_ARRAY_BUFFER, 128 * 16 * sizeof(float), NULL, GL_DYNAMIC_DRAW);
+		_blastVBO = OpenGL::ShaderGL::createBuffer(GL_ARRAY_BUFFER, 128 * 16 * sizeof(float), nullptr, GL_DYNAMIC_DRAW);
 	}
 }
 
@@ -853,7 +853,7 @@ void GfxOpenGLS::startActorDraw(const Actor *actor) {
 
 
 void GfxOpenGLS::finishActorDraw() {
-	_currentActor = NULL;
+	_currentActor = nullptr;
 	glDisable(GL_POLYGON_OFFSET_FILL);
 	if (g_grim->getGameType() == GType_MONKEY4) {
 		glDisable(GL_CULL_FACE);
@@ -919,8 +919,8 @@ void GfxOpenGLS::drawShadowPlanes() {
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, sud->_indicesVBO);
 	const uint32 attribPos = _shadowPlaneProgram->getAttribute("position")._idx;
 	glEnableVertexAttribArray(attribPos);
-	glVertexAttribPointer(attribPos, 3, GL_FLOAT, GL_TRUE, 3 * sizeof(float), 0);
-	glDrawElements(GL_TRIANGLES, 3 * sud->_numTriangles, GL_UNSIGNED_SHORT, 0);
+	glVertexAttribPointer(attribPos, 3, GL_FLOAT, GL_TRUE, 3 * sizeof(float), nullptr);
+	glDrawElements(GL_TRIANGLES, 3 * sud->_numTriangles, GL_UNSIGNED_SHORT, nullptr);
 
 	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
 
@@ -1022,7 +1022,7 @@ void GfxOpenGLS::drawEMIModelFace(const EMIModel* model, const EMIMeshFace* face
 
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, face->_indicesEBO);
 
-	glDrawElements(GL_TRIANGLES, 3 * face->_faceLength, GL_UNSIGNED_SHORT, 0);
+	glDrawElements(GL_TRIANGLES, 3 * face->_faceLength, GL_UNSIGNED_SHORT, nullptr);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
 }
 
@@ -1039,7 +1039,7 @@ void GfxOpenGLS::drawMesh(const Mesh *mesh) {
 	actorShader->use();
 	actorShader->setUniform("extraMatrix", _matrixStack.top());
 
-	const Material *curMaterial = NULL;
+	const Material *curMaterial = nullptr;
 	for (int i = 0; i < mesh->_numFaces;) {
 		const MeshFace *face = &mesh->_faces[i];
 
@@ -1074,7 +1074,7 @@ void GfxOpenGLS::drawDimPlane() {
 	_dimPlaneProgram->setUniform1f("dim", _dimLevel);
 
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _quadEBO);
-	glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
+	glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
 
 	glEnable(GL_DEPTH_TEST);
@@ -1135,7 +1135,7 @@ void GfxOpenGLS::drawSprite(const Sprite *sprite) {
 	_spriteProgram->setUniform("uniformColor", color);
 
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _quadEBO);
-	glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
+	glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
 	glEnable(GL_DEPTH_TEST);
 	glDepthMask(GL_TRUE);
@@ -1209,7 +1209,7 @@ void GfxOpenGLS::createTexture(Texture *texture, const uint8 *data, const CMap *
 	char *texdata = new char[texture->_width * texture->_height * 4];
 	char *texdatapos = texdata;
 
-	if (cmap != NULL) { // EMI doesn't have colour-maps
+	if (cmap != nullptr) { // EMI doesn't have colour-maps
 		int bytes = 4;
 		for (int y = 0; y < texture->_height; y++) {
 			for (int x = 0; x < texture->_width; x++) {
@@ -1313,8 +1313,8 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) {
 		bitmap->_texIds = textures;
 		glGenTextures(bitmap->_numTex * bitmap->_numImages, textures);
 
-		byte *texData = 0;
-		byte *texOut = 0;
+		byte *texData = nullptr;
+		byte *texOut = nullptr;
 
 		GLint format = GL_RGBA;
 		GLint type = GL_UNSIGNED_BYTE;
@@ -1324,7 +1324,7 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) {
 
 		for (int pic = 0; pic < bitmap->_numImages; pic++) {
 			if (bitmap->_format == 1 && bitmap->_bpp == 16 && bitmap->_colorFormat != BM_RGB1555) {
-				if (texData == 0)
+				if (texData == nullptr)
 					texData = new byte[bytes * bitmap->_width * bitmap->_height];
 				// Convert data to 32-bit RGBA format
 				byte *texDataPtr = texData;
@@ -1360,7 +1360,7 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) {
 			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-			glTexImage2D(GL_TEXTURE_2D, 0, format, actualWidth, actualHeight, 0, format, type, NULL);
+			glTexImage2D(GL_TEXTURE_2D, 0, format, actualWidth, actualHeight, 0, format, type, nullptr);
 
 			glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap->_width, bitmap->_height, format, type, texOut);
 		}
@@ -1379,8 +1379,8 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) {
 		}
 	} else {
 		bitmap->_numTex = 0;
-		bitmap->_texIds = NULL;
-		bitmap->_userData = NULL;
+		bitmap->_texIds = nullptr;
+		bitmap->_userData = nullptr;
 	}
 }
 
@@ -1436,7 +1436,7 @@ void GfxOpenGLS::drawBitmap(const Bitmap *bitmap, int dx, int dy, uint32 layer)
 		shader->setUniform("offsetXY", Math::Vector2d(float(dx) / _gameWidth, float(dy) / _gameHeight));
 		shader->setUniform("sizeWH", Math::Vector2d(width / _gameWidth, height / _gameHeight));
 		shader->setUniform("texcrop", Math::Vector2d(width / nextHigher2((int)width), height / nextHigher2((int)height)));
-		glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
+		glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
 
 		glDisable(GL_BLEND);
 		glDepthMask(GL_TRUE);
@@ -1454,7 +1454,7 @@ void GfxOpenGLS::drawBitmap(const Bitmap *bitmap, int dx, int dy, uint32 layer)
 
 void GfxOpenGLS::drawDepthBitmap(int x, int y, int w, int h, char *data) {
 	static int prevX = -1, prevY = -1;
-	static char *prevData = NULL;
+	static char *prevData = nullptr;
 
 	if (prevX == x && prevY == y && data == prevData)
 		return;
@@ -1476,7 +1476,7 @@ void GfxOpenGLS::destroyBitmap(BitmapData *bitmap) {
 	if (textures) {
 		glDeleteTextures(bitmap->_numTex * bitmap->_numImages, textures);
 		delete[] textures;
-		bitmap->_texIds = 0;
+		bitmap->_texIds = nullptr;
 	}
 	OpenGL::ShaderGL *shader = (OpenGL::ShaderGL *)bitmap->_userData;
 	if (g_grim->getGameType() == GType_MONKEY4) {
@@ -1667,7 +1667,7 @@ void GfxOpenGLS::drawTextObject(const TextObject *text) {
 	_textProgram->setUniform("color", colors);
 	glBindTexture(GL_TEXTURE_2D, td->texture);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _quadEBO);
-	glDrawElements(GL_TRIANGLES, td->characters * 6, GL_UNSIGNED_SHORT, 0);
+	glDrawElements(GL_TRIANGLES, td->characters * 6, GL_UNSIGNED_SHORT, nullptr);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
 	glEnable(GL_DEPTH_TEST);
 }
@@ -1677,7 +1677,7 @@ void GfxOpenGLS::destroyTextObject(TextObject *text) {
 	if (!text->isBlastDraw()) {
 		glDeleteBuffers(1, &td->shader->getAttributeAt(0)._vbo);
 	}
-	text->setUserData(NULL);
+	text->setUserData(nullptr);
 
 	delete td->shader;
 	delete td;
@@ -2005,7 +2005,7 @@ void GfxOpenGLS::prepareMovieFrame(Graphics::Surface* frame) {
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-	glTexImage2D(GL_TEXTURE_2D, 0, frameFormat, nextHigher2(width), nextHigher2(height), 0, frameFormat, frameType, NULL);
+	glTexImage2D(GL_TEXTURE_2D, 0, frameFormat, nextHigher2(width), nextHigher2(height), 0, frameFormat, frameType, nullptr);
 
 	glPixelStorei(GL_UNPACK_ALIGNMENT, frame->format.bytesPerPixel);
 	glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, frameFormat, frameType, bitmap);
@@ -2027,7 +2027,7 @@ void GfxOpenGLS::drawMovieFrame(int offsetX, int offsetY) {
 	_smushProgram->setUniform("swizzle", _smushSwizzle);
 	glBindTexture(GL_TEXTURE_2D, _smushTexId);
 
-	glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
+	glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
 
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
 	glEnable(GL_DEPTH_TEST);
@@ -2138,7 +2138,7 @@ void GfxOpenGLS::createMesh(Mesh *mesh) {
 	}
 
 	if (meshInfo.empty()) {
-		mesh->_userData = NULL;
+		mesh->_userData = nullptr;
 		return;
 	}
 
diff --git a/engines/grim/remastered/overlay.cpp b/engines/grim/remastered/overlay.cpp
index 8c59274701..ac0f482380 100644
--- a/engines/grim/remastered/overlay.cpp
+++ b/engines/grim/remastered/overlay.cpp
@@ -32,7 +32,7 @@ namespace Grim {
 
 Overlay::Overlay(const Common::String &filename, Common::SeekableReadStream *data) :
 		_x(0), _y(0) {
-	_material = g_resourceloader->loadMaterial(filename, NULL, true);
+	_material = g_resourceloader->loadMaterial(filename, nullptr, true);
 }
 
 Overlay::~Overlay() {


Commit: 09099482815a3223b77feb3fbbe791b55fa3b144
    https://github.com/scummvm/scummvm/commit/09099482815a3223b77feb3fbbe791b55fa3b144
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
GROOVIE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/groovie/cursor.cpp
    engines/groovie/debug.cpp
    engines/groovie/detection.cpp
    engines/groovie/font.cpp
    engines/groovie/groovie.cpp
    engines/groovie/logic/pente.cpp
    engines/groovie/music.cpp
    engines/groovie/resource.cpp
    engines/groovie/script.cpp
    engines/groovie/video/player.cpp
    engines/groovie/video/roq.cpp
    engines/groovie/video/vdx.cpp


diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp
index a1d3ffd90c..c557980ad2 100644
--- a/engines/groovie/cursor.cpp
+++ b/engines/groovie/cursor.cpp
@@ -35,7 +35,7 @@ namespace Groovie {
 // Cursor Manager
 
 GrvCursorMan::GrvCursorMan(OSystem *system) :
-	_syst(system), _lastTime(0), _current(255), _cursor(NULL), _lastFrame(0) {
+	_syst(system), _lastTime(0), _current(255), _cursor(nullptr), _lastFrame(0) {
 }
 
 GrvCursorMan::~GrvCursorMan() {
@@ -141,7 +141,7 @@ const uint GrvCursorMan_t7g::_cursorPal[NUM_STYLES] = {0, 0, 0, 0, 2, 0, 1, 3, 5
 GrvCursorMan_t7g::GrvCursorMan_t7g(OSystem *system, Common::MacResManager *macResFork) :
 	GrvCursorMan(system) {
 
-	Common::SeekableReadStream *robgjd = 0;
+	Common::SeekableReadStream *robgjd = nullptr;
 
 	if (macResFork) {
 		// Open the cursors file from the resource fork
diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp
index 3ef4d811dd..905ce1d8ac 100644
--- a/engines/groovie/debug.cpp
+++ b/engines/groovie/debug.cpp
@@ -54,7 +54,7 @@ Debugger::~Debugger() {
 }
 
 int Debugger::getNumber(const char *arg) {
-	return strtol(arg, (char **)NULL, 0);
+	return strtol(arg, (char **)nullptr, 0);
 }
 
 bool Debugger::cmd_step(int argc, const char **argv) {
diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp
index afdd93c552..87c7efe667 100644
--- a/engines/groovie/detection.cpp
+++ b/engines/groovie/detection.cpp
@@ -54,7 +54,7 @@ static const PlainGameDescriptor groovieGames[] = {
 	{"unclehenry", "Uncle Henry's Playhouse"},
 	{"tlc", "Tender Loving Care"},
 
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const GroovieGameDescription gameDescriptions[] = {
@@ -75,7 +75,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 	{
 		{
 			"t7g", "",
-			AD_ENTRY2s("script.grv", NULL, -1,				// FIXMEMD5
+			AD_ENTRY2s("script.grv", nullptr, -1,				// FIXMEMD5
 						"T7GMac", "acdc4a58dd3f007f65e99b99d78e0bce", 1814029),
 			Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK,
 			GUIO7(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_NOASPECT, GUIO_NOSFX, GAMEOPTION_T7G_FAST_MOVIE_SPEED, GAMEOPTION_ORIGINAL_SAVELOAD)
@@ -88,7 +88,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"t7g", "",
 			AD_ENTRY2s("script.grv", "d1b8033b40aa67c076039881eccce90d", 16659,
-						"intro.gjd", NULL, 31711554),
+						"intro.gjd", nullptr, 31711554),
 			Common::RU_RUS, Common::kPlatformDOS, ADGF_NO_FLAGS,
 			GUIO7(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_NOASPECT, GUIO_NOSFX, GAMEOPTION_T7G_FAST_MOVIE_SPEED, GAMEOPTION_ORIGINAL_SAVELOAD)
 		},
@@ -100,7 +100,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"t7g", "",
 			AD_ENTRY2s("script.grv", "d1b8033b40aa67c076039881eccce90d", 16659,
-						"SeventhGuest", NULL, -1),
+						"SeventhGuest", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformIOS, ADGF_NO_FLAGS,
 			GUIO5(GUIO_NOMIDI, GUIO_NOASPECT, GUIO_NOSFX, GAMEOPTION_T7G_FAST_MOVIE_SPEED, GAMEOPTION_ORIGINAL_SAVELOAD)
 		},
@@ -123,7 +123,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"11h", "",
 			AD_ENTRY2s("script.grv", "bdb9a783d4debe477ac3856adc454c17", 62447,
-						"introd1.gjd", NULL, -1),
+						"introd1.gjd", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE,
 			GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_NOASPECT)
 		},
@@ -195,7 +195,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"11h", "Making Of",
 			AD_ENTRY2s("makingof.grv", "12e1e5eef2c7a9536cd12ac800b31408", 994,
-						"zmakd2a.gjd", NULL, -1),
+						"zmakd2a.gjd", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE,
 			GUIO3(GUIO_NOMIDI, GUIO_NOLAUNCHLOAD, GUIO_NOASPECT)
 		},
@@ -231,7 +231,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"clandestiny", "Trailer",
 			AD_ENTRY2s("trailer.grv", "a7c8bdc4e8bff621f4f50928a95eaaba", 6,
-						"atpuz.gjd", NULL, -1),
+						"atpuz.gjd", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE,
 			GUIO3(GUIO_NOMIDI, GUIO_NOLAUNCHLOAD, GUIO_NOASPECT)
 		},
@@ -267,7 +267,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"clandestiny", "Demo",
 			AD_ENTRY2s("clandemo.grv", "faa863738da1c93673ed58a4b9597a63", 6744,
-						"cddemo.gjd", NULL, -1),
+						"cddemo.gjd", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE,
 			GUIO3(GUIO_NOMIDI, GUIO_NOLAUNCHLOAD, GUIO_NOASPECT)
 		},
@@ -279,7 +279,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"clandestiny", "",
 			AD_ENTRY2s("clanmain.grv", "dd424120fa1daa9d6b576d0ba22a4936", 54253,
-						"ACT01MUS.MPG", NULL, -1),
+						"ACT01MUS.MPG", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE,
 			GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
 		},
@@ -291,7 +291,7 @@ static const GroovieGameDescription gameDescriptions[] = {
         {
             "clandestiny", "Mac/iOS",
             AD_ENTRY2s("CLANMAIN.GRV", "dd424120fa1daa9d6b576d0ba22a4936", 54253,
-                       "ACT01MUS.m4a", NULL, -1),
+                       "ACT01MUS.m4a", nullptr, -1),
             Common::EN_ANY, Common::kPlatformUnknown, ADGF_UNSTABLE,
             GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
         },
@@ -303,7 +303,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"unclehenry", "",
 			AD_ENTRY2s("tpot.grv", "849dc7e5309e1b9acf72d8abc9e145df", 11693,
-						"trt7g.gjd", NULL, -1),
+						"trt7g.gjd", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE,
 			GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
 		},
@@ -315,7 +315,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"tlc", "CD",
 			AD_ENTRY2s("tlcmain.grv", "47c235155de5103e72675fe7294720b8", 17479,
-						"tlcnav.gjd", NULL, -1),
+						"tlcnav.gjd", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE,
 			GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
 		},
@@ -327,7 +327,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"tlc", "DVD",
 			AD_ENTRY2s("tlcmain.grv", "151af191015beb6f662919153e6c28d8", 17379,
-						"tlcnav.gjd", NULL, -1),
+						"tlcnav.gjd", nullptr, -1),
 			Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE,
 			GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
 		},
@@ -339,7 +339,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"tlc", "Demo",
 			AD_ENTRY2s("tlcmain.grv", "6ec818f595eedca6570280af0c681642", 17361,
-						"tlcnav.gjd", NULL, -1),
+						"tlcnav.gjd", nullptr, -1),
 			Common::DE_DEU, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE,
 			GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
 		},
@@ -351,7 +351,7 @@ static const GroovieGameDescription gameDescriptions[] = {
 		{
 			"tlc", "Trailer",
 			AD_ENTRY2s("preview.grv", "d95401509a0ef251e8c340737edf728c", 19,
-						"drama1.gjd", NULL, -1),
+						"drama1.gjd", nullptr, -1),
 			Common::UNK_LANG, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE,
 			GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)
 		},
@@ -365,7 +365,7 @@ static const char *directoryGlobs[] = {
 	"MIDI",
 	"GROOVIE",
 	"MEDIA",
-	0
+	nullptr
 };
 
 static const ADExtraGuiOptionsMap optionsList[] = {
diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp
index e3074779ec..52e6275d8d 100644
--- a/engines/groovie/font.cpp
+++ b/engines/groovie/font.cpp
@@ -28,7 +28,7 @@
 
 namespace Groovie {
 
-T7GFont::T7GFont() : _maxHeight(0), _maxWidth(0), _glyphs(0) {
+T7GFont::T7GFont() : _maxHeight(0), _maxWidth(0), _glyphs(nullptr) {
 }
 
 T7GFont::~T7GFont() {
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index b6c6e58aa8..11d36261de 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -49,9 +49,9 @@
 namespace Groovie {
 
 GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) :
-	Engine(syst), _gameDescription(gd), _script(NULL),
-	_resMan(NULL), _grvCursorMan(NULL), _videoPlayer(NULL), _musicPlayer(NULL),
-	_graphicsMan(NULL), _macResFork(NULL), _waitingForInput(false), _font(NULL),
+	Engine(syst), _gameDescription(gd), _script(nullptr),
+	_resMan(nullptr), _grvCursorMan(nullptr), _videoPlayer(nullptr), _musicPlayer(nullptr),
+	_graphicsMan(nullptr), _macResFork(nullptr), _waitingForInput(false), _font(nullptr),
 	_spookyMode(false) {
 
 	// Adding the default directories
@@ -413,9 +413,9 @@ void GroovieEngine::waitForInput() {
 }
 
 SoundEffectQueue::SoundEffectQueue() {
-	_vm = NULL;
-	_player = NULL;
-	_file = NULL;
+	_vm = nullptr;
+	_player = nullptr;
+	_file = nullptr;
 }
 
 void SoundEffectQueue::setVM(GroovieEngine *vm) {
@@ -469,7 +469,7 @@ void SoundEffectQueue::tick() {
 void SoundEffectQueue::deleteFile() {
 	if (_file) {
 		delete _file;
-		_file = NULL;
+		_file = nullptr;
 		_vm->_script->setBitFlag(0, false);
 	}
 }
diff --git a/engines/groovie/logic/pente.cpp b/engines/groovie/logic/pente.cpp
index 7a0ebd6a4a..6e77e872e5 100644
--- a/engines/groovie/logic/pente.cpp
+++ b/engines/groovie/logic/pente.cpp
@@ -121,7 +121,7 @@ void PenteGame::buildLookupTable() {
 
 void PenteGame::penteDeInit() {
 	delete _table;
-	_table = NULL;
+	_table = nullptr;
 }
 
 void PenteGame::penteInit(uint width, uint height, uint length) {
@@ -642,7 +642,7 @@ void PenteGame::opQueryPiece(byte *vars) {
 
 void PenteGame::run(byte *vars) {
 	byte op = vars[4];
-	if (_table == NULL && op != 0) {
+	if (_table == nullptr && op != 0) {
 		penteInit(20, 15, 5);
 	}
 	debugC(kDebugLogic, "penteOp vars[4]: %d", (int)op);
@@ -694,7 +694,7 @@ void PenteGame::run(byte *vars) {
 }
 
 PenteGame::PenteGame() : _random("PenteGame") {
-	_table = NULL;
+	_table = nullptr;
 	_nextCapturedSpot = -1;
 	_animateCapturesBitMask = 0;
 	_previousMove = 0;
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index f414e92036..9b1bbf59a4 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -274,7 +274,7 @@ void MusicPlayer::stopCreditsIOS() {
 // MusicPlayerMidi
 
 MusicPlayerMidi::MusicPlayerMidi(GroovieEngine *vm) :
-	MusicPlayer(vm), _midiParser(NULL), _data(NULL), _driver(NULL) {
+	MusicPlayer(vm), _midiParser(nullptr), _data(nullptr), _driver(nullptr) {
 	// Initialize the channel volumes
 	for (int i = 0; i < 0x10; i++) {
 		_chanVolumes[i] = 0x7F;
@@ -284,7 +284,7 @@ MusicPlayerMidi::MusicPlayerMidi(GroovieEngine *vm) :
 MusicPlayerMidi::~MusicPlayerMidi() {
 	// Stop the callback
 	if (_driver)
-		_driver->setTimerCallback(NULL, NULL);
+		_driver->setTimerCallback(nullptr, nullptr);
 
 	Common::StackLock lock(_mutex);
 
@@ -389,7 +389,7 @@ void MusicPlayerMidi::unload(bool updateState) {
 
 	// Unload the data
 	delete[] _data;
-	_data = NULL;
+	_data = nullptr;
 }
 
 bool MusicPlayerMidi::loadParser(Common::SeekableReadStream *stream, bool loop) {
@@ -422,14 +422,14 @@ bool MusicPlayerMidi::loadParser(Common::SeekableReadStream *stream, bool loop)
 // MusicPlayerXMI
 
 MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String &gtlName) :
-		MusicPlayerMidi(vm), _multisourceDriver(0), _milesXmidiTimbres(0) {
+		MusicPlayerMidi(vm), _multisourceDriver(nullptr), _milesXmidiTimbres(nullptr) {
 
 	// Create the driver
 	MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
 	MusicType musicType = MidiDriver::getMusicType(dev);
 	if (musicType == MT_GM && ConfMan.getBool("native_mt32"))
 		musicType = MT_MT32;
-	_driver = NULL;
+	_driver = nullptr;
 
 	_musicType = 0;
 
@@ -459,7 +459,7 @@ MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String &gtlName)
 	assert(_driver);
 
 	// Create the parser
-	_midiParser = MidiParser::createParser_XMIDI(NULL, NULL, 0);
+	_midiParser = MidiParser::createParser_XMIDI(nullptr, nullptr, 0);
 
 	int result = _driver->open();
 	if (result > 0 && result != MidiDriver::MERR_ALREADY_OPEN)
@@ -758,7 +758,7 @@ bool MusicPlayerIOS::load(uint32 fileref, bool loop) {
 
 
 MusicPlayerTlc::MusicPlayerTlc(GroovieEngine *vm) : MusicPlayer(vm) {
-	_file = NULL;
+	_file = nullptr;
 	vm->getTimerManager()->installTimerProc(&onTimer, 50 * 1000, this, "groovieMusic");
 }
 
@@ -778,7 +778,7 @@ void MusicPlayerTlc::unload(bool updateState) {
 	if (_file) {
 		delete _file;
 	}
-	_file = NULL;
+	_file = nullptr;
 }
 
 Common::String MusicPlayerTlc::getFilename(uint32 fileref) {
@@ -803,7 +803,7 @@ bool MusicPlayerTlc::load(uint32 fileref, bool loop) {
 
 	// Create the audio stream from fileref
 	_file->open(filename);
-	Audio::SeekableAudioStream *seekStream = NULL;
+	Audio::SeekableAudioStream *seekStream = nullptr;
 	if (_file->isOpen()) {
 		if (filename.hasSuffix(".m4a"))
 			seekStream = Audio::makeQuickTimeStream(_file, DisposeAfterUse::NO);
@@ -813,7 +813,7 @@ bool MusicPlayerTlc::load(uint32 fileref, bool loop) {
 #endif
 	} else {
 		delete _file;
-		_file = NULL;
+		_file = nullptr;
 	}
 
 	if (!seekStream) {
diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp
index ada07cc0be..5a3447d54d 100644
--- a/engines/groovie/resource.cpp
+++ b/engines/groovie/resource.cpp
@@ -39,7 +39,7 @@ Common::SeekableReadStream *ResMan::open(uint32 fileRef) {
 	// Get the information about the resource
 	ResInfo resInfo;
 	if (!getResInfo(fileRef, resInfo)) {
-		return NULL;
+		return nullptr;
 	}
 
 	debugC(1, kDebugResource, "Groovie::Resource: Opening resource %d", fileRef);
@@ -50,7 +50,7 @@ Common::SeekableReadStream *ResMan::open(const ResInfo &resInfo) {
 	// Do we know the name of the required GJD?
 	if (resInfo.gjd >= _gjds.size()) {
 		error("Groovie::Resource: Unknown GJD %d", resInfo.gjd);
-		return NULL;
+		return nullptr;
 	}
 
 	debugC(1, kDebugResource, "Groovie::Resource: Opening resource (%s, %d, %d, %d)", _gjds[resInfo.gjd].c_str(), resInfo.offset, resInfo.size, resInfo.disks);
@@ -58,7 +58,7 @@ Common::SeekableReadStream *ResMan::open(const ResInfo &resInfo) {
 	// Does it exist?
 	if (!Common::File::exists(_gjds[resInfo.gjd])) {
 		error("Groovie::Resource: %s not found (resInfo.disks: %d)", _gjds[resInfo.gjd].c_str(), resInfo.disks);
-		return NULL;
+		return nullptr;
 	}
 
 	// Open the pack file
@@ -66,7 +66,7 @@ Common::SeekableReadStream *ResMan::open(const ResInfo &resInfo) {
 	if (!gjdFile->open(_gjds[resInfo.gjd].c_str())) {
 		delete gjdFile;
 		error("Groovie::Resource: Couldn't open %s", _gjds[resInfo.gjd].c_str());
-		return NULL;
+		return nullptr;
 	}
 
 	// Save the used gjd file (except xmi and gamwav)
@@ -137,7 +137,7 @@ uint32 ResMan_t7g::getRef(Common::String name) {
 	Common::String rlFileName(t7g_gjds[_lastGjd]);
 	rlFileName += ".rl";
 
-	Common::SeekableReadStream *rlFile = 0;
+	Common::SeekableReadStream *rlFile = nullptr;
 
 	if (_macResFork) {
 		// Open the RL file from the resource fork
@@ -189,7 +189,7 @@ bool ResMan_t7g::getResInfo(uint32 fileRef, ResInfo &resInfo) {
 	Common::String rlFileName(t7g_gjds[resInfo.gjd]);
 	rlFileName += ".rl";
 
-	Common::SeekableReadStream *rlFile = 0;
+	Common::SeekableReadStream *rlFile = nullptr;
 
 	if (_macResFork) {
 		// Open the RL file from the resource fork
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 9f331c7ead..aac56ea63e 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -76,9 +76,9 @@ enum kSpecialVariableTypes {
 };
 
 Script::Script(GroovieEngine *vm, EngineVersion version) :
-	_code(NULL), _savedCode(NULL), _stacktop(0), _debugger(NULL), _vm(vm),
-	_videoFile(NULL), _videoRef(UINT_MAX), _cellGame(NULL), _lastCursor(0xff),
-	_version(version), _random("GroovieScripts"), _tlcGame(0) {
+	_code(nullptr), _savedCode(nullptr), _stacktop(0), _debugger(nullptr), _vm(vm),
+	_videoFile(nullptr), _videoRef(UINT_MAX), _cellGame(nullptr), _lastCursor(0xff),
+	_version(version), _random("GroovieScripts"), _tlcGame(nullptr) {
 
 	// Initialize the opcode set depending on the engine version
 	if (version == kGroovieT7G) {
@@ -150,7 +150,7 @@ void Script::timerTick() {
 }
 
 bool Script::loadScript(Common::String filename) {
-	Common::SeekableReadStream *scriptfile = 0;
+	Common::SeekableReadStream *scriptfile = nullptr;
 
 	if (_vm->_macResFork) {
 		// Try to open the script file from the resource fork
@@ -226,7 +226,7 @@ void Script::directGameLoad(int slot) {
 	}
 
 	uint16 targetInstruction;
-	const byte *midiInitScript = 0;
+	const byte *midiInitScript = nullptr;
 	uint8 midiInitScriptSize = 0;
 
 	// HACK: We set the slot to load in the appropriate variable, and set the
@@ -860,7 +860,7 @@ bool Script::playvideofromref(uint32 fileref, bool loopUntilAudioDone) {
 
 			// Close the file
 			delete _videoFile;
-			_videoFile = NULL;
+			_videoFile = nullptr;
 			_videoRef = UINT_MAX;
 
 			// Clear the input events while playing the video
@@ -912,7 +912,7 @@ void Script::o_inputloopstart() {	//0x0B
 	debugC(5, kDebugScript, "Groovie::Script: Input loop start");
 
 	// For TLC the regions for many questions are in an extra database. Reset internal region counters
-	if (_version == kGroovieTLC && _tlcGame != NULL) {
+	if (_version == kGroovieTLC && _tlcGame != nullptr) {
 #ifdef ENABLE_GROOVIE2
 		_tlcGame->getRegionRewind();
 #endif
@@ -967,7 +967,7 @@ void Script::o_hotspot_rect() {
 	uint8 cursor = readScript8bits();
 
 	// TLC: The regions for many questions are in an extra database
-	if (_version == kGroovieTLC && left == 0 && top == 0 && right == 0 && bottom == 0 && _tlcGame != NULL) {
+	if (_version == kGroovieTLC && left == 0 && top == 0 && right == 0 && bottom == 0 && _tlcGame != nullptr) {
 #ifdef ENABLE_GROOVIE2
 		if (_tlcGame->getRegionNext(left, top, right, bottom) < 0) {
 			debugC(5, kDebugScript, "Groovie::Script: HOTSPOT-RECT(%d,%d,%d,%d) @0x%04X cursor=%d SKIPPED", left, top, right, bottom, address, cursor);
@@ -1835,7 +1835,7 @@ void Script::o_returnscript() {
 	delete[] _code;
 	_code = _savedCode;
 	_codeSize = _savedCodeSize;
-	_savedCode = NULL;
+	_savedCode = nullptr;
 	_currentInstruction = _savedInstruction;
 
 	// Restore the stack
diff --git a/engines/groovie/video/player.cpp b/engines/groovie/video/player.cpp
index b715089d94..661d5e5382 100644
--- a/engines/groovie/video/player.cpp
+++ b/engines/groovie/video/player.cpp
@@ -31,7 +31,7 @@
 namespace Groovie {
 
 VideoPlayer::VideoPlayer(GroovieEngine *vm) :
-	_vm(vm), _syst(vm->_system), _file(NULL), _audioStream(NULL), _fps(0), _overrideSpeed(false), _flags(0),
+	_vm(vm), _syst(vm->_system), _file(nullptr), _audioStream(nullptr), _fps(0), _overrideSpeed(false), _flags(0),
 	_begunPlaying(false), _millisBetweenFrames(0), _lastFrameTime(0), _frameTimeDrift(0) {
 }
 
@@ -48,7 +48,7 @@ bool VideoPlayer::load(Common::SeekableReadStream *file, uint16 flags) {
 		_begunPlaying = false;
 		return true;
 	} else {
-		_file = NULL;
+		_file = nullptr;
 		return false;
 	}
 }
@@ -83,14 +83,14 @@ bool VideoPlayer::playFrame() {
 
 	// The file has been completely processed
 	if (end) {
-		_file = NULL;
+		_file = nullptr;
 
 		// Wait for pending audio
 		if (_audioStream) {
 			if (_audioStream->endOfData() || isFastForwarding()) {
 				// Mark the audio stream as finished (no more data will be appended)
 				_audioStream->finish();
-				_audioStream = NULL;
+				_audioStream = nullptr;
 			} else {
 				// Don't end if there's still audio playing
 				end = false;
diff --git a/engines/groovie/video/roq.cpp b/engines/groovie/video/roq.cpp
index a81635c3f7..1a04616b2a 100644
--- a/engines/groovie/video/roq.cpp
+++ b/engines/groovie/video/roq.cpp
@@ -127,7 +127,7 @@ void ROQPlayer::stopAudioStream() {
 	if (_audioStream) {
 		g_system->getMixer()->stopHandle(_soundHandle);
 	}
-	_audioStream = NULL;
+	_audioStream = nullptr;
 }
 
 uint16 ROQPlayer::loadInternal() {
@@ -257,9 +257,9 @@ void ROQPlayer::buildShowBuf() {
 
 	// Select the destination buffer according to the given flags
 	int destOffset = 0;
-	Graphics::Surface *maskBuf = NULL;
+	Graphics::Surface *maskBuf = nullptr;
 	Graphics::Surface *srcBuf = _currBuf;
-	Graphics::Surface *destBuf = NULL;
+	Graphics::Surface *destBuf = nullptr;
 	if (_flagMasked) {
 		srcBuf = _bg;
 		maskBuf = _currBuf;
@@ -288,7 +288,7 @@ void ROQPlayer::buildShowBuf() {
 		byte *in = (byte *)srcBuf->getBasePtr(MAX(0, -_origX) / _scaleX, (line - _origY) / _scaleY);
 		byte *inOvr = (byte *)_overBuf->getBasePtr(startX, line);
 		byte *out = (byte *)destBuf->getBasePtr(startX, line + destOffset);
-		byte *mask = NULL;
+		byte *mask = nullptr;
 		if (_flagMasked) {
 			mask = (byte *)maskBuf->getBasePtr(MAX(0, -_origX) / _scaleX, (line - _origY) / _scaleY);
 		}
diff --git a/engines/groovie/video/vdx.cpp b/engines/groovie/video/vdx.cpp
index 5cc83aa389..10774af0e1 100644
--- a/engines/groovie/video/vdx.cpp
+++ b/engines/groovie/video/vdx.cpp
@@ -60,7 +60,7 @@ void VDXPlayer::stopAudioStream() {
 	if (_audioStream) {
 		g_system->getMixer()->stopHandle(_soundHandle);
 	}
-	_audioStream = NULL;
+	_audioStream = nullptr;
 }
 
 uint16 VDXPlayer::loadInternal() {
@@ -137,7 +137,7 @@ uint16 VDXPlayer::loadInternal() {
 
 bool VDXPlayer::playFrameInternal() {
 	byte currRes = 0x80;
-	Common::ReadStream *vdxData = 0;
+	Common::ReadStream *vdxData = nullptr;
 	while (currRes == 0x80) {
 		currRes = _file->readByte();
 
@@ -184,7 +184,7 @@ bool VDXPlayer::playFrameInternal() {
 				error("Groovie::VDX: Invalid resource type: %d", currRes);
 		}
 		delete vdxData;
-		vdxData = 0;
+		vdxData = nullptr;
 	}
 
 	// Wait until the current frame can be shown
@@ -505,7 +505,7 @@ void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colors, uint16 imageWidth)
 	// Move the pointers to the beginning of the current block
 	int32 blockOff = _origX + _origY * imageWidth;
 	dest += blockOff;
-	byte *fgBuf = 0;
+	byte *fgBuf = nullptr;
 	if (_flagSeven) {
 		fgBuf = (byte *)_fg->getPixels() + offset + blockOff;
 		//byte *bgBuf = (byte *)_bg->getPixels() + offset + blockOff;


Commit: 5c3b20d5e959e2c12ceb8b8ef6232ee0c40a8a0e
    https://github.com/scummvm/scummvm/commit/5c3b20d5e959e2c12ceb8b8ef6232ee0c40a8a0e
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
HADESCH: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/hadesch/detection.cpp


diff --git a/engines/hadesch/detection.cpp b/engines/hadesch/detection.cpp
index b6d4da1e7a..462f6788cd 100644
--- a/engines/hadesch/detection.cpp
+++ b/engines/hadesch/detection.cpp
@@ -41,7 +41,7 @@ static const DebugChannelDef debugFlagList[] = {
 namespace Hadesch {
 static const PlainGameDescriptor hadeschGames[] = {
 	{"hadesch", "Hades Challenge"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 // The list is pretty long but it's because we need just a few files but
@@ -63,7 +63,7 @@ static const char *const directoryGlobs[] = {
 	"Hades - Copy To Hard Drive",
 	"Hades Challenge",
 	"Hades_Challenge",
-	0
+	nullptr
 };
 }
 


Commit: 138f943076fbd6e112bd14a22c44a6ca3ea66bfd
    https://github.com/scummvm/scummvm/commit/138f943076fbd6e112bd14a22c44a6ca3ea66bfd
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
HDB: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/hdb/detection.cpp
    engines/hdb/gfx.cpp
    engines/hdb/lua-script.cpp
    engines/hdb/sound.cpp


diff --git a/engines/hdb/detection.cpp b/engines/hdb/detection.cpp
index 0c6f6dade8..6bfc1fb802 100644
--- a/engines/hdb/detection.cpp
+++ b/engines/hdb/detection.cpp
@@ -28,7 +28,7 @@
 
 static const PlainGameDescriptor hdbGames[] = {
 	{"hdb", "Hyperspace Delivery Boy!"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #define GAMEOPTION_CHEATMODE GUIO_GAMEOPTIONS1
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp
index b1fb00f44d..5a3be816df 100644
--- a/engines/hdb/gfx.cpp
+++ b/engines/hdb/gfx.cpp
@@ -1291,7 +1291,7 @@ void Gfx::drawBonusStars() {
 		_starsInfo.active = false;
 		delete _starsInfo.gfx[0];
 		delete _starsInfo.gfx[1];
-		_starsInfo.gfx[0] = _starsInfo.gfx[1] = 0;
+		_starsInfo.gfx[0] = _starsInfo.gfx[1] = nullptr;
 	}
 }
 
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index ee98d5ba2f..53d9d9aeaf 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -947,7 +947,7 @@ static int dialogChoice(lua_State *L) {
 	const char *title = lua_tostring(L, 1);
 	const char *text = lua_tostring(L, 2);
 	const char *func = lua_tostring(L, 3);
-	const char *choice[10] = {0,0,0,0,0,0,0,0,0,0};
+	const char *choice[10] = {nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr};
 
 	int	amount = lua_gettop(L) - 3;
 	if (amount > 9)
@@ -1368,7 +1368,7 @@ static int openFile(lua_State *L) {
 
 	lua_pop(L, 2); // drop 2 parameters
 
-	lua_pushlightuserdata(L, 0);
+	lua_pushlightuserdata(L, nullptr);
 
 	return 1;
 }
diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp
index 47f78b1a01..2f2d0c13a1 100644
--- a/engines/hdb/sound.cpp
+++ b/engines/hdb/sound.cpp
@@ -1519,7 +1519,7 @@ void Sound::playSound(int index) {
 		audioStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
 	}
 
-	if (audioStream == 0) {
+	if (audioStream == nullptr) {
 		warning("playSound: sound %d is corrupt", index);
 		return;
 	}
@@ -1583,7 +1583,7 @@ void Sound::playSoundEx(int index, int channel, bool loop) {
 		audioStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
 	}
 
-	if (audioStream == 0) {
+	if (audioStream == nullptr) {
 		warning("playSoundEx: sound %d is corrupt", index);
 		return;
 	}


Commit: 13bcd9a0f7b2d699cca0f6da992143560eff1d8e
    https://github.com/scummvm/scummvm/commit/13bcd9a0f7b2d699cca0f6da992143560eff1d8e
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
HOPKINS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/hopkins/anim.cpp
    engines/hopkins/computer.cpp
    engines/hopkins/detection.cpp
    engines/hopkins/dialogs.cpp
    engines/hopkins/events.cpp
    engines/hopkins/files.cpp
    engines/hopkins/font.cpp
    engines/hopkins/globals.cpp
    engines/hopkins/graphics.cpp
    engines/hopkins/hopkins.cpp
    engines/hopkins/lines.cpp
    engines/hopkins/menu.cpp
    engines/hopkins/objects.cpp
    engines/hopkins/saveload.cpp
    engines/hopkins/script.cpp
    engines/hopkins/sound.cpp
    engines/hopkins/talk.cpp


diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 8f2a18f741..e0cf26de8b 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -198,7 +198,7 @@ void AnimationManager::playAnim(const Common::String &hiresName, const Common::S
  */
 void AnimationManager::playAnim2(const Common::String &hiresName, const Common::String &lowresName, uint32 rate1, uint32 rate2, uint32 rate3) {
 	int oldScrollPosX = 0;
-	byte *screenP = NULL;
+	byte *screenP = nullptr;
 	Common::File f;
 
 	if (_vm->shouldQuit())
@@ -508,7 +508,7 @@ void AnimationManager::searchAnim(const byte *data, int animIndex, int bufSize)
 						innerLoopCond = true;
 					if (bufSize < curBufferPos) {
 						_animBqe[animIndex]._enabledFl = false;
-						_animBqe[animIndex]._data = NULL;
+						_animBqe[animIndex]._data = nullptr;
 						return;
 					}
 					++curBufferPos;
@@ -781,12 +781,12 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
 
 void AnimationManager::initAnimBqe() {
 	for (int idx = 0; idx < 35; ++idx) {
-		_animBqe[idx]._data = NULL;
+		_animBqe[idx]._data = nullptr;
 		_animBqe[idx]._enabledFl = false;
 	}
 
 	for (int idx = 0; idx < 8; ++idx) {
-		Bank[idx]._data = NULL;
+		Bank[idx]._data = nullptr;
 		Bank[idx]._loadedFl = false;
 		Bank[idx]._filename = "";
 		Bank[idx]._fileHeader = 0;
diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp
index 7616b3573e..41fb0e11a3 100644
--- a/engines/hopkins/computer.cpp
+++ b/engines/hopkins/computer.cpp
@@ -43,9 +43,9 @@ ComputerManager::ComputerManager(HopkinsEngine *vm) {
 		memset(_menuText[i]._line, 0, ARRAYSIZE(_menuText[0]._line));
 	}
 	Common::fill(&_inputBuf[0], &_inputBuf[200], '\0');
-	_breakoutSpr = NULL;
+	_breakoutSpr = nullptr;
 	_textColor = 0;
-	_breakoutLevel = (int16 *)NULL;
+	_breakoutLevel = (int16 *)nullptr;
 	_breakoutBrickNbr = 0;
 	_breakoutScore = 0;
 	_breakoutLives = 0;
@@ -555,9 +555,9 @@ void ComputerManager::displayGamesSubMenu() {
 
 	_vm->_globals->_speed = 1;
 	_vm->_events->changeMouseCursor(0);
-	_breakoutSpr = NULL;
+	_breakoutSpr = nullptr;
 	_vm->_events->_breakoutFl = true;
-	_breakoutLevel = (int16 *)NULL;
+	_breakoutLevel = (int16 *)nullptr;
 	_breakoutBrickNbr = 0;
 	_breakoutScore = 0;
 	_breakoutLives = 5;
diff --git a/engines/hopkins/detection.cpp b/engines/hopkins/detection.cpp
index 62526500f2..769f3aec1b 100644
--- a/engines/hopkins/detection.cpp
+++ b/engines/hopkins/detection.cpp
@@ -35,7 +35,7 @@ static const DebugChannelDef debugFlagList[] = {
 
 static const PlainGameDescriptor hopkinsGames[] = {
 	{"hopkins", "Hopkins FBI"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #include "hopkins/detection_tables.h"
@@ -67,7 +67,7 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 const static char *directoryGlobs[] = {
 	"voice",
 	"link",
-	0
+	nullptr
 };
 
 class HopkinsMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp
index 2e7c397b5d..13afc79b27 100644
--- a/engines/hopkins/dialogs.cpp
+++ b/engines/hopkins/dialogs.cpp
@@ -45,9 +45,9 @@ DialogsManager::DialogsManager(HopkinsEngine *vm) {
 	_inventX = _inventY = 0;
 	_oldInventX = 0;
 	_inventWidth = _inventHeight = 0;
-	_inventWin1 = NULL;
-	_inventBuf2 = NULL;
-	_inventoryIcons = NULL;
+	_inventWin1 = nullptr;
+	_inventBuf2 = nullptr;
+	_inventoryIcons = nullptr;
 }
 
 DialogsManager::~DialogsManager() {
@@ -57,8 +57,8 @@ DialogsManager::~DialogsManager() {
 }
 
 void DialogsManager::clearAll() {
-	_inventWin1 = NULL;
-	_inventBuf2 = NULL;
+	_inventWin1 = nullptr;
+	_inventBuf2 = nullptr;
 }
 
 void DialogsManager::loadIcons() {
@@ -351,7 +351,7 @@ void DialogsManager::showInventory() {
 		_vm->_events->getMouseY();
 		_vm->_events->refreshScreenAndEvents();
 	}
-	_inventWin1 = NULL;
+	_inventWin1 = nullptr;
 
 	bool loopFl;
 	do {
diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp
index c2a9339397..4e0fe306f3 100644
--- a/engines/hopkins/events.cpp
+++ b/engines/hopkins/events.cpp
@@ -44,14 +44,14 @@ EventsManager::EventsManager(HopkinsEngine *vm) {
 	_mouseSpriteId = 0;
 	_curMouseButton = 0;
 	_mouseButton = 0;
-	_mouseCursor = NULL;
+	_mouseCursor = nullptr;
 	_gameCounter = 0;
 	_rateCounter = 0;
 	_escKeyFl = false;
 	_gameKey = KEY_NONE;
 	_mouseCursorId = 0;
 	_oldIconId = 0;
-	_objectBuf = NULL;
+	_objectBuf = nullptr;
 
 	Common::fill(&_keyState[0], &_keyState[256], false);
 	_priorCounterTime = _priorFrameTime = g_system->getMillis();
diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp
index 4e874597c2..cd5e6f686e 100644
--- a/engines/hopkins/files.cpp
+++ b/engines/hopkins/files.cpp
@@ -90,7 +90,7 @@ bool FileManager::fileExists(const Common::String &file) {
  * Search file in Cat file
  */
 byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fileFoundFl) {
-	byte *ptr = NULL;
+	byte *ptr = nullptr;
 	fileFoundFl = true;
 	Common::File f;
 
@@ -102,7 +102,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 	case RES_INI:
 		if (!f.exists("RES_INI.CAT")) {
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		ptr = loadFile("RES_INI.CAT");
@@ -112,7 +112,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 	case RES_REP:
 		if (!f.exists("RES_REP.CAT")) {
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		ptr = loadFile("RES_REP.CAT");
@@ -122,7 +122,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 	case RES_LIN:
 		if (!f.exists("RES_LIN.CAT")) {
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		ptr = loadFile("RES_LIN.CAT");
@@ -132,7 +132,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 	case RES_PER:
 		if (!f.exists("RES_PER.CAT")) {
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		ptr = loadFile("RES_PER.CAT");
@@ -142,7 +142,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 	case RES_PIC:
 		if (!f.exists("PIC.CAT")) {
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		ptr = loadFile("PIC.CAT");
@@ -151,7 +151,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 	case RES_SAN:
 		if (!f.exists("RES_SAN.CAT")) {
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		ptr = loadFile("RES_SAN.CAT");
@@ -160,7 +160,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 	case RES_SLI:
 		if (!f.exists("RES_SLI.CAT")) {
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		ptr = loadFile("RES_SLI.CAT");
@@ -189,7 +189,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 
 		if (!f.exists(tmpFilename)) {
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		ptr = loadFile(tmpFilename);
@@ -219,7 +219,7 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 		if (name == "FINIS") {
 			_vm->_globals->freeMemory(ptr);
 			fileFoundFl = false;
-			return NULL;
+			return nullptr;
 		}
 
 		offsetVal += 23;
@@ -234,14 +234,14 @@ byte *FileManager::searchCat(const Common::String &file, CatMode mode, bool &fil
 		f.seek(_catalogPos);
 
 		byte *catData = _vm->_globals->allocMemory(_catalogSize);
-		if (catData == NULL)
+		if (catData == nullptr)
 			error("CHARGE_FICHIER");
 
 		readStream(f, catData, _catalogSize);
 		f.close();
 		result = catData;
 	} else {
-		result = NULL;
+		result = nullptr;
 	}
 
 	return result;
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index ab95510175..f44ecbedb9 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -61,7 +61,7 @@ void FontManager::loadZoneText() {
 }
 
 void FontManager::clearAll() {
-	_font = NULL;
+	_font = nullptr;
 	_fontFixedHeight = 0;
 	_fontFixedWidth = 0;
 
@@ -84,8 +84,8 @@ void FontManager::clearAll() {
 	for (int idx = 0; idx < 4048; idx++)
 		_index[idx] = 0;
 
-	_tempText = NULL;
-	_zoneText = NULL;
+	_tempText = nullptr;
+	_zoneText = nullptr;
 
 	_boxWidth = 240;
 }
@@ -216,7 +216,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
 			f.seek(_index[messageId]);
 
 			_tempText = _vm->_globals->allocMemory(2058);
-			if (_tempText == NULL)
+			if (_tempText == nullptr)
 				error("Error allocating text");
 
 			Common::fill(&_tempText[0], &_tempText[2058], 0);
@@ -360,7 +360,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
 		if (textType == 1 || textType == 3 || textType == 5 || textType == 6) {
 			int size = saveHeight * saveWidth;
 			byte *ptrd = _vm->_globals->allocMemory(size);
-			if (ptrd == NULL)
+			if (ptrd == nullptr)
 				error("Cutting a block for text box (%d)", size);
 
 			_vm->_graphicsMan->copySurfaceRect(_vm->_graphicsMan->_frontBuffer, ptrd, posX, posY, saveWidth, saveHeight);
@@ -391,7 +391,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
 			_text[idx]._textBlock = _vm->_globals->freeMemory(_text[idx]._textBlock);
 			int blockSize = blockHeight * blockWidth;
 			byte *ptre = _vm->_globals->allocMemory(blockSize + 20);
-			if (ptre == NULL)
+			if (ptre == nullptr)
 				error("Cutting a block for text box (%d)", blockSize);
 
 			_text[idx]._textBlock = ptre;
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index d659b050ef..dd55795096 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -77,7 +77,7 @@ Globals::Globals(HopkinsEngine *vm) {
 	_speed = 1;
 	_eventMode = EVENTMODE_DEFAULT;
 	_exitId = 0;
-	_characterSpriteBuf = 0;
+	_characterSpriteBuf = nullptr;
 	_screenId = 0;
 	_prevScreenId = 0;
 	_characterMaxPosY = 0;
@@ -105,11 +105,11 @@ Globals::Globals(HopkinsEngine *vm) {
 	_oceanDirection = DIR_NONE;
 
 	// Initialize pointers
-	_levelSpriteBuf = NULL;
-	_saveData = NULL;
-	_answerBuffer = NULL;
-	_characterSpriteBuf = NULL;
-	_optionDialogSpr = NULL;
+	_levelSpriteBuf = nullptr;
+	_saveData = nullptr;
+	_answerBuffer = nullptr;
+	_characterSpriteBuf = nullptr;
+	_optionDialogSpr = nullptr;
 
 	// Reset flags
 	_censorshipFl = false;
@@ -128,7 +128,7 @@ Globals::~Globals() {
 	freeMemory((byte *)_saveData);
 	freeMemory(_answerBuffer);
 	freeMemory(_characterSpriteBuf);
-	free(NULL);
+	free(nullptr);
 }
 
 void Globals::setConfig() {
@@ -174,9 +174,9 @@ void Globals::setConfig() {
 void Globals::clearAll() {
 	_vm->_fontMan->clearAll();
 	_vm->_dialog->clearAll();
-	_answerBuffer = NULL;
-	_levelSpriteBuf = NULL;
-	_saveData = NULL;
+	_answerBuffer = nullptr;
+	_levelSpriteBuf = nullptr;
+	_saveData = nullptr;
 	_vm->_objectsMan->_curObjectIndex = 0;
 
 	_vm->_linesMan->clearAll();
@@ -204,14 +204,14 @@ void Globals::loadCharacterData() {
 byte *Globals::allocMemory(int count) {
 	byte *result = (byte *)malloc(count);
 	if (!result)
-		result = NULL;
+		result = nullptr;
 	return result;
 }
 
 byte *Globals::freeMemory(byte *p) {
 	if (p)
 		free(p);
-	return NULL;
+	return nullptr;
 }
 
 } // End of namespace Hopkins
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 86a25c5ea4..cf13db78f6 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -42,17 +42,17 @@ GraphicsManager::GraphicsManager(HopkinsEngine *vm) {
 	_initGraphicsFl = false;
 	_screenWidth = _screenHeight = 0;
 	_screenLineSize = 0;
-	_palettePixels = NULL;
+	_palettePixels = nullptr;
 	_lineNbr = 0;
-	_videoPtr = NULL;
+	_videoPtr = nullptr;
 	_scrollOffset = 0;
 	_scrollPosX = 0;
 	_largeScreenFl = false;
 	_oldScrollPosX = 0;
-	_backBuffer = NULL;
-	_frontBuffer = NULL;
-	_screenBuffer = NULL;
-	_backupScreen = NULL;
+	_backBuffer = nullptr;
+	_frontBuffer = nullptr;
+	_screenBuffer = nullptr;
+	_backupScreen = nullptr;
 	_showDirtyRects = false;
 
 	_lineNbr2 = 0;
@@ -113,7 +113,7 @@ void GraphicsManager::setGraphicalMode(int width, int height) {
 		_frontBuffer = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT);
 		_screenBuffer = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT);
 
-		_videoPtr = NULL;
+		_videoPtr = nullptr;
 		_screenWidth = width;
 		_screenHeight = height;
 
@@ -145,7 +145,7 @@ void GraphicsManager::lockScreen() {
 void GraphicsManager::unlockScreen() {
 	assert(_videoPtr);
 	if (--_lockCounter == 0) {
-		_videoPtr = NULL;
+		_videoPtr = nullptr;
 	}
 }
 
@@ -1143,7 +1143,7 @@ void GraphicsManager::displayDirtyRects() {
 
 void GraphicsManager::displayRefreshRects() {
 	debugC(1, kDebugGraphics, "displayRefreshRects() start");
-	Graphics::Surface *screenSurface = NULL;
+	Graphics::Surface *screenSurface = nullptr;
 	if (_showDirtyRects) {
 		screenSurface = g_system->lockScreen();
 		g_system->copyRectToScreen(_screenBuffer, _screenLineSize, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -1910,7 +1910,7 @@ void GraphicsManager::drawVerticalLine(byte *surface, int xp, int yp, int height
  */
 void GraphicsManager::backupScreen() {
 	// Allocate a new data block for the screen, if necessary
-	if (_vm->_graphicsMan->_backupScreen == NULL)
+	if (_vm->_graphicsMan->_backupScreen == nullptr)
 		_vm->_graphicsMan->_backupScreen = _vm->_globals->allocMemory(SCREEN_WIDTH * 2 * SCREEN_HEIGHT);
 
 	// Backup the screen
@@ -1928,7 +1928,7 @@ void GraphicsManager::restoreScreen() {
 	Common::copy(_vm->_graphicsMan->_backupScreen, _vm->_graphicsMan->_backupScreen +
 		SCREEN_WIDTH * 2 * SCREEN_HEIGHT, _vm->_graphicsMan->_backBuffer);
 	_vm->_globals->freeMemory(_vm->_graphicsMan->_backupScreen);
-	_backupScreen = NULL;
+	_backupScreen = nullptr;
 }
 
 } // End of namespace Hopkins
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index 0240a7659f..3d92a67994 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -1194,7 +1194,7 @@ bool HopkinsEngine::runFull() {
 			_objectsMan->_forestFl = true;
 			Common::String im = Common::String::format("IM%d", _globals->_exitId);
 			_soundMan->playSound(13);
-			if (_objectsMan->_forestSprite == NULL) {
+			if (_objectsMan->_forestSprite == nullptr) {
 				_objectsMan->_forestSprite = _objectsMan->loadSprite("HOPDEG.SPR");
 				_soundMan->loadSample(1, "SOUND41.WAV");
 			}
@@ -1276,7 +1276,7 @@ bool HopkinsEngine::runFull() {
 		case 62:
 			_linesMan->setMaxLineIdx(8);
 			_globals->_characterMaxPosY = 435;
-			_objectsMan->sceneControl2("IM62", "IM62", NULL, "IM62", 21, false);
+			_objectsMan->sceneControl2("IM62", "IM62", nullptr, "IM62", 21, false);
 			break;
 
 		case 63:
@@ -1306,7 +1306,7 @@ bool HopkinsEngine::runFull() {
 		case 67:
 			_linesMan->setMaxLineIdx(8);
 			_globals->_characterMaxPosY = 435;
-			_objectsMan->sceneControl2("IM67", "IM67", NULL, "IM67", 21, false);
+			_objectsMan->sceneControl2("IM67", "IM67", nullptr, "IM67", 21, false);
 			break;
 
 		case 68:
@@ -1324,7 +1324,7 @@ bool HopkinsEngine::runFull() {
 		case 70:
 			_linesMan->setMaxLineIdx(8);
 			_globals->_characterMaxPosY = 435;
-			_objectsMan->sceneControl2("IM70", "IM70", NULL, "IM70", 21, false);
+			_objectsMan->sceneControl2("IM70", "IM70", nullptr, "IM70", 21, false);
 			break;
 
 		case 71:
@@ -2078,7 +2078,7 @@ void HopkinsEngine::playEnding() {
 	_globals->_cityMapEnabledFl = false;
 	_globals->_eventMode = EVENTMODE_IGNORE;
 	_soundMan->playSound(26);
-	_linesMan->_route = NULL;
+	_linesMan->_route = nullptr;
 	_globals->_freezeCharacterFl = true;
 	_globals->_exitId = 0;
 	_soundMan->loadSample(1, "SOUND90.WAV");
@@ -2826,7 +2826,7 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi
 	_graphicsMan->setColorPercentage(251, 100, 100, 100);
 	_graphicsMan->setColorPercentage(254, 0, 0, 0);
 	_objectsMan->animateSprite(0);
-	_linesMan->_route = NULL;
+	_linesMan->_route = nullptr;
 	_events->mouseOn();
 	_events->changeMouseCursor(4);
 
diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp
index f511e6aa5a..2e733b8a8a 100644
--- a/engines/hopkins/lines.cpp
+++ b/engines/hopkins/lines.cpp
@@ -68,13 +68,13 @@ LinesManager::LinesManager(HopkinsEngine *vm) {
 	_lastLine = 0;
 	_maxLineIdx = 0;
 	_pathFindingMaxDepth = 0;
-	_testRoute0 = NULL;
-	_testRoute1 = NULL;
-	_testRoute2 = NULL;
-	_lineBuf = NULL;
-	_route = NULL;
+	_testRoute0 = nullptr;
+	_testRoute1 = nullptr;
+	_testRoute2 = nullptr;
+	_lineBuf = nullptr;
+	_route = nullptr;
 	_currentSegmentId = 0;
-	_largeBuf = NULL;
+	_largeBuf = nullptr;
 	_zoneSkipCount = 0;
 	_hotspotTextColor = 0;
 	_forceHideText = false;
@@ -389,7 +389,7 @@ bool LinesManager::checkCollisionLine(int xp, int yp, int *foundDataIdx, int *fo
 	for (int curLineIdx = startLineIdx; curLineIdx <= endLineIdx; curLineIdx++) {
 		lineData = _lineItem[curLineIdx]._lineData;
 
-		if (lineData == NULL)
+		if (lineData == nullptr)
 			continue;
 
 		bool collisionFl = true;
@@ -808,7 +808,7 @@ int LinesManager::computeRouteIdx(int lineIdx, int dataIdx, int fromX, int fromY
 		int endLineIdx = 2 * _lineItem[startLineIdx - 1]._lineDataEndIdx;
 
 		int16 *lineData = _lineItem[startLineIdx - 1]._lineData;
-		if (lineData == NULL)
+		if (lineData == nullptr)
 			break;
 		while (lineData[endLineIdx - 2] != lineX || lineY != lineData[endLineIdx - 1]) {
 			--curLineIdx;
@@ -839,7 +839,7 @@ int LinesManager::computeRouteIdx(int lineIdx, int dataIdx, int fromX, int fromY
 		int curLineIdx = endLineIdx + 1;
 		int nextLineDataEndIdx = 2 * _lineItem[curLineIdx]._lineDataEndIdx;
 		int16 *lineData = _lineItem[curLineIdx]._lineData;
-		if (lineData == NULL)
+		if (lineData == nullptr)
 			break;
 		for (;;) {
 			curLineDataEndIdx = nextLineDataEndIdx;
@@ -910,7 +910,7 @@ int LinesManager::computeRouteIdx(int lineIdx, int dataIdx, int fromX, int fromY
 	int minLineY = 0;
 	for (int i = startLineIdx; i <= endLineIdx; ++i) {
 		int16 *lineData = _lineItem[i]._lineData;
-		if (lineData == NULL)
+		if (lineData == nullptr)
 			error("error in genial routine");
 		if (i == startLineIdx) {
 			minLineY = MIN(lineData[1], lineData[2 * _lineItem[i]._lineDataEndIdx - 1]);
@@ -1108,13 +1108,13 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
 	if (!_vm->_globals->_checkDistanceFl) {
 		if (abs(fromX - _oldRouteFromX) <= 4 && abs(fromY - _oldRouteFromY) <= 4 &&
 		    abs(_oldRouteDestX - destX) <= 4 && abs(_oldRouteDestY - clipDestY) <= 4)
-			return NULL;
+			return nullptr;
 
 		if (abs(fromX - destX) <= 4 && abs(fromY - clipDestY) <= 4)
-			return NULL;
+			return nullptr;
 
 		if (_oldZoneNum > 0 && _vm->_objectsMan->_zoneNum > 0 && _oldZoneNum == _vm->_objectsMan->_zoneNum)
-			return NULL;
+			return nullptr;
 	}
 	_vm->_globals->_checkDistanceFl = false;
 	_oldZoneNum = _vm->_objectsMan->_zoneNum;
@@ -1134,7 +1134,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
 		clipDestY = _vm->_globals->_characterMaxPosY;
 
 	if (abs(fromX - clipDestX) <= 3 && abs(fromY - clipDestY) <= 3)
-		return NULL;
+		return nullptr;
 
 	for (int i = 0; i <= 8; ++i) {
 		collLineIdxArr[i] = -1;
@@ -1213,7 +1213,7 @@ RouteItem *LinesManager::findRoute(int fromX, int fromY, int destX, int destY) {
 	if (collLineIdxArr[DIR_LEFT] < 0)
 		deltaArr[DIR_LEFT] = INVALID_LINE_VALUE;
 	if (collLineIdxArr[DIR_UP] == -1 && collLineIdxArr[DIR_RIGHT] == -1 && collLineIdxArr[DIR_DOWN] == -1 && collLineIdxArr[DIR_LEFT] == -1)
-		return NULL;
+		return nullptr;
 
 	if (collLineIdxArr[DIR_DOWN] != -1 && deltaArr[DIR_UP] >= deltaArr[DIR_DOWN] && deltaArr[DIR_RIGHT] >= deltaArr[DIR_DOWN] && deltaArr[DIR_LEFT] >= deltaArr[DIR_DOWN]) {
 		curLineIdx = collLineIdxArr[DIR_DOWN];
@@ -2173,7 +2173,7 @@ RouteItem *LinesManager::cityMapCarRoute(int x1, int y1, int x2, int y2) {
 		_bestRoute[superRouteIdx].invalidate();
 		result = &_bestRoute[0];
 	} else {
-		result = NULL;
+		result = nullptr;
 	}
 	return result;
 }
@@ -2727,7 +2727,7 @@ void LinesManager::initSquareZones() {
 
 	for (int idx = 0; idx < MAX_LINES + 1; ++idx) {
 		int16 *dataP = _zoneLine[idx]._zoneData;
-		if (dataP == NULL)
+		if (dataP == nullptr)
 			continue;
 
 		SquareZoneItem *curZone = &_squareZone[_zoneLine[idx]._bobZoneIdx];
@@ -2762,22 +2762,22 @@ void LinesManager::clearAll() {
 		_zone[idx]._spriteIndex = 0;
 	}
 
-	_testRoute0 = NULL;
-	_testRoute1 = NULL;
-	_testRoute2 = NULL;
-	_lineBuf = NULL;
-	_route = NULL;
+	_testRoute0 = nullptr;
+	_testRoute1 = nullptr;
+	_testRoute2 = nullptr;
+	_lineBuf = nullptr;
+	_route = nullptr;
 
 	for (int idx = 0; idx < MAX_LINES; ++idx) {
 		_lineItem[idx]._lineDataEndIdx = 0;
 		_lineItem[idx]._direction = DIR_NONE;
 		_lineItem[idx]._directionRouteInc = DIR_NONE;
 		_lineItem[idx]._directionRouteDec = DIR_NONE;
-		_lineItem[idx]._lineData = NULL;
+		_lineItem[idx]._lineData = nullptr;
 
 		_zoneLine[idx]._count = 0;
 		_zoneLine[idx]._bobZoneIdx = 0;
-		_zoneLine[idx]._zoneData = NULL;
+		_zoneLine[idx]._zoneData = nullptr;
 	}
 
 	for (int idx = 0; idx < 100; ++idx)
@@ -2787,11 +2787,11 @@ void LinesManager::clearAll() {
 	_testRoute1 = new RouteItem[8334];
 	_testRoute2 = new RouteItem[8334];
 	if (!_testRoute0)
-		_testRoute0 = NULL;
+		_testRoute0 = nullptr;
 	if (!_testRoute1)
-		_testRoute1 = NULL;
+		_testRoute1 = nullptr;
 	if (!_testRoute2)
-		_testRoute2 = NULL;
+		_testRoute2 = nullptr;
 
 	_largeBuf = _vm->_globals->allocMemory(10000);
 	_lineBuf = (int16 *)(_largeBuf);
@@ -2820,7 +2820,7 @@ void LinesManager::resetLines() {
 	for (int idx = 0; idx < MAX_LINES; ++idx) {
 		_lineItem[idx]._lineData = (int16 *)_vm->_globals->freeMemory((byte *)_lineItem[idx]._lineData);
 		_lineItem[idx]._lineDataEndIdx = 0;
-		_lineItem[idx]._lineData = NULL;
+		_lineItem[idx]._lineData = nullptr;
 	}
 }
 
@@ -2884,7 +2884,7 @@ void LinesManager::checkZone() {
 	if (_zoneSkipCount <= 1)
 		return;
 
-	if (_vm->_globals->_freezeCharacterFl || (_route == NULL) || _zoneSkipCount > 4) {
+	if (_vm->_globals->_freezeCharacterFl || (_route == nullptr) || _zoneSkipCount > 4) {
 		_zoneSkipCount = 0;
 		int zoneId;
 		if (_oldMouseX != mouseX || _oldMouseY != oldMouseY) {
diff --git a/engines/hopkins/menu.cpp b/engines/hopkins/menu.cpp
index 5ec9eb82c1..3fd6f613b2 100644
--- a/engines/hopkins/menu.cpp
+++ b/engines/hopkins/menu.cpp
@@ -44,7 +44,7 @@ MenuManager::MenuManager(HopkinsEngine *vm) {
 }
 
 int MenuManager::menu() {
-	byte *spriteData = NULL;
+	byte *spriteData = nullptr;
 	MenuSelection menuIndex;
 	Common::Point mousePos;
 	signed int result;
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 95dd47a9e6..2ec84cfe62 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -61,7 +61,7 @@ ObjectsManager::ObjectsManager(HopkinsEngine *vm) {
 		Common::fill((byte *)&_hidingItem[i], (byte *)&_hidingItem[i] + sizeof(HidingItem), 0);
 
 	for (int i = 0; i < 6; ++i)
-		_hidingItemData[i] = NULL;
+		_hidingItemData[i] = nullptr;
 
 	for (int i = 0; i < 6; ++i)
 		Common::fill((byte *)&_liste[i], (byte *)&_liste[i] + sizeof(ListeItem), 0);
@@ -78,10 +78,10 @@ ObjectsManager::ObjectsManager(HopkinsEngine *vm) {
 	_saveLoadX = _saveLoadY = 0;
 	_oldCharacterPosX = _oldCharacterPosY = 0;
 	_eraseVisibleCounter = 0;
-	_saveLoadSprite = NULL;
-	_saveLoadSprite2 = NULL;
-	_spritePtr = NULL;
-	_oldSpriteData = NULL;
+	_saveLoadSprite = nullptr;
+	_saveLoadSprite2 = nullptr;
+	_spritePtr = nullptr;
+	_oldSpriteData = nullptr;
 	_saveLoadFl = false;
 	_visibleFl = false;
 	_zoneNum = 0;
@@ -101,10 +101,10 @@ ObjectsManager::ObjectsManager(HopkinsEngine *vm) {
 	_curObjectIndex = 0;
 	_forestFl = false;
 	_mapCarPosX = _mapCarPosY = 0;
-	_forestSprite = NULL;
-	_gestureBuf = NULL;
+	_forestSprite = nullptr;
+	_gestureBuf = nullptr;
 	_curGestureFile = 0;
-	_headSprites = NULL;
+	_headSprites = nullptr;
 	_homeRateCounter = 0;
 	_lastDirection = DIR_NONE;
 	_oldDirection = DIR_NONE;
@@ -112,7 +112,7 @@ ObjectsManager::ObjectsManager(HopkinsEngine *vm) {
 	_objectWidth = _objectHeight = 0;
 	_hidingActiveFl = false;
 	_curObjectFileNum = 0;
-	_objectDataBuf = NULL;
+	_objectDataBuf = nullptr;
 	_charactersEnabledFl = false;
 	_refreshBobMode10Fl = false;
 }
@@ -170,7 +170,7 @@ void ObjectsManager::resetHidingItems() {
 
 	for (int idx = 0; idx <= 20; ++idx) {
 		HidingItem *hid = &_hidingItem[idx];
-		hid->_spriteData = NULL;
+		hid->_spriteData = nullptr;
 		hid->_x = 0;
 		hid->_y = 0;
 		hid->_spriteIndex = 0;
@@ -193,7 +193,7 @@ void ObjectsManager::changeObject(int objIndex) {
 }
 
 byte *ObjectsManager::loadObjectFromFile(int objIndex, bool mode) {
-	byte *dataP = NULL;
+	byte *dataP = nullptr;
 	int objectFileNum = _objectAuthIcons[objIndex]._objectFileNum;
 	int idx = _objectAuthIcons[objIndex]._idx;
 
@@ -219,7 +219,7 @@ byte *ObjectsManager::loadObjectFromFile(int objIndex, bool mode) {
 		dataP = _vm->_events->_objectBuf;
 	} else {
 		dataP = _vm->_globals->allocMemory(height * width);
-		if (dataP == NULL)
+		if (dataP == nullptr)
 			error("CAPTURE_OBJET");
 
 		capture_mem_sprite(_objectDataBuf, dataP, idx);
@@ -574,7 +574,7 @@ void ObjectsManager::resetBob(int idx) {
 	ListeItem &item = _liste2[idx];
 
 	bob._bobMode = 0;
-	bob._spriteData = NULL;
+	bob._spriteData = nullptr;
 	bob._xp = 0;
 	bob._yp = 0;
 	bob._frameIndex = 0;
@@ -582,7 +582,7 @@ void ObjectsManager::resetBob(int idx) {
 	bob._moveChange1 = 0;
 	bob._moveChange2 = 0;
 	bob._disabledAnimationFl = false;
-	bob._animData = NULL;
+	bob._animData = nullptr;
 	bob._bobMode10 = false;
 	bob._bobModeChange = 0;
 	bob._modeChangeCtr = 0;
@@ -1008,7 +1008,7 @@ void ObjectsManager::displayBobAnim() {
 			continue;
 
 		bob->_bobMode10 = false;
-		if (bob->_animData == NULL || bob->_disabledAnimationFl || bob->_modeChangeCtr == 0 || bob->_modeChangeCtr < -1) {
+		if (bob->_animData == nullptr || bob->_disabledAnimationFl || bob->_modeChangeCtr == 0 || bob->_modeChangeCtr < -1) {
 			if (bob->_bobModeChange == 1 || bob->_bobModeChange == 2)
 				bob->_bobMode10 = true;
 			continue;
@@ -1161,14 +1161,14 @@ void ObjectsManager::displayVBob() {
 			vbob->_surface = _vm->_globals->freeMemory(vbob->_surface);
 
 			vbob->_displayMode = 0;
-			vbob->_spriteData = NULL;
+			vbob->_spriteData = nullptr;
 			vbob->_xp = 0;
 			vbob->_yp = 0;
 			vbob->_oldX = 0;
 			vbob->_oldY = 0;
 			vbob->_frameIndex = 0;
 			vbob->_oldFrameIndex = 0;
-			vbob->_oldSpriteData = NULL;
+			vbob->_oldSpriteData = nullptr;
 		}
 
 		if (vbob->_displayMode == 3) {
@@ -1246,7 +1246,7 @@ int ObjectsManager::getSpriteY(int idx) {
  */
 void ObjectsManager::clearSprite() {
 	for (int idx = 0; idx < MAX_SPRITE; idx++) {
-		_sprite[idx]._spriteData = NULL;
+		_sprite[idx]._spriteData = nullptr;
 		_sprite[idx]._animationType = 0;
 	}
 
@@ -1333,7 +1333,7 @@ void ObjectsManager::setFlipSprite(int idx, bool flipFl) {
 }
 
 void ObjectsManager::goHome() {
-	if (_vm->_linesMan->_route == NULL)
+	if (_vm->_linesMan->_route == nullptr)
 		return;
 
 	if (_homeRateCounter > 1) {
@@ -1370,11 +1370,11 @@ void ObjectsManager::goHome() {
 				zoneId = _vm->_globals->_saveData->_data[svLastZoneNum];
 			else
 				zoneId = _zoneNum;
-			_vm->_linesMan->_route = NULL;
+			_vm->_linesMan->_route = nullptr;
 			computeAndSetSpriteSize();
 			setFlipSprite(0, false);
 			_homeRateCounter = 0;
-			_vm->_linesMan->_route = NULL;
+			_vm->_linesMan->_route = nullptr;
 			_oldDirection = DIR_NONE;
 			if (zoneId > 0) {
 				ZoneItem *curZone = &_vm->_linesMan->_zone[zoneId];
@@ -1591,7 +1591,7 @@ void ObjectsManager::goHome() {
 				zoneId = _zoneNum;
 			setSpriteIndex(0, _oldDirection + 59);
 			_vm->_globals->_actionDirection = DIR_NONE;
-			_vm->_linesMan->_route = NULL;
+			_vm->_linesMan->_route = nullptr;
 			computeAndSetSpriteSize();
 			setFlipSprite(0, false);
 			_homeRateCounter = 0;
@@ -1652,7 +1652,7 @@ void ObjectsManager::goHome() {
 }
 
 void ObjectsManager::goHome2() {
-	if (_vm->_linesMan->_route == NULL)
+	if (_vm->_linesMan->_route == nullptr)
 		return;
 
 	int realSpeed = 2;
@@ -1715,7 +1715,7 @@ void ObjectsManager::goHome2() {
 		break;
 	}
 
-	_vm->_linesMan->_route = NULL;
+	_vm->_linesMan->_route = nullptr;
 }
 
 /**
@@ -1806,7 +1806,7 @@ void ObjectsManager::handleCityMap() {
 	_vm->_globals->_cityMapEnabledFl = true;
 	_vm->_graphicsMan->_noFadingFl = false;
 	_vm->_globals->_freezeCharacterFl = false;
-	_spritePtr = NULL;
+	_spritePtr = nullptr;
 	_vm->_globals->_exitId = 0;
 	_vm->_globals->_checkDistanceFl = true;
 	_vm->_soundMan->playSound(31);
@@ -1835,7 +1835,7 @@ void ObjectsManager::handleCityMap() {
 	_vm->_graphicsMan->scrollScreen(getSpriteX(0) - 320);
 	_vm->_graphicsMan->_scrollOffset = getSpriteX(0) - 320;
 	animateSprite(0);
-	_vm->_linesMan->_route = NULL;
+	_vm->_linesMan->_route = nullptr;
 	_vm->_graphicsMan->setColorPercentage(252, 100, 100, 100);
 	_vm->_graphicsMan->setColorPercentage(253, 100, 100, 100);
 	_vm->_graphicsMan->setColorPercentage(251, 100, 100, 100);
@@ -1877,7 +1877,7 @@ void ObjectsManager::handleCityMap() {
 		_vm->_linesMan->checkZone();
 		goHome2();
 
-		if (_vm->_linesMan->_route == NULL && _vm->_globals->_actionMoveTo)
+		if (_vm->_linesMan->_route == nullptr && _vm->_globals->_actionMoveTo)
 			paradise();
 		_vm->_events->refreshScreenAndEvents();
 
@@ -1972,13 +1972,13 @@ void ObjectsManager::handleLeftButton() {
 	}
 	_vm->_globals->_actionMoveTo = false;
 	RouteItem *oldRoute = _vm->_linesMan->_route;
-	_vm->_linesMan->_route = NULL;
+	_vm->_linesMan->_route = nullptr;
 	if (_forestFl && _zoneNum >= 20 && _zoneNum <= 23) {
 		if (getSpriteY(0) > 374 && getSpriteY(0) <= 410) {
-			_vm->_linesMan->_route = NULL;
+			_vm->_linesMan->_route = nullptr;
 			setSpriteIndex(0, _oldDirectionSpriteIdx);
 			_vm->_globals->_actionDirection = DIR_NONE;
-			_vm->_linesMan->_route = NULL;
+			_vm->_linesMan->_route = nullptr;
 			computeAndSetSpriteSize();
 			setFlipSprite(0, false);
 			_homeRateCounter = 0;
@@ -2032,7 +2032,7 @@ void ObjectsManager::handleLeftButton() {
 				&& _curObjectIndex == 20 && _zoneNum == 12
 				&& _vm->_events->_mouseCursorId == 23) {
 		// Special case for throwing darts at the switch in Purgatory - the player shouldn't move
-		_vm->_linesMan->_route = NULL;
+		_vm->_linesMan->_route = nullptr;
 		getSpriteX(0);
 		getSpriteY(0);
 	}
@@ -2149,7 +2149,7 @@ void ObjectsManager::clearScreen() {
 	_forceZoneFl = true;
 	_vm->_linesMan->resetLinesNumb();
 	_vm->_linesMan->resetLastLine();
-	_vm->_linesMan->_route = NULL;
+	_vm->_linesMan->_route = nullptr;
 	_vm->_globals->_answerBuffer = _vm->_globals->freeMemory(_vm->_globals->_answerBuffer);
 	_vm->_globals->_levelSpriteBuf = _vm->_globals->freeMemory(_vm->_globals->_levelSpriteBuf);
 	_vm->_events->_startPos.x = 0;
@@ -2159,7 +2159,7 @@ void ObjectsManager::clearScreen() {
 	_vm->_globals->_actionMoveTo = false;
 	_forceZoneFl = true;
 	_changeVerbFl = false;
-	_vm->_linesMan->_route = NULL;
+	_vm->_linesMan->_route = nullptr;
 	_oldDirection = DIR_NONE;
 	_vm->_graphicsMan->resetDirtyRects();
 }
@@ -2176,7 +2176,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
 	_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, 532, 25, 65, 40, _vm->_graphicsMan->_frontBuffer, 532, 25);
 	_vm->_graphicsMan->addDirtyRect(532, 25, 597, 65);
 	_vm->_globals->_checkDistanceFl = true;
-	_vm->_linesMan->_route = NULL;
+	_vm->_linesMan->_route = nullptr;
 
 	if (oldCharacter == CHARACTER_SAMANTHA && newCharacter == CHARACTER_HOPKINS
 		&& _vm->_globals->_saveData->_realHopkins._location == _vm->_globals->_screenId) {
@@ -2622,7 +2622,7 @@ void ObjectsManager::loadObjectIniFile() {
 	data = _vm->_fileIO->searchCat(file, RES_INI, fileFoundFl);
 	if (!fileFoundFl) {
 		data = _vm->_fileIO->loadFile(file);
-		if (data == NULL)
+		if (data == nullptr)
 			error("INI file %s not found", file.c_str());
 	}
 
@@ -3143,7 +3143,7 @@ void ObjectsManager::loadLinkFile(const Common::String &file, bool skipDetails)
 
 		nbytes = f.size();
 		ptr = _vm->_globals->allocMemory(nbytes);
-		if (ptr == NULL)
+		if (ptr == nullptr)
 			error("INILINK");
 		_vm->_fileIO->readStream(f, ptr, nbytes);
 		f.close();
@@ -3771,7 +3771,7 @@ void ObjectsManager::sceneControl(const Common::String &backgroundFile, const Co
 	_vm->_globals->_cityMapEnabledFl = false;
 	_vm->_globals->_eventMode = EVENTMODE_IGNORE;
 	_vm->_soundMan->playSound(soundNum);
-	_vm->_linesMan->_route = NULL;
+	_vm->_linesMan->_route = nullptr;
 	_vm->_globals->_freezeCharacterFl = true;
 	_vm->_globals->_exitId = 0;
 	if (!backgroundFile.empty())
@@ -3791,7 +3791,7 @@ void ObjectsManager::sceneControl(const Common::String &backgroundFile, const Co
 	if (_vm->_globals->_screenId == 61) {
 		addStaticSprite(_vm->_globals->_characterSpriteBuf, Common::Point(330, 418), 0, 60, 0, false, 34, 190);
 		animateSprite(0);
-		_vm->_linesMan->_route = NULL;
+		_vm->_linesMan->_route = nullptr;
 		computeAndSetSpriteSize();
 	}
 	_vm->_graphicsMan->setColorPercentage(252, 100, 100, 100);
@@ -3809,7 +3809,7 @@ void ObjectsManager::sceneControl(const Common::String &backgroundFile, const Co
 		_oldCharacterPosX = getSpriteX(0);
 		_oldDirection = DIR_NONE;
 		_homeRateCounter = 0;
-		_vm->_linesMan->_route = NULL;
+		_vm->_linesMan->_route = nullptr;
 		_vm->_linesMan->_route = _vm->_linesMan->findRoute(getSpriteX(0), getSpriteY(0), 330, 345);
 		_vm->_globals->_checkDistanceFl = true;
 		do {
@@ -3918,7 +3918,7 @@ void ObjectsManager::sceneControl2(const Common::String &backgroundFile, const C
 	computeAndSetSpriteSize();
 	animateSprite(0);
 	enableHidingBehavior();
-	_vm->_linesMan->_route = NULL;
+	_vm->_linesMan->_route = nullptr;
 	computeAndSetSpriteSize();
 	sceneSpecialIni();
 	_vm->_events->_mouseSpriteId = 4;
@@ -3949,7 +3949,7 @@ void ObjectsManager::sceneControl2(const Common::String &backgroundFile, const C
 					int yp = _vm->_events->getMouseY();
 
 					if ((xCheck == xp) && (yCheck == yp)) {
-						_vm->_linesMan->_route = NULL;
+						_vm->_linesMan->_route = nullptr;
 						paradise();
 						if (_vm->_globals->_exitId)
 							breakFlag = true;
@@ -3965,8 +3965,8 @@ void ObjectsManager::sceneControl2(const Common::String &backgroundFile, const C
 		if (!_vm->_globals->_exitId) {
 			_vm->_dialog->testDialogOpening();
 			_vm->_linesMan->checkZone();
-			if (_vm->_linesMan->_route == NULL
-					|| (goHome(), _vm->_linesMan->_route == NULL)) {
+			if (_vm->_linesMan->_route == nullptr
+					|| (goHome(), _vm->_linesMan->_route == nullptr)) {
 				if (_vm->_globals->_actionMoveTo)
 					paradise();
 			}
@@ -4027,7 +4027,7 @@ void ObjectsManager::loadHidingItems(const Common::String &file) {
 		hid->_x = READ_LE_INT16((uint16 *)ptr + curBufIdx + 1);
 		hid->_y = READ_LE_INT16((uint16 *)ptr + curBufIdx + 2);
 		hid->_yOffset = READ_LE_INT16((uint16 *)ptr + curBufIdx + 4);
-		if (spriteData == NULL) {
+		if (spriteData == nullptr) {
 			hid->_useCount = 0;
 		} else {
 			hid->_spriteData = spriteData;
@@ -4051,9 +4051,9 @@ void ObjectsManager::initVBob() {
 		vbob->_xp = 0;
 		vbob->_yp = 0;
 		vbob->_frameIndex = 0;
-		vbob->_surface = NULL;
-		vbob->_spriteData = NULL;
-		vbob->_oldSpriteData = NULL;
+		vbob->_surface = nullptr;
+		vbob->_spriteData = nullptr;
+		vbob->_oldSpriteData = nullptr;
 	}
 }
 
@@ -4065,8 +4065,8 @@ void ObjectsManager::clearVBob() {
 		vbob->_yp = 0;
 		vbob->_frameIndex = 0;
 		vbob->_surface = _vm->_globals->freeMemory(vbob->_surface);
-		vbob->_spriteData = NULL;
-		vbob->_oldSpriteData = NULL;
+		vbob->_spriteData = nullptr;
+		vbob->_oldSpriteData = nullptr;
 	}
 }
 
diff --git a/engines/hopkins/saveload.cpp b/engines/hopkins/saveload.cpp
index ef3551803d..21f97767b8 100644
--- a/engines/hopkins/saveload.cpp
+++ b/engines/hopkins/saveload.cpp
@@ -57,7 +57,7 @@ bool SaveLoadManager::save(const Common::String &file, const void *buf, size_t n
 
 bool SaveLoadManager::saveExists(const Common::String &file) {
 	Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading(file);
-	bool result = savefile != NULL;
+	bool result = savefile != nullptr;
 	delete savefile;
 	return result;
 }
@@ -69,7 +69,7 @@ bool SaveLoadManager::saveFile(const Common::String &file, const void *buf, size
 
 void SaveLoadManager::load(const Common::String &file, byte *buf) {
 	Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading(file);
-	if (savefile == NULL)
+	if (savefile == nullptr)
 		error("Error opening file - %s", file.c_str());
 
 	int32 filesize = savefile->size();
@@ -156,7 +156,7 @@ Common::Error SaveLoadManager::saveGame(int slot, const Common::String &saveName
 		return Common::kCreatingFileFailed;
 
 	// Set up the serializer
-	Common::Serializer serializer(NULL, savefile);
+	Common::Serializer serializer(nullptr, savefile);
 
 	// Write out the savegame header
 	hopkinsSavegameHeader header;
@@ -182,7 +182,7 @@ Common::Error SaveLoadManager::loadGame(int slot) {
 		return Common::kReadingFailed;
 
 	// Set up the serializer
-	Common::Serializer serializer(savefile, NULL);
+	Common::Serializer serializer(savefile, nullptr);
 
 	// Read in the savegame header
 	hopkinsSavegameHeader header;
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index 96d5204c8e..1116399070 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -767,7 +767,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 		case 46: {
 			_vm->_globals->_checkDistanceFl = true;
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 564, 420);
 			_vm->_objectsMan->_zoneNum = -1;
 			do {
@@ -776,7 +776,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_objectsMan->removeSprite(0);
 			_vm->_globals->_checkDistanceFl = true;
 			_vm->_soundMan->loadSample(1, "SOUND44.WAV");
@@ -1002,7 +1002,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 			_vm->_objectsMan->_oldCharacterPosX = _vm->_objectsMan->getSpriteX(0);
 			_vm->_objectsMan->resetOldDirection();
 			_vm->_objectsMan->resetHomeRateCounter();
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 445, 332);
 			_vm->_globals->_checkDistanceFl = true;
 			do {
@@ -1011,7 +1011,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_objectsMan->removeSprite(0);
 			_vm->_objectsMan->setBobAnimation(7);
 			_vm->_objectsMan->setBobAnimDataIdx(7, 0);
@@ -1125,7 +1125,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 			_vm->_objectsMan->_oldCharacterPosX = _vm->_objectsMan->getSpriteX(0);
 			_vm->_objectsMan->resetOldDirection();
 			_vm->_objectsMan->resetHomeRateCounter();
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 119, 268);
 			_vm->_globals->_checkDistanceFl = true;
 			do {
@@ -1134,7 +1134,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_objectsMan->removeSprite(0);
 			_vm->_objectsMan->setBobAnimation(11);
 			_vm->_objectsMan->setBobAnimation(8);
@@ -1450,7 +1450,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 			_vm->_objectsMan->_oldCharacterPosX = _vm->_objectsMan->getSpriteX(0);
 			_vm->_objectsMan->resetOldDirection();
 			_vm->_objectsMan->resetHomeRateCounter();
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			switch (_vm->_globals->_saveData->_data[svField253]) {
 			case 1:
 				_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 201, 294);
@@ -1470,7 +1470,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_objectsMan->removeSprite(0);
 			_vm->_objectsMan->setSpriteIndex(0, 60);
 			_vm->_soundMan->loadSample(1, "SOUND63.WAV");
@@ -1704,7 +1704,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 			_vm->_objectsMan->resetOldDirection();
 			_vm->_objectsMan->resetHomeRateCounter();
 			_vm->_globals->_checkDistanceFl = true;
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 361, 325);
 			_vm->_globals->_checkDistanceFl = true;
 			_vm->_objectsMan->_zoneNum = -1;
@@ -1714,7 +1714,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_globals->_exitId = 59;
 			break;
 			}
@@ -1732,7 +1732,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 			_vm->_objectsMan->resetOldDirection();
 			_vm->_objectsMan->resetHomeRateCounter();
 			_vm->_globals->_checkDistanceFl = true;
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 361, 325);
 			_vm->_globals->_checkDistanceFl = true;
 			_vm->_objectsMan->_zoneNum = -1;
@@ -1742,7 +1742,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_globals->_exitId = 59;
 			break;
 			}
@@ -1923,7 +1923,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 				_vm->_soundMan->_specialSoundNum = 0;
 			}
 			_vm->_globals->_checkDistanceFl = true;
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 330, 418);
 			_vm->_globals->_checkDistanceFl = true;
 			_vm->_objectsMan->_zoneNum = 0;
@@ -1933,7 +1933,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_objectsMan->setSpriteIndex(0, 64);
 			_vm->_globals->_exitId = _vm->_globals->_saveData->_data[svField401];
 			_vm->_globals->_disableInventFl = false;
@@ -1953,7 +1953,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 				_vm->_events->refreshScreenAndEvents();
 			} while (_vm->_objectsMan->getBobAnimDataIdx(1) != 9);
 			_vm->_objectsMan->stopBobAnimation(1);
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			_vm->_globals->_checkDistanceFl = true;
 			_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 330, 314);
 			_vm->_objectsMan->_zoneNum = 0;
@@ -1964,7 +1964,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_objectsMan->setSpriteIndex(0, 64);
 			_vm->_objectsMan->setBobAnimation(2);
 			_vm->_soundMan->playSoundFile("SOUND66.WAV");
@@ -2045,7 +2045,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 			_vm->_objectsMan->resetOldDirection();
 			_vm->_objectsMan->resetHomeRateCounter();
 			_vm->_globals->_checkDistanceFl = true;
-			_vm->_linesMan->_route = (RouteItem *)NULL;
+			_vm->_linesMan->_route = (RouteItem *)nullptr;
 			_vm->_linesMan->_route = _vm->_linesMan->findRoute(_vm->_objectsMan->getSpriteX(0), _vm->_objectsMan->getSpriteY(0), 488, 280);
 			_vm->_globals->_checkDistanceFl = true;
 			do {
@@ -2054,7 +2054,7 @@ int ScriptManager::handleOpcode(const byte *dataP) {
 
 				_vm->_objectsMan->goHome();
 				_vm->_events->refreshScreenAndEvents();
-			} while (_vm->_linesMan->_route != (RouteItem *)NULL);
+			} while (_vm->_linesMan->_route != (RouteItem *)nullptr);
 			_vm->_objectsMan->removeSprite(0);
 			bool playFl = false;
 			_vm->_objectsMan->setBobAnimation(7);
diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp
index 16f451b472..1004dd3df8 100644
--- a/engines/hopkins/sound.cpp
+++ b/engines/hopkins/sound.cpp
@@ -60,9 +60,9 @@ private:
 
 Audio::RewindableAudioStream *makeAPCStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse) {
 	if (stream->readUint32BE() != MKTAG('C', 'R', 'Y', 'O'))
-		return 0;
+		return nullptr;
 	if (stream->readUint32BE() != MKTAG('_', 'A', 'P', 'C'))
-		return 0;
+		return nullptr;
 	stream->readUint32BE(); // version
 	stream->readUint32LE(); // out size
 	uint32 rate = stream->readUint32LE();
@@ -77,7 +77,7 @@ public:
 	TwaAudioStream(Common::String name, Common::SeekableReadStream *stream) {
 		_name = name;
 		_cueSheet.clear();
-		_cueStream = NULL;
+		_cueStream = nullptr;
 		_cue = 0;
 		_loadedCue = -1;
 
@@ -99,7 +99,7 @@ public:
 
 	~TwaAudioStream() override {
 		delete _cueStream;
-		_cueStream = NULL;
+		_cueStream = nullptr;
 	}
 
 	bool isStereo() const override {
@@ -111,7 +111,7 @@ public:
 	}
 
 	bool endOfData() const override {
-		return _cueStream == NULL;
+		return _cueStream == nullptr;
 	}
 
 	int readBuffer(int16 *buffer, const int numSamples) override {
@@ -147,7 +147,7 @@ protected:
 		}
 
 		delete _cueStream;
-		_cueStream = NULL;
+		_cueStream = nullptr;
 		_loadedCue = _cueSheet[nr];
 
 		Common::String filename = Common::String::format("%s_%02d", _name.c_str(), _cueSheet[nr]);
@@ -793,7 +793,7 @@ bool SoundManager::removeWavSample(int wavIndex) {
 
 	_vm->_mixer->stopHandle(_sWav[wavIndex]._soundHandle);
 	delete _sWav[wavIndex]._audioStream;
-	_sWav[wavIndex]._audioStream = NULL;
+	_sWav[wavIndex]._audioStream = nullptr;
 	_sWav[wavIndex]._active = false;
 
 	return true;
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index 1ed7aaf66c..efffdbad29 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -37,10 +37,10 @@ namespace Hopkins {
 
 TalkManager::TalkManager(HopkinsEngine *vm) {
 	_vm = vm;
-	_characterBuffer = NULL;
-	_characterPalette = NULL;
-	_characterSprite = NULL;
-	_characterAnim = NULL;
+	_characterBuffer = nullptr;
+	_characterPalette = nullptr;
+	_characterSprite = nullptr;
+	_characterAnim = nullptr;
 	_characterSize = 0;
 	_dialogueMesgId1 = _dialogueMesgId2 = _dialogueMesgId3 = _dialogueMesgId4 = 0;
 	_paletteBufferIdx = 0;
@@ -719,7 +719,7 @@ bool TalkManager::searchCharacterAnim(int idx, const byte *bufPerso, int animId,
 					loopCond = true;
 				if (bufIndx > bufferSize) {
 					_vm->_animMan->_animBqe[idx]._enabledFl = false;
-					_vm->_animMan->_animBqe[idx]._data = NULL;
+					_vm->_animMan->_animBqe[idx]._data = nullptr;
 					return false;
 				}
 				++bufIndx;
@@ -768,11 +768,11 @@ void TalkManager::handleAnswer(int zone, int verb) {
 	byte verbObj = verb;
 
 	bool outerLoopFl;
-	byte *ptr = NULL;
+	byte *ptr = nullptr;
 	do {
 		outerLoopFl = false;
 		bool tagFound = false;
-		if (_vm->_globals->_answerBuffer == NULL)
+		if (_vm->_globals->_answerBuffer == nullptr)
 			return;
 
 		byte *curAnswerBuf = _vm->_globals->_answerBuffer;
@@ -1019,7 +1019,7 @@ void TalkManager::animateObject(const Common::String &filename) {
 	searchCharacterPalette(_paletteBufferIdx, true);
 	startCharacterAnim0(_paletteBufferIdx, false);
 	byte *oldAnswerBufferPtr = _vm->_globals->_answerBuffer;
-	_vm->_globals->_answerBuffer = NULL;
+	_vm->_globals->_answerBuffer = nullptr;
 	_vm->_globals->_freezeCharacterFl = true;
 	_vm->_objectsMan->loadLinkFile(screenFilename);
 	_vm->_objectsMan->_charactersEnabledFl = true;


Commit: 94e1c56272adde9d27f1b4ca300d86a0c4b88090
    https://github.com/scummvm/scummvm/commit/94e1c56272adde9d27f1b4ca300d86a0c4b88090
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
HUGO: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/hugo/detection.cpp
    engines/hugo/display.cpp
    engines/hugo/file.cpp
    engines/hugo/file_v1d.cpp
    engines/hugo/file_v2d.cpp
    engines/hugo/file_v3d.cpp
    engines/hugo/hugo.cpp
    engines/hugo/mouse.cpp
    engines/hugo/object.cpp
    engines/hugo/parser.cpp
    engines/hugo/parser_v1d.cpp
    engines/hugo/parser_v2d.cpp
    engines/hugo/route.cpp
    engines/hugo/text.cpp


diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp
index f335b07cc0..a9cca2c0fd 100644
--- a/engines/hugo/detection.cpp
+++ b/engines/hugo/detection.cpp
@@ -47,7 +47,7 @@ static const PlainGameDescriptor hugoGames[] = {
 	{"hugo1", "Hugo 1: Hugo's House of Horrors"},
 	{"hugo2", "Hugo 2: Whodunit?"},
 	{"hugo3", "Hugo 3: Jungle of Doom"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const HugoGameDescription gameDescriptions[] = {
@@ -55,7 +55,7 @@ static const HugoGameDescription gameDescriptions[] = {
 	// Hugo1 DOS
 	{
 		{
-			"hugo1", 0,
+			"hugo1", nullptr,
 			AD_ENTRY1s("house.art", "c9403b2fe539185c9fd569b6cc4ff5ca", 14811),
 			Common::EN_ANY,
 			Common::kPlatformDOS,
@@ -67,7 +67,7 @@ static const HugoGameDescription gameDescriptions[] = {
 	// Hugo1 Windows
 	{
 		{
-			"hugo1", 0,
+			"hugo1", nullptr,
 			AD_ENTRY1s("objects.dat", "3ba0f108f7690a05a34c56a02fbe644a", 126488),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -79,7 +79,7 @@ static const HugoGameDescription gameDescriptions[] = {
 	// Hugo2 DOS
 	{
 		{
-			"hugo2", 0,
+			"hugo2", nullptr,
 			AD_ENTRY1s("objects.dat", "88a718cc0ff2b3b25d49aaaa69d6d52c", 155240),
 			Common::EN_ANY,
 			Common::kPlatformDOS,
@@ -91,7 +91,7 @@ static const HugoGameDescription gameDescriptions[] = {
 	// Hugo2 Windows
 	{
 		{
-			"hugo2", 0,
+			"hugo2", nullptr,
 			AD_ENTRY1s("objects.dat", "5df4ffc851e66a544c0e95e4e084a806", 158480),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -103,7 +103,7 @@ static const HugoGameDescription gameDescriptions[] = {
 	// Hugo3 DOS
 	{
 		{
-			"hugo3", 0,
+			"hugo3", nullptr,
 			AD_ENTRY1s("objects.dat", "bb1b061538a445f2eb99b682c0f506cc", 136419),
 			Common::EN_ANY,
 			Common::kPlatformDOS,
@@ -115,7 +115,7 @@ static const HugoGameDescription gameDescriptions[] = {
 	// Hugo3 Windows
 	{
 		{
-			"hugo3", 0,
+			"hugo3", nullptr,
 			AD_ENTRY1s("objects.dat", "c9a8af7aa14cc907434eecee3ddd06d3", 136638),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 2a466e6f84..ee77b2e783 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -663,10 +663,10 @@ void Screen::drawBoundaries() {
 	for (int i = 0; i < _vm->_object->_numObj; i++) {
 		Object *obj = &_vm->_object->_objects[i]; // Get pointer to object
 		if (obj->_screenIndex == *_vm->_screenPtr) {
-			if ((obj->_currImagePtr != 0) && (obj->_cycling != kCycleInvisible))
+			if ((obj->_currImagePtr != nullptr) && (obj->_cycling != kCycleInvisible))
 				drawRectangle(false, obj->_x + obj->_currImagePtr->_x1, obj->_y + obj->_currImagePtr->_y1,
 				                     obj->_x + obj->_currImagePtr->_x2, obj->_y + obj->_currImagePtr->_y2, _TLIGHTGREEN);
-			else if ((obj->_currImagePtr == 0) && (obj->_vxPath != 0) && !obj->_carriedFl)
+			else if ((obj->_currImagePtr == nullptr) && (obj->_vxPath != 0) && !obj->_carriedFl)
 				drawRectangle(false, obj->_oldx, obj->_oldy, obj->_oldx + obj->_vxPath, obj->_oldy + obj->_vyPath, _TBRIGHTWHITE);
 		}
 	}
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index a3fa4463b4..014131f091 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -107,8 +107,8 @@ Seq *FileManager::readPCX(Common::SeekableReadStream &f, Seq *seqPtr, byte *imag
 	debugC(1, kDebugFile, "readPCX(..., %s)", name);
 
 	// Allocate memory for Seq if 0
-	if (seqPtr == 0) {
-		if ((seqPtr = (Seq *)malloc(sizeof(Seq))) == 0)
+	if (seqPtr == nullptr) {
+		if ((seqPtr = (Seq *)malloc(sizeof(Seq))) == nullptr)
 			error("Insufficient memory to run game.");
 	}
 
@@ -128,7 +128,7 @@ Seq *FileManager::readPCX(Common::SeekableReadStream &f, Seq *seqPtr, byte *imag
 	uint16 size = pcxSurface->w * pcxSurface->h;
 
 	// Allocate memory for image data if NULL
-	if (imagePtr == 0)
+	if (imagePtr == nullptr)
 		imagePtr = (byte *)malloc((size_t) size);
 
 	assert(imagePtr);
@@ -176,19 +176,19 @@ void FileManager::readImage(const int objNum, Object *objPtr) {
 	}
 
 	bool  firstImgFl = true;                        // Initializes pcx read function
-	Seq *seqPtr = 0;                              // Ptr to sequence structure
+	Seq *seqPtr = nullptr;                              // Ptr to sequence structure
 
 	// Now read the images into an images list
 	for (int j = 0; j < objPtr->_seqNumb; j++) {     // for each sequence
 		for (int k = 0; k < objPtr->_seqList[j]._imageNbr; k++) { // each image
 			if (k == 0) {                           // First image
 				// Read this image - allocate both seq and image memory
-				seqPtr = readPCX(_objectsArchive, 0, 0, firstImgFl, _vm->_text->getNoun(objPtr->_nounIndex, 0));
+				seqPtr = readPCX(_objectsArchive, nullptr, nullptr, firstImgFl, _vm->_text->getNoun(objPtr->_nounIndex, 0));
 				objPtr->_seqList[j]._seqPtr = seqPtr;
 				firstImgFl = false;
 			} else {                                // Subsequent image
 				// Read this image - allocate both seq and image memory
-				seqPtr->_nextSeqPtr = readPCX(_objectsArchive, 0, 0, firstImgFl, _vm->_text->getNoun(objPtr->_nounIndex, 0));
+				seqPtr->_nextSeqPtr = readPCX(_objectsArchive, nullptr, nullptr, firstImgFl, _vm->_text->getNoun(objPtr->_nounIndex, 0));
 				seqPtr = seqPtr->_nextSeqPtr;
 			}
 
@@ -585,7 +585,7 @@ void FileManager::readUIFItem(const int16 id, byte *buf) {
 	Seq *dummySeq;                                // Dummy Seq for image data
 	switch (id) {
 	case UIF_IMAGES:                                // Read uif images file
-		dummySeq = readPCX(ip, 0, buf, true, getUifFilename());
+		dummySeq = readPCX(ip, nullptr, buf, true, getUifFilename());
 		free(dummySeq);
 		break;
 	default:                                        // Read file data into supplied array
diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp
index b6b51eaa7b..a5ba35e546 100644
--- a/engines/hugo/file_v1d.cpp
+++ b/engines/hugo/file_v1d.cpp
@@ -88,7 +88,7 @@ void FileManager_v1d::readBackground(const int screenIndex) {
 		error("File not found: %s", buf.c_str());
 	// Read the image into dummy seq and static dib_a
 	Seq *dummySeq;                                // Image sequence structure for Read_pcx
-	dummySeq = readPCX(_sceneryArchive1, 0, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
+	dummySeq = readPCX(_sceneryArchive1, nullptr, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
 	free(dummySeq);
 	_sceneryArchive1.close();
 }
diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp
index 5f748133ea..ca6efc9ceb 100644
--- a/engines/hugo/file_v2d.cpp
+++ b/engines/hugo/file_v2d.cpp
@@ -94,7 +94,7 @@ void FileManager_v2d::readBackground(const int screenIndex) {
 
 	// Read the image into dummy seq and static dib_a
 	Seq *dummySeq;                                  // Image sequence structure for Read_pcx
-	dummySeq = readPCX(_sceneryArchive1, 0, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
+	dummySeq = readPCX(_sceneryArchive1, nullptr, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
 	free(dummySeq);
 }
 
diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp
index 0cfb1dc162..4796c4e28d 100644
--- a/engines/hugo/file_v3d.cpp
+++ b/engines/hugo/file_v3d.cpp
@@ -66,11 +66,11 @@ void FileManager_v3d::readBackground(const int screenIndex) {
 	if (screenIndex < 20) {
 		_sceneryArchive1.seek(sceneBlock._sceneOffset, SEEK_SET);
 		// Read the image into dummy seq and static dib_a
-		dummySeq = readPCX(_sceneryArchive1, 0, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
+		dummySeq = readPCX(_sceneryArchive1, nullptr, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
 	} else {
 		_sceneryArchive2.seek(sceneBlock._sceneOffset, SEEK_SET);
 		// Read the image into dummy seq and static dib_a
-		dummySeq = readPCX(_sceneryArchive2, 0, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
+		dummySeq = readPCX(_sceneryArchive2, nullptr, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
 	}
 	free(dummySeq);
 }
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 71fd52635d..9e42eadb81 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -59,7 +59,7 @@ HugoEngine::HugoEngine(OSystem *syst, const HugoGameDescription *gd) : Engine(sy
 	_system = syst;
 
 	setDebugger(new HugoConsole(this));
-	_rnd = 0;
+	_rnd = nullptr;
 
 	_screen = nullptr;
 	_mouse = nullptr;
@@ -530,13 +530,13 @@ bool HugoEngine::loadHugoDat() {
 }
 
 uint16 **HugoEngine::loadLongArray(Common::SeekableReadStream &in) {
-	uint16 **resArray = 0;
+	uint16 **resArray = nullptr;
 
 	for (int varnt = 0; varnt < _numVariant; varnt++) {
 		uint16 numRows = in.readUint16BE();
 		if (varnt == _gameVariant) {
 			resArray = (uint16 **)malloc(sizeof(uint16 *) * (numRows + 1));
-			resArray[numRows] = 0;
+			resArray[numRows] = nullptr;
 		}
 		for (int i = 0; i < numRows; i++) {
 			uint16 numElems = in.readUint16BE();
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index 8c0ba12f8f..b86ba20a5a 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -375,7 +375,7 @@ void MouseHandler::readHotspot(Common::ReadStream &in, Hotspot &hotspot) {
  * Load hotspots data from hugo.dat
  */
 void MouseHandler::loadHotspots(Common::ReadStream &in) {
-	Hotspot *wrkHotspots = 0;
+	Hotspot *wrkHotspots = nullptr;
 	Hotspot tmp;
 	memset(&tmp, 0, sizeof(tmp));
 	for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp
index bbd2b93adc..5a8a0270b9 100644
--- a/engines/hugo/object.cpp
+++ b/engines/hugo/object.cpp
@@ -143,7 +143,7 @@ void ObjectHandler::useObject(int16 objId) {
 			sprintf(_vm->_line, "%s %s", _vm->_text->getVerb(_vm->_take, 0), _vm->_text->getNoun(obj->_nounIndex, 0));
 		else if (obj->_cmdIndex != 0)                     // Use non-collectible item if able
 			sprintf(_vm->_line, "%s %s", _vm->_text->getVerb(_vm->_parser->getCmdDefaultVerbIdx(obj->_cmdIndex), 0), _vm->_text->getNoun(obj->_nounIndex, 0));
-		else if ((verb = _vm->_parser->useBG(_vm->_text->getNoun(obj->_nounIndex, 0))) != 0)
+		else if ((verb = _vm->_parser->useBG(_vm->_text->getNoun(obj->_nounIndex, 0))) != nullptr)
 			sprintf(_vm->_line, "%s %s", verb, _vm->_text->getNoun(obj->_nounIndex, 0));
 		else
 			return;                                       // Can't use object directly
@@ -204,7 +204,7 @@ int16 ObjectHandler::findObject(uint16 x, uint16 y) {
 		if (obj->_screenIndex == *_vm->_screenPtr && (obj->_genericCmd || obj->_objValue || obj->_cmdIndex)) {
 			Seq *curImage = obj->_currImagePtr;
 			// Object must have a visible image...
-			if (curImage != 0 && obj->_cycling != kCycleInvisible) {
+			if (curImage != nullptr && obj->_cycling != kCycleInvisible) {
 				// If cursor inside object
 				if (x >= (uint16)obj->_x && x <= obj->_x + curImage->_x2 && y >= (uint16)obj->_y && y <= obj->_y + curImage->_y2) {
 					// If object is closest so far
@@ -215,7 +215,7 @@ int16 ObjectHandler::findObject(uint16 x, uint16 y) {
 				}
 			} else {
 				// ...or a dummy object that has a hotspot rectangle
-				if (curImage == 0 && obj->_vxPath != 0 && !obj->_carriedFl) {
+				if (curImage == nullptr && obj->_vxPath != 0 && !obj->_carriedFl) {
 					// If cursor inside special rectangle
 					if ((int16)x >= obj->_oldx && (int16)x < obj->_oldx + obj->_vxPath && (int16)y >= obj->_oldy && (int16)y < obj->_oldy + obj->_vyPath) {
 						// If object is closest so far
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index c853023362..7793cc6b57 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -144,7 +144,7 @@ void Parser::loadBackgroundObjects(Common::ReadStream &in) {
  * Read _catchallList from Hugo.dat
  */
 void Parser::loadCatchallList(Common::ReadStream &in) {
-	Background *wrkCatchallList = 0;
+	Background *wrkCatchallList = nullptr;
 	Background tmpBG;
 	memset(&tmpBG, 0, sizeof(tmpBG));
 
@@ -183,7 +183,7 @@ const char *Parser::useBG(const char *name) {
 
 void Parser::freeParser() {
 	if (_arrayReqs) {
-		for (int i = 0; _arrayReqs[i] != 0; i++)
+		for (int i = 0; _arrayReqs[i] != nullptr; i++)
 			free(_arrayReqs[i]);
 		free(_arrayReqs);
 		_arrayReqs = nullptr;
@@ -404,7 +404,7 @@ void Parser::command(const char *format, ...) {
  * Locate any member of object name list appearing in command line
  */
 bool Parser::isWordPresent(char **wordArr) const {
-	if (wordArr != 0) {
+	if (wordArr != nullptr) {
 		debugC(1, kDebugParser, "isWordPresent(%s)", wordArr[0]);
 
 		for (int i = 0; strlen(wordArr[i]); i++) {
diff --git a/engines/hugo/parser_v1d.cpp b/engines/hugo/parser_v1d.cpp
index 404a7bae80..1e0ef3cbcd 100644
--- a/engines/hugo/parser_v1d.cpp
+++ b/engines/hugo/parser_v1d.cpp
@@ -69,7 +69,7 @@ const char *Parser_v1d::findNextNoun(const char *noun) const {
 				return _vm->_text->getNoun(i, 0);
 		}
 	}
-	return 0;
+	return nullptr;
 }
 
 /**
@@ -395,7 +395,7 @@ void Parser_v1d::lineHandler() {
 
 	// Find the first verb in the line
 	const char *verb = findVerb();
-	const char *noun = 0;                           // Noun not found yet
+	const char *noun = nullptr;                           // Noun not found yet
 	char farComment[kCompLineSize * 5] = "";        // hold 5 line comment if object not nearby
 
 	if (verb) {                                     // OK, verb found.  Try to match with object
diff --git a/engines/hugo/parser_v2d.cpp b/engines/hugo/parser_v2d.cpp
index d8e91adec2..7eb5a38f27 100644
--- a/engines/hugo/parser_v2d.cpp
+++ b/engines/hugo/parser_v2d.cpp
@@ -145,7 +145,7 @@ void Parser_v2d::lineHandler() {
 
 	// Find the first verb in the line
 	const char *verb = findVerb();
-	const char *noun = 0;                           // Noun not found yet
+	const char *noun = nullptr;                           // Noun not found yet
 	char farComment[kCompLineSize * 5] = "";        // hold 5 line comment if object not nearby
 
 	if (verb) {                                     // OK, verb found.  Try to match with object
diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp
index ed1a7fd788..96b7ec1944 100644
--- a/engines/hugo/route.cpp
+++ b/engines/hugo/route.cpp
@@ -391,7 +391,7 @@ bool Route::findRoute(const int16 cx, const int16 cy) {
 	// Look in segments[] for straight lines from destination to hero
 	for (i = 0, _routeListIndex = 0; i < _segmentNumb - 1; i++) {
 		Common::Point *routeNode;                   // Ptr to route node
-		if ((routeNode = newNode()) == 0)           // New node for new segment
+		if ((routeNode = newNode()) == nullptr)           // New node for new segment
 			return false;                           // Too many nodes
 		routeNode->y = _segment[i]._y;
 
@@ -403,7 +403,7 @@ bool Route::findRoute(const int16 cx, const int16 cy) {
 				routeNode->y = segPtr->_y;          // Yes, keep updating node
 			} else {
 				// No, create another node on previous segment to reach it
-				if ((routeNode = newNode()) == 0)   // Add new route node
+				if ((routeNode = newNode()) == nullptr)   // Add new route node
 					return false;                   // Too many nodes
 
 				// Find overlap between old and new segments
diff --git a/engines/hugo/text.cpp b/engines/hugo/text.cpp
index 617fccc36d..0522f35c15 100644
--- a/engines/hugo/text.cpp
+++ b/engines/hugo/text.cpp
@@ -202,11 +202,11 @@ char **TextHandler::loadTexts(Common::ReadStream &in) {
 
 void TextHandler::loadAllTexts(Common::ReadStream &in) {
 	// Read textData
-	_textData = loadTextsVariante(in, 0);
+	_textData = loadTextsVariante(in, nullptr);
 
 	// Read stringtData
 	// Only Hugo 1 DOS should use this array
-	_stringtData = loadTextsVariante(in, 0);
+	_stringtData = loadTextsVariante(in, nullptr);
 
 	// Read arrayNouns
 	_arrayNouns = loadTextsArray(in);
@@ -221,7 +221,7 @@ void TextHandler::loadAllTexts(Common::ReadStream &in) {
 	_textEngine = loadTexts(in);
 
 	// Read textIntro
-	_textIntro = loadTextsVariante(in, 0);
+	_textIntro = loadTextsVariante(in, nullptr);
 
 	// Read textMouse
 	_textMouse = loadTexts(in);
@@ -230,7 +230,7 @@ void TextHandler::loadAllTexts(Common::ReadStream &in) {
 	_textParser = loadTexts(in);
 
 	// Read textUtil
-	_textUtil = loadTextsVariante(in, 0);
+	_textUtil = loadTextsVariante(in, nullptr);
 }
 
 void TextHandler::freeTexts(char **ptr) {


Commit: 91816427ca33084aca08256288f63217c07b948f
    https://github.com/scummvm/scummvm/commit/91816427ca33084aca08256288f63217c07b948f
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
HYPNO: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/hypno/detection.cpp
    engines/hypno/lexer_arc.cpp
    engines/hypno/lexer_mis.cpp
    engines/hypno/scene.cpp


diff --git a/engines/hypno/detection.cpp b/engines/hypno/detection.cpp
index b24205637c..be58165471 100644
--- a/engines/hypno/detection.cpp
+++ b/engines/hypno/detection.cpp
@@ -37,7 +37,7 @@ static const PlainGameDescriptor hypnoGames[] = {
 	{"sinistersix", "Marvel Comics Spider-Man: The Sinister Six"},
 	{"wetlands", "Wetlands"},
 	{"soldierboyz", "Soldier Boyz"},
-	{0, 0}};
+	{nullptr, nullptr}};
 
 static const ADGameDescription gameDescriptions[] = {
 	{
@@ -52,7 +52,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"sinistersix", // US release
-		0,
+		nullptr,
 		AD_ENTRY2s("DATA.Z", "a1f71005a45e6ee454bb0bf3868dff54", 8766307,
 				"MISSIONS.LIB", "585704e26094cbaf14fbee90798e8d5d", 119945),
 		Common::EN_USA,
@@ -62,7 +62,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"sinistersix", // ES release
-		0,
+		nullptr,
 		AD_ENTRY2s("SPIDER.EXE", "dbd912d6f6724c6d44775fc19cfa8ca0", 483871,
 				"MISSIONS.LIB", "585704e26094cbaf14fbee90798e8d5d", 119945),
 		Common::ES_ESP,
@@ -72,7 +72,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"sinistersix", // HE release
-		0,
+		nullptr,
 		AD_ENTRY2s("SPIDER.EXE", "dbd912d6f6724c6d44775fc19cfa8ca0", 483359,
 				"MISSIONS.LIB", "585704e26094cbaf14fbee90798e8d5d", 119945),
 		Common::HE_ISR,
@@ -113,7 +113,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"wetlands", // Wetlands (US)
-		0,
+		nullptr,
 		AD_ENTRY2s("wetlands.exe", "15a6b1b3819ef002438df340509b5373", 647447,
 				"missions.lib", "aeaaa8b26ab17e37f060334a311a3ff6", 309793),
 		Common::EN_USA,
@@ -123,7 +123,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"wetlands", // Wetlands (FR)
-		0,
+		nullptr,
 		AD_ENTRY2s("wetlands.exe", "edc5b0c0caf3d5b01d344cb555d9a085", 629575,
 			    "missions.lib", "aeaaa8b26ab17e37f060334a311a3ff6", 309793),
 		Common::FR_FRA,
@@ -133,7 +133,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"wetlands", // Wetlands (ES)
-		0,
+		nullptr,
 		AD_ENTRY2s("wetlands.exe", "8d0f3630523da827bb25e665b7d3f879", 644055,
 				"missions.lib", "aeaaa8b26ab17e37f060334a311a3ff6", 309793),
 		Common::ES_ESP,
@@ -163,7 +163,7 @@ static const char *const directoryGlobs[] = {
 	"factory",
 	"movie",
 	"c_misc",
-	NULL
+	nullptr
 };
 
 class HypnoMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/hypno/lexer_arc.cpp b/engines/hypno/lexer_arc.cpp
index e9c5106850..81a4771ce7 100644
--- a/engines/hypno/lexer_arc.cpp
+++ b/engines/hypno/lexer_arc.cpp
@@ -527,7 +527,7 @@ struct yy_buffer_state
 /* Stack of input buffers. */
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = nullptr; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
@@ -549,7 +549,7 @@ static int yy_n_chars;		/* number of characters read into yy_ch_buf */
 int yyleng;
 
 /* Points to current character in buffer. */
-static char *yy_c_buf_p = NULL;
+static char *yy_c_buf_p = nullptr;
 static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
@@ -606,7 +606,7 @@ void yyfree ( void *  );
 #define YY_SKIP_YYWRAP
 typedef flex_uint8_t YY_CHAR;
 
-FILE *yyin = NULL, *yyout = NULL;
+FILE *yyin = nullptr, *yyout = nullptr;
 
 typedef int yy_state_type;
 
@@ -1530,7 +1530,7 @@ static int yy_get_next_buffer (void)
 				}
 			else
 				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = NULL;
+				b->yy_ch_buf = nullptr;
 
 			if ( ! b->yy_ch_buf )
 				YY_FATAL_ERROR(
@@ -1834,7 +1834,7 @@ static void yy_load_buffer_state  (void)
 		return;
 
 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr;
 
 	if ( b->yy_is_our_buffer )
 		yyfree( (void *) b->yy_ch_buf  );
@@ -1905,7 +1905,7 @@ static void yy_load_buffer_state  (void)
  */
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-    	if (new_buffer == NULL)
+    	if (new_buffer == nullptr)
 		return;
 
 	yyensure_buffer_stack();
@@ -1939,7 +1939,7 @@ void yypop_buffer_state (void)
 		return;
 
 	yy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = NULL;
+	YY_CURRENT_BUFFER_LVALUE = nullptr;
 	if ((yy_buffer_stack_top) > 0)
 		--(yy_buffer_stack_top);
 
@@ -2009,7 +2009,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
 		/* They forgot to leave room for the EOB's. */
-		return NULL;
+		return nullptr;
 
 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
 	if ( ! b )
@@ -2018,7 +2018,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
 	b->yy_buf_pos = b->yy_ch_buf = base;
 	b->yy_is_our_buffer = 0;
-	b->yy_input_file = NULL;
+	b->yy_input_file = nullptr;
 	b->yy_n_chars = b->yy_buf_size;
 	b->yy_is_interactive = 0;
 	b->yy_at_bol = 1;
@@ -2197,10 +2197,10 @@ static int yy_init_globals (void)
     /* We do not touch yylineno unless the option is enabled. */
     yylineno =  1;
     
-    (yy_buffer_stack) = NULL;
+    (yy_buffer_stack) = nullptr;
     (yy_buffer_stack_top) = 0;
     (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = NULL;
+    (yy_c_buf_p) = nullptr;
     (yy_init) = 0;
     (yy_start) = 0;
 
@@ -2209,8 +2209,8 @@ static int yy_init_globals (void)
     yyin = stdin;
     yyout = stdout;
 #else
-    yyin = NULL;
-    yyout = NULL;
+    yyin = nullptr;
+    yyout = nullptr;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
@@ -2226,13 +2226,13 @@ int yylex_destroy  (void)
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		yy_delete_buffer( YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
+		YY_CURRENT_BUFFER_LVALUE = nullptr;
 		yypop_buffer_state();
 	}
 
 	/* Destroy the stack itself. */
 	yyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = NULL;
+	(yy_buffer_stack) = nullptr;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
      * yylex() is called, initialization will occur. */
diff --git a/engines/hypno/lexer_mis.cpp b/engines/hypno/lexer_mis.cpp
index f3c5c1385e..0a87847f08 100644
--- a/engines/hypno/lexer_mis.cpp
+++ b/engines/hypno/lexer_mis.cpp
@@ -527,7 +527,7 @@ struct yy_buffer_state
 /* Stack of input buffers. */
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = nullptr; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
@@ -549,7 +549,7 @@ static int yy_n_chars;		/* number of characters read into yy_ch_buf */
 int yyleng;
 
 /* Points to current character in buffer. */
-static char *yy_c_buf_p = NULL;
+static char *yy_c_buf_p = nullptr;
 static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
@@ -606,7 +606,7 @@ void yyfree ( void *  );
 #define YY_SKIP_YYWRAP
 typedef flex_uint8_t YY_CHAR;
 
-FILE *yyin = NULL, *yyout = NULL;
+FILE *yyin = nullptr, *yyout = nullptr;
 
 typedef int yy_state_type;
 
@@ -1613,7 +1613,7 @@ static int yy_get_next_buffer (void)
 				}
 			else
 				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = NULL;
+				b->yy_ch_buf = nullptr;
 
 			if ( ! b->yy_ch_buf )
 				YY_FATAL_ERROR(
@@ -1917,7 +1917,7 @@ static void yy_load_buffer_state  (void)
 		return;
 
 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr;
 
 	if ( b->yy_is_our_buffer )
 		yyfree( (void *) b->yy_ch_buf  );
@@ -1988,7 +1988,7 @@ static void yy_load_buffer_state  (void)
  */
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-    	if (new_buffer == NULL)
+    	if (new_buffer == nullptr)
 		return;
 
 	yyensure_buffer_stack();
@@ -2022,7 +2022,7 @@ void yypop_buffer_state (void)
 		return;
 
 	yy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = NULL;
+	YY_CURRENT_BUFFER_LVALUE = nullptr;
 	if ((yy_buffer_stack_top) > 0)
 		--(yy_buffer_stack_top);
 
@@ -2092,7 +2092,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
 		/* They forgot to leave room for the EOB's. */
-		return NULL;
+		return nullptr;
 
 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
 	if ( ! b )
@@ -2101,7 +2101,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
 	b->yy_buf_pos = b->yy_ch_buf = base;
 	b->yy_is_our_buffer = 0;
-	b->yy_input_file = NULL;
+	b->yy_input_file = nullptr;
 	b->yy_n_chars = b->yy_buf_size;
 	b->yy_is_interactive = 0;
 	b->yy_at_bol = 1;
@@ -2280,10 +2280,10 @@ static int yy_init_globals (void)
     /* We do not touch yylineno unless the option is enabled. */
     yylineno =  1;
     
-    (yy_buffer_stack) = NULL;
+    (yy_buffer_stack) = nullptr;
     (yy_buffer_stack_top) = 0;
     (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = NULL;
+    (yy_c_buf_p) = nullptr;
     (yy_init) = 0;
     (yy_start) = 0;
 
@@ -2292,8 +2292,8 @@ static int yy_init_globals (void)
     yyin = stdin;
     yyout = stdout;
 #else
-    yyin = NULL;
-    yyout = NULL;
+    yyin = nullptr;
+    yyout = nullptr;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
@@ -2309,13 +2309,13 @@ int yylex_destroy  (void)
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		yy_delete_buffer( YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
+		YY_CURRENT_BUFFER_LVALUE = nullptr;
 		yypop_buffer_state();
 	}
 
 	/* Destroy the stack itself. */
 	yyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = NULL;
+	(yy_buffer_stack) = nullptr;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
      * yylex() is called, initialization will occur. */
diff --git a/engines/hypno/scene.cpp b/engines/hypno/scene.cpp
index a72f5e4832..44334fae14 100644
--- a/engines/hypno/scene.cpp
+++ b/engines/hypno/scene.cpp
@@ -56,7 +56,7 @@ const static char *sceneVariables[] = {
 	"GS_COMBATJSON",
 	"GS_COMBATLEVEL",
 	"GS_PUZZLELEVEL",
-	NULL
+	nullptr
 };
 
 void HypnoEngine::loadSceneLevel(const Common::String &current, const Common::String &next, const Common::String &prefix) {
@@ -408,13 +408,13 @@ void HypnoEngine::runScene(Scene *scene) {
 			debugC(1, kHypnoDebugScene, "Removing a hotspot list!");
 			stack.pop_back();
 			runMenu(*stack.back());
-			_nextHotsToRemove = NULL;
+			_nextHotsToRemove = nullptr;
 			drawScreen();
 		} else if (_nextHotsToAdd) {
 			debugC(1, kHypnoDebugScene, "Adding a hotspot list!");
 			stack.push_back(_nextHotsToAdd);
 			runMenu(*stack.back());
-			_nextHotsToAdd = NULL;
+			_nextHotsToAdd = nullptr;
 			drawScreen();
 		}
 


Commit: 75bfc1290b54c4de032ae9ab97add20ed3b37330
    https://github.com/scummvm/scummvm/commit/75bfc1290b54c4de032ae9ab97add20ed3b37330
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
ICB: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/icb/actor_pc.cpp
    engines/icb/actor_view_pc.cpp
    engines/icb/barriers.cpp
    engines/icb/chi.cpp
    engines/icb/cluster_manager_pc.cpp
    engines/icb/common/ptr_util.cpp
    engines/icb/common/px_clu_api.cpp
    engines/icb/common/px_string.cpp
    engines/icb/custom_logics.cpp
    engines/icb/debug.cpp
    engines/icb/detection.cpp
    engines/icb/drawpoly_pc.cpp
    engines/icb/fn_animation.cpp
    engines/icb/fn_interact.cpp
    engines/icb/fn_movie_pc.cpp
    engines/icb/fn_remora_functions.cpp
    engines/icb/fn_sound.cpp
    engines/icb/footstep.cpp
    engines/icb/gfx/gfxstub_dutch.cpp
    engines/icb/gfx/gfxstub_rev.cpp
    engines/icb/gfx/psx_tman.cpp
    engines/icb/gfx/rab_api.cpp
    engines/icb/global_objects.cpp
    engines/icb/icb.cpp
    engines/icb/icon_menu.cpp
    engines/icb/icon_menu_pc.cpp
    engines/icb/jpeg.cpp
    engines/icb/keyboard.cpp
    engines/icb/light_pc.cpp
    engines/icb/logic.cpp
    engines/icb/map_marker.cpp
    engines/icb/mission.cpp
    engines/icb/mission_functions.cpp
    engines/icb/mouse.cpp
    engines/icb/options_manager_pc.cpp
    engines/icb/p4_pc.cpp
    engines/icb/player.cpp
    engines/icb/player_interaction.cpp
    engines/icb/remora.cpp
    engines/icb/remora_pc.cpp
    engines/icb/res_man.cpp
    engines/icb/res_man_pc.cpp
    engines/icb/route_manager.cpp
    engines/icb/session.cpp
    engines/icb/set_pc.cpp
    engines/icb/shadow_pc.cpp
    engines/icb/sound.cpp
    engines/icb/sound/direct_sound.cpp
    engines/icb/sound/fx_manager.cpp
    engines/icb/sound/music_manager.cpp
    engines/icb/sound/speech_manager.cpp
    engines/icb/sound_logic.cpp
    engines/icb/sound_lowlevel_pc.cpp
    engines/icb/speech.cpp
    engines/icb/stagedraw_pc_poly.cpp
    engines/icb/surface_manager.cpp
    engines/icb/text_sprites_pc.cpp


diff --git a/engines/icb/actor_pc.cpp b/engines/icb/actor_pc.cpp
index abfd9297f7..235ece5016 100644
--- a/engines/icb/actor_pc.cpp
+++ b/engines/icb/actor_pc.cpp
@@ -155,7 +155,7 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
 		if (skelPiece->parent != mesh->nBones) {
 			bone->parent = skeleton + skelPiece->parent;
 		} else
-			bone->parent = 0x0;
+			bone->parent = nullptr;
 	}
 
 	int32 hasUpperBodyDeform = 0;
@@ -273,7 +273,7 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
 			pcoord = pcoord->parent;
 		}
 		*lwPtr = *workm0;
-		bone->parent = NULL;
+		bone->parent = nullptr;
 		bone->matrix = *workm0;
 	}
 
@@ -418,7 +418,7 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
 	}
 
 	// draw the shadow
-	if (smesh != NULL) {
+	if (smesh != nullptr) {
 		shadtpc = g_system->getMillis();
 		DrawShadow1PC(smesh, -1, bone2actor, &cam_pc, &act_pc, ns, ldirs, lcolours, p_n, p_d, debug, shadowBox, actor->shadowMinBox, actor->shadowMaxBox);
 		shadtpc = g_system->getMillis() - shadtpc;
@@ -428,7 +428,7 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
 	}
 
 	// Draw the accessory
-	if ((pose != NULL) && (pb != 0)) {
+	if ((pose != nullptr) && (pb != 0)) {
 		DrawModel4PC(pose, pb, bone2actor, local2screen, uvframe, debug, poseBox, &poseMinBox, &poseMaxBox);
 
 		// WARNING
diff --git a/engines/icb/actor_view_pc.cpp b/engines/icb/actor_view_pc.cpp
index d1088a8f34..b96f225b63 100644
--- a/engines/icb/actor_view_pc.cpp
+++ b/engines/icb/actor_view_pc.cpp
@@ -178,7 +178,7 @@ void ChangeAnimPlaying(const char *pose, const char *anim, bool8 forwards, int32
 	}
 
 	// Require anim parameter
-	if (anim == NULL)
+	if (anim == nullptr)
 		Fatal_error("ChangeAnimPlaying() cannot set active animation to NULL!");
 
 	// Remake raj filename
@@ -453,7 +453,7 @@ void DrawFrame(const int32 frame) {
 	BoneDeformation *myBones[MAX_DEFORMABLE_BONES];
 
 	for (int32 i = 0; i < MAX_DEFORMABLE_BONES; i++) {
-		myBones[i] = NULL;
+		myBones[i] = nullptr;
 	}
 
 	// Shadow stuff to play with
diff --git a/engines/icb/barriers.cpp b/engines/icb/barriers.cpp
index 24d3505672..b9edf7b555 100644
--- a/engines/icb/barriers.cpp
+++ b/engines/icb/barriers.cpp
@@ -546,7 +546,7 @@ void _barrier_handler::___init() {
 	for (j = 0; j < MAX_slices; j++) {
 		anim_slices[j].num_props_in_slice = 0;
 		for (uint32 l = 0; l < MAX_parents_per_anim_slice; l++)
-			anim_slices[j].anim_parents[l] = 0; // unasigned pointer
+			anim_slices[j].anim_parents[l] = nullptr; // unasigned pointer
 	}
 	for (j = 0; j < MAX_props; j++) {
 		anim_prop_info[j].barriers_per_state = 0;
@@ -720,32 +720,32 @@ void _barrier_handler::Form_route_barrier_list(PXreal x, PXreal y, PXreal z, PXr
 				} else if (((CHILDR >= RBL) && (CHILDL <= RBR)) && ((CHILDB >= RBT) && (CHILDT <= RBB))) {
 					// child is wholly inside route box - add it and delete child
 					ADD_CHILD
-					clist[j] = NULL; // delete the child now it has been absorbed
+					clist[j] = nullptr; // delete the child now it has been absorbed
 				} else if (((RBR >= CHILDL) && (RBL <= CHILDR)) && ((RBT >= CHILDT) && (RBB <= CHILDB))) {
 					// route box is wholly inside child box - expand route box, add and delete child
 					ADD_CHILD
-					clist[j] = NULL; // delete the child now it has been absorbed
+					clist[j] = nullptr; // delete the child now it has been absorbed
 					EXPAND_ROUTE_BOX
 				} else {
 					if ((CHILDL > RBL) && (CHILDL < RBR) && ((CHILDT > RBT) && (CHILDT < RBB))) {
 						// child top/left is within route box - expand route box, add and delete child
 						ADD_CHILD
-						clist[j] = NULL; // delete the child now it has been absorbed
+						clist[j] = nullptr; // delete the child now it has been absorbed
 						EXPAND_ROUTE_BOX
 					} else if ((CHILDR > RBL) && (CHILDR < RBR) && ((CHILDT > RBT) && (CHILDT < RBB))) {
 						// child top/right is within route box - expand route box, add and delete child
 						ADD_CHILD
-						clist[j] = NULL; // delete the child now it has been absorbed
+						clist[j] = nullptr; // delete the child now it has been absorbed
 						EXPAND_ROUTE_BOX
 					} else if ((CHILDL > RBL) && (CHILDL < RBR) && ((CHILDB > RBT) && (CHILDB < RBB))) {
 						// child bottom/left is within route box - expand route box, add and delete child
 						ADD_CHILD
-						clist[j] = NULL; // delete the child now it has been absorbed
+						clist[j] = nullptr; // delete the child now it has been absorbed
 						EXPAND_ROUTE_BOX
 					} else if ((CHILDR > RBL) && (CHILDR < RBR) && ((CHILDB > RBT) && (CHILDB < RBB))) {
 						// child bottom/right is within route box - expand route box, add and delete child
 						ADD_CHILD
-						clist[j] = NULL; // delete the child now it has been absorbed
+						clist[j] = nullptr; // delete the child now it has been absorbed
 						EXPAND_ROUTE_BOX
 					} else {
 						// we must check for our route line intersecting a horizontal and vertical child box edge
@@ -842,7 +842,7 @@ _parent_box *_barrier_handler::Fetch_parent_num_on_slice_y(uint32 requested_pare
 
 	// reached total?
 	if (requested_parent == slice->num_parent_boxes)
-		return (0);
+		return (nullptr);
 
 	// simply return the pointer
 
@@ -867,8 +867,8 @@ _parent_box *_barrier_handler::Fetch_parent_box_for_xyz(PXreal x, PXreal y, PXre
 	// return a pointer to the parent box of a point in world space
 	// returns 0 if the point does not lie within a parent box
 
-	_routing_slice *slice = NULL;
-	_parent_box *parent = NULL;
+	_routing_slice *slice = nullptr;
+	_parent_box *parent = nullptr;
 
 	// find correct slice according to height
 	// fetch first
@@ -906,7 +906,7 @@ _parent_box *_barrier_handler::Fetch_parent_box_for_xyz(PXreal x, PXreal y, PXre
 		}
 	}
 
-	return (0);
+	return (nullptr);
 }
 
 void _game_session::Prepare_megas_route_barriers(bool8 pl) {
@@ -915,7 +915,7 @@ void _game_session::Prepare_megas_route_barriers(bool8 pl) {
 	// this system is custom for the player object - routing megas use their own system
 	// this routine fecthes the 'special' player only line-of-sight barriers too
 
-	_parent_box *par = 0;
+	_parent_box *par = nullptr;
 	_child_group *pchild;
 	uint32 total_childs;
 	uint32 j, k;
@@ -973,7 +973,7 @@ void _game_session::Prepare_megas_route_barriers(bool8 pl) {
 
 	if (parent_number == slice->num_parent_boxes) {
 		// not on a legal position - can happen
-		M->cur_parent = 0; // null pointer
+		M->cur_parent = nullptr; // null pointer
 		M->number_of_barriers = 0;
 		M->number_of_nudge = 0;
 		M->number_of_animating = 0;
diff --git a/engines/icb/chi.cpp b/engines/icb/chi.cpp
index 47f552df85..e26968bcac 100644
--- a/engines/icb/chi.cpp
+++ b/engines/icb/chi.cpp
@@ -515,7 +515,7 @@ bool8 _game_session::Process_chi() {
 
 						// play gun sound
 						if (MS->logic_structs[cur_id]->sfxVars[GUNSHOT_SFX_VAR] != 0)
-							RegisterSound(cur_id, NULL, MS->logic_structs[cur_id]->sfxVars[GUNSHOT_SFX_VAR], gunDesc,
+							RegisterSound(cur_id, nullptr, MS->logic_structs[cur_id]->sfxVars[GUNSHOT_SFX_VAR], gunDesc,
 							              (int8)127); // have to use full version so we can give hash instead of string
 						else
 							RegisterSound(cur_id, defaultGunSfx, gunDesc); // use small version as we have string not hash
diff --git a/engines/icb/cluster_manager_pc.cpp b/engines/icb/cluster_manager_pc.cpp
index 6b6e867a54..4b8ef6930f 100644
--- a/engines/icb/cluster_manager_pc.cpp
+++ b/engines/icb/cluster_manager_pc.cpp
@@ -84,14 +84,14 @@ ClusterManager::ClusterManager() {
 	m_filelistCursor = -1;
 	m_filelistSize = 0;
 
-	m_src_fp = NULL;
-	m_dst_fp = NULL;
+	m_src_fp = nullptr;
+	m_dst_fp = nullptr;
 
 	m_currentFileSize = 0;
 	m_chunkCounter = 0;
 	m_bytesDone = 0;
 
-	m_movieMemoryPointer = NULL;
+	m_movieMemoryPointer = nullptr;
 
 	m_installDone = FALSE8;
 
@@ -244,7 +244,7 @@ char *ClusterManager::GetFileListEntry() {
 	if (m_filelistCursor == -1)
 		Fatal_error("Can't retrieve filelist entry without loading a filelist first!");
 
-	char *line = NULL;
+	char *line = nullptr;
 
 	// End of file check
 	if (m_filelistCursor < m_filelistSize) {
@@ -399,7 +399,7 @@ const char *MissionIdToName(MISSION_ID mission) {
 	}
 
 	Fatal_error("MissionIdToName() should never get here - smack AndyB");
-	return NULL;
+	return nullptr;
 }
 
 void MakeDirectoryTree(MISSION_ID /*mission*/) {
diff --git a/engines/icb/common/ptr_util.cpp b/engines/icb/common/ptr_util.cpp
index 341d6b3a36..4121f3d65c 100644
--- a/engines/icb/common/ptr_util.cpp
+++ b/engines/icb/common/ptr_util.cpp
@@ -41,7 +41,7 @@ const int32 PTR_ARRAY_MAX(1024);
 uint32 encodePtr(uint8 *ptr) {
 	PointerReference ptrRef;
 
-	ptrdiff_t diff = ptr - (uint8 *)0;
+	ptrdiff_t diff = ptr - (uint8 *)nullptr;
 	ptrRef.ref = (uint32)(diff & 0xFFFFFFFF);
 	ptrRef.ptr = ptr;
 
@@ -65,7 +65,7 @@ uint32 encodePtr(uint8 *ptr) {
 
 uint8 *resolvePtr(uint32 ref) {
 	if (ref == 0)
-		return NULL;
+		return nullptr;
 
 	// do a linear search
 	for (Common::Array<PointerReference>::iterator it = g_ptrArray->begin(); it < g_ptrArray->end(); it++) {
@@ -74,7 +74,7 @@ uint8 *resolvePtr(uint32 ref) {
 
 			// purge
 			it->ref = 0;
-			it->ptr = 0;
+			it->ptr = nullptr;
 
 			return ptr;
 		}
@@ -82,7 +82,7 @@ uint8 *resolvePtr(uint32 ref) {
 
 	error("MemoryUtil::resolvePtr(%08x) COULD NOT RESOLVE POINTER!\n", ref);
 
-	return NULL;
+	return nullptr;
 }
 
 void clearAllPtrs(void) { g_ptrArray->clear(); }
diff --git a/engines/icb/common/px_clu_api.cpp b/engines/icb/common/px_clu_api.cpp
index 6de8b60876..939abc0554 100644
--- a/engines/icb/common/px_clu_api.cpp
+++ b/engines/icb/common/px_clu_api.cpp
@@ -34,7 +34,7 @@ namespace ICB {
 const char *hashTable = "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345";
 
 uint32 EngineHashString(const char *fn) {
-	if (fn == NULL)
+	if (fn == nullptr)
 		return 0;
 	char *f;
 	char c;
diff --git a/engines/icb/common/px_string.cpp b/engines/icb/common/px_string.cpp
index a3e3be494b..434af6af1f 100644
--- a/engines/icb/common/px_string.cpp
+++ b/engines/icb/common/px_string.cpp
@@ -49,7 +49,7 @@ const char *pxString::operator=(const char *str) {
 		s = new char[len];
 		memcpy((unsigned char *)s, (unsigned char *)const_cast<char *>(str), len);
 	} else
-		s = NULL; // Just the null string
+		s = nullptr; // Just the null string
 	return (s);
 }
 
@@ -63,7 +63,7 @@ void pxString::operator=(const pxString &str) {
 		s = new char[len];
 		memcpy((unsigned char *)s, (unsigned char *)str.s, len);
 	} else
-		s = NULL; // Null string
+		s = nullptr; // Null string
 }
 
 const char *pxString::operator+=(const char *adder) {
@@ -96,9 +96,9 @@ const pxString pxString::operator+(const char *adder) const {
 
 bool pxString::operator==(const char *string) const {
 	// Do a character by character comparison
-	if (s == NULL)
-		return ((bool)(string == NULL));
-	if (string == NULL)
+	if (s == nullptr)
+		return ((bool)(string == nullptr));
+	if (string == nullptr)
 		return (false);
 	return ((bool)(strcmp(s, const_cast<char *>(string)) == 0));
 }
@@ -118,7 +118,7 @@ void pxString::SetString(const char *data, uint32 len) {
 		// And null terminate it
 		s[len] = 0;
 	} else
-		s = NULL;
+		s = nullptr;
 }
 
 void pxString::Substr(pxString &rsStr, uint32 nStart, uint32 nNum) const {
@@ -215,10 +215,10 @@ void pxString::ConvertPath() {
 const pxString &pxString::Format(const char *format, ...) {
 	if (s)
 		delete[] s;
-	s = NULL;
+	s = nullptr;
 
 	// Check for a null parameter
-	if (format == NULL)
+	if (format == nullptr)
 		return (*this);
 
 	// The data could be any size. Rather than incrementally allocating memory until
@@ -228,7 +228,7 @@ const pxString &pxString::Format(const char *format, ...) {
 
 	// Allocate a start buffer
 	s = new char[startBufferSize + 2];
-	if (s == NULL)
+	if (s == nullptr)
 		return (*this);
 
 	// Process the variable arguments
@@ -246,7 +246,7 @@ const pxString &pxString::Format(const char *format, ...) {
 		// I can't see why, so I shall turn the warning off for this bit of code
 
 		// If the sllocation failed return an empty string
-		if (s == NULL)
+		if (s == nullptr)
 			return (*this);
 	}
 
@@ -289,7 +289,7 @@ pxFixedCharBuffer::pxFixedCharBuffer(uint32 len) {
 	m_data = new char[len];
 
 	// Check for an error
-	if (m_data == NULL) {
+	if (m_data == nullptr) {
 		error("pxFixedCharBuffer memory allocation error");
 	}
 }
diff --git a/engines/icb/custom_logics.cpp b/engines/icb/custom_logics.cpp
index 4524f8d2c9..3bb1998310 100644
--- a/engines/icb/custom_logics.cpp
+++ b/engines/icb/custom_logics.cpp
@@ -223,7 +223,7 @@ void _game_session::Custom_button_operated_door() {
 
 			// close sound
 			if (logic_structs[cur_id]->sfxVars[CLOSE_SFX_VAR] != 0)
-				RegisterSound(cur_id, NULL, logic_structs[cur_id]->sfxVars[CLOSE_SFX_VAR], closeDesc,
+				RegisterSound(cur_id, nullptr, logic_structs[cur_id]->sfxVars[CLOSE_SFX_VAR], closeDesc,
 				              (int8)127); // have to use full version so we can give hash instead of string
 			else
 				RegisterSound(cur_id, defaultCloseSfx, closeDesc); // use small version as we have string not hash
@@ -263,7 +263,7 @@ void _game_session::Custom_button_operated_door() {
 
 				// open sound
 				if (logic_structs[cur_id]->sfxVars[OPEN_SFX_VAR] != 0)
-					RegisterSound(cur_id, NULL, logic_structs[cur_id]->sfxVars[OPEN_SFX_VAR], openDesc,
+					RegisterSound(cur_id, nullptr, logic_structs[cur_id]->sfxVars[OPEN_SFX_VAR], openDesc,
 					              (int8)127); // have to use full version so we can give hash instead of string
 				else
 					RegisterSound(cur_id, defaultOpenSfx, openDesc); // use small version as we have string not hash
@@ -357,7 +357,7 @@ void _game_session::Custom_auto_door() {
 			CAD_STATE = CAD_CLOSING;
 			// close sound
 			if (logic_structs[cur_id]->sfxVars[CLOSE_SFX_VAR] != 0)
-				RegisterSound(cur_id, NULL, logic_structs[cur_id]->sfxVars[CLOSE_SFX_VAR], closeDesc,
+				RegisterSound(cur_id, nullptr, logic_structs[cur_id]->sfxVars[CLOSE_SFX_VAR], closeDesc,
 				              (int8)127); // have to use full version so we can give hash instead of string
 			else
 				RegisterSound(cur_id, defaultCloseSfx, closeDesc); // use small version as we have string not hash
@@ -392,7 +392,7 @@ void _game_session::Custom_auto_door() {
 
 			// open sound
 			if (logic_structs[cur_id]->sfxVars[OPEN_SFX_VAR] != 0)
-				RegisterSound(cur_id, NULL, logic_structs[cur_id]->sfxVars[OPEN_SFX_VAR], openDesc,
+				RegisterSound(cur_id, nullptr, logic_structs[cur_id]->sfxVars[OPEN_SFX_VAR], openDesc,
 				              (int8)127); // have to use full version so we can give hash instead of string
 			else
 				RegisterSound(cur_id, defaultOpenSfx, openDesc); // use small version as we have string not hash
diff --git a/engines/icb/debug.cpp b/engines/icb/debug.cpp
index 474c406a22..5705c2de59 100644
--- a/engines/icb/debug.cpp
+++ b/engines/icb/debug.cpp
@@ -116,7 +116,7 @@ void _game_session::Show_lit_unlit_diagnostics() {
 	// Draw the lights at their screen positions and with their base colours
 	if (SetOK()) {
 		rlp_API *lights = set.GetPRig();
-		if (lights != NULL) {
+		if (lights != nullptr) {
 			for (j = 0; j < lights->nLamps; j++) {
 				PSXLamp *pLamp = (PSXLamp *)lights->GetLamp(j);
 				uint32 state = pLamp->nStates - 1;
diff --git a/engines/icb/detection.cpp b/engines/icb/detection.cpp
index 718f5a1141..ac9a41f946 100644
--- a/engines/icb/detection.cpp
+++ b/engines/icb/detection.cpp
@@ -26,14 +26,14 @@ namespace ICB {
 
 static const PlainGameDescriptor icbGames[] = {
 	{ "icb", "In Cold Blood" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const char *directoryGlobs[] = {
 	"engine",
 	"linc",
 	"demo",
-	0
+	nullptr
 };
 
 static const ADGameDescription gameDescriptions[] = {
diff --git a/engines/icb/drawpoly_pc.cpp b/engines/icb/drawpoly_pc.cpp
index 98ed4e7dbc..15e1a16461 100644
--- a/engines/icb/drawpoly_pc.cpp
+++ b/engines/icb/drawpoly_pc.cpp
@@ -3526,7 +3526,7 @@ void drawSolidBboxPC(SVECTOR *scrn, CVECTOR *rgbIn) {
 	int32 z0, flag;
 	SVECTOR normal;
 	CVECTOR rgb;
-	POLY_F4 *face = NULL;
+	POLY_F4 *face = nullptr;
 
 	gte_NormalClip_pc(&(scrn[0]), &(scrn[1]), &(scrn[2]), &flag);
 	if (flag > 0) {
diff --git a/engines/icb/fn_animation.cpp b/engines/icb/fn_animation.cpp
index e70a05527d..297c554e70 100644
--- a/engines/icb/fn_animation.cpp
+++ b/engines/icb/fn_animation.cpp
@@ -665,7 +665,7 @@ mcodeFunctionReturnCodes _game_session::fn_play_generic_anim(int32 &, int32 *par
 
 	bool8 ret;
 
-	const char *anim_name = NULL;
+	const char *anim_name = nullptr;
 	if (params && params[0]) {
 		anim_name = (const char *)MemoryUtil::resolvePtr(params[0]);
 	}
@@ -735,7 +735,7 @@ mcodeFunctionReturnCodes _game_session::fn_easy_play_generic_anim(int32 &, int32
 	// return    IR_CONT or
 	//			IR_REPEAT
 
-	const char *anim_name = NULL;
+	const char *anim_name = nullptr;
 	if (params && params[0]) {
 		anim_name = (const char *)MemoryUtil::resolvePtr(params[0]);
 	}
@@ -1155,7 +1155,7 @@ mcodeFunctionReturnCodes _game_session::fn_play_custom_anim(int32 &result, int32
 		return IR_REPEAT;
 	}
 
-	return (fn_play_generic_anim(result, 0));
+	return (fn_play_generic_anim(result, nullptr));
 }
 
 mcodeFunctionReturnCodes _game_session::fn_reverse_custom_anim(int32 &, int32 *params) {
@@ -1247,7 +1247,7 @@ mcodeFunctionReturnCodes _game_session::fn_easy_play_custom_anim(int32 &result,
 		return (IR_REPEAT);
 	}
 
-	return (fn_easy_play_generic_anim(result, 0));
+	return (fn_easy_play_generic_anim(result, nullptr));
 }
 
 mcodeFunctionReturnCodes _game_session::fn_apply_bullet(int32 &, int32 *) {
@@ -1313,7 +1313,7 @@ mcodeFunctionReturnCodes _game_session::fn_new_apply_bullet(int32 &, int32 *para
 
 	// gun sound
 	if (logic_structs[cur_id]->sfxVars[GUNSHOT_SFX_VAR] != 0)
-		RegisterSound(cur_id, NULL, logic_structs[cur_id]->sfxVars[GUNSHOT_SFX_VAR], gunDesc, (int8)127); // have to use full version so we can give hash instead of string
+		RegisterSound(cur_id, nullptr, logic_structs[cur_id]->sfxVars[GUNSHOT_SFX_VAR], gunDesc, (int8)127); // have to use full version so we can give hash instead of string
 	else
 		RegisterSound(cur_id, defaultGunSfx, gunDesc); // use small version as we have string not hash
 
@@ -1415,7 +1415,7 @@ mcodeFunctionReturnCodes _game_session::fn_new_apply_bullet(int32 &, int32 *para
 	if (missed) {
 		// gun sound
 		if (logic_structs[cur_id]->sfxVars[RICOCHET_SFX_VAR] != 0)
-			RegisterSound(cur_id, NULL, logic_structs[cur_id]->sfxVars[RICOCHET_SFX_VAR], ricochetDesc,
+			RegisterSound(cur_id, nullptr, logic_structs[cur_id]->sfxVars[RICOCHET_SFX_VAR], ricochetDesc,
 			              (int8)127); // have to use full version so we can give hash instead of string
 		else
 			RegisterSound(cur_id, defaultRicochetSfx, ricochetDesc); // use small version as we have string not hash
diff --git a/engines/icb/fn_interact.cpp b/engines/icb/fn_interact.cpp
index 19edc73dec..4e025bdb7d 100644
--- a/engines/icb/fn_interact.cpp
+++ b/engines/icb/fn_interact.cpp
@@ -262,7 +262,7 @@ mcodeFunctionReturnCodes _game_session::Core_prop_interact(int32 & /*result*/, i
 	//				4 play target anim
 	//				5
 
-	const char *anim_name = NULL;
+	const char *anim_name = nullptr;
 	if (params && params[0]) {
 		anim_name = (const char *)MemoryUtil::resolvePtr(params[0]);
 	}
@@ -290,7 +290,7 @@ mcodeFunctionReturnCodes _game_session::Core_prop_interact(int32 & /*result*/, i
 		}
 
 		// start psx asyncing the anim - may already be doing so if scripts are written properly!
-		if (rs_anims->Res_open(I->get_info_name(anim), I->info_name_hash[anim], I->base_path, I->base_path_hash) == 0)
+		if (rs_anims->Res_open(I->get_info_name(anim), I->info_name_hash[anim], I->base_path, I->base_path_hash) == nullptr)
 			return IR_REPEAT;
 
 		// we are now looping, having done the init
diff --git a/engines/icb/fn_movie_pc.cpp b/engines/icb/fn_movie_pc.cpp
index 897e0b55c2..3eae671a09 100644
--- a/engines/icb/fn_movie_pc.cpp
+++ b/engines/icb/fn_movie_pc.cpp
@@ -44,7 +44,7 @@ void Init_play_movie(const char *param0, bool8 param1);
 mcodeFunctionReturnCodes fn_play_movie(int32 &result, int32 *params) { return (MS->fn_play_movie(result, params)); }
 
 mcodeFunctionReturnCodes _game_session::fn_play_movie(int32 &, int32 *params) {
-	const char *movie_name = NULL;
+	const char *movie_name = nullptr;
 	if (params && params[0]) {
 		movie_name = (const char *)MemoryUtil::resolvePtr(params[0]);
 	}
diff --git a/engines/icb/fn_remora_functions.cpp b/engines/icb/fn_remora_functions.cpp
index 648c668ef6..2d6b0aa2de 100644
--- a/engines/icb/fn_remora_functions.cpp
+++ b/engines/icb/fn_remora_functions.cpp
@@ -356,7 +356,7 @@ mcodeFunctionReturnCodes _game_session::fn_remora_warning_text(int32 &, int32 *p
 
 mcodeFunctionReturnCodes _game_session::fn_remora_blank_line(int32 &, int32 *) {
 	// Set the blank line.
-	g_oRemora->SetText(NULL, 0, 0, PIN_AT_CENTRE);
+	g_oRemora->SetText(nullptr, 0, 0, PIN_AT_CENTRE);
 
 	// Calling script can continue.
 	return (IR_CONT);
diff --git a/engines/icb/fn_sound.cpp b/engines/icb/fn_sound.cpp
index 150c67dcb2..ceb0a36def 100644
--- a/engines/icb/fn_sound.cpp
+++ b/engines/icb/fn_sound.cpp
@@ -162,7 +162,7 @@ mcodeFunctionReturnCodes _game_session::fn_stop_sfx(int32 &, int32 *params) {
 	const char *sub = strstr(const_cast<char *>(snd), "::");
 
 	// if object name is given in form obj::snd then extract both parts
-	if (sub != NULL) {
+	if (sub != nullptr) {
 		char tempObj[64];
 		char tempSnd[64];
 
diff --git a/engines/icb/footstep.cpp b/engines/icb/footstep.cpp
index 3de3017f4d..7f398b30d1 100644
--- a/engines/icb/footstep.cpp
+++ b/engines/icb/footstep.cpp
@@ -183,7 +183,7 @@ void _game_session::UpdateFootstep() {
 
 			// check for special mega who just has single sfx
 			if (M->footstep_special) {
-				RegisterSound(cur_id, NULL, specialFootSfx, "foot", (int8)(vol));
+				RegisterSound(cur_id, nullptr, specialFootSfx, "foot", (int8)(vol));
 			}
 			// we are an ordinary mega look for sfx
 			else {
@@ -211,7 +211,7 @@ void _game_session::UpdateFootstep() {
 					sfx = defaultFootSfx;
 
 				if (sfx)
-					RegisterSound(cur_id, NULL, sfx, "foot", (int8)(vol));
+					RegisterSound(cur_id, nullptr, sfx, "foot", (int8)(vol));
 			}
 		}
 	}
diff --git a/engines/icb/gfx/gfxstub_dutch.cpp b/engines/icb/gfx/gfxstub_dutch.cpp
index 71df5cd7bb..1848e5ce8a 100644
--- a/engines/icb/gfx/gfxstub_dutch.cpp
+++ b/engines/icb/gfx/gfxstub_dutch.cpp
@@ -60,14 +60,14 @@ typedef struct {
 	int32 ZBytesPerPixel;
 } MyRenderDevice;
 
-MyRenderDevice myRenDev = {NULL, 0, 0, NULL, 0, 0};
-RevRenderDevice *lastRevRenDev = NULL;
+MyRenderDevice myRenDev = {nullptr, 0, 0, nullptr, 0, 0};
+RevRenderDevice *lastRevRenDev = nullptr;
 
 int32 SetRenderDevice(RevRenderDevice *renderDev) {
-	lastRevRenDev = NULL;
-	if (renderDev->RGBdata == NULL)
+	lastRevRenDev = nullptr;
+	if (renderDev->RGBdata == nullptr)
 		return 1;
-	if (renderDev->Zdata == NULL)
+	if (renderDev->Zdata == nullptr)
 		return 1;
 	if (renderDev->width <= 0)
 		return 1;
@@ -99,10 +99,10 @@ int32 UnregisterTexture(TextureHandle *texture) {
 	int32 i;
 
 	for (i = 0; i < 9; i++)
-		if ((texture->pRGBA[i]) != NULL)
+		if ((texture->pRGBA[i]) != nullptr)
 			delete[](texture->pRGBA[i]);
 
-	if (texture->palette != NULL)
+	if (texture->palette != nullptr)
 		delete[](texture->palette);
 
 	delete texture;
@@ -119,21 +119,21 @@ TextureHandle *RegisterTexture(const RevTexture *revInput) {
 	th->h = revInput->height;
 
 	for (i = 0; i < 9; i++)
-		th->pRGBA[i] = NULL;
+		th->pRGBA[i] = nullptr;
 
 	if (revInput->palette[0] == 0xDEADBEAF) {
 		th->bpp = 4;
-		th->palette = NULL;
+		th->palette = nullptr;
 		th->pRGBA[0] = revInput->level[0];
 	} else {
 		// Complain if width or height > 256 < 1
 		if ((th->w < 1) || (th->w > 256)) {
 			delete th;
-			return NULL;
+			return nullptr;
 		}
 		if ((th->h < 1) || (th->h > 256)) {
 			delete th;
-			return NULL;
+			return nullptr;
 		}
 
 		// Complain if the width or height are not powers of 2
@@ -142,14 +142,14 @@ TextureHandle *RegisterTexture(const RevTexture *revInput) {
 			if (((th->w >> i) << i) != th->w) {
 				if ((th->w >> i) != 0) {
 					delete th;
-					return NULL;
+					return nullptr;
 				}
 			}
 			// ERROR
 			if (((th->h >> i) << i) != th->h) {
 				if ((th->h >> i) != 0) {
 					delete th;
-					return NULL;
+					return nullptr;
 				}
 			}
 		}
@@ -184,9 +184,9 @@ int32 DrawGouraudTexturedPolygon(const vertex2D *verts, int32 nVerts, uint16 z)
 	float y;
 	span_t *pspan;
 
-	if (myRenDev.pRGB == NULL)
+	if (myRenDev.pRGB == nullptr)
 		return 0;
-	if (myTexHan.pRGBA[mip_map_level] == NULL)
+	if (myTexHan.pRGBA[mip_map_level] == nullptr)
 		return 0;
 
 	// Test for clockwise polygons
@@ -461,7 +461,7 @@ int32 DrawFlatUnTexturedPolygon(const vertex2D *verts, int32 nVerts, uint16 z) {
 	float y;
 	span_t *pspan;
 
-	if (myRenDev.pRGB == NULL)
+	if (myRenDev.pRGB == nullptr)
 		return 0;
 
 	// Test for clockwise polygons
@@ -604,7 +604,7 @@ int32 DrawGouraudUnTexturedPolygon(const vertex2D *verts, int32 nVerts, uint16 z
 	float y;
 	span_t *pspan;
 
-	if (myRenDev.pRGB == NULL)
+	if (myRenDev.pRGB == nullptr)
 		return 0;
 
 	// Test for clockwise polygons
@@ -793,9 +793,9 @@ int32 DrawFlatTexturedPolygon(const vertex2D *verts, int32 nVerts, uint16 z) {
 	float y;
 	span_t *pspan;
 
-	if (myRenDev.pRGB == NULL)
+	if (myRenDev.pRGB == nullptr)
 		return 0;
-	if (myTexHan.pRGBA[mip_map_level] == NULL)
+	if (myTexHan.pRGBA[mip_map_level] == nullptr)
 		return 0;
 
 	// Test for clockwise polygons
diff --git a/engines/icb/gfx/gfxstub_rev.cpp b/engines/icb/gfx/gfxstub_rev.cpp
index 9e0b0ea7e6..9c1f43badb 100644
--- a/engines/icb/gfx/gfxstub_rev.cpp
+++ b/engines/icb/gfx/gfxstub_rev.cpp
@@ -90,10 +90,10 @@ void endDrawing() {
 int32 DrawSprite(int32 x0, int32 y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, uint16 /*u0*/, uint16 v0, uint8 alpha, uint16 z, void *tex) {
 	int32 x, y;
 	int32 lx0, ly0;
-	TextureHandle *pthan = NULL;
+	TextureHandle *pthan = nullptr;
 	int32 lx1, ly1;
 
-	if (tex == NULL) {
+	if (tex == nullptr) {
 		return 0;
 	} else {
 		pthan = (TextureHandle *)tex;
@@ -941,8 +941,8 @@ int32 DrawFlatTriangleTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2,
 	if (ClipPolygon(verts, 3, clipverts, &nVerts) == 0)
 		return 1;
 
-	TextureHandle *pthan = NULL;
-	if (tex == NULL) {
+	TextureHandle *pthan = nullptr;
+	if (tex == nullptr) {
 		return 0;
 	} else {
 		pthan = (TextureHandle *)tex;
@@ -972,7 +972,7 @@ int32 DrawFlatTriangleTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2,
 		}
 	}
 
-	if (tex == NULL)
+	if (tex == nullptr)
 		delete pthan;
 	return ret;
 }
@@ -1014,8 +1014,8 @@ int32 DrawFlatQuadTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int
 	if (ClipPolygon(verts, 4, clipverts, &nVerts) == 0)
 		return 1;
 
-	TextureHandle *pthan = NULL;
-	if (tex == NULL) {
+	TextureHandle *pthan = nullptr;
+	if (tex == nullptr) {
 		return 0;
 	} else {
 		pthan = (TextureHandle *)tex;
@@ -1039,7 +1039,7 @@ int32 DrawFlatQuadTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int
 			ret |= DrawFlatTexturedPolygon(newVerts, 3, z);
 	}
 
-	if (tex == NULL)
+	if (tex == nullptr)
 		delete pthan;
 	return ret;
 }
@@ -1071,8 +1071,8 @@ int32 DrawGouraudTriangleTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32
 	if (ClipPolygon(verts, 3, clipverts, &nVerts) == 0)
 		return 1;
 
-	TextureHandle *pthan = NULL;
-	if (tex == NULL) {
+	TextureHandle *pthan = nullptr;
+	if (tex == nullptr) {
 		return 0;
 	} else {
 		pthan = (TextureHandle *)tex;
@@ -1102,7 +1102,7 @@ int32 DrawGouraudTriangleTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32
 		}
 	}
 
-	if (tex == NULL)
+	if (tex == nullptr)
 		delete pthan;
 
 	return ret;
@@ -1149,8 +1149,8 @@ int32 DrawGouraudQuadTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2,
 	if (ClipPolygon(verts, 4, clipverts, &nVerts) == 0)
 		return 1;
 
-	TextureHandle *pthan = NULL;
-	if (tex == NULL) {
+	TextureHandle *pthan = nullptr;
+	if (tex == nullptr) {
 		return 0;
 	} else {
 		pthan = (TextureHandle *)tex;
@@ -1174,7 +1174,7 @@ int32 DrawGouraudQuadTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2,
 			ret |= DrawGouraudTexturedPolygon(newVerts, 3, z);
 	}
 
-	if (tex == NULL)
+	if (tex == nullptr)
 		delete pthan;
 	return ret;
 }
diff --git a/engines/icb/gfx/psx_tman.cpp b/engines/icb/gfx/psx_tman.cpp
index 1448141593..8b1f99a03f 100644
--- a/engines/icb/gfx/psx_tman.cpp
+++ b/engines/icb/gfx/psx_tman.cpp
@@ -73,14 +73,14 @@ TextureInfo *TextureManager::FindTexture(uint32 id, uint32 age) {
 		slot++;
 	}
 	// printf( "Texture %X not found", id );
-	return NULL;
+	return nullptr;
 }
 
 TextureInfo *TextureManager::AddTexture(uint32 * /*tim_ptr*/, uint32 id, uint32 age, uint16 imgW, uint16 imgH) {
 	// printf( "Adding Texture %X", id );
 	if (id == 0) {
 		Message_box("AddTexture 0 ID");
-		return NULL;
+		return nullptr;
 	}
 
 	// Try to find a slot for it
@@ -254,7 +254,7 @@ PaletteInfo *TextureManager::FindPalette(uint32 id, uint32 age) {
 		}
 		slot++;
 	}
-	return NULL;
+	return nullptr;
 }
 
 PaletteInfo *TextureManager::AddPalette(uint32 * /*clut_ptr*/, uint32 id, uint32 age) {
@@ -269,7 +269,7 @@ PaletteInfo *TextureManager::AddPalette(uint32 * /*clut_ptr*/, uint32 id, uint32
 		nPalettesUsed++;
 		return slot;
 	}
-	return NULL;
+	return nullptr;
 }
 
 } // End of namespace ICB
diff --git a/engines/icb/gfx/rab_api.cpp b/engines/icb/gfx/rab_api.cpp
index d01922c818..27d3f1f5ba 100644
--- a/engines/icb/gfx/rab_api.cpp
+++ b/engines/icb/gfx/rab_api.cpp
@@ -36,7 +36,7 @@ namespace ICB {
 // values with zero
 Bone_Frame *rab_API::GetFrame(const int32 f) {
 	Bone_Frame *curFrm = GetCurrentFrame();
-	Bone_Frame *prevFrm = NULL;
+	Bone_Frame *prevFrm = nullptr;
 
 	if (f != currentFrame) {
 		// Decode and decompress the data from the animation frame into
@@ -173,7 +173,7 @@ Bone_Frame *rab_API::GetFrame(const int32 f) {
 				}
 				break;
 			}
-			default: { return NULL; }
+			default: { return nullptr; }
 			}
 		}
 		curFrm->poseBone = frm->poseBone;
diff --git a/engines/icb/global_objects.cpp b/engines/icb/global_objects.cpp
index 6fffb9b4c3..ebbce48fb7 100644
--- a/engines/icb/global_objects.cpp
+++ b/engines/icb/global_objects.cpp
@@ -44,25 +44,25 @@ int32 g_mega_select_g = 200;
 int32 g_mega_select_b = 200;
 
 // holds info about current mission
-_mission *g_mission = NULL;
+_mission *g_mission = nullptr;
 
 // main buffer object
 // if this remains NULL then the system knows that there are no resources present
 // this should be used as a high level indication of the situation
-res_man *rs1 = NULL;
-res_man *rs2 = NULL;
-res_man *rs3 = NULL;
+res_man *rs1 = nullptr;
+res_man *rs2 = nullptr;
+res_man *rs3 = nullptr;
 
-res_man *private_session_resman = NULL;
+res_man *private_session_resman = nullptr;
 
-res_man *rs_bg = NULL;     // pointer to which res_man to use for background buffer
-res_man *rs_icons = NULL;  // pointer to which res_man to use for icons
-res_man *rs_anims = NULL;  // pointer to which res_man to use for animation data
-res_man *rs_remora = NULL; // pointer to which res_man to use for remora graphics
-res_man *rs_font = NULL;   // pointer to which res_man to use for font data
+res_man *rs_bg = nullptr;     // pointer to which res_man to use for background buffer
+res_man *rs_icons = nullptr;  // pointer to which res_man to use for icons
+res_man *rs_anims = nullptr;  // pointer to which res_man to use for animation data
+res_man *rs_remora = nullptr; // pointer to which res_man to use for remora graphics
+res_man *rs_font = nullptr;   // pointer to which res_man to use for font data
 
 // global test only
-res_man *global_text_resman = NULL;
+res_man *global_text_resman = nullptr;
 _linked_data_file *global_text;
 
 // route-manager service object
diff --git a/engines/icb/icb.cpp b/engines/icb/icb.cpp
index 8fd1d33410..b998e7123d 100644
--- a/engines/icb/icb.cpp
+++ b/engines/icb/icb.cpp
@@ -57,7 +57,7 @@ IcbEngine::IcbEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(
 
 IcbEngine::~IcbEngine() {
 	delete _randomSource;
-	g_icb = NULL;
+	g_icb = nullptr;
 }
 
 Common::KeymapArray IcbEngine::initKeymapsIcb(const char *target) {
diff --git a/engines/icb/icon_menu.cpp b/engines/icb/icon_menu.cpp
index 4503df96ee..33fe4c015c 100644
--- a/engines/icb/icon_menu.cpp
+++ b/engines/icb/icon_menu.cpp
@@ -320,9 +320,9 @@ const char *_icon_menu::GetLastSelection() {
 		if (m_pIconList->GetIconCount() > 0)
 			return (m_pIconList->GetIcon(m_nLastSelection));
 		else
-			return (NULL);
+			return (nullptr);
 	} else {
-		return (NULL);
+		return (nullptr);
 	}
 }
 
diff --git a/engines/icb/icon_menu_pc.cpp b/engines/icb/icon_menu_pc.cpp
index b79f411ffa..06382f3405 100644
--- a/engines/icb/icon_menu_pc.cpp
+++ b/engines/icb/icon_menu_pc.cpp
@@ -118,7 +118,7 @@ void _icon_menu::Activate(const _icon_list *pIconList, const _icon_menu_duplicat
 		pyIconBitmap = surface_manager->Lock_surface(m_pnIconSurfaceIDs[i]);
 		uint32 nPitch = surface_manager->Get_pitch(m_pnIconSurfaceIDs[i]);
 		// Load the icon into the surface
-		SpriteXYFrameDraw(pyIconBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, NULL, 255);
+		SpriteXYFrameDraw(pyIconBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
 		// convert it to b/w
 		uint32 *icon_ad = (uint32 *)pyIconBitmap;
 		for (uint32 y = 0; y < ICON_Y_SIZE; y++) {
@@ -145,7 +145,7 @@ void _icon_menu::Activate(const _icon_list *pIconList, const _icon_menu_duplicat
 		pyHiLiteBitmap = surface_manager->Lock_surface(m_pnHiLiteSurfaceIDs[i]);
 		nPitch = surface_manager->Get_pitch(m_pnHiLiteSurfaceIDs[i]);
 		// Load the icon hilight
-		SpriteXYFrameDraw(pyHiLiteBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, NULL, 255);
+		SpriteXYFrameDraw(pyHiLiteBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
 		// Unlock the surface
 		surface_manager->Unlock_surface(m_pnHiLiteSurfaceIDs[i]);
 	}
@@ -206,7 +206,7 @@ void _icon_menu::ReActivate() {
 		uint32 nPitch = surface_manager->Get_pitch(m_pnIconSurfaceIDs[i]);
 
 		// Load the icon into the surface
-		SpriteXYFrameDraw(pyIconBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, NULL, 255);
+		SpriteXYFrameDraw(pyIconBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
 		// convert it to b/w
 		uint32 *icon_ad = (uint32 *)pyIconBitmap;
 		for (uint32 y = 0; y < ICON_Y_SIZE; y++) {
@@ -232,7 +232,7 @@ void _icon_menu::ReActivate() {
 		uint8 *pyHiLiteBitmap = surface_manager->Lock_surface(m_pnHiLiteSurfaceIDs[i]);
 		nPitch = surface_manager->Get_pitch(m_pnHiLiteSurfaceIDs[i]);
 		// Load the icon hilight
-		SpriteXYFrameDraw(pyHiLiteBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, NULL, 255);
+		SpriteXYFrameDraw(pyHiLiteBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
 		// Unlock the surface
 		surface_manager->Unlock_surface(m_pnHiLiteSurfaceIDs[i]);
 		// Set the transparency keys for the icon
@@ -483,7 +483,7 @@ void _icon_menu::SetupAdding(const char *pcIconName, uint32 &nSurfaceID) {
 	nPitch = surface_manager->Get_pitch(nSurfaceID);
 
 	// Draw the icon into the surface.
-	SpriteXYFrameDraw(p8Bitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, NULL, 255);
+	SpriteXYFrameDraw(p8Bitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
 
 	// Finished drawing the icon into the surfaces so we can unlock them.
 	surface_manager->Unlock_surface(nSurfaceID);
@@ -635,8 +635,8 @@ void _icon_menu::SetUpOffScreenArrows() {
 		Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", pcArrowIconName, PC_BITMAP_SCHEMA, psIconBitmap->schema);
 
 	// Draw the two frames onto their respective surfaces.
-	SpriteXYFrameDraw(pyLeftBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, NULL, 255);
-	SpriteXYFrameDraw(pyLeftHiLiteBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 1, FALSE8, NULL, 255);
+	SpriteXYFrameDraw(pyLeftBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
+	SpriteXYFrameDraw(pyLeftHiLiteBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 1, FALSE8, nullptr, 255);
 
 	// Finished drawing the icon into the surfaces so we can unlock them.
 	surface_manager->Unlock_surface(m_nLeftArrowID);
@@ -665,8 +665,8 @@ void _icon_menu::SetUpOffScreenArrows() {
 		Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", pcArrowIconName, PC_BITMAP_SCHEMA, psIconBitmap->schema);
 
 	// Draw the two frames onto their respective surfaces.
-	SpriteXYFrameDraw(pyRightBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, NULL, 255);
-	SpriteXYFrameDraw(pyRightHiLiteBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 1, FALSE8, NULL, 255);
+	SpriteXYFrameDraw(pyRightBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 0, FALSE8, nullptr, 255);
+	SpriteXYFrameDraw(pyRightHiLiteBitmap, nPitch, ICON_X_SIZE, ICON_Y_SIZE, psIconBitmap, 0, 0, 1, FALSE8, nullptr, 255);
 
 	// Finished drawing the icon into the surfaces so we can unlock them.
 	surface_manager->Unlock_surface(m_nRightArrowID);
diff --git a/engines/icb/jpeg.cpp b/engines/icb/jpeg.cpp
index c795944727..7f1aa2b7fd 100644
--- a/engines/icb/jpeg.cpp
+++ b/engines/icb/jpeg.cpp
@@ -70,18 +70,18 @@ JpegDecoder::JpegDecoder() {
 
 JpegDecoder::~JpegDecoder() {
 	delete[] ac_tables;
-	ac_tables = NULL;
+	ac_tables = nullptr;
 	delete[] dc_tables;
-	dc_tables = NULL;
+	dc_tables = nullptr;
 
 	delete[] quantization_tables;
-	quantization_tables = NULL;
+	quantization_tables = nullptr;
 	delete[] components;
-	components = NULL;
+	components = nullptr;
 	delete[] component_indices;
-	component_indices = NULL;
+	component_indices = nullptr;
 	delete[] scan_components;
-	scan_components = NULL;
+	scan_components = nullptr;
 }
 
 void JpegDecoder::Initialize() {
@@ -1029,13 +1029,13 @@ JpegDecoderComponent::JpegDecoderComponent() {
 	v_sampling = 0;
 	h_sampling = 0;
 	last_dc_value = 0;
-	ac_table = NULL;
-	dc_table = NULL;
-	quantization_table = NULL;
+	ac_table = nullptr;
+	dc_table = nullptr;
+	quantization_table = nullptr;
 	noninterleaved_rows = 0;
 	noninterleaved_cols = 0;
-	data_units = NULL;
-	upsample_data = NULL;
+	data_units = nullptr;
+	upsample_data = nullptr;
 	return;
 }
 
@@ -1046,9 +1046,9 @@ JpegDecoderComponent::JpegDecoderComponent() {
 //
 JpegDecoderComponent::~JpegDecoderComponent() {
 	delete[] data_units;
-	data_units = NULL;
+	data_units = nullptr;
 	delete[] upsample_data;
-	upsample_data = NULL;
+	upsample_data = nullptr;
 }
 
 //
@@ -1071,7 +1071,7 @@ void JpegDecoderComponent::SetQuantizationTable(JpegDecoderQuantizationTable &ta
 //    decoder:  The jpeg decoder this component belongs to.
 //
 void JpegDecoderComponent::AllocateComponentBuffers(const JpegDecoder &decoder) {
-	if (data_units == NULL) {
+	if (data_units == nullptr) {
 		// Determine sampling for the component. This is the amount of
 		// stretching needed for the component.
 		v_sampling = decoder.max_vertical_frequency / vertical_frequency;
@@ -1096,9 +1096,9 @@ void JpegDecoderComponent::AllocateComponentBuffers(const JpegDecoder &decoder)
 //
 void JpegDecoderComponent::FreeComponentBuffers() {
 	delete[] data_units;
-	data_units = NULL;
+	data_units = nullptr;
 	delete[] upsample_data;
-	upsample_data = NULL;
+	upsample_data = nullptr;
 }
 
 //
@@ -1186,7 +1186,7 @@ void JpegDecoderComponent::Upsample() {
 	if (imagesize == 0)
 		return; // No data for this component yet.
 
-	if (upsample_data == NULL)
+	if (upsample_data == nullptr)
 		upsample_data = new uint8[imagesize];
 
 	// Simple case where component does not need to be upsampled.
diff --git a/engines/icb/keyboard.cpp b/engines/icb/keyboard.cpp
index 63fa2ed59d..3433f617ba 100644
--- a/engines/icb/keyboard.cpp
+++ b/engines/icb/keyboard.cpp
@@ -61,7 +61,7 @@ int32 ReadKey(char *key) {
 	if (!keyBacklog)
 		return (0);
 
-	if (key == NULL)
+	if (key == nullptr)
 		return 0;
 
 	*key = keyBuffer[keyPointer++];
diff --git a/engines/icb/light_pc.cpp b/engines/icb/light_pc.cpp
index 46503947bf..1ed20ff6cd 100644
--- a/engines/icb/light_pc.cpp
+++ b/engines/icb/light_pc.cpp
@@ -78,7 +78,7 @@ int32 prepareLightsPC(VECTOR *pos, PSXrgb *ambient, PSXLampList *lamplist, PSXSh
 	lampBounce[1] = 0;
 	lampBounce[2] = 0;
 
-	if (lamplist == NULL) {
+	if (lamplist == nullptr) {
 		return prepareLightsGlobalPC(lDirects);
 	}
 
@@ -120,7 +120,7 @@ int32 prepareLightsPC(VECTOR *pos, PSXrgb *ambient, PSXLampList *lamplist, PSXSh
 
 	uint32 num = lamplist->n;
 
-	PSXLamp *plamp = NULL;
+	PSXLamp *plamp = nullptr;
 	PSXLampState *plampstate;
 
 	uint32 state;
diff --git a/engines/icb/logic.cpp b/engines/icb/logic.cpp
index 84332a3610..931bc284b8 100644
--- a/engines/icb/logic.cpp
+++ b/engines/icb/logic.cpp
@@ -121,8 +121,8 @@ void _logic::___init(const char *name) {
 
 	// clear the pointer to the voxel object specific structure
 	// if these are NULL then the object is non mega
-	voxel_info = NULL;
-	mega = NULL; // clear mega info
+	voxel_info = nullptr;
+	mega = nullptr; // clear mega info
 
 	// defaults to a prop
 	image_type = PROP;
@@ -152,8 +152,8 @@ void _logic::___init(const char *name) {
 
 	// clear the logic tree
 	for (j = 0; j < TREE_SIZE; j++) {
-		logic[j] = 0;
-		logic_ref[j] = 0;
+		logic[j] = nullptr;
+		logic_ref[j] = nullptr;
 	}
 
 	// set owner rect to something safe - for fn_on_screen calls by props
@@ -192,7 +192,7 @@ void _mega::___init() {
 	auto_target_pan = ZERO_TURN; // auto target
 
 	target_pan = ZERO_TURN; // reset turn-on-spot-to pan
-	cur_parent = NULL;
+	cur_parent = nullptr;
 	cur_slice = 0;
 	number_of_barriers = 0;  // number of local barriers associated with mega position
 	number_of_nudge = 0;     // number of local barriers associated with mega position
@@ -210,7 +210,7 @@ void _mega::___init() {
 	m_phase = 0;
 
 	m_main_route.total_points = 0; // final route size
-	m_main_route.diag_bars = 0;
+	m_main_route.diag_bars = nullptr;
 	m_main_route.number_of_diag_bars = 0;
 
 	use_strike_script = 0;
@@ -677,7 +677,7 @@ void _game_session::Reset_all_objects() {
 
 	for (uint32 j = 0; j < tot_obs; j++) {
 		logic_structs[j]->logic_level = 0;
-		logic_structs[j]->logic_ref[1] = 0;
+		logic_structs[j]->logic_ref[1] = nullptr;
 	}
 }
 
diff --git a/engines/icb/map_marker.cpp b/engines/icb/map_marker.cpp
index fc2eaf3f2c..43debd3ac3 100644
--- a/engines/icb/map_marker.cpp
+++ b/engines/icb/map_marker.cpp
@@ -69,7 +69,7 @@ _map_marker *_marker::Fetch_marker_by_object_name(const char *name) {
 	}
 
 	// not found
-	return (NULL);
+	return (nullptr);
 }
 
 } // End of namespace ICB
diff --git a/engines/icb/mission.cpp b/engines/icb/mission.cpp
index 2c318dac4c..5ac526b01a 100644
--- a/engines/icb/mission.cpp
+++ b/engines/icb/mission.cpp
@@ -183,9 +183,9 @@ void _mission::___init_mission(const char *new_mission_name, const char *session
 	num_medi = 0;
 	inited_globals = FALSE8;
 
-	if (new_mission_name == NULL)
+	if (new_mission_name == nullptr)
 		Fatal_error("new mission no mission name");
-	if (session_name == NULL)
+	if (session_name == nullptr)
 		Fatal_error("new mission no session name");
 
 	// Work out which CD we should be using
@@ -257,7 +257,7 @@ void _mission::___delete_mission() {
 	Zdebug("deleting mission");
 
 	// kill the pointer which doubles as an inited yes/no flag
-	g_mission = NULL;
+	g_mission = nullptr;
 
 	session->___destruct();
 
@@ -281,7 +281,7 @@ void _mission::End_mission() {
 }
 
 _mission::_mission()
-		: session(NULL), camera_follow_id_overide(0), remora_save_mode(0), ad_time(0), lt_time(0), set_time(0), flip_time(0), cycle_time(0), logic_time(0), resman_logic_time(0),
+		: session(nullptr), camera_follow_id_overide(0), remora_save_mode(0), ad_time(0), lt_time(0), set_time(0), flip_time(0), cycle_time(0), logic_time(0), resman_logic_time(0),
 		los_time(0), event_time(0), sound_time(0), xtra_mega_time(0), nActorsDrawn(0), nActorsConsidered(0), old_hits_value(0), chi_following(0), num_bullets(0), num_clips(0),
 		num_medi(0), inited_globals(FALSE8), mission_terminate(0), mission_status(0), number_sessions_saved(0), new_session(FALSE8), init_nico(FALSE8) {
 	memset(new_session_name, '\0', TINY_NAME_LEN);
@@ -311,7 +311,7 @@ uint32 _mission::Game_cycle() {
 	//				1 finish the mission
 
 	// safety check for no session
-	if (session == NULL)
+	if (session == nullptr)
 		Fatal_error("no session");
 
 	if (new_session == TRUE8) { // a new session has been requested
@@ -614,7 +614,7 @@ void _mission::Save_game_position(const char *filename, const char *slot_label,
 	// first save the index file which contains the session name and mission name that we're currently running - and hence want to
 	// restore to later
 	Common::WriteStream *stream = openDiskWriteStream(filename); // attempt to open the file for writing
-	if (stream == NULL)
+	if (stream == nullptr)
 		Fatal_error("Save_game_position cannot *OPEN* [%s]", (const char *)filename);
 
 	// specific stuff for pc save game menu
@@ -638,7 +638,7 @@ void _mission::Save_game_position(const char *filename, const char *slot_label,
 	stream->writeByte(atinyvalue);
 
 	for (j = 0; j < atinyvalue; j++) {
-		avalue = (int32)g_globalScriptVariables->GetVariable((*g_globalScriptVariables)[j].hash, 0, 0);
+		avalue = (int32)g_globalScriptVariables->GetVariable((*g_globalScriptVariables)[j].hash, nullptr, 0);
 		stream->writeSint32LE(avalue);
 		Tdebug("save_restore.txt", "  %d 0x%08x = %d", j, (*g_globalScriptVariables)[j].hash, avalue);
 	}
@@ -912,7 +912,7 @@ void _mission::Restore_micro_session_from_save_game(Common::SeekableReadStream *
 
 __load_result Load_game(const char *filename) {
 	// load a save game
-	Common::SeekableReadStream *stream = 0; // file pointer
+	Common::SeekableReadStream *stream = nullptr; // file pointer
 	uint32 avalue;
 	uint8 atinyvalue;
 	char mission_name[64];
@@ -928,7 +928,7 @@ __load_result Load_game(const char *filename) {
 	// open the index file
 	stream = openDiskFileForBinaryStreamRead(filename); // attempt to open the file for reading
 
-	if (stream == NULL)
+	if (stream == nullptr)
 		return __NO_SUCH_FILE;
 
 	char label[MAX_LABEL_LENGTH];           // load into here cause i'm too thick to know how to skip it (tw)
diff --git a/engines/icb/mission_functions.cpp b/engines/icb/mission_functions.cpp
index fcb9deed23..7c2d96e886 100644
--- a/engines/icb/mission_functions.cpp
+++ b/engines/icb/mission_functions.cpp
@@ -80,7 +80,7 @@ int32 LoadMission(int32 m, void * /*usr*/) {
 }
 
 void RestartMission(void) {
-	if (g_mission == NULL) {
+	if (g_mission == nullptr) {
 		Fatal_error("Can't restart a deleted mission");
 	}
 
@@ -99,7 +99,7 @@ void RestartMission(void) {
 	m++;
 
 	// Right : so just Load that mission
-	LoadMission(m, NULL);
+	LoadMission(m, nullptr);
 }
 
 int32 FindMissionNumber(const char *mission) {
diff --git a/engines/icb/mouse.cpp b/engines/icb/mouse.cpp
index 00024bb493..e821b0d80e 100644
--- a/engines/icb/mouse.cpp
+++ b/engines/icb/mouse.cpp
@@ -95,7 +95,7 @@ _mouseEvent *MouseEvent() {
 
 		return (me);
 	}
-	return (NULL);
+	return (nullptr);
 }
 
 } // End of namespace ICB
diff --git a/engines/icb/options_manager_pc.cpp b/engines/icb/options_manager_pc.cpp
index 755ca9fbf8..887dc45fe9 100644
--- a/engines/icb/options_manager_pc.cpp
+++ b/engines/icb/options_manager_pc.cpp
@@ -366,7 +366,7 @@ void LoadAMovieShot(uint32 slot_id, uint32 to_surface_id) {
 }
 
 OptionsManager::OptionsManager() {
-	m_global_text = NULL; // Clear global text pointer
+	m_global_text = nullptr; // Clear global text pointer
 
 	InitialiseGlobalColours();
 
@@ -394,10 +394,10 @@ OptionsManager::OptionsManager() {
 	m_warpDirection = TRUE8;
 
 	memset(m_fontName, 0, ENGINE_STRING_LEN);
-	m_font_file = NULL;
-	m_fontPalette = NULL;
+	m_font_file = nullptr;
+	m_fontPalette = nullptr;
 	m_fontHeight = 20;
-	m_currentSprite = NULL;
+	m_currentSprite = nullptr;
 
 	m_selectedShade.red = 202;
 	m_selectedShade.green = 0;
@@ -410,7 +410,7 @@ OptionsManager::OptionsManager() {
 	m_fullscreen.top = 0;
 	m_fullscreen.bottom = SCREEN_DEPTH;
 
-	m_global_text = NULL;
+	m_global_text = nullptr;
 
 	// Explicitly set alpha:
 	m_drawColour.alpha = 0;
@@ -652,7 +652,7 @@ void OptionsManager::StartGameOverOptions() {
 	LoadBitmapFont();
 
 	// Error check
-	if (g_mission == NULL)
+	if (g_mission == nullptr)
 		Fatal_error("OptionsManager::StartGameOverOptions() needs to know what mission is running (ie Can't have mission == NULL)");
 
 	// Figure out what mission is running
@@ -899,7 +899,7 @@ void OptionsManager::StartMainOptions(void) {
 
 	// Need to calculate bracket dimesions
 	uint32 int32estWidth = 0;
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	for (uint32 i = 0; i < NUMBER_OF_MAIN_TOP_CHOICES; i++) {
 		switch (i) {
@@ -1051,7 +1051,7 @@ void OptionsManager::InitialiseInGameOptions(void) {
 
 	// Need to calculate bracket dimesions
 	uint32 int32estWidth = 0;
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	for (uint32 i = 0; i < NUMBER_OF_IN_GAME_TOP_CHOICES; i++) {
 		switch (i) {
@@ -1181,7 +1181,7 @@ void OptionsManager::GrabThumbnailImage() {
 }
 
 void OptionsManager::DrawGameOverScreen() {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	switch (m_activeMenu) {
 	case GAME_OVER:
@@ -1225,7 +1225,7 @@ void OptionsManager::DrawInGameOptionsScreen() {
 	bool8 animating;
 	uint32 pitch;
 	uint8 *surface_address;
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 temp;
 	pxString str;
 	int32 icon_x, icon_y;
@@ -1492,7 +1492,7 @@ void OptionsManager::DrawInGameOptionsScreen() {
 }
 
 void OptionsManager::DrawQuitGameConfirmScreen(uint32 surface_id) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 halfScreen = SCREEN_WIDTH / 2;
 	uint32 temp;
 
@@ -1523,7 +1523,7 @@ void OptionsManager::DrawQuitGameConfirmScreen(uint32 surface_id) {
 }
 
 void OptionsManager::DrawOverwriteSaveConfirmScreen(uint32 surface_id) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 halfScreen = SCREEN_WIDTH / 2;
 	uint32 temp;
 
@@ -1552,7 +1552,7 @@ void OptionsManager::DrawOverwriteSaveConfirmScreen(uint32 surface_id) {
 void OptionsManager::DrawMainOptionsScreen(uint32 surface_id) {
 	uint32 pitch;
 	uint8 *surface_address;
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	// With bink compression updating only portions of the screen per cycle we
 	// need to draw things that beint32 on top to another surface then blit with
@@ -2791,7 +2791,7 @@ void OptionsManager::DoChoice() {
 		case SLOT2:
 		case SLOT3:
 		case SLOT4:
-			if (m_slots[m_slotOffset + m_GAMESLOT_selected] != NULL) {
+			if (m_slots[m_slotOffset + m_GAMESLOT_selected] != nullptr) {
 				MakeFullSaveFilename(m_slotOffset + m_GAMESLOT_selected, buff);
 				// LOAD THIS INDEX FILE:
 
@@ -3101,7 +3101,7 @@ void OptionsManager::DoChoice() {
 			m_editing = TRUE8;
 			m_letJoystickQuitEdit = FALSE8;
 			// If the slot contains data, copy the label into our editing buffer else use default name
-			if (m_slots[m_slotOffset + m_GAMESLOT_selected] != NULL) {
+			if (m_slots[m_slotOffset + m_GAMESLOT_selected] != nullptr) {
 				// Wish to edit an existing slot label
 				strcpy(m_editBuffer, m_slots[m_slotOffset + m_GAMESLOT_selected]->label);
 				// Record this ex-time played so we restore if if the action is cancelled
@@ -3147,7 +3147,7 @@ void OptionsManager::DoChoice() {
 			if (m_emptySlotFlag == 0) {
 				// Slot was previously empty so delete on cancellation
 				delete m_slots[m_slotOffset + m_GAMESLOT_selected];
-				m_slots[m_slotOffset + m_GAMESLOT_selected] = NULL;
+				m_slots[m_slotOffset + m_GAMESLOT_selected] = nullptr;
 			} else {
 				// Just need to restore time played to cancel
 				m_slots[m_slotOffset + m_GAMESLOT_selected]->secondsPlayed = m_emptySlotFlag;
@@ -3446,7 +3446,7 @@ void OptionsManager::InitialiseSlots() {
 
 	// Set all slots by default to empty
 	for (uint32 i = 0; i < TOTAL_NUMBER_OF_GAME_SLOTS; i++) {
-		m_slots[i] = NULL;
+		m_slots[i] = nullptr;
 
 		// Now look for any valid game files and set corresponding info
 
@@ -3465,7 +3465,7 @@ void OptionsManager::InitialiseSlots() {
 		// Now we must get the label and time from the file and set accordingly
 		Common::SeekableReadStream *stream = openDiskFileForBinaryStreamRead(buff);
 
-		if (stream == NULL)
+		if (stream == nullptr)
 			Fatal_error(pxVString("Failed to open save file: %s", buff));
 
 		// Get storage for this slot
@@ -3485,15 +3485,15 @@ void OptionsManager::InitialiseSlots() {
 
 void OptionsManager::DestroySlots() {
 	for (uint32 i = 0; i < TOTAL_NUMBER_OF_GAME_SLOTS; i++) {
-		if (m_slots[i] != NULL) {
+		if (m_slots[i] != nullptr) {
 			delete m_slots[i];
-			m_slots[i] = NULL;
+			m_slots[i] = nullptr;
 		}
 	}
 }
 
 void OptionsManager::DrawGameSlots(uint32 slotOffset, uint32 surface_id /* = working_buffer_id*/) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 temp;
 	pxString str;
 
@@ -3523,7 +3523,7 @@ void OptionsManager::DrawGameSlots(uint32 slotOffset, uint32 surface_id /* = wor
 		DrawRectangle((bool8)(m_GAMESLOT_selected == slot), id_wPos + 9, h - 1, 65, 49, ad, pitch);
 
 		// Followed by label and time played if the slot is in use
-		if (m_slots[slotOffset + slot] == NULL) {
+		if (m_slots[slotOffset + slot] == nullptr) {
 			if ((m_editing) && (m_GAMESLOT_selected == slot)) {
 				// Unlock the surface for the thumbnail blit
 				surface_manager->Unlock_surface(surface_id);
@@ -3570,14 +3570,14 @@ void OptionsManager::DrawGameSlots(uint32 slotOffset, uint32 surface_id /* = wor
 				// Are we to draw current thumbnails or the preloaded next thumbnails (paging animation)
 				if (slotOffset == m_slotOffset) {
 					if (m_GAMESLOT_selected == slot)
-						surface_manager->Blit_surface_to_surface(m_thumbSurfaceIDs[slot], surface_id, NULL, &dest);
+						surface_manager->Blit_surface_to_surface(m_thumbSurfaceIDs[slot], surface_id, nullptr, &dest);
 					else
-						surface_manager->Blit_surface_to_surface(m_grayThumbSurfaceIDs[slot], surface_id, NULL, &dest);
+						surface_manager->Blit_surface_to_surface(m_grayThumbSurfaceIDs[slot], surface_id, nullptr, &dest);
 				} else {
 					if (m_GAMESLOT_selected == slot)
-						surface_manager->Blit_surface_to_surface(m_thumbSurfaceIDs[slot + 4], surface_id, NULL, &dest);
+						surface_manager->Blit_surface_to_surface(m_thumbSurfaceIDs[slot + 4], surface_id, nullptr, &dest);
 					else
-						surface_manager->Blit_surface_to_surface(m_grayThumbSurfaceIDs[slot + 4], surface_id, NULL, &dest);
+						surface_manager->Blit_surface_to_surface(m_grayThumbSurfaceIDs[slot + 4], surface_id, nullptr, &dest);
 				}
 
 				// Lock it back up again and continue
@@ -3604,7 +3604,7 @@ void OptionsManager::DrawGameSlots(uint32 slotOffset, uint32 surface_id /* = wor
 }
 
 void OptionsManager::DrawMovieSlots(uint32 offset, uint32 surface_id /* = working_buffer_id*/) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	LRECT dest;
 	uint32 selectedMovie;
 	uint32 selectedMovieSlot;
@@ -3642,14 +3642,14 @@ void OptionsManager::DrawMovieSlots(uint32 offset, uint32 surface_id /* = workin
 		if (g_movieLibrary[selectedMovie].visible) {
 			if (offset == m_movieOffset) {
 				if (m_M_MOVIE_selected == (M_MOVIE_CHOICES)selectedMovieSlot)
-					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot], surface_id, nullptr, &dest);
 				else
-					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot], surface_id, nullptr, &dest);
 			} else {
 				if (m_M_MOVIE_selected == (M_MOVIE_CHOICES)selectedMovieSlot)
-					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot + 12], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot + 12], surface_id, nullptr, &dest);
 				else
-					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot + 12], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot + 12], surface_id, nullptr, &dest);
 			}
 		}
 		firstColumnX += 120;
@@ -3676,14 +3676,14 @@ void OptionsManager::DrawMovieSlots(uint32 offset, uint32 surface_id /* = workin
 		if (g_movieLibrary[selectedMovie].visible) {
 			if (offset == m_movieOffset) {
 				if (m_M_MOVIE_selected == (M_MOVIE_CHOICES)selectedMovieSlot)
-					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot], surface_id, nullptr, &dest);
 				else
-					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot], surface_id, nullptr, &dest);
 			} else {
 				if (m_M_MOVIE_selected == (M_MOVIE_CHOICES)selectedMovieSlot)
-					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot + 12], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot + 12], surface_id, nullptr, &dest);
 				else
-					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot + 12], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot + 12], surface_id, nullptr, &dest);
 			}
 		}
 		firstColumnX += 120;
@@ -3710,14 +3710,14 @@ void OptionsManager::DrawMovieSlots(uint32 offset, uint32 surface_id /* = workin
 		if (g_movieLibrary[selectedMovie].visible) {
 			if (offset == m_movieOffset) {
 				if (m_M_MOVIE_selected == (M_MOVIE_CHOICES)selectedMovieSlot)
-					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot], surface_id, nullptr, &dest);
 				else
-					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot], surface_id, nullptr, &dest);
 			} else {
 				if (m_M_MOVIE_selected == (M_MOVIE_CHOICES)selectedMovieSlot)
-					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot + 12], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot + 12], surface_id, nullptr, &dest);
 				else
-					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot + 12], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot + 12], surface_id, nullptr, &dest);
 			}
 		}
 		firstColumnX += 120;
@@ -3744,14 +3744,14 @@ void OptionsManager::DrawMovieSlots(uint32 offset, uint32 surface_id /* = workin
 		if (g_movieLibrary[selectedMovie].visible) {
 			if (offset == m_movieOffset) {
 				if (m_M_MOVIE_selected == (M_MOVIE_CHOICES)selectedMovieSlot)
-					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot], surface_id, nullptr, &dest);
 				else
-					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot], surface_id, nullptr, &dest);
 			} else {
 				if (m_M_MOVIE_selected == (M_MOVIE_CHOICES)selectedMovieSlot)
-					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot + 12], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_movieSurfaceIDs[selectedMovieSlot + 12], surface_id, nullptr, &dest);
 				else
-					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot + 12], surface_id, NULL, &dest);
+					surface_manager->Blit_surface_to_surface(m_grayMovieSurfaceIDs[selectedMovieSlot + 12], surface_id, nullptr, &dest);
 			}
 		}
 		firstRowY += 75;
@@ -3786,7 +3786,7 @@ void OptionsManager::DrawMovieSlots(uint32 offset, uint32 surface_id /* = workin
 }
 
 void OptionsManager::DrawMainLoadScreen(uint32 surface_id) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 temp;
 	pxString str;
 	int32 icon_x = 60;
@@ -3829,7 +3829,7 @@ void OptionsManager::DrawMainLoadScreen(uint32 surface_id) {
 }
 
 void OptionsManager::DrawMovieScreen(uint32 surface_id) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 temp;
 	int32 icon_x = 40;
 	int32 icon_y = (SCREEN_DEPTH / 2) - (m_fontHeight / 2);
@@ -3873,7 +3873,7 @@ void OptionsManager::DrawMovieScreen(uint32 surface_id) {
 }
 
 void OptionsManager::DrawExtrasScreen(uint32 surface_id) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	uint8 *ad = surface_manager->Lock_surface(surface_id);
 	uint32 pitch = surface_manager->Get_pitch(surface_id);
@@ -3914,7 +3914,7 @@ void OptionsManager::DrawWidescreenBorders() {
 }
 
 void OptionsManager::DrawPlaySelectScreen(uint32 surface_id) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	// Some of this is disabled for demos
 	int32 demo = g_globalScriptVariables->GetVariable("demo");
@@ -3973,7 +3973,7 @@ void OptionsManager::DrawPlaySelectScreen(uint32 surface_id) {
 }
 
 void OptionsManager::DrawProfileSelectScreen(uint32 surface_id) {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	uint8 *ad = surface_manager->Lock_surface(surface_id);
 	uint32 pitch = surface_manager->Get_pitch(surface_id);
@@ -4023,7 +4023,7 @@ void OptionsManager::InitialiseAProfile() {
 
 	// Need to calculate printing margin
 	m_margin = 0;
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	// This ensures correct spacing for any translations
 	for (uint32 i = 0; i < 5; i++) {
@@ -4066,7 +4066,7 @@ void OptionsManager::InitialiseAProfile() {
 	m_profileScrollingLine = -1;
 
 	// Setup the character drawing stuff here using m_M_PROFILES_selected ...
-	const char *character_name = NULL;
+	const char *character_name = nullptr;
 	const char *outfit_name = "outfit";
 	const char *anim_name = "walk";
 	int16 rx = 0;
@@ -4173,8 +4173,8 @@ void OptionsManager::DrawProfileScreen(uint32 surface_id) {
 	// Timing code to lock the refresh rate at a constant
 	uint32 t = GetMicroTimer();
 
-	const char *msg = NULL;
-	const char *prefix = NULL;
+	const char *msg = nullptr;
+	const char *prefix = nullptr;
 	uint32 temp;
 	pxString label;
 
@@ -4230,7 +4230,7 @@ void OptionsManager::DrawProfileScreen(uint32 surface_id) {
 	label.Format("%s%s", prefix, "info");
 	msg = GetTextFromReference(HashString(label));
 
-	if (msg == NULL)
+	if (msg == nullptr)
 		msg = "Please update 'globals\\translations\\' files";
 
 	// Get some storage from the stack
@@ -4555,7 +4555,7 @@ void OptionsManager::GetKeyAssignment() {
 }
 
 void OptionsManager::InitialiseControlsScreen() {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	// Need to calculate printing margin
 	m_margin = 0;
@@ -4578,7 +4578,7 @@ void OptionsManager::InitialiseControlsScreen() {
 }
 
 void OptionsManager::DrawControllerConfiguration() {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 halfScreen = SCREEN_WIDTH / 2;
 	uint32 temp;
 	pxString sentence;
@@ -4627,7 +4627,7 @@ void OptionsManager::DrawControllerConfiguration() {
 }
 
 void OptionsManager::DrawGameOptions() {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 
 	uint8 *ad = surface_manager->Lock_surface(working_buffer_id);
 	uint32 pitch = surface_manager->Get_pitch(working_buffer_id);
@@ -4651,7 +4651,7 @@ void OptionsManager::DrawGameOptions() {
 }
 
 void OptionsManager::DrawAudioSettings() {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 halfScreen = SCREEN_WIDTH / 2;
 	uint32 temp;
 	LRECT repairRect;
@@ -4711,7 +4711,7 @@ void OptionsManager::DrawAudioSettings() {
 }
 
 void OptionsManager::DrawVideoSettings() {
-	const char *msg = NULL;
+	const char *msg = nullptr;
 	uint32 halfScreen = SCREEN_WIDTH / 2;
 	uint32 temp;
 	LRECT repairRect;
@@ -5510,7 +5510,7 @@ void OptionsManager::DrawRectangle(bool8 selected, uint32 x, uint32 y, uint32 wi
 }
 
 const char *OptionsManager::GetTextFromReference(uint32 hashRef) {
-	char *textLine = NULL;
+	char *textLine = nullptr;
 
 	// Get the text via a label
 	if (m_global_text)
@@ -5591,7 +5591,7 @@ void OptionsManager::LoadGlobalTextFile() {
 	if (tt) {
 		// Ok, translators mode has been activated
 		// Only load the global text if it hasn't been loaded already
-		if (m_global_text == NULL)
+		if (m_global_text == nullptr)
 			m_global_text = LoadTranslatedFile("global", "global\\global\\");
 	} else
 		m_global_text = (_linked_data_file *)rs1->Res_open(textFileName, buf_hash, globalClusterFile, globalClusterHash);
@@ -5646,7 +5646,7 @@ void OptionsManager::DisplayText(uint8 *ad, uint32 pitch, const char *str, int32
 	int32 initialX;
 
 	// Ensure font is loaded as this function can be used outside this module
-	if (m_font_file == NULL) {
+	if (m_font_file == nullptr) {
 		LoadBitmapFont();
 	}
 
@@ -6085,7 +6085,7 @@ void OptionsManager::DrawSlideShow() {
 				m_pageOn_from.left = (WADGE_INCREMENTS + m_slideWadger) * 20;
 
 				// Stretchy blit
-				surface_manager->Blit_surface_to_surface(m_mySlotSurface1ID, working_buffer_id, &m_pageOn_from, NULL, 0);
+				surface_manager->Blit_surface_to_surface(m_mySlotSurface1ID, working_buffer_id, &m_pageOn_from, nullptr, 0);
 			}
 
 			m_slideWadger++;
@@ -6108,7 +6108,7 @@ void OptionsManager::DrawSlideShow() {
 				m_pageOn_from.right = SCREEN_WIDTH - ((WADGE_INCREMENTS - m_slideWadger) * 20);
 
 				// Stretchy blit
-				surface_manager->Blit_surface_to_surface(m_mySlotSurface1ID, working_buffer_id, &m_pageOn_from, NULL, 0);
+				surface_manager->Blit_surface_to_surface(m_mySlotSurface1ID, working_buffer_id, &m_pageOn_from, nullptr, 0);
 			}
 
 			m_slideWadger--;
@@ -6205,7 +6205,7 @@ void OptionsManager::DrawSlideShow() {
 		delete binkDecoder;
 
 		// Update the screen
-		surface_manager->Blit_surface_to_surface(m_mySlotSurface1ID, working_buffer_id, NULL, NULL, 0);
+		surface_manager->Blit_surface_to_surface(m_mySlotSurface1ID, working_buffer_id, nullptr, nullptr, 0);
 
 		// Now ensure the slide surroundings are the correct colour at this cycle
 
@@ -6317,7 +6317,7 @@ uint32 GetFileSz(const char *path) {
 }
 
 Crediter::Crediter()
-	: m_creditsFile(NULL), m_numberOfBytes(0), m_endOfCredits(0), m_currentHeight(0), m_cursor(0), m_scrollOffset(0), m_logoSurfaceID(0), m_logoDraw(0), m_logoAttached(0),
+	: m_creditsFile(nullptr), m_numberOfBytes(0), m_endOfCredits(0), m_currentHeight(0), m_cursor(0), m_scrollOffset(0), m_logoSurfaceID(0), m_logoDraw(0), m_logoAttached(0),
 	  m_movieSurfaceID(0), m_movieBackdrop(FALSE8), m_loopingMovie(FALSE8), m_frameStart(0), m_totalMovieFrames(0) {
 	memset(m_theData, 0, MAX_BYTESIZE_OF_CREDITS_FILE);
 	m_movieRect.left = m_movieRect.right = m_movieRect.bottom = m_movieRect.top = 0;
@@ -6379,7 +6379,7 @@ void Crediter::Initialise(const char *textFileName, const char *movieFileName, b
 	}
 
 	// Now sort out the movie to play as the backdrop
-	if (movieFileName == NULL) {
+	if (movieFileName == nullptr) {
 		m_movieBackdrop = FALSE8;
 	} else {
 		// Safety check
@@ -6596,7 +6596,7 @@ linesDone:
 		logo_rect.left = halfScreenW - 30;
 		logo_rect.right = logo_rect.left + 60;
 
-		surface_manager->Blit_surface_to_surface(m_logoSurfaceID, working_buffer_id, NULL, &logo_rect, 0);
+		surface_manager->Blit_surface_to_surface(m_logoSurfaceID, working_buffer_id, nullptr, &logo_rect, 0);
 	}
 
 	// Draw border rects
diff --git a/engines/icb/p4_pc.cpp b/engines/icb/p4_pc.cpp
index ff436ef6da..9256a32caf 100644
--- a/engines/icb/p4_pc.cpp
+++ b/engines/icb/p4_pc.cpp
@@ -239,7 +239,7 @@ void InitEngine(const char *lpCmdLine) {
 
 	// ok, see if the special gameScript is present
 	// if so set the stub mode to GameScript mode
-	if (gs.Init_game_script() && strstr(lpCmdLine, "mission") == NULL) {
+	if (gs.Init_game_script() && strstr(lpCmdLine, "mission") == nullptr) {
 		// GameScript mode
 		// unless there is a console.icb file we dont allow debugging
 
diff --git a/engines/icb/player.cpp b/engines/icb/player.cpp
index e7a738d8ea..2b2c152a0a 100644
--- a/engines/icb/player.cpp
+++ b/engines/icb/player.cpp
@@ -220,7 +220,7 @@ __mode_return _player::Player_press_fire_button() {
 
 		// play gun sound
 		if (MS->logic_structs[player_id]->sfxVars[GUNSHOT_SFX_VAR] != 0)
-			RegisterSound(player_id, NULL, MS->logic_structs[player_id]->sfxVars[GUNSHOT_SFX_VAR], gunDesc,
+			RegisterSound(player_id, nullptr, MS->logic_structs[player_id]->sfxVars[GUNSHOT_SFX_VAR], gunDesc,
 			              (int8)127); // have to use full version so we can give hash instead of string
 		else
 			RegisterSound(player_id, defaultGunSfx, gunDesc); // use small version as we have string not hash
@@ -249,7 +249,7 @@ __mode_return _player::Player_press_fire_button() {
 		} else {
 			// no hit play ricochet sound
 			if (MS->logic_structs[player_id]->sfxVars[RICOCHET_SFX_VAR] != 0)
-				RegisterSound(player_id, NULL, MS->logic_structs[player_id]->sfxVars[RICOCHET_SFX_VAR], ricochetDesc,
+				RegisterSound(player_id, nullptr, MS->logic_structs[player_id]->sfxVars[RICOCHET_SFX_VAR], ricochetDesc,
 				              (int8)127); // have to use full version so we can give hash instead of string
 			else
 				RegisterSound(player_id, defaultRicochetSfx, ricochetDesc); // use small version as we have string not hash
@@ -453,7 +453,7 @@ mcodeFunctionReturnCodes _game_session::fn_player(int32 &, int32 *) {
 	if (!L->looping) {
 		L->anim_pc = 0; // reset for when we are coming straight back in after a context re-run has changed the logic unexpectedly
 		L->looping = TRUE8;
-		M->cur_parent = 0; // force a reset - if players routes first cycle then the player barriers are never brought in
+		M->cur_parent = nullptr; // force a reset - if players routes first cycle then the player barriers are never brought in
 	}
 
 	// run player user, control and animation logic
@@ -1350,7 +1350,7 @@ __mode_return _player::Process_strike() {
 	// check for the hit frame
 	// The animation will have made the INT marker visible on the frame designated to be the "hit" frame
 	// Get the current frame from the anim
-	PXframe *currentFrame = NULL;
+	PXframe *currentFrame = nullptr;
 	// Note the weird = NULL & then setting it removes GCC warnings
 	currentFrame = PXFrameEnOfAnim(log->anim_pc, pAnim);
 
@@ -2905,7 +2905,7 @@ void _player::Set_player_id(uint32 id) {
 	MS->Prepare_megas_route_barriers(TRUE8);
 
 	// reset pointer to player parent barrier box
-	MS->logic_structs[id]->mega->cur_parent = NULL;
+	MS->logic_structs[id]->mega->cur_parent = nullptr;
 
 	crouch = FALSE8; // not crouching
 
@@ -3155,7 +3155,7 @@ void _game_session::Restart_player() {
 	ob->SetIntegerVariable(var_num, MAX_HITS); // another 10 hits
 
 	L->logic_level = 0; // restart
-	L->logic_ref[1] = 0;
+	L->logic_ref[1] = nullptr;
 
 	M->dead = 0; // not dead!!!
 
diff --git a/engines/icb/player_interaction.cpp b/engines/icb/player_interaction.cpp
index 36de9db649..0c278871c3 100644
--- a/engines/icb/player_interaction.cpp
+++ b/engines/icb/player_interaction.cpp
@@ -311,7 +311,7 @@ __mode_return _player::Player_interact() {
 				//      get the address of the script we want to run
 				const char *pc = (const char *)MS->scripts->Try_fetch_item_by_hash(iobject->GetScriptNameFullHash(OB_ACTION_CONTEXT)); //
 
-				if (pc == NULL)
+				if (pc == nullptr)
 					Fatal_error("Object [%s] has no interact script", iobject->GetName());
 
 				//      now run the action context script which may or may not set a new script on level 1
@@ -329,7 +329,7 @@ __mode_return _player::Player_interact() {
 		// get the address of the script we want to run
 		const char *pc = (const char *)MS->scripts->Try_fetch_item_by_hash(iobject->GetScriptNameFullHash(OB_ACTION_CONTEXT)); //
 
-		if (pc == NULL)
+		if (pc == nullptr)
 			Fatal_error("Object [%s] has no interact script", iobject->GetName());
 
 		interact_lock = TRUE8; // switch the lock on
diff --git a/engines/icb/remora.cpp b/engines/icb/remora.cpp
index 56c906c903..af6546987c 100644
--- a/engines/icb/remora.cpp
+++ b/engines/icb/remora.cpp
@@ -53,7 +53,7 @@ _remora::_remora() {
 	m_nFlashCounter = 0;
 	m_bMainHeadingSet = FALSE8;
 	m_nCurrentPalette = 0;
-	m_pDisplayBuffer = NULL;
+	m_pDisplayBuffer = nullptr;
 
 	// Set initial zoom range and an initial zoom.
 	m_nMinZoom = REMORA_SCAN_ZOOM_HARD_LOWER;
@@ -80,7 +80,7 @@ void _remora::InitialiseRemora() {
 	m_bModeChanged = FALSE8;
 
 	// Clear any mega speech (there shouldn't be any though).
-	m_pcSpeechText = NULL;
+	m_pcSpeechText = nullptr;
 	m_nSpeechTimer = 0;
 
 	// Initially, the zoom is set at 1X and cannot be moved.  This might well change.
@@ -177,7 +177,7 @@ void _remora::DisplayCharacterSpeech(uint32 nHash) {
 		// Put the text in the buffer.
 		m_pcSpeechText = &pcText[1];
 	} else {
-		m_pcSpeechText = NULL;
+		m_pcSpeechText = nullptr;
 	}
 
 	// Initialise the counter for how int32 it will be displayed.
@@ -195,7 +195,7 @@ void _remora::SetCurrentZoom(uint32 nZoom) {
 }
 
 bool8 _remora::IsThisEmailWaiting(const char *pcEmailID) const {
-	if ((pcEmailID == NULL) || (strlen(m_pcEmailID) == 0))
+	if ((pcEmailID == nullptr) || (strlen(m_pcEmailID) == 0))
 		return (FALSE8);
 
 	if (strcmp(pcEmailID, m_pcEmailID))
@@ -880,7 +880,7 @@ void _remora::ClearAllText() {
 	m_bMainHeadingSet = FALSE8;
 
 	// These control the spoken text display.
-	m_pcSpeechText = NULL;
+	m_pcSpeechText = nullptr;
 	m_nSpeechTimer = 0;
 }
 
diff --git a/engines/icb/remora_pc.cpp b/engines/icb/remora_pc.cpp
index 9aa5e17dad..48169414ef 100644
--- a/engines/icb/remora_pc.cpp
+++ b/engines/icb/remora_pc.cpp
@@ -269,7 +269,7 @@ void _remora::GrabTextFormattingMemory() {
 void _remora::ReleaseTextFormattingMemory() {
 	if (m_pDisplayBuffer) {
 		delete[] m_pDisplayBuffer;
-		m_pDisplayBuffer = NULL;
+		m_pDisplayBuffer = nullptr;
 	}
 }
 
@@ -1595,7 +1595,7 @@ void _remora::SetUpSurfaceForBitmap(const char *pcBitmapName, DXrect &sSourceRec
 
 	pSurfaceBitmap = surface_manager->Lock_surface(nSurfaceID);
 	nPitch = surface_manager->Get_pitch(nSurfaceID);
-	SpriteXYFrameDraw(pSurfaceBitmap, nPitch, pSprite->width, pSprite->height, pBitmap, 0, 0, 0, FALSE8, NULL, 255);
+	SpriteXYFrameDraw(pSurfaceBitmap, nPitch, pSprite->width, pSprite->height, pBitmap, 0, 0, 0, FALSE8, nullptr, 255);
 	surface_manager->Unlock_surface(nSurfaceID);
 }
 
diff --git a/engines/icb/res_man.cpp b/engines/icb/res_man.cpp
index e33de90dd6..f0f1bcc55b 100644
--- a/engines/icb/res_man.cpp
+++ b/engines/icb/res_man.cpp
@@ -363,9 +363,9 @@ void res_man::Advance_time_stamp() {
 }
 
 res_man::res_man() {
-	memory_base = NULL;
+	memory_base = nullptr;
 	max_mem_blocks = 0;
-	mem_list = NULL;
+	mem_list = nullptr;
 }
 
 res_man::res_man(uint32 memory_tot) {
@@ -704,7 +704,7 @@ uint8 *res_man::Internal_open(RMParams *params, int32 *ret_len) {
 		}
 		// otherwise we're doing an async so it's alright to return 9
 		else
-			return 0x00000000;
+			return nullptr;
 	}
 
 	// Pass the 8-byte aligned length back to calling function
@@ -712,7 +712,7 @@ uint8 *res_man::Internal_open(RMParams *params, int32 *ret_len) {
 		*ret_len = params->len;
 
 	if (mem_list[params->search].protect)
-		return 0x00000000;
+		return nullptr;
 
 	return ptr;
 }
@@ -734,7 +734,7 @@ uint8 *res_man::LoadFile(int32 &cluster_search, RMParams *params) {
 	// if we are preloading the cluster
 	if (params->not_ready_yet) {
 		// printf("LoadFile cluster not ready yet");
-		return NULL;
+		return nullptr;
 	}
 
 	// align to 8 byte boundary in length so that next resource will adjoin legally
diff --git a/engines/icb/res_man_pc.cpp b/engines/icb/res_man_pc.cpp
index aef162fd07..5905e162d1 100644
--- a/engines/icb/res_man_pc.cpp
+++ b/engines/icb/res_man_pc.cpp
@@ -54,7 +54,7 @@ Common::File *openDiskFileForBinaryRead(const char *filename) {
 	} else {
 		delete result;
 		warning("openDiskFileForBinaryRead(%s) - FAILED", path.c_str());
-		return NULL;
+		return nullptr;
 	}
 }
 
@@ -163,7 +163,7 @@ uint32 res_man::Fetch_size(const char * /*url*/, uint32 url_hash, const char *cl
 	HEADER_NORMAL *hn = GetFileHeader(cluster_search, &params);
 
 	// return value of 0 means no such file
-	if (hn == NULL)
+	if (hn == nullptr)
 		return 0;
 
 	return hn->size;
@@ -184,7 +184,7 @@ bool8 res_man::Test_file(const char *url, uint32 url_hash, const char *cluster,
 
 	HEADER_NORMAL *hn = GetFileHeader(cluster_search, &params);
 
-	if (hn == NULL)
+	if (hn == nullptr)
 		return 0;
 
 	return 1;
@@ -235,7 +235,7 @@ void res_man::ReadFile(const char * /*url*/, RMParams *params) {
 
 		Tdebug("clusters.txt", "  Close handle %x", params->_stream);
 		delete params->_stream; // close the cluster
-		params->_stream = NULL;
+		params->_stream = nullptr;
 
 		mem_list[params->search].protect = 0;
 	}
@@ -259,7 +259,7 @@ const char *res_man::OpenFile(int32 &cluster_search, RMParams *params) {
 		params->_stream = openDiskFileForBinaryStreamRead(clusterPath.c_str());
 		Tdebug("clusters.txt", "  open cluster file %s handle %x", clusterPath.c_str(), params->_stream);
 
-		if (params->_stream == NULL)
+		if (params->_stream == nullptr)
 			Fatal_error("Res_open cannot *OPEN* cluster file %s", clusterPath.c_str());
 
 		// Read in 16 bytes, part of which is the cluster header length
@@ -276,7 +276,7 @@ const char *res_man::OpenFile(int32 &cluster_search, RMParams *params) {
 	}
 
 	HEADER_NORMAL *hn = GetFileHeader(cluster_search, params);
-	if (hn == NULL) {
+	if (hn == nullptr) {
 		// Big error the file wasn't found in the cluster
 		Fatal_error("res_man::OpenFile couldn't find url %X in cluster %s %X", params->url_hash, params->cluster, params->cluster_hash);
 	}
@@ -288,7 +288,7 @@ const char *res_man::OpenFile(int32 &cluster_search, RMParams *params) {
 	params->_stream = openDiskFileForBinaryStreamRead(clusterPath.c_str());
 	Tdebug("clusters.txt", "  open cluster file %s handle %x", clusterPath.c_str(), params->_stream);
 
-	if (params->_stream == NULL)
+	if (params->_stream == nullptr)
 		Fatal_error("Res_open cannot *OPEN* cluster file %s", clusterPath.c_str());
 
 	params->seekpos = hn->offset;
@@ -300,7 +300,7 @@ const char *res_man::OpenFile(int32 &cluster_search, RMParams *params) {
 	} else
 		params->len = hn->size;
 
-	return NULL;
+	return nullptr;
 }
 
 // Get the header infomation for a particular file from a cluster
@@ -352,7 +352,7 @@ HEADER_NORMAL *res_man::GetFileHeader(int32 &cluster_search, RMParams *params) {
 
 	// Check that the file was actually found
 	if (i == clu->ho.noFiles) {
-		return NULL;
+		return nullptr;
 	}
 
 	return hn;
@@ -364,7 +364,7 @@ void res_man::Res_open_mini_cluster(const char *cluster_url, uint32 &cluster_has
 	// open the mini-cluster
 
 	uint32 zeroHash = 0;
-	Cluster_API *clu = (Cluster_API *)Res_open(NULL, zeroHash, cluster_url, cluster_hash);
+	Cluster_API *clu = (Cluster_API *)Res_open(nullptr, zeroHash, cluster_url, cluster_hash);
 
 	int32 numFiles = clu->ho.noFiles;
 
@@ -404,7 +404,7 @@ void res_man::Res_open_mini_cluster(const char *cluster_url, uint32 &cluster_has
 
 	// ensure the header is still in memory
 
-	clu = (Cluster_API *)Res_open(NULL, zeroHash, cluster_url, cluster_hash);
+	clu = (Cluster_API *)Res_open(nullptr, zeroHash, cluster_url, cluster_hash);
 
 	// now load in the body...
 	// from first file upwards
diff --git a/engines/icb/route_manager.cpp b/engines/icb/route_manager.cpp
index 2c7b9b4e65..d08ee23ce0 100644
--- a/engines/icb/route_manager.cpp
+++ b/engines/icb/route_manager.cpp
@@ -269,7 +269,7 @@ _route_description *_game_session::Fetch_route_desc(uint32 id) {
 
 	// no route at all
 	if (!logic_structs[id]->mega->m_phase)
-		return (0);
+		return (nullptr);
 
 	return (&logic_structs[id]->mega->m_main_route);
 }
@@ -278,7 +278,7 @@ void _route_description::___init() {
 	// nethack diagnostics
 	if (diag_bars)
 		delete[] diag_bars;
-	diag_bars = 0;
+	diag_bars = nullptr;
 
 	number_of_diag_bars = 0;
 
@@ -494,7 +494,7 @@ mcodeFunctionReturnCodes _game_session::fn_route_to_nico(int32 &result, int32 *p
 
 	_feature_info *monica;
 
-	const char *nico_name = NULL;
+	const char *nico_name = nullptr;
 	if (params && params[0]) {
 		nico_name = (const char *)MemoryUtil::resolvePtr(params[0]);
 	}
diff --git a/engines/icb/session.cpp b/engines/icb/session.cpp
index e253e1d33d..162902c788 100644
--- a/engines/icb/session.cpp
+++ b/engines/icb/session.cpp
@@ -233,7 +233,7 @@ void _game_session::___init(const char *mission, const char *new_session_name) {
 	Tdebug("text_lines.txt", "\n\n---Text Lines---\n");
 
 	// text
-	text = NULL; // game can exist with this file
+	text = nullptr; // game can exist with this file
 
 	char textFileName[100];
 
@@ -259,7 +259,7 @@ void _game_session::___init(const char *mission, const char *new_session_name) {
 
 	// A copy of the code above to open the global text file.  Feel free to edit this if I've ballsed up
 	// anywhere.
-	global_text = NULL;
+	global_text = nullptr;
 
 	char global_cluster[ENGINE_STRING_LEN];
 
@@ -982,7 +982,7 @@ void _game_session::Script_cycle() {
 			}
 
 			if (!L->logic_level) { // restart the object
-				L->logic_ref[1] = 0; // completely reset L 1 so that context choose will select ok
+				L->logic_ref[1] = nullptr; // completely reset L 1 so that context choose will select ok
 				// it is acceptable to choose the logic that had previously been running
 
 				// temp reset PC the hard way
@@ -1203,7 +1203,7 @@ _linked_data_file *LoadTranslatedFile(const char *mission, const char *session)
 	// Load in this file
 	Common::SeekableReadStream *stream = openDiskFileForBinaryStreamRead(fname.c_str());
 
-	if (stream == NULL) // if it could not be opened
+	if (stream == nullptr) // if it could not be opened
 		Fatal_error("Unable to load file %s", (const char *)fname);
 
 	uint32 len = stream->size();
diff --git a/engines/icb/set_pc.cpp b/engines/icb/set_pc.cpp
index e59942b52f..14e9ae8384 100644
--- a/engines/icb/set_pc.cpp
+++ b/engines/icb/set_pc.cpp
@@ -568,7 +568,7 @@ _set::_set() {
 	set_cluster[0] = '\0';
 	m_setOk = 0;
 	m_TotalPropSurfaces = 0;
-	m_props = 0;
+	m_props = nullptr;
 	memset(m_propSurfaces, 0x00, sizeof(int32) * MAX_PROP_STATES);
 	InitWeather(WEATHER_NONE, 0, 0, 0, 0, 0);
 }
@@ -640,7 +640,7 @@ void _set::Reset() {
 		surface_manager->Kill_surface(bg_buffer_id);
 
 		delete m_props;
-		m_props = 0;
+		m_props = nullptr;
 	}
 
 	m_setOk = 0;
diff --git a/engines/icb/shadow_pc.cpp b/engines/icb/shadow_pc.cpp
index 6923b668ca..b24c39d6db 100644
--- a/engines/icb/shadow_pc.cpp
+++ b/engines/icb/shadow_pc.cpp
@@ -94,7 +94,7 @@ void MakeShadowPC(rap_API *srap, SVECTORPC *local, int32 nVertices, SVECTORPC *p
 				  int16 zmaxLocal) {
 
 	SVECTORPC workVerts[MAX_VECTORS];
-	SVECTORPC *vertices = NULL;
+	SVECTORPC *vertices = nullptr;
 
 	vertices = workVerts;
 
diff --git a/engines/icb/sound.cpp b/engines/icb/sound.cpp
index 89c66f83ea..00b633bb91 100644
--- a/engines/icb/sound.cpp
+++ b/engines/icb/sound.cpp
@@ -256,7 +256,7 @@ int32 EvalEnv(const CEnvelope &env, int32 x) {
 _linked_data_file *GetMissionSfxFile() {
 	uint32 fileHash;
 	uint32 clusterHash;
-	_linked_data_file *f = NULL;
+	_linked_data_file *f = nullptr;
 
 	// if no mission return NULL
 	if (!g_mission) {
@@ -284,7 +284,7 @@ _linked_data_file *GetSessionSfxFile() {
 	// if no session return NULL
 	if ((!g_mission) || (!(g_mission->session))) {
 		warning("no session so no sfx file!");
-		return NULL;
+		return nullptr;
 	}
 
 	uint32 fileHash = NULL_HASH;
@@ -327,7 +327,7 @@ int32 WhichMissionSfx(uint32 sfx) {
 	uint32 n;
 
 	linkedSfx = GetMissionSfxFile();
-	if (linkedSfx == NULL)
+	if (linkedSfx == nullptr)
 		return -1;
 
 	n = linkedSfx->Fetch_item_number_by_hash(sfx);
@@ -343,7 +343,7 @@ int32 WhichSessionSfx(uint32 sfx) {
 	uint32 n;
 
 	linkedSfx = GetSessionSfxFile();
-	if (linkedSfx == NULL)
+	if (linkedSfx == nullptr)
 		return -1;
 
 	n = linkedSfx->Fetch_item_number_by_hash(sfx);
@@ -396,7 +396,7 @@ int32 GetFreeChannel() {
 
 // Get sfx for this registered sound
 CSfx *CRegisteredSound::GetSfx() {
-	CSfx *the_sfx = 0;
+	CSfx *the_sfx = nullptr;
 
 	if (m_sfxNumber == -1)
 		Fatal_error("sfx is not found in session or mission");
@@ -1025,7 +1025,7 @@ void RegisterSoundOffset(uint32 obj, const char *offsetName, const char *sfxName
 		g_registeredSounds[i]->RegisterFromAbsolute(obj, sndID, sfxName, sfxHash, xo, yo, zo, volume_offset);
 	}
 	// absolute sound (no name)
-	else if ((offsetName == NULL) || (strcmp(offsetName, "") == 0)) {
+	else if ((offsetName == nullptr) || (strcmp(offsetName, "") == 0)) {
 		// absolute address
 		g_registeredSounds[i]->RegisterFromAbsolute(obj, sndID, sfxName, sfxHash, xo, yo, zo, volume_offset);
 	}
@@ -1056,7 +1056,7 @@ void RegisterSound(uint32 obj, const char *sfxName, uint32 sfxHash, const char *
 	const char *name;
 
 	if (obj == SPECIAL_SOUND)
-		name = NULL;
+		name = nullptr;
 	else
 		name = (const char *)(MS->objects->Fetch_items_name_by_number(obj));
 
@@ -1065,14 +1065,14 @@ void RegisterSound(uint32 obj, const char *sfxName, uint32 sfxHash, const char *
 
 // register a sound from an absolute position
 void RegisterSoundAbsolute(uint32 obj, const char *sfxName, uint32 sfxHash, const char *sndID, PXreal x, PXreal y, PXreal z, int8 volume_offset) {
-	RegisterSoundOffset(obj, NULL, sfxName, sfxHash, sndID, x, y, z, 0, 0, volume_offset);
+	RegisterSoundOffset(obj, nullptr, sfxName, sfxHash, sndID, x, y, z, 0, 0, volume_offset);
 }
 
 void RegisterSoundTime(uint32 obj, const char *sfxName, uint32 sfxHash, const char *sndID, int32 time, int8 volume_offset) {
 	const char *name;
 
 	if (obj == SPECIAL_SOUND)
-		name = NULL;
+		name = nullptr;
 	else
 		name = (const char *)(MS->objects->Fetch_items_name_by_number(obj));
 
@@ -1083,14 +1083,14 @@ void RegisterSoundTime(uint32 obj, const char *sfxName, uint32 sfxHash, const ch
 // for menus
 void RegisterMenuSound(const char *sfxName, uint32 sfxHash, int32 volume, int32 pan, int8 volume_offset) {
 	// volume is z of position
-	RegisterSoundOffset(SPECIAL_SOUND, NULL, sfxName, sfxHash, menuSoundID, (PXreal)pan, (PXreal)0, (PXreal)volume, 0, 0, volume_offset);
+	RegisterSoundOffset(SPECIAL_SOUND, nullptr, sfxName, sfxHash, menuSoundID, (PXreal)pan, (PXreal)0, (PXreal)volume, 0, 0, volume_offset);
 }
 
 // special sound
 // for in game (these are paused just like any other...
 void RegisterSoundSpecial(const char *sfxName, uint32 sfxHash, const char *sndID, int32 volume, int32 pan, int8 volume_offset) {
 	// volume is z of position
-	RegisterSoundOffset(SPECIAL_SOUND, NULL, sfxName, sfxHash, sndID, (PXreal)pan, (PXreal)0, (PXreal)volume, 0, 0, volume_offset);
+	RegisterSoundOffset(SPECIAL_SOUND, nullptr, sfxName, sfxHash, sndID, (PXreal)pan, (PXreal)0, (PXreal)volume, 0, 0, volume_offset);
 }
 
 void RemoveRegisteredSound(uint32 obj, const char *sndID) {
diff --git a/engines/icb/sound/direct_sound.cpp b/engines/icb/sound/direct_sound.cpp
index 3568570b09..6ecd88562f 100644
--- a/engines/icb/sound/direct_sound.cpp
+++ b/engines/icb/sound/direct_sound.cpp
@@ -39,9 +39,9 @@
 
 namespace ICB {
 
-MusicManager *g_theMusicManager = NULL;
-SpeechManager *g_theSpeechManager = NULL;
-FxManager *g_theFxManager = NULL;
+MusicManager *g_theMusicManager = nullptr;
+SpeechManager *g_theSpeechManager = nullptr;
+FxManager *g_theFxManager = nullptr;
 bool8 g_TimerOn = TRUE8;
 
 Common::TimerManager::TimerProc g_timer_id;
@@ -72,19 +72,19 @@ bool8 Close_Sound_Engine() {
 	// Destroy the fx manager
 	if (g_theFxManager) {
 		delete g_theFxManager;
-		g_theFxManager = NULL;
+		g_theFxManager = nullptr;
 	}
 
 	// Destroy the music manager
 	if (g_theMusicManager) {
 		delete g_theMusicManager;
-		g_theMusicManager = NULL;
+		g_theMusicManager = nullptr;
 	}
 
 	// Destroy the speech manager
 	if (g_theSpeechManager) {
 		delete g_theSpeechManager;
-		g_theSpeechManager = NULL;
+		g_theSpeechManager = nullptr;
 	}
 	g_icb->_mixer->stopAll();
 
diff --git a/engines/icb/sound/fx_manager.cpp b/engines/icb/sound/fx_manager.cpp
index 92f696a470..560f67b22d 100644
--- a/engines/icb/sound/fx_manager.cpp
+++ b/engines/icb/sound/fx_manager.cpp
@@ -55,7 +55,7 @@ FxManager::FxManager() {
 		m_effects[id].pitch = 0;
 		m_effects[id].pan = 0;
 		m_effects[id].volume = 0;
-		m_effects[id]._stream = NULL;
+		m_effects[id]._stream = nullptr;
 	}
 }
 
diff --git a/engines/icb/sound/music_manager.cpp b/engines/icb/sound/music_manager.cpp
index b523b2cefc..2d9bf6bc04 100644
--- a/engines/icb/sound/music_manager.cpp
+++ b/engines/icb/sound/music_manager.cpp
@@ -52,7 +52,7 @@ MusicManager::MusicManager() {
 	m_fading = 0;
 	m_adjustFadeVol = 0;
 
-	_audioStream = NULL;
+	_audioStream = nullptr;
 }
 
 MusicManager::~MusicManager() {
@@ -106,7 +106,7 @@ bool8 MusicManager::LoadMusic(const char *clusterName, uint32 byteOffsetToWav, i
 
 	// Open the cluster file
 	Common::SeekableReadStream *stream = openDiskFileForBinaryStreamRead(clusterName);
-	if (stream == NULL)
+	if (stream == nullptr)
 		return FALSE8;
 
 	// Need to seek to the correct postion in the cluster
diff --git a/engines/icb/sound/speech_manager.cpp b/engines/icb/sound/speech_manager.cpp
index 745f4a2c3e..8df1f8009e 100644
--- a/engines/icb/sound/speech_manager.cpp
+++ b/engines/icb/sound/speech_manager.cpp
@@ -50,7 +50,7 @@ SpeechManager::SpeechManager() {
 	m_lengthInCycles = 0;
 	m_speechVol = 0;
 
-	_audioStream = NULL;
+	_audioStream = nullptr;
 }
 
 SpeechManager::~SpeechManager() { KillBuffer(); }
@@ -80,7 +80,7 @@ bool8 SpeechManager::StartSpeech(const char *fileName, uint32 byteOffsetToWav, i
 
 	// Open the cluster file
 	Common::SeekableReadStream *stream = openDiskFileForBinaryStreamRead(fileName);
-	if (stream == NULL)
+	if (stream == nullptr)
 		return FALSE8;
 
 	// Need to seek to the correct postion in the cluster
diff --git a/engines/icb/sound_logic.cpp b/engines/icb/sound_logic.cpp
index 7f27e71744..10cbe99758 100644
--- a/engines/icb/sound_logic.cpp
+++ b/engines/icb/sound_logic.cpp
@@ -39,7 +39,7 @@ void _sound_logic::Initialise() {
 
 	m_nNumSubscribers = 0;
 	m_nSFXSubtitleTimer = 0;
-	m_pcSFXSubtitleText = NULL;
+	m_pcSFXSubtitleText = nullptr;
 	m_nNumLinkedFloors = 0;
 
 	for (i = 0; i < SL_MAX_CONCURRENT_SOUNDS; ++i) {
diff --git a/engines/icb/sound_lowlevel_pc.cpp b/engines/icb/sound_lowlevel_pc.cpp
index 27fb5d67b5..25ea7bf784 100644
--- a/engines/icb/sound_lowlevel_pc.cpp
+++ b/engines/icb/sound_lowlevel_pc.cpp
@@ -44,7 +44,7 @@ bool8 DoesClusterContainFile(pxString clustername, uint32 hash_to_find, uint32 &
 	// Manually open the cluster file
 	Common::SeekableReadStream *stream = openDiskFileForBinaryStreamRead(clustername.c_str());
 
-	if (stream == NULL)
+	if (stream == nullptr)
 		Fatal_error(pxVString("Failed to open cluster: %s", clustername.c_str()));
 
 	// Read in first 16 bytes so we can get the header size
diff --git a/engines/icb/speech.cpp b/engines/icb/speech.cpp
index ed7580da5a..2b111342bd 100644
--- a/engines/icb/speech.cpp
+++ b/engines/icb/speech.cpp
@@ -456,8 +456,8 @@ void _game_session::Service_speech() {
 		speech_object = (c_game_object *)objects->Fetch_item_by_name("scenes");
 		cur_id = objects->Fetch_item_number_by_name("scenes");
 		L = logic_structs[cur_id];
-		I = 0;
-		M = 0;
+		I = nullptr;
+		M = nullptr;
 
 		// run the script
 		ret = RunScript(const_cast<const char *&>(speech_info[CONV_ID].script_pc), speech_object);
diff --git a/engines/icb/stagedraw_pc_poly.cpp b/engines/icb/stagedraw_pc_poly.cpp
index f5a5f0d461..b98e71df9d 100644
--- a/engines/icb/stagedraw_pc_poly.cpp
+++ b/engines/icb/stagedraw_pc_poly.cpp
@@ -79,16 +79,16 @@ typedef struct {
 #define ZBytesPerPixel      2                                 // 16bit z-buffer
 
 RevRenderDevice revRen;
-char *pActorBuffer = NULL;                  // buffer for drawing actors
-char *pRGB = NULL;                          // buffer for RGB data
-char *pZa = NULL;                           // buffer for actor z data
-char *pZfx = NULL;                          // buffer for fx z data
-char *pZ = NULL;                            // Current z buffer being used by the renderer
+char *pActorBuffer = nullptr;                  // buffer for drawing actors
+char *pRGB = nullptr;                          // buffer for RGB data
+char *pZa = nullptr;                           // buffer for actor z data
+char *pZfx = nullptr;                          // buffer for fx z data
+char *pZ = nullptr;                            // Current z buffer being used by the renderer
 int32 mip_map_level = 0;
 #define ZBUFFERSIZE (2 * SCREEN_WIDTH * SCREEN_DEPTH)
 
 // Stage draw composition table ... keeps track of the tiles which need drawing
-uint32 *pUsedTiles = NULL;
+uint32 *pUsedTiles = nullptr;
 
 // Init the dutch dll thing render device etc...
 void InitRevRenderDevice() {
@@ -121,7 +121,7 @@ void InitRevRenderDevice() {
 	revRen.Zdata = (uint16 *)pZa;
 	SetRenderDevice(&revRen);
 
-	if (pUsedTiles == NULL)
+	if (pUsedTiles == nullptr)
 		pUsedTiles = new uint32[TILE_COUNT]();
 }
 
@@ -131,11 +131,11 @@ void DestoryRevRenderDevice() {
 	if (pActorBuffer)
 		delete[] pActorBuffer;
 
-	pActorBuffer = NULL;
-	pRGB = NULL;
-	pZ = NULL;
-	pZa = NULL;
-	pZfx = NULL;
+	pActorBuffer = nullptr;
+	pRGB = nullptr;
+	pZ = nullptr;
+	pZa = nullptr;
+	pZfx = nullptr;
 
 	if (pUsedTiles)
 		delete[] pUsedTiles;
@@ -436,7 +436,7 @@ void drawObjects(SDactor &act, PSXLampList &lamplist, PSXrgb *pAmbient, PSXShade
 	myBones[NECK_DEFORMATION] = &(vox->neckBone);
 	myBones[JAW_DEFORMATION] = &(vox->jawBone);
 	myBones[LOOK_DEFORMATION] = &(vox->lookBone);
-	myBones[SPARE_DEFORMATION] = NULL; // no 4th deformation (unless player...)
+	myBones[SPARE_DEFORMATION] = nullptr; // no 4th deformation (unless player...)
 
 	// if player then update player bones
 	if (MS->player.log == act.log)
@@ -445,7 +445,7 @@ void drawObjects(SDactor &act, PSXLampList &lamplist, PSXrgb *pAmbient, PSXShade
 	int32 uvframe;
 
 	// For dead things do not draw the animating polygons
-	if (g_mission->session->objects == NULL || strcmp(act.log->GetName(), "StageView") == 0) {
+	if (g_mission->session->objects == nullptr || strcmp(act.log->GetName(), "StageView") == 0) {
 		uvframe = gameCycle;
 	} else {
 		c_game_object *ob = (c_game_object *)MS->objects->Fetch_item_by_name(act.log->GetName());
@@ -884,7 +884,7 @@ void StageDrawPoly(SDactor *actors, uint32 actorQty) {
 							// Get a pointer to the z table
 							uint16 *zTable = pStat->GetZTileTable(tileOffset);
 
-							if (zTable != NULL) {
+							if (zTable != nullptr) {
 								uint16 *zPtr = zTable;
 								uint16 *rowAd = zActor + offset;
 
@@ -912,7 +912,7 @@ void StageDrawPoly(SDactor *actors, uint32 actorQty) {
 
 							// Now do the semi transparencies for this prop tile
 							uint16 *tilePtrs = pStat->GetSemiTileTable(tileOffset); // pStat->GetSemiTileTable(tileOffset);
-							if ((tilePtrs != NULL) && (g_px->semitransparencies == TRUE8)) {
+							if ((tilePtrs != nullptr) && (g_px->semitransparencies == TRUE8)) {
 								uint16 *tPtr = tilePtrs;
 								uint32 *bufRGB = source + offset;
 								uint16 *bufZ = zActor + offset;
@@ -1052,7 +1052,7 @@ void StageDrawPoly(SDactor *actors, uint32 actorQty) {
 
 						// Now add the static semitransparencies
 						uint16 *tilePtrs = sceneZ->GetSemiTileTable(tileOffset);
-						if ((tilePtrs != NULL) && (g_px->semitransparencies == TRUE8)) {
+						if ((tilePtrs != nullptr) && (g_px->semitransparencies == TRUE8)) {
 							uint16 *tPtr = tilePtrs;
 							uint32 *bufRGB = source + offset;
 							uint16 *bufZ = zActor + offset;
@@ -1195,7 +1195,7 @@ void StageDrawPoly(SDactor *actors, uint32 actorQty) {
 						uint16 *zA = zActor + offset;
 						uint32 *rgbA32 = source + offset;
 						uint32 *rgbS32 = safe_ad + pitchedOffset + screenShakeOffset;
-						if (tilePtrs != NULL) {
+						if (tilePtrs != nullptr) {
 							uint16 *zPtr = tilePtrs;
 							for (int32 y = 0; y < TILE_HEIGHT; y++) {
 								uint16 *zDst = zA;
@@ -1613,7 +1613,7 @@ void StageDrawPoly(SDactor *actors, uint32 actorQty) {
 								uint32 *rgbA32 = source + offset;
 								uint32 *rgbS32 = safe_ad + pitchedOffset + screenShakeOffset;
 
-								if (tilePtrs != NULL) {
+								if (tilePtrs != nullptr) {
 									uint16 *zPtr = tilePtrs;
 									for (int32 y = 0; y < TILE_HEIGHT; y++) {
 										uint16 *zDst = zA;
diff --git a/engines/icb/surface_manager.cpp b/engines/icb/surface_manager.cpp
index 8c0c846c8c..799229db34 100644
--- a/engines/icb/surface_manager.cpp
+++ b/engines/icb/surface_manager.cpp
@@ -62,7 +62,7 @@ _surface::~_surface() {
 }
 
 _surface::_surface() {
-	m_dds = NULL;
+	m_dds = nullptr;
 	m_name = "Created";
 	m_width = 0;
 	m_height = 0;
@@ -72,7 +72,7 @@ _surface::_surface() {
 void _surface_manager::PrintDebugLabel(const char *mess, uint32 c) {
 	static int32 y = 100;
 
-	if (mess == NULL) {
+	if (mess == nullptr) {
 		y = c;
 	} else {
 		/*      Get_surface_DC( working_buffer_id, dc );
@@ -116,7 +116,7 @@ void _surface_manager::PrintTimer(char label, uint32 time, uint32 limit) {
 
 _surface_manager::_surface_manager() {
 	// Setup uninitialized pointers
-	screenSurface = NULL;
+	screenSurface = nullptr;
 
 	// set these up only once
 	full_rect.left = 0;
@@ -256,7 +256,7 @@ void _surface_manager::Flip() {
 
 	flipTime = GetMicroTimer() - flipTime;
 
-	PrintDebugLabel(NULL, 0x00000000);
+	PrintDebugLabel(nullptr, 0x00000000);
 	PrintTimer('\0', 0, 0);
 }
 
@@ -264,7 +264,7 @@ void _surface_manager::Flip() {
 uint32 _surface_manager::Create_new_surface(const char *name, uint32 width, uint32 height, uint32 /*type*/) {
 	// Find the next free slot
 	uint32 slot;
-	for (slot = FIRST_CLIENT_SURFACE; slot < m_Surfaces.GetNoItems() && m_Surfaces[slot] != NULL; slot++)
+	for (slot = FIRST_CLIENT_SURFACE; slot < m_Surfaces.GetNoItems() && m_Surfaces[slot] != nullptr; slot++)
 		;
 
 	// Create the new surface structure
@@ -282,17 +282,17 @@ uint32 _surface_manager::Create_new_surface(const char *name, uint32 width, uint
 		return slot;
 
 	delete m_Surfaces[slot];
-	m_Surfaces[slot] = NULL;
+	m_Surfaces[slot] = nullptr;
 
 	return 0;
 }
 
 void _surface_manager::Kill_surface(uint32 s_id) {
-	if (m_Surfaces[s_id] == NULL)
+	if (m_Surfaces[s_id] == nullptr)
 		return; // Already killed
 
 	delete m_Surfaces[s_id];
-	m_Surfaces[s_id] = NULL;
+	m_Surfaces[s_id] = nullptr;
 }
 
 uint8 *_surface_manager::Lock_surface(uint32 s_id) {
diff --git a/engines/icb/text_sprites_pc.cpp b/engines/icb/text_sprites_pc.cpp
index b83d061f68..a3325a9ce1 100644
--- a/engines/icb/text_sprites_pc.cpp
+++ b/engines/icb/text_sprites_pc.cpp
@@ -34,7 +34,7 @@ namespace ICB {
 
 #define SPACE ' ' // ASCII for space character
 
-_rgb *psTempSpeechColour = NULL;
+_rgb *psTempSpeechColour = nullptr;
 
 _TSrtn text_sprite::BuildTextSprite(int32 stopAtLine, bool8 bRemoraLeftFormatting) {
 	uint8 *linePtr;                                                                // used to point to the start of each line of pixels in the text sprite
@@ -143,7 +143,7 @@ _TSrtn text_sprite::BuildTextSprite(int32 stopAtLine, bool8 bRemoraLeftFormattin
 	if (psTempSpeechColour) {
 		memcpy(pal, pnSavePalette, 24);
 
-		psTempSpeechColour = NULL;
+		psTempSpeechColour = nullptr;
 	}
 
 	return TS_OK; // return with success


Commit: 49d745bbe43c51378cd8bde863456ad38e92c561
    https://github.com/scummvm/scummvm/commit/49d745bbe43c51378cd8bde863456ad38e92c561
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
ILLUSIONS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/illusions/actor.cpp
    engines/illusions/bbdou/bbdou_bubble.cpp
    engines/illusions/bbdou/bbdou_inventory.cpp
    engines/illusions/bbdou/bbdou_specialcode.cpp
    engines/illusions/bbdou/bbdou_triggerfunctions.cpp
    engines/illusions/bbdou/bbdou_videoplayer.cpp
    engines/illusions/bbdou/illusions_bbdou.cpp
    engines/illusions/bbdou/menusystem_bbdou.cpp
    engines/illusions/bbdou/scriptopcodes_bbdou.cpp
    engines/illusions/camera.cpp
    engines/illusions/cursor.cpp
    engines/illusions/detection.cpp
    engines/illusions/duckman/duckman_dialog.cpp
    engines/illusions/duckman/duckman_inventory.cpp
    engines/illusions/duckman/duckman_videoplayer.cpp
    engines/illusions/duckman/illusions_duckman.cpp
    engines/illusions/duckman/menusystem_duckman.cpp
    engines/illusions/duckman/scriptopcodes_duckman.cpp
    engines/illusions/gamarchive.cpp
    engines/illusions/gamestate.cpp
    engines/illusions/illusions.cpp
    engines/illusions/menusystem.cpp
    engines/illusions/pathfinder.cpp
    engines/illusions/resources/actorresource.cpp
    engines/illusions/resources/backgroundresource.cpp
    engines/illusions/resources/fontresource.cpp
    engines/illusions/resources/genericresource.cpp
    engines/illusions/resources/midiresource.cpp
    engines/illusions/resources/scriptresource.cpp
    engines/illusions/resources/soundresource.cpp
    engines/illusions/resources/talkresource.cpp
    engines/illusions/resourcesystem.cpp
    engines/illusions/screen.cpp
    engines/illusions/screentext.cpp
    engines/illusions/sequenceopcodes.cpp
    engines/illusions/sound.cpp
    engines/illusions/thread.cpp
    engines/illusions/threads/talkthread.cpp
    engines/illusions/threads/talkthread_duckman.cpp


diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp
index 10e3578a45..20a24a16f1 100644
--- a/engines/illusions/actor.cpp
+++ b/engines/illusions/actor.cpp
@@ -66,13 +66,13 @@ Actor::Actor(IllusionsEngine *vm)
 	_surfInfo._pixelSize = 0;
 	_surfInfo._dimensions._width = 0;
 	_surfInfo._dimensions._height = 0;
-	_surface = 0;
-	_frames = 0;
-	_scaleLayer = 0;
-	_priorityLayer = 0;
-	_regionLayer = 0;
-	_pathWalkPoints = 0;
-	_pathWalkRects = 0;
+	_surface = nullptr;
+	_frames = nullptr;
+	_scaleLayer = nullptr;
+	_priorityLayer = nullptr;
+	_regionLayer = nullptr;
+	_pathWalkPoints = nullptr;
+	_pathWalkRects = nullptr;
 	_position.x = 0;
 	_position.y = 0;
 	_position2.x = 0;
@@ -89,8 +89,8 @@ Actor::Actor(IllusionsEngine *vm)
 	}
 	_notifyThreadId1 = 0;
 	_notifyThreadId2 = 0;
-	_entryTblPtr = 0;
-	_seqCodeIp = 0;
+	_entryTblPtr = nullptr;
+	_seqCodeIp = nullptr;
 	_sequenceId = 0;
 	_seqCodeValue1 = 0;
 	_seqCodeValue2 = 600;
@@ -98,7 +98,7 @@ Actor::Actor(IllusionsEngine *vm)
 
 	_notifyId3C = 0;
 
-	_controlRoutine = 0;
+	_controlRoutine = nullptr;
 	setControlRoutine(new Common::Functor2Mem<Control*, uint32, void, Controls>(_vm->_controls, &Controls::actorControlRoutine));
 
 	_walkCallerThreadId1 = 0;
@@ -112,7 +112,7 @@ Actor::Actor(IllusionsEngine *vm)
 	_pathPoints = 0;
 	_pathPointIndex = 0;
 	_pathPointsCount = 0;
-	_pathNode = 0;
+	_pathNode = nullptr;
 
 }
 
@@ -149,7 +149,7 @@ void Actor::destroySurface() {
 	if (_surface) {
 		_surface->free();
 		delete _surface;
-		_surface = 0;
+		_surface = nullptr;
 	}
 }
 
@@ -201,7 +201,7 @@ Control::Control(IllusionsEngine *vm)
 	_position.x = 0;
 	_position.y = 0;
 	_actorTypeId = 0;
-	_actor = 0;
+	_actor = nullptr;
 	_sceneId = _vm->getCurrentScene();
 }
 
@@ -211,9 +211,9 @@ Control::~Control() {
 void Control::pause() {
 
 	if (_vm->getGameId() == kGameIdBBDOU || !(_flags & 4)) {
-		_vm->_dict->setObjectControl(_objectId, 0);
+		_vm->_dict->setObjectControl(_objectId, nullptr);
 		if (_objectId == Illusions::CURSOR_OBJECT_ID)
-			_vm->setCursorControl(0);
+			_vm->setCursorControl(nullptr);
 	}
 
 	if (_actor && !(_actor->_flags & Illusions::ACTOR_FLAG_200))
@@ -387,12 +387,12 @@ void Control::clearNotifyThreadId2() {
 		if (_actor->_subobjects[i]) {
 			Control *subControl = _vm->_dict->getObjectControl(_actor->_subobjects[i]);
 			subControl->_actor->_flags &= ~Illusions::ACTOR_FLAG_80;
-			subControl->_actor->_entryTblPtr = 0;
+			subControl->_actor->_entryTblPtr = nullptr;
 			subControl->_actor->_notifyThreadId2 = 0;
 		}
 	}
 	_actor->_flags &= ~Illusions::ACTOR_FLAG_80;
-	_actor->_entryTblPtr = 0;
+	_actor->_entryTblPtr = nullptr;
 	_actor->_notifyThreadId2 = 0;
 }
 
@@ -551,13 +551,13 @@ void Control::setActorFrameIndex(int16 frameIndex) {
 }
 
 void Control::stopActor() {
-	_actor->_seqCodeIp = 0;
+	_actor->_seqCodeIp = nullptr;
 	if (_actor->_pathNode) {
 		if (_actor->_flags & Illusions::ACTOR_FLAG_400) {
 			delete _actor->_pathNode;
 			_actor->_flags &= ~Illusions::ACTOR_FLAG_400;
 		}
-		_actor->_pathNode = 0;
+		_actor->_pathNode = nullptr;
 		_actor->_pathPoints = 0;
 		_actor->_pathPointsCount = 0;
 		_actor->_pathPointIndex = 0;
@@ -570,7 +570,7 @@ void Control::stopActor() {
 }
 
 void Control::startSequenceActor(uint32 sequenceId, int value, uint32 notifyThreadId) {
-	startSequenceActorIntern(sequenceId, value, 0, notifyThreadId);
+	startSequenceActorIntern(sequenceId, value, nullptr, notifyThreadId);
 }
 
 void Control::stopSequenceActor() {
@@ -654,7 +654,7 @@ void Control::sequenceActor() {
 
 	if (sequenceFinished) {
 		//debug(1, "Sequence has finished");
-		_actor->_seqCodeIp = 0;
+		_actor->_seqCodeIp = nullptr;
 	}
 }
 
@@ -705,7 +705,7 @@ void Control::stopSubSequence(int linkIndex) {
 		linkedActor->_seqCodeValue1 = _actor->_seqCodeValue1;
 		linkedActor->_seqCodeValue3 = _actor->_seqCodeValue3;
 		_actor->_flags &= ~Illusions::ACTOR_FLAG_80;
-		_actor->_entryTblPtr = 0;
+		_actor->_entryTblPtr = nullptr;
 		_actor->_notifyThreadId1 = 0;
 		_actor->_notifyThreadId2 = 0;
 	}
@@ -760,8 +760,8 @@ void Control::startMoveActor(uint32 sequenceId, Common::Point destPt, uint32 cal
 }
 
 PointArray *Control::createPath(Common::Point destPt) {
-	PointArray *walkPoints = (_actor->_flags & Illusions::ACTOR_FLAG_HAS_WALK_POINTS) ? _actor->_pathWalkPoints->_points : 0;
-	PathLines *walkRects = (_actor->_flags & Illusions::ACTOR_FLAG_HAS_WALK_RECTS) ? _actor->_pathWalkRects->_rects : 0;
+	PointArray *walkPoints = (_actor->_flags & Illusions::ACTOR_FLAG_HAS_WALK_POINTS) ? _actor->_pathWalkPoints->_points : nullptr;
+	PathLines *walkRects = (_actor->_flags & Illusions::ACTOR_FLAG_HAS_WALK_RECTS) ? _actor->_pathWalkRects->_rects : nullptr;
 	PathFinder pathFinder;
 	WidthHeight bgDimensions = _vm->_backgroundInstances->getMasterBgDimensions();
 	PointArray *path = pathFinder.findPath(_vm->_camera, _actor->_position, destPt, walkPoints, walkRects, bgDimensions);
@@ -780,7 +780,7 @@ void Control::updateActorMovement(uint32 deltaTime) {
 			fastWalked = true;
 			disappearActor();
 			_actor->_flags |= Illusions::ACTOR_FLAG_8000;
-			_actor->_seqCodeIp = 0;
+			_actor->_seqCodeIp = nullptr;
 			deltaTime = 2;
 		}
 
@@ -892,7 +892,7 @@ void Control::updateActorMovement(uint32 deltaTime) {
 					delete _actor->_pathNode;
 					_actor->_flags &= ~Illusions::ACTOR_FLAG_400;
 				}
-				_actor->_pathNode = 0;
+				_actor->_pathNode = nullptr;
 				_actor->_pathPoints = 0;
 				_actor->_pathPointsCount = 0;
 				_actor->_pathPointIndex = 0;
@@ -948,7 +948,7 @@ void Control::startSequenceActorIntern(uint32 sequenceId, int value, byte *entry
 	_actor->_notifyThreadId1 = notifyThreadId;
 	_actor->_notifyId3C = 0;
 	_actor->_walkCallerThreadId1 = 0;
-	_actor->_entryTblPtr = 0;
+	_actor->_entryTblPtr = nullptr;
 
 	Sequence *sequence = _vm->_dict->findSequence(sequenceId);
 
@@ -1113,7 +1113,7 @@ void Controls::placeSequenceLessActor(uint32 objectId, Common::Point placePt, Wi
 	control->_position.y = 0;
 	control->_actorTypeId = 0x50004;
 	control->_actor = actor;
-	actor->setControlRoutine(0);
+	actor->setControlRoutine(nullptr);
 	actor->_surfInfo._pixelSize = dimensions._width * dimensions._height;
 	actor->_surfInfo._dimensions = dimensions;
 	actor->createSurface(actor->_surfInfo);
@@ -1121,7 +1121,7 @@ void Controls::placeSequenceLessActor(uint32 objectId, Common::Point placePt, Wi
 	actor->_position2 = placePt;
 	actor->_facing = 64;
 	actor->_scale = 100;
-	actor->_namedPoints = 0;
+	actor->_namedPoints = nullptr;
 	actor->_pathCtrY = 140;
 
 	_controls.push_front(control);
@@ -1140,7 +1140,7 @@ void Controls::placeActorLessObject(uint32 objectId, Common::Point feetPt, Commo
 	control->_position.x = 0;
 	control->_position.y = 0;
 	control->_actorTypeId = 0;
-	control->_actor = 0;
+	control->_actor = nullptr;
 	_controls.push_front(control);
 	_vm->_dict->setObjectControl(objectId, control);
 }
@@ -1272,7 +1272,7 @@ void Controls::unpauseControlsBySceneId(uint32 sceneId) {
 }
 
 bool Controls::getOverlappedObject(Control *control, Common::Point pt, Control **outOverlappedControl, int minPriority) {
-	Control *foundControl = 0;
+	Control *foundControl = nullptr;
 	uint32 foundPriority = 0;
 	uint32 minPriorityExt = _vm->getPriorityFromBase(minPriority);
 
@@ -1302,11 +1302,11 @@ bool Controls::getOverlappedObject(Control *control, Common::Point pt, Control *
 		*outOverlappedControl = foundControl;
 	}
 
-	return foundControl != 0;
+	return foundControl != nullptr;
 }
 
 bool Controls::getOverlappedObjectAccurate(Control *control, Common::Point pt, Control **outOverlappedControl, int minPriority) {
-	Control *foundControl = 0;
+	Control *foundControl = nullptr;
 	uint32 foundPriority = 0;
 	uint32 minPriorityExt = _vm->getPriorityFromBase(minPriority);
 
@@ -1337,11 +1337,11 @@ bool Controls::getOverlappedObjectAccurate(Control *control, Common::Point pt, C
 		*outOverlappedControl = foundControl;
 	}
 
-	return foundControl != 0;
+	return foundControl != nullptr;
 }
 
 bool Controls::getDialogItemAtPos(Control *control, Common::Point pt, Control **outOverlappedControl) {
-	Control *foundControl = 0;
+	Control *foundControl = nullptr;
 	for (ItemsIterator it = _controls.begin(); it != _controls.end(); ++it) {
 		Control *testControl = *it;
 		if (testControl != control && testControl->_pauseCtr == 0 &&
@@ -1354,11 +1354,11 @@ bool Controls::getDialogItemAtPos(Control *control, Common::Point pt, Control **
 		}
 	}
 	*outOverlappedControl = foundControl;
-	return foundControl != 0;
+	return foundControl != nullptr;
 }
 
 bool Controls::getOverlappedWalkObject(Control *control, Common::Point pt, Control **outOverlappedControl) {
-	Control *foundControl = 0;
+	Control *foundControl = nullptr;
 	for (ItemsIterator it = _controls.begin(); it != _controls.end(); ++it) {
 		Control *testControl = *it;
 		if (testControl != control && testControl->_pauseCtr == 0 &&
@@ -1372,7 +1372,7 @@ bool Controls::getOverlappedWalkObject(Control *control, Common::Point pt, Contr
 	}
 	if (foundControl)
 		*outOverlappedControl = foundControl;
-	return foundControl != 0;
+	return foundControl != nullptr;
 }
 
 void Controls::destroyControl(Control *control) {
@@ -1468,10 +1468,10 @@ uint32 Controls::newTempObjectId() {
 void Controls::destroyControlInternal(Control *control) {
 
 	if ((_vm->getGameId() == kGameIdBBDOU || !(control->_flags & 4)) && control->_pauseCtr <= 0)
-		_vm->_dict->setObjectControl(control->_objectId, 0);
+		_vm->_dict->setObjectControl(control->_objectId, nullptr);
 
 	if ((_vm->getGameId() == kGameIdBBDOU || !(control->_flags & 4)) && control->_objectId == Illusions::CURSOR_OBJECT_ID && control->_pauseCtr <= 0)
-		_vm->setCursorControl(0);
+		_vm->setCursorControl(nullptr);
 
 	if (control->_actor) {
 		if (control->_actor->_pathNode && (control->_actor->_flags & Illusions::ACTOR_FLAG_400))
@@ -1479,7 +1479,7 @@ void Controls::destroyControlInternal(Control *control) {
 		if (!(control->_actor->_flags & Illusions::ACTOR_FLAG_200))
 			control->_actor->destroySurface();
 		delete control->_actor;
-		control->_actor = 0;
+		control->_actor = nullptr;
 	}
 
 	delete control;
diff --git a/engines/illusions/bbdou/bbdou_bubble.cpp b/engines/illusions/bbdou/bbdou_bubble.cpp
index a110a7aee4..a8fa063207 100644
--- a/engines/illusions/bbdou/bbdou_bubble.cpp
+++ b/engines/illusions/bbdou/bbdou_bubble.cpp
@@ -75,9 +75,9 @@ void BbdouBubble::init() {
 		_icons[i]._sequenceId = 0;
 	}
 
-	_currBubbleStyle = 0;
-	_showingBubbleStyle = 0;
-	_hidingBubbleStyle = 0;
+	_currBubbleStyle = nullptr;
+	_showingBubbleStyle = nullptr;
+	_hidingBubbleStyle = nullptr;
 	_sourcePt.x = 0;
 	_sourcePt.y = 0;
 	_destPt.x = 0;
@@ -109,7 +109,7 @@ void BbdouBubble::show() {
 	}
 
 	_showingBubbleStyle = _currBubbleStyle;
-	_currBubbleStyle = 0;
+	_currBubbleStyle = nullptr;
 
 	calcBubbleTrail(_sourcePt, _destPt);
 
@@ -132,7 +132,7 @@ void BbdouBubble::show() {
 
 void BbdouBubble::hide() {
 	_hidingBubbleStyle = _showingBubbleStyle;
-	_showingBubbleStyle = 0;
+	_showingBubbleStyle = nullptr;
 	if (_hidingBubbleStyle) {
 		Control *bubbleControl = _vm->_dict->getObjectControl(_hidingBubbleStyle->_objectId);
 		bubbleControl->startSequenceActor(_hidingBubbleStyle->_hideSequenceId, 2, 0);
diff --git a/engines/illusions/bbdou/bbdou_inventory.cpp b/engines/illusions/bbdou/bbdou_inventory.cpp
index b491c7701c..c9e2c7b1a0 100644
--- a/engines/illusions/bbdou/bbdou_inventory.cpp
+++ b/engines/illusions/bbdou/bbdou_inventory.cpp
@@ -43,7 +43,7 @@ InventoryItem::InventoryItem(uint32 objectId, uint32 sequenceId)
 // InventorySlot
 
 InventorySlot::InventorySlot(uint32 namedPointId)
-	: _namedPointId(namedPointId), _objectId(0), _inventoryItem(0) {
+	: _namedPointId(namedPointId), _objectId(0), _inventoryItem(nullptr) {
 }
 
 // InventoryBag
@@ -76,7 +76,7 @@ bool InventoryBag::addInventoryItem(InventoryItem *inventoryItem, InventorySlot
 void InventoryBag::removeInventoryItem(InventoryItem *inventoryItem) {
 	for (InventorySlotsIterator it = _inventorySlots.begin(); it != _inventorySlots.end(); ++it) {
 		if ((*it)->_inventoryItem && (*it)->_inventoryItem->_objectId == inventoryItem->_objectId)
-			(*it)->_inventoryItem = 0;
+			(*it)->_inventoryItem = nullptr;
 	}
 }
 
@@ -99,7 +99,7 @@ void InventoryBag::buildItems() {
 		if (inventoryItem) {
 			++inventoryItem->_timesPresent;
 			if (!inventoryItem->_assigned || inventoryItem->_flag || inventoryItem->_timesPresent > 1)
-				inventorySlot->_inventoryItem = 0;
+				inventorySlot->_inventoryItem = nullptr;
 		}
 	}
 }
@@ -108,7 +108,7 @@ void InventoryBag::clear() {
 	for (InventorySlotsIterator it = _inventorySlots.begin();
 		it != _inventorySlots.end(); ++it) {
 		InventorySlot *inventorySlot = *it;
-		inventorySlot->_inventoryItem = 0;
+		inventorySlot->_inventoryItem = nullptr;
 	}
 }
 
@@ -117,12 +117,12 @@ InventorySlot *InventoryBag::getInventorySlot(uint32 objectId) {
 		if (_inventorySlots[i]->_objectId == objectId)
 			return _inventorySlots[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 InventorySlot *InventoryBag::findClosestSlot(Common::Point putPos, int index) {
 	uint minDistance = 0xFFFFFFFF;
-	InventorySlot *minDistanceSlot = 0;
+	InventorySlot *minDistanceSlot = nullptr;
 	for (InventorySlotsIterator it = _inventorySlots.begin(); it != _inventorySlots.end(); ++it) {
 		InventorySlot *inventorySlot = *it;
 		Common::Point slotPos = _vm->getNamedPointPosition(inventorySlot->_namedPointId);
@@ -163,7 +163,7 @@ void BbdouInventory::addInventoryItem(uint32 objectId) {
 	inventoryItem->_assigned = true;
 	if (!assigned && !inventoryItem->_flag) {
 		for (uint i = 0; i < _inventoryBags.size(); ++i) {
-			if (!_inventoryBags[i]->addInventoryItem(inventoryItem, 0))
+			if (!_inventoryBags[i]->addInventoryItem(inventoryItem, nullptr))
 				inventoryItem->_assigned = false;
 		}
 	}
@@ -243,7 +243,7 @@ InventoryBag *BbdouInventory::getInventoryBag(uint32 sceneId) {
 		if (_inventoryBags[i]->_sceneId == sceneId)
 			return _inventoryBags[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 InventoryItem *BbdouInventory::getInventoryItem(uint32 objectId) {
@@ -251,7 +251,7 @@ InventoryItem *BbdouInventory::getInventoryItem(uint32 objectId) {
 		if (_inventoryItems[i]->_objectId == objectId)
 			return _inventoryItems[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 void BbdouInventory::refresh() {
@@ -282,7 +282,7 @@ void BbdouInventory::buildItems(InventoryBag *inventoryBag) {
 		if (inventoryItem->_assigned && !inventoryItem->_flag &&
 			inventoryItem->_timesPresent == 0 &&
 			inventoryItem->_objectId != _bbdou->_cursor->_data._holdingObjectId)
-			inventoryBag->addInventoryItem(inventoryItem, 0);
+			inventoryBag->addInventoryItem(inventoryItem, nullptr);
 	}
 }
 
@@ -376,7 +376,7 @@ void BbdouInventory::putBackInventoryItem(uint32 objectId, Common::Point cursorP
 			inventoryBag->addInventoryItem(inventoryItem, inventorySlot);
 		} else {
 			if (!inventoryBag->hasInventoryItem(objectId))
-				inventoryBag->addInventoryItem(inventoryItem, 0);
+				inventoryBag->addInventoryItem(inventoryItem, nullptr);
 		}
 	}
 	refresh();
diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp
index 9519d13a2c..e7f94a6f14 100644
--- a/engines/illusions/bbdou/bbdou_specialcode.cpp
+++ b/engines/illusions/bbdou/bbdou_specialcode.cpp
@@ -115,7 +115,7 @@ ObjectInteractModeMap::ObjectInteractModeMap() {
 }
 
 void ObjectInteractModeMap::setObjectInteractMode(uint32 objectId, int value) {
-	ObjectInteractMode *objectInteractMode = 0;
+	ObjectInteractMode *objectInteractMode = nullptr;
 	for (uint i = 0; i < ARRAYSIZE(_objectVerbs); ++i) {
 		if (_objectVerbs[i]._objectId == objectId) {
 			objectInteractMode = &_objectVerbs[i];
@@ -150,7 +150,7 @@ int ObjectInteractModeMap::getObjectInteractMode(uint32 objectId) {
 // BbdouSpecialCode
 
 BbdouSpecialCode::BbdouSpecialCode(IllusionsEngine_BBDOU *vm)
-	: _vm(vm), _credits(0) {
+	: _vm(vm), _credits(nullptr) {
 	_bubble = new BbdouBubble(_vm, this);
 	_cursor = new BbdouCursor(_vm, this);
 	_inventory = new BbdouInventory(_vm, this);
@@ -650,7 +650,7 @@ void BbdouSpecialCode::cursorInteractControlRoutine(Control *cursorControl, uint
 
 		cursorPos = getBackgroundCursorPos(cursorPos);
 		bool foundOverlapped = false;
-		Control *overlappedControl = 0;
+		Control *overlappedControl = nullptr;
 
 		if (cursorData._flags & 1) {
 			foundOverlapped = false;
@@ -816,7 +816,7 @@ void BbdouSpecialCode::cursorCrosshairControlRoutine(Control *cursorControl, uin
 			if (control2 && control2->_actor) {
 				if (_shooterStatus[i].gridX != gridX && (!_shooterStatus[i].flag || !control2->_actor->_seqCodeIp)) {
 					_shooterStatus[i].gridX = gridX;
-					control2->_actor->_seqCodeIp = 0;
+					control2->_actor->_seqCodeIp = nullptr;
 					control2->startSequenceActor(anim.sequenceIds1[gridX], 2, 0);
 				}
 			}
@@ -826,7 +826,7 @@ void BbdouSpecialCode::cursorCrosshairControlRoutine(Control *cursorControl, uin
 
 	Common::Point cursorPos = getBackgroundCursorPos(screenCursorPos);
 	bool foundOverlapped = false;
-	Control *overlappedControl = 0;
+	Control *overlappedControl = nullptr;
 
 	if (cursorData._flags & 1)
 		foundOverlapped = false;
diff --git a/engines/illusions/bbdou/bbdou_triggerfunctions.cpp b/engines/illusions/bbdou/bbdou_triggerfunctions.cpp
index 6025d44de7..e602d1eb88 100644
--- a/engines/illusions/bbdou/bbdou_triggerfunctions.cpp
+++ b/engines/illusions/bbdou/bbdou_triggerfunctions.cpp
@@ -54,7 +54,7 @@ TriggerFunction *TriggerFunctions::find(uint32 sceneId, uint32 verbId, uint32 ob
 	ItemsIterator it = findInternal(sceneId, verbId, objectId2, objectId);
 	if (it != _triggerFunctions.end())
 		return (*it);
-	return 0;
+	return nullptr;
 }
 
 void TriggerFunctions::removeBySceneId(uint32 sceneId) {
diff --git a/engines/illusions/bbdou/bbdou_videoplayer.cpp b/engines/illusions/bbdou/bbdou_videoplayer.cpp
index f61f0d3366..fa430eacc9 100644
--- a/engines/illusions/bbdou/bbdou_videoplayer.cpp
+++ b/engines/illusions/bbdou/bbdou_videoplayer.cpp
@@ -33,7 +33,7 @@ namespace Illusions {
 // BBDOUVideoPlayer
 
 BBDOUVideoPlayer::BBDOUVideoPlayer(IllusionsEngine_BBDOU *vm)
-	: _vm(vm), _videoDecoder(0), _callingThreadId(0), _objectId(0) {
+	: _vm(vm), _videoDecoder(nullptr), _callingThreadId(0), _objectId(0) {
 }
 
 BBDOUVideoPlayer::~BBDOUVideoPlayer() {
@@ -52,7 +52,7 @@ void BBDOUVideoPlayer::start(uint32 videoId, uint32 objectId, uint32 priority, u
 	_videoDecoder = new Video::AVIDecoder();
 	if (!_videoDecoder->loadFile(filename)) {
 		delete _videoDecoder;
-		_videoDecoder = 0;
+		_videoDecoder = nullptr;
 		warning("Unable to open video %s", filename.c_str());
 		notifyCallingThread();
 		return;
@@ -63,7 +63,7 @@ void BBDOUVideoPlayer::start(uint32 videoId, uint32 objectId, uint32 priority, u
 void BBDOUVideoPlayer::stop() {
 	_vm->_input->discardAllEvents();
 	delete _videoDecoder;
-	_videoDecoder = 0;
+	_videoDecoder = nullptr;
 	notifyCallingThread();
 	_objectId = 0;
 }
@@ -96,7 +96,7 @@ void BBDOUVideoPlayer::update() {
 }
 
 bool BBDOUVideoPlayer::isPlaying() const {
-	return _videoDecoder != 0;
+	return _videoDecoder != nullptr;
 }
 
 void BBDOUVideoPlayer::notifyCallingThread() {
diff --git a/engines/illusions/bbdou/illusions_bbdou.cpp b/engines/illusions/bbdou/illusions_bbdou.cpp
index d32fcf6a61..0d3cc031c6 100644
--- a/engines/illusions/bbdou/illusions_bbdou.cpp
+++ b/engines/illusions/bbdou/illusions_bbdou.cpp
@@ -181,7 +181,7 @@ Common::Error IllusionsEngine_BBDOU::run() {
 
 	initUpdateFunctions();
 
-	_fader = 0;
+	_fader = nullptr;
 
 	_scriptOpcodes = new ScriptOpcodes_BBDOU(this);
 	_stack = new ScriptStack();
@@ -367,7 +367,7 @@ void IllusionsEngine_BBDOU::loadSpecialCode(uint32 resId) {
 
 void IllusionsEngine_BBDOU::unloadSpecialCode(uint32 resId) {
 	delete _specialCode;
-	_specialCode = 0;
+	_specialCode = nullptr;
 }
 
 void IllusionsEngine_BBDOU::notifyThreadId(uint32 &threadId) {
@@ -574,7 +574,7 @@ bool IllusionsEngine_BBDOU::enterScene(uint32 sceneId, uint32 threadId) {
 		// After that the game is ready and a savegame can finally be loaded.
 		_canResumeFromSavegame = true;
 	}
-	return sceneInfo != 0;
+	return sceneInfo != nullptr;
 }
 
 void IllusionsEngine_BBDOU::exitScene(uint32 threadId) {
@@ -611,7 +611,7 @@ void IllusionsEngine_BBDOU::dumpActiveScenes(uint32 sceneId, uint32 threadId) {
 	uint activeScenesCount = _activeScenes.getActiveScenesCount();
 	while (activeScenesCount > 0) {
 		uint32 activeSceneId;
-		_activeScenes.getActiveSceneInfo(activeScenesCount, &activeSceneId, 0);
+		_activeScenes.getActiveSceneInfo(activeScenesCount, &activeSceneId, nullptr);
 		if (activeSceneId == sceneId)
 			break;
 		exitScene(threadId);
diff --git a/engines/illusions/bbdou/menusystem_bbdou.cpp b/engines/illusions/bbdou/menusystem_bbdou.cpp
index 5836646b23..106f68268f 100644
--- a/engines/illusions/bbdou/menusystem_bbdou.cpp
+++ b/engines/illusions/bbdou/menusystem_bbdou.cpp
@@ -56,7 +56,7 @@ void BBDOUMenuSystem::runMenu(MenuChoiceOffsets menuChoiceOffsets, int16 *menuCh
 
 void BBDOUMenuSystem::clearMenus() {
 	for (int i = 0; i < kBBDOULastMenuIndex; ++i) {
-		_menus[i] = 0;
+		_menus[i] = nullptr;
 	}
 }
 
@@ -85,15 +85,15 @@ BaseMenu *BBDOUMenuSystem::createMenuById(int menuId) {
 }
 
 BaseMenu *BBDOUMenuSystem::createMainMenu() {
-	return 0; // TODO
+	return nullptr; // TODO
 }
 
 BaseMenu *BBDOUMenuSystem::createLoadGameMenu() {
-	return 0; // TODO
+	return nullptr; // TODO
 }
 
 BaseMenu *BBDOUMenuSystem::createOptionsMenu() {
-	return 0; // TODO
+	return nullptr; // TODO
 }
 
 BaseMenu *BBDOUMenuSystem::createPauseMenu() {
diff --git a/engines/illusions/bbdou/scriptopcodes_bbdou.cpp b/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
index e1ac701514..f289858ac1 100644
--- a/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
+++ b/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
@@ -58,7 +58,7 @@ typedef Common::Functor2Mem<ScriptThread*, OpCall&, void, ScriptOpcodes_BBDOU> S
 void ScriptOpcodes_BBDOU::initOpcodes() {
 	// First clear everything
 	for (uint i = 0; i < 256; ++i) {
-		_opcodes[i] = 0;
+		_opcodes[i] = nullptr;
 	}
 	// Register opcodes
 	OPCODE(2, opSuspend);
@@ -282,7 +282,7 @@ void ScriptOpcodes_BBDOU::opEnterScene(ScriptThread *scriptThread, OpCall &opCal
 	uint scenesCount = _vm->_activeScenes.getActiveScenesCount();
 	if (scenesCount > 0) {
 		uint32 currSceneId;
-		_vm->_activeScenes.getActiveSceneInfo(scenesCount, &currSceneId, 0);
+		_vm->_activeScenes.getActiveSceneInfo(scenesCount, &currSceneId, nullptr);
 		// TODO krnfileDump(currSceneId);
 	}
 	if (!_vm->enterScene(sceneId, opCall._callerThreadId))
diff --git a/engines/illusions/camera.cpp b/engines/illusions/camera.cpp
index aa372be8c1..6d9aa7cc48 100644
--- a/engines/illusions/camera.cpp
+++ b/engines/illusions/camera.cpp
@@ -46,7 +46,7 @@ Camera::Camera(IllusionsEngine *vm)
 	_activeState._panYShl = _screenMidY << 16;
 	_activeState._panTargetPoint.x = _screenMidX;
 	_activeState._panTargetPoint.y = 240;
-	_activeState._panToPositionPtr = 0;
+	_activeState._panToPositionPtr = nullptr;
 	_activeState._panNotifyId = 0;
 	_activeState._trackingLimits.x = 0;
 	_activeState._trackingLimits.y = 0;
@@ -74,7 +74,7 @@ void Camera::set(Common::Point &panPoint, WidthHeight &dimensions) {
 	_activeState._panXShl = _activeState._currPan.x << 16;
 	_activeState._panYShl = _activeState._currPan.y << 16;
 	_vm->_backgroundInstances->refreshPan();
-	_activeState._panToPositionPtr = 0;
+	_activeState._panToPositionPtr = nullptr;
 	_activeState._panObjectId = 0;
 	_activeState._panNotifyId = 0;
 	_activeState._trackingLimits.x = 0;
@@ -139,7 +139,7 @@ void Camera::panToPoint(Common::Point pt, int16 panSpeed, uint32 panNotifyId) {
 		_activeState._trackingLimits.x = 0;
 		_activeState._trackingLimits.y = 0;
 		_activeState._pointFlags = 0;
-		_activeState._panToPositionPtr = 0;
+		_activeState._panToPositionPtr = nullptr;
 		_activeState._panNotifyId = panNotifyId;
 		_activeState._panStartTime = getCurrentTime();
 		recalcPan(_activeState._panStartTime);
@@ -172,7 +172,7 @@ void Camera::stopPan() {
 	_activeState._panSpeed = 1;
 	_activeState._panXShl = _activeState._currPan.x << 16;
 	_activeState._panYShl = _activeState._currPan.y << 16;
-	_activeState._panToPositionPtr = 0;
+	_activeState._panToPositionPtr = nullptr;
 	_activeState._panObjectId = 0;
 	_activeState._panNotifyId = 0;
 	_activeState._pointFlags = 0;
diff --git a/engines/illusions/cursor.cpp b/engines/illusions/cursor.cpp
index 0ae21beae9..f52f309117 100644
--- a/engines/illusions/cursor.cpp
+++ b/engines/illusions/cursor.cpp
@@ -30,7 +30,7 @@ namespace Illusions {
 Cursor::Cursor(IllusionsEngine *vm)
 	: _vm(vm) {
 	_status = 1;
-	_control = 0;
+	_control = nullptr;
 	_x = 320;
 	_y = 240;
 	_cursorNum = 1;
diff --git a/engines/illusions/detection.cpp b/engines/illusions/detection.cpp
index 67d74e4389..ce1ca055eb 100644
--- a/engines/illusions/detection.cpp
+++ b/engines/illusions/detection.cpp
@@ -29,7 +29,7 @@
 static const PlainGameDescriptor illusionsGames[] = {
 	{ "bbdou", "Beavis and Butt-head Do U" },
 	{ "duckman", "Duckman" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 namespace Illusions {
@@ -38,7 +38,7 @@ static const IllusionsGameDescription gameDescriptions[] = {
 	{
 		{
 			"bbdou",
-			0,
+			nullptr,
 			AD_ENTRY1s("000D0001.scr", "d0c846d5dccc5607a482c7dcbdf06973", 601980),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -51,7 +51,7 @@ static const IllusionsGameDescription gameDescriptions[] = {
 	{
 		{
 			"duckman",
-			0,
+			nullptr,
 			AD_ENTRY1s("duckman.gam", "172c0514f3793041718159cf9cf9935f", 29560832),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -77,7 +77,7 @@ static const IllusionsGameDescription gameDescriptions[] = {
 	{
 		{
 			"duckman",
-			0,
+			nullptr,
 			AD_ENTRY1s("duckman.gam", "64d16922ffb46b746fc2c12a14d75bcc", 29779968),
 			Common::DE_DEU,
 			Common::kPlatformWindows,
@@ -90,7 +90,7 @@ static const IllusionsGameDescription gameDescriptions[] = {
 	{
 		{
 			"duckman",
-			0,
+			nullptr,
 			AD_ENTRY1s("duckman.gam", "a65f9b58427b3543882bddf36abe5878", 29564928),
 			Common::RU_RUS,
 			Common::kPlatformWindows,
@@ -107,7 +107,7 @@ static const IllusionsGameDescription gameDescriptions[] = {
 
 static const char * const directoryGlobs[] = {
 	"resource",
-	0
+	nullptr
 };
 
 class IllusionsMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/illusions/duckman/duckman_dialog.cpp b/engines/illusions/duckman/duckman_dialog.cpp
index 60da222ad9..31a9f8191f 100644
--- a/engines/illusions/duckman/duckman_dialog.cpp
+++ b/engines/illusions/duckman/duckman_dialog.cpp
@@ -96,7 +96,7 @@ void DuckmanDialogSystem::startDialog(int16 *choiceOfsPtr, uint32 actorTypeId, u
 		_vm->_cursor._dialogItemsCount = 0;
 		_vm->_cursor._overlappedObjectId = 0;
 		_vm->_cursor._op113_choiceOfsPtr = choiceOfsPtr;
-		_vm->_cursor._currOverlappedControl = 0;
+		_vm->_cursor._currOverlappedControl = nullptr;
 
 		/* TODO?
 		if (!_vm->_input->getCursorMouseMode())
@@ -150,7 +150,7 @@ void DuckmanDialogSystem::updateDialogState() {
 		currOverlappedControl->setActorIndex(1);
 		currOverlappedControl->startSequenceActor(currOverlappedControl->_actor->_sequenceId, 2, 0);
 		_vm->playSoundEffect(10);
-		_vm->_cursor._currOverlappedControl = 0;
+		_vm->_cursor._currOverlappedControl = nullptr;
 		_vm->_cursor._overlappedObjectId = 0;
 		_vm->startCursorSequence();
 		_vm->setCursorActorIndex(6, 1, 0);
@@ -168,7 +168,7 @@ void DuckmanDialogSystem::updateDialogState() {
 			_vm->_cursor._gameState = 2;
 			_vm->_cursor._dialogItemsCount = 0;
 			_vm->_cursor._overlappedObjectId = 0;
-			_vm->_cursor._op113_choiceOfsPtr = 0;
+			_vm->_cursor._op113_choiceOfsPtr = nullptr;
 			_vm->_cursor._control->disappearActor();
 		}
 	}
diff --git a/engines/illusions/duckman/duckman_inventory.cpp b/engines/illusions/duckman/duckman_inventory.cpp
index e1ab1ffbd7..6efa5063ed 100644
--- a/engines/illusions/duckman/duckman_inventory.cpp
+++ b/engines/illusions/duckman/duckman_inventory.cpp
@@ -145,7 +145,7 @@ DMInventorySlot *DuckmanInventory::findInventorySlot(uint32 objectId) {
 		if (_inventorySlots[i]._objectId == objectId)
 			return &_inventorySlots[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 DMInventoryItem *DuckmanInventory::findInventoryItem(uint32 objectId) {
@@ -153,12 +153,12 @@ DMInventoryItem *DuckmanInventory::findInventoryItem(uint32 objectId) {
 		if (_inventoryItems[i]._objectId == objectId)
 			return &_inventoryItems[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 DMInventorySlot *DuckmanInventory::findClosestInventorySlot(Common::Point pos) {
 	int minDistance = 0xFFFFFF;
-	DMInventorySlot *minInventorySlot = 0;
+	DMInventorySlot *minInventorySlot = nullptr;
 	for (uint i = 0; i < _inventorySlots.size(); ++i) {
 		DMInventorySlot *inventorySlot = &_inventorySlots[i];
 		if (inventorySlot->_objectId == 0) {
diff --git a/engines/illusions/duckman/duckman_videoplayer.cpp b/engines/illusions/duckman/duckman_videoplayer.cpp
index 42defee2a5..56e24c9c1a 100644
--- a/engines/illusions/duckman/duckman_videoplayer.cpp
+++ b/engines/illusions/duckman/duckman_videoplayer.cpp
@@ -31,7 +31,7 @@ namespace Illusions {
 // DuckmanVideoPlayer
 
 DuckmanVideoPlayer::DuckmanVideoPlayer(IllusionsEngine_Duckman *vm)
-	: _vm(vm), _videoDecoder(0) {
+	: _vm(vm), _videoDecoder(nullptr) {
 }
 
 DuckmanVideoPlayer::~DuckmanVideoPlayer() {
@@ -46,7 +46,7 @@ void DuckmanVideoPlayer::start(uint32 videoId, uint32 callingThreadId) {
 	_videoDecoder = new Video::AVIDecoder();
 	if (!_videoDecoder->loadFile(filename)) {
 		delete _videoDecoder;
-		_videoDecoder = 0;
+		_videoDecoder = nullptr;
 		warning("Unable to open video %s", filename.c_str());
 		return;
 	}
@@ -56,7 +56,7 @@ void DuckmanVideoPlayer::start(uint32 videoId, uint32 callingThreadId) {
 void DuckmanVideoPlayer::stop() {
 	_vm->_input->discardAllEvents();
 	delete _videoDecoder;
-	_videoDecoder = 0;
+	_videoDecoder = nullptr;
 	if (_callingThreadId != 0) {
 		_vm->notifyThreadId(_callingThreadId);
 		_callingThreadId = 0;
@@ -94,7 +94,7 @@ void DuckmanVideoPlayer::update() {
 }
 
 bool DuckmanVideoPlayer::isPlaying() const {
-	return _videoDecoder != 0;
+	return _videoDecoder != nullptr;
 }
 
 } // End of namespace Illusions
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index ca00241402..f476f29f45 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -138,7 +138,7 @@ Common::Error IllusionsEngine_Duckman::run() {
 	_unpauseControlActorFlag = false;
 	_lastUpdateTime = 0;
 
-	_currWalkOverlappedControl = 0;
+	_currWalkOverlappedControl = nullptr;
 
 	_pauseCtr = 0;
 	_doScriptThreadInit = false;
@@ -352,7 +352,7 @@ int IllusionsEngine_Duckman::updateScreenShaker(uint flags) {
 	if (_screenShaker->_finished) {
 		notifyThreadId(_screenShaker->_notifyThreadId);
 		delete _screenShaker;
-		_screenShaker = 0;
+		_screenShaker = nullptr;
 		_screen->setScreenOffset(Common::Point(0, 0));
 		return 2;
 	}
@@ -472,7 +472,7 @@ bool IllusionsEngine_Duckman::testMainActorCollision(Control *control) {
 			if (runTriggerCause(9, 0, overlappedControl->_objectId)) {
 				delete control->_actor->_pathNode;
 				control->_actor->_flags &= ~Illusions::ACTOR_FLAG_400;
-				control->_actor->_pathNode = 0;
+				control->_actor->_pathNode = nullptr;
 				control->_actor->_pathPoints = 0;
 				control->_actor->_pathPointsCount = 0;
 				_threads->terminateThreadChain(control->_actor->_walkCallerThreadId1);
@@ -484,7 +484,7 @@ bool IllusionsEngine_Duckman::testMainActorCollision(Control *control) {
 			}
 		}
 	} else {
-		_currWalkOverlappedControl = 0;
+		_currWalkOverlappedControl = nullptr;
 	}
 	return result;
 }
@@ -598,7 +598,7 @@ void IllusionsEngine_Duckman::placeCursorControl(Control *control, uint32 sequen
 	_cursor._control = control;
 	_cursor._actorIndex = 1;
 	_cursor._savedActorIndex = 1;
-	_cursor._currOverlappedControl = 0;
+	_cursor._currOverlappedControl = nullptr;
 	_cursor._sequenceId1 = sequenceId;
 	_cursor._field14[0] = true;
 	_cursor._field14[1] = true;
@@ -613,7 +613,7 @@ void IllusionsEngine_Duckman::placeCursorControl(Control *control, uint32 sequen
 	_cursor._field14[6] = _cursor._sequenceId2 != 0 && _cursor._objectId != 0;
 	_cursor._field14[7] = false;
 	_cursor._field14[8] = false;
-	_cursor._op113_choiceOfsPtr = 0;
+	_cursor._op113_choiceOfsPtr = nullptr;
 	_cursor._notifyThreadId30 = 0;
 	_cursor._dialogItemsCount = 0;
 	_cursor._overlappedObjectId = 0;
@@ -640,13 +640,13 @@ void IllusionsEngine_Duckman::hideCursor() {
 
 void IllusionsEngine_Duckman::initCursor() {
 	_cursor._gameState = 1;
-	_cursor._control = 0;
+	_cursor._control = nullptr;
 	_cursor._position.x = 160;
 	_cursor._position.y = 100;
 	_cursor._objectId = 0;
 	_cursor._actorIndex = 1;
 	_cursor._savedActorIndex = 1;
-	_cursor._currOverlappedControl = 0;
+	_cursor._currOverlappedControl = nullptr;
 	_cursor._sequenceId1 = 0;
 	_cursor._sequenceId2 = 0;
 	_cursor._field14[0] = true;
@@ -662,7 +662,7 @@ void IllusionsEngine_Duckman::initCursor() {
 	_cursor._field14[10] = false;
 	_cursor._field14[11] = false;
 	_cursor._field14[12] = false;
-	_cursor._op113_choiceOfsPtr = 0;
+	_cursor._op113_choiceOfsPtr = nullptr;
 	_cursor._notifyThreadId30 = 0;
 	_cursor._dialogItemsCount = 0;
 	_cursor._overlappedObjectId = 0;
@@ -699,7 +699,7 @@ void IllusionsEngine_Duckman::disableCursorVerb(int verbNum) {
 		_cursor._actorIndex = getCursorActorIndex();
 		setCursorActorIndex(_cursor._actorIndex, 1, 0);
 		startCursorSequence();
-		_cursor._currOverlappedControl = 0;
+		_cursor._currOverlappedControl = nullptr;
 	}
 }
 
@@ -765,7 +765,7 @@ void IllusionsEngine_Duckman::startCursorHoldingObject(uint32 objectId, uint32 s
 	_cursor._field14[6] = true;
 	_cursor._control->startSequenceActor(sequenceId, 2, 0);
 	setCursorActorIndex(_cursor._actorIndex, 1, 0);
-	_cursor._currOverlappedControl = 0;
+	_cursor._currOverlappedControl = nullptr;
 }
 
 void IllusionsEngine_Duckman::stopCursorHoldingObject() {
@@ -1075,7 +1075,7 @@ void IllusionsEngine_Duckman::updateGameState2() {
 			setCursorActorIndex(_cursor._actorIndex, 1, 0);
 			startCursorSequence();
 		}
-		_cursor._currOverlappedControl = 0;
+		_cursor._currOverlappedControl = nullptr;
 		foundOverlapped = false;
 	}
 
@@ -1101,7 +1101,7 @@ void IllusionsEngine_Duckman::updateGameState2() {
 			_cursor._actorIndex = _cursor._savedActorIndex;
 		setCursorActorIndex(_cursor._actorIndex, 1, 0);
 		startCursorSequence();
-		_cursor._currOverlappedControl = 0;
+		_cursor._currOverlappedControl = nullptr;
 	}
 
 	if (_input->pollEvent(kEventLeftClick)) {
diff --git a/engines/illusions/duckman/menusystem_duckman.cpp b/engines/illusions/duckman/menusystem_duckman.cpp
index a219b23b0d..9b8731f149 100644
--- a/engines/illusions/duckman/menusystem_duckman.cpp
+++ b/engines/illusions/duckman/menusystem_duckman.cpp
@@ -57,7 +57,7 @@ void DuckmanMenuSystem::runMenu(MenuChoiceOffsets menuChoiceOffsets, int16 *menu
 
 void DuckmanMenuSystem::clearMenus() {
 	for (int i = 0; i < kDuckmanLastMenuIndex; ++i) {
-		_menus[i] = 0;
+		_menus[i] = nullptr;
 	}
 }
 
@@ -135,7 +135,7 @@ BaseMenu *DuckmanMenuSystem::createMainMenuDemo() {
 }
 
 BaseMenu *DuckmanMenuSystem::createLoadGameMenu() {
-	return 0; // TODO
+	return nullptr; // TODO
 }
 
 BaseMenu *DuckmanMenuSystem::createLoadGameFailedMenu() {
@@ -405,7 +405,7 @@ void MenuActionInventoryAddRemove::execute() {
 
 MenuActionUpdateSlider::MenuActionUpdateSlider(BaseMenuSystem *menuSystem, BaseMenu *baseMenu, SliderActionType type, IllusionsEngine_Duckman *vm)
 			: BaseMenuAction(menuSystem), menu(baseMenu), _type(type), _vm(vm) {
-	_menuItem = NULL;
+	_menuItem = nullptr;
 }
 
 void MenuActionUpdateSlider::execute() {
diff --git a/engines/illusions/duckman/scriptopcodes_duckman.cpp b/engines/illusions/duckman/scriptopcodes_duckman.cpp
index dc3415b57f..a2dd492aff 100644
--- a/engines/illusions/duckman/scriptopcodes_duckman.cpp
+++ b/engines/illusions/duckman/scriptopcodes_duckman.cpp
@@ -58,7 +58,7 @@ typedef Common::Functor2Mem<ScriptThread*, OpCall&, void, ScriptOpcodes_Duckman>
 void ScriptOpcodes_Duckman::initOpcodes() {
 	// First clear everything
 	for (uint i = 0; i < 256; ++i) {
-		_opcodes[i] = 0;
+		_opcodes[i] = nullptr;
 	}
 	// Register opcodes
 	OPCODE(1, opNop);
diff --git a/engines/illusions/gamarchive.cpp b/engines/illusions/gamarchive.cpp
index 0061cce24c..a64f489a28 100644
--- a/engines/illusions/gamarchive.cpp
+++ b/engines/illusions/gamarchive.cpp
@@ -25,7 +25,7 @@
 namespace Illusions {
 
 GamArchive::GamArchive(const char *filename)
-	: _fd(0), _groupCount(0), _groups(0) {
+	: _fd(nullptr), _groupCount(0), _groups(nullptr) {
 	_fd = new Common::File();
 	if (!_fd->open(filename))
 		error("GamArchive::GamArchive() Could not open %s", filename);
@@ -80,7 +80,7 @@ const GamGroupEntry *GamArchive::getGroupEntry(uint32 sceneId) {
 		if (_groups[i]._id == sceneId)
 			return &_groups[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 const GamFileEntry *GamArchive::getFileEntry(const GamGroupEntry *groupEntry, uint32 resId) {
@@ -88,7 +88,7 @@ const GamFileEntry *GamArchive::getFileEntry(const GamGroupEntry *groupEntry, ui
 		if (groupEntry->_files[i]._id == resId)
 			return &groupEntry->_files[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 const GamFileEntry *GamArchive::getGroupFileEntry(uint32 sceneId, uint32 resId) {
diff --git a/engines/illusions/gamestate.cpp b/engines/illusions/gamestate.cpp
index 1cafb770d9..332e29db09 100644
--- a/engines/illusions/gamestate.cpp
+++ b/engines/illusions/gamestate.cpp
@@ -25,7 +25,7 @@
 namespace Illusions {
 
 GameState::GameState()
-	: _writeBufferSize(0), _writeBuffer(0), _readStream(0) {
+	: _writeBufferSize(0), _writeBuffer(nullptr), _readStream(nullptr) {
 }
 
 GameState::~GameState() {
@@ -58,7 +58,7 @@ void GameState::write(Common::WriteStream *out) {
 
 void GameState::deleteReadStream() {
 	delete _readStream;
-	_readStream = 0;
+	_readStream = nullptr;
 }
 
 Common::WriteStream *GameState::newWriteStream() {
diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp
index 987d024a0b..ebd5e0ac8f 100644
--- a/engines/illusions/illusions.cpp
+++ b/engines/illusions/illusions.cpp
@@ -128,7 +128,7 @@ Common::Point *IllusionsEngine::getObjectActorPositionPtr(uint32 objectId) {
 	Control *control = getObjectControl(objectId);
 	if (control && control->_actor)
 		return &control->_actor->_position;
-	return 0;
+	return nullptr;
 }
 
 uint32 IllusionsEngine::getElapsedUpdateTime() {
diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp
index e4d230a167..b839668183 100644
--- a/engines/illusions/menusystem.cpp
+++ b/engines/illusions/menusystem.cpp
@@ -95,7 +95,7 @@ void BaseMenu::enterMenu() {
 // BaseMenuSystem
 
 BaseMenuSystem::BaseMenuSystem(IllusionsEngine *vm)
-	: _vm(vm), _isTimeOutEnabled(false), _menuChoiceOffset(0) {
+	: _vm(vm), _isTimeOutEnabled(false), _menuChoiceOffset(nullptr) {
 }
 
 BaseMenuSystem::~BaseMenuSystem() {
diff --git a/engines/illusions/pathfinder.cpp b/engines/illusions/pathfinder.cpp
index 777cb4d4bd..4697612eb2 100644
--- a/engines/illusions/pathfinder.cpp
+++ b/engines/illusions/pathfinder.cpp
@@ -96,7 +96,7 @@ void PathFinder::postProcess(Common::Point sourcePt, PointArray *foundPath) {
 
 bool PathFinder::isLineBlocked(PathLine &line) {
 	for (uint i = 0; i < _walkRects->size(); ++i) {
-		if (calcLineStatus(line, (*_walkRects)[i], 0) != 3)
+		if (calcLineStatus(line, (*_walkRects)[i], nullptr) != 3)
 			return true;
 	}
 	return false;
diff --git a/engines/illusions/resources/actorresource.cpp b/engines/illusions/resources/actorresource.cpp
index 04e6c9dc67..098be3e76b 100644
--- a/engines/illusions/resources/actorresource.cpp
+++ b/engines/illusions/resources/actorresource.cpp
@@ -292,7 +292,7 @@ FramesList *ActorInstanceList::findSequenceFrames(Sequence *sequence) {
 		if (actorInstance->_pauseCtr <= 0 && actorInstance->_actorResource->containsSequence(sequence))
 			return &actorInstance->_actorResource->_frames;
 	}
-	return 0;
+	return nullptr;
 }
 
 ActorInstance *ActorInstanceList::findActorByResource(ActorResource *actorResource) {
@@ -300,7 +300,7 @@ ActorInstance *ActorInstanceList::findActorByResource(ActorResource *actorResour
 		if ((*it)->_actorResource == actorResource)
 			return (*it);
 	}
-	return 0;
+	return nullptr;
 }
 
 bool ActorInstanceList::findNamedPoint(uint32 namedPointId, Common::Point &pt) {
diff --git a/engines/illusions/resources/backgroundresource.cpp b/engines/illusions/resources/backgroundresource.cpp
index 7212ccc6f4..a54f378117 100644
--- a/engines/illusions/resources/backgroundresource.cpp
+++ b/engines/illusions/resources/backgroundresource.cpp
@@ -204,9 +204,9 @@ void PathWalkRects::load(byte *dataStart, Common::SeekableReadStream &stream) {
 // BackgroundResource
 
 BackgroundResource::BackgroundResource()
-	: _bgInfos(0), _scaleLayers(0), _priorityLayers(0), _regionLayers(0),
-	_regionSequences(0), _backgroundObjects(0), _pathWalkPoints(0),
-	_pathWalkRects(0), _palettes(0) {
+	: _bgInfos(nullptr), _scaleLayers(nullptr), _priorityLayers(nullptr), _regionLayers(nullptr),
+	_regionSequences(nullptr), _backgroundObjects(nullptr), _pathWalkPoints(nullptr),
+	_pathWalkRects(nullptr), _palettes(nullptr) {
 }
 
 BackgroundResource::~BackgroundResource() {
@@ -382,7 +382,7 @@ bool BackgroundResource::findNamedPoint(uint32 namedPointId, Common::Point &pt)
 // BackgroundInstance
 
 BackgroundInstance::BackgroundInstance(IllusionsEngine *vm)
-	: _vm(vm), _sceneId(0), _pauseCtr(0), _bgRes(0), _savedPalette(0) {
+	: _vm(vm), _sceneId(0), _pauseCtr(0), _bgRes(nullptr), _savedPalette(nullptr) {
 }
 
 void BackgroundInstance::load(Resource *resource) {
@@ -442,7 +442,7 @@ void BackgroundInstance::unpause() {
 		initSurface();
 		_vm->_screenPalette->setPalette(_savedPalette, 1, 256);
 		delete[] _savedPalette;
-		_savedPalette = 0;
+		_savedPalette = nullptr;
 		_vm->clearFader();
 		_vm->_camera->setActiveState(_savedCameraState);
 		_vm->_backgroundInstances->refreshPan();
@@ -465,7 +465,7 @@ void BackgroundInstance::unregisterResources() {
 
 void BackgroundInstance::initSurface() {
 	for (uint i = 0; i < kMaxBackgroundItemSurfaces; ++i) {
-		_surfaces[i] = 0;
+		_surfaces[i] = nullptr;
 	}
 	for (uint i = 0; i < _bgRes->_bgInfosCount; ++i) {
 		BgInfo *bgInfo = &_bgRes->_bgInfos[i];
@@ -490,7 +490,7 @@ void BackgroundInstance::freeSurface() {
 		if (_surfaces[i]) {
 			_surfaces[i]->free();
 			delete _surfaces[i];
-			_surfaces[i] = 0;
+			_surfaces[i] = nullptr;
 		}
 	}
 }
@@ -598,7 +598,7 @@ BackgroundInstance *BackgroundInstanceList::findActiveBackgroundInstance() {
 		if ((*it)->_pauseCtr == 0)
 			return (*it);
 	}
-	return 0;
+	return nullptr;
 }
 
 BackgroundInstance *BackgroundInstanceList::findBackgroundByResource(BackgroundResource *backgroundResource) {
@@ -606,14 +606,14 @@ BackgroundInstance *BackgroundInstanceList::findBackgroundByResource(BackgroundR
 		if ((*it)->_bgRes == backgroundResource)
 			return (*it);
 	}
-	return 0;
+	return nullptr;
 }
 
 BackgroundResource *BackgroundInstanceList::getActiveBgResource() {
 	BackgroundInstance *background = findActiveBackgroundInstance();
 	if (background)
 		return background->_bgRes;
-	return 0;
+	return nullptr;
 }
 
 WidthHeight BackgroundInstanceList::getMasterBgDimensions() {
diff --git a/engines/illusions/resources/fontresource.cpp b/engines/illusions/resources/fontresource.cpp
index 8d11e92b48..847202af44 100644
--- a/engines/illusions/resources/fontresource.cpp
+++ b/engines/illusions/resources/fontresource.cpp
@@ -108,7 +108,7 @@ CharInfo *FontResource::getCharInfo(uint16 c) {
 		if (_charRanges[i].containsChar(c))
 			return _charRanges[i].getCharInfo(c);
 	}
-	return 0;
+	return nullptr;
 }
 
 const Common::Rect FontResource::calculateRectForText(uint16 *text, uint textLength) {
diff --git a/engines/illusions/resources/genericresource.cpp b/engines/illusions/resources/genericresource.cpp
index 8d83026206..ffaebd012a 100644
--- a/engines/illusions/resources/genericresource.cpp
+++ b/engines/illusions/resources/genericresource.cpp
@@ -29,7 +29,7 @@ namespace Illusions {
 // GenericResourceLoader
 
 void GenericResourceLoader::load(Resource *resource) {
-	resource->_instance = 0;
+	resource->_instance = nullptr;
 }
 
 bool GenericResourceLoader::isFlag(int flag) {
diff --git a/engines/illusions/resources/midiresource.cpp b/engines/illusions/resources/midiresource.cpp
index 036755b298..a5c96e7e95 100644
--- a/engines/illusions/resources/midiresource.cpp
+++ b/engines/illusions/resources/midiresource.cpp
@@ -52,7 +52,7 @@ void MidiMusic::load(Common::SeekableReadStream &stream) {
 // MidiGroupResource
 
 MidiGroupResource::MidiGroupResource()
-	: _midiMusicCount(0), _midiMusic(0) {
+	: _midiMusicCount(0), _midiMusic(nullptr) {
 }
 
 MidiGroupResource::~MidiGroupResource() {
@@ -78,7 +78,7 @@ void MidiGroupResource::load(byte *data, uint32 dataSize) {
 // MidiGroupInstance
 
 MidiGroupInstance::MidiGroupInstance(IllusionsEngine *vm)
-	: _vm(vm), _midiGroupResource(0) {
+	: _vm(vm), _midiGroupResource(nullptr) {
 }
 
 void MidiGroupInstance::load(Resource *resource) {
diff --git a/engines/illusions/resources/scriptresource.cpp b/engines/illusions/resources/scriptresource.cpp
index 49bacff679..fb7351a926 100644
--- a/engines/illusions/resources/scriptresource.cpp
+++ b/engines/illusions/resources/scriptresource.cpp
@@ -41,7 +41,7 @@ bool ScriptResourceLoader::isFlag(int flag) {
 // Properties
 
 Properties::Properties()
-	: _count(0), _properties(0) {
+	: _count(0), _properties(nullptr) {
 }
 
 void Properties::init(uint count, byte *properties) {
@@ -100,7 +100,7 @@ void Properties::getProperyPos(uint32 propertyId, uint &index, byte &mask) {
 // BlockCounters
 
 BlockCounters::BlockCounters()
-	: _count(0), _blockCounters(0) {
+	: _count(0), _blockCounters(nullptr) {
 }
 
 void BlockCounters::init(uint count, byte *blockCounters) {
@@ -165,7 +165,7 @@ void TriggerCause::load(Common::SeekableReadStream &stream) {
 // TriggerObject
 
 TriggerObject::TriggerObject()
-	: _causesCount(0), _causes(0) {
+	: _causesCount(0), _causes(nullptr) {
 }
 
 TriggerObject::~TriggerObject() {
@@ -213,8 +213,8 @@ void TriggerObject::fixupSceneInfosDuckman() {
 // SceneInfo
 
 SceneInfo::SceneInfo()
-	: _triggerObjectsCount(0), _triggerObjects(0),
-	_resourcesCount(0), _resources(0) {
+	: _triggerObjectsCount(0), _triggerObjects(nullptr),
+	_resourcesCount(0), _resources(nullptr) {
 }
 
 SceneInfo::~SceneInfo() {
@@ -267,7 +267,7 @@ TriggerObject *SceneInfo::findTriggerObject(uint32 objectId) {
 		if (_triggerObjects[i]._objectId == objectId)
 			return &_triggerObjects[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 void SceneInfo::fixupSceneInfosDuckman() {
@@ -279,7 +279,7 @@ void SceneInfo::fixupSceneInfosDuckman() {
 // ScriptResource
 
 ScriptResource::ScriptResource()
-	: _codeOffsets(0), _objectMap(0) {
+	: _codeOffsets(nullptr), _objectMap(nullptr) {
 }
 
 ScriptResource::~ScriptResource() {
@@ -381,7 +381,7 @@ byte *ScriptResource::getCode(uint32 codeOffs) {
 SceneInfo *ScriptResource::getSceneInfo(uint32 index) {
 	if (index > 0 && index <= _sceneInfosCount)
 		return &_sceneInfos[index - 1];
-	return 0;
+	return nullptr;
 }
 
 uint32 ScriptResource::getObjectActorTypeId(uint32 objectId) {
@@ -407,7 +407,7 @@ void ScriptInstance::load(Resource *resource) {
 
 void ScriptInstance::unload() {
 	delete _vm->_scriptResource;
-	_vm->_scriptResource = 0;
+	_vm->_scriptResource = nullptr;
 }
 
 } // End of namespace Illusions
diff --git a/engines/illusions/resources/soundresource.cpp b/engines/illusions/resources/soundresource.cpp
index 030a4cc3a9..a2d3e0c709 100644
--- a/engines/illusions/resources/soundresource.cpp
+++ b/engines/illusions/resources/soundresource.cpp
@@ -56,7 +56,7 @@ void SoundEffect::load(Common::SeekableReadStream &stream) {
 // SoundGroupResource
 
 SoundGroupResource::SoundGroupResource()
-	: _soundEffects(0) {
+	: _soundEffects(nullptr) {
 }
 
 SoundGroupResource::~SoundGroupResource() {
@@ -82,7 +82,7 @@ void SoundGroupResource::load(byte *data, uint32 dataSize) {
 // SoundGroupInstance
 
 SoundGroupInstance::SoundGroupInstance(IllusionsEngine *vm)
-	: _vm(vm), _soundGroupResource(0) {
+	: _vm(vm), _soundGroupResource(nullptr) {
 }
 
 void SoundGroupInstance::load(Resource *resource) {
diff --git a/engines/illusions/resources/talkresource.cpp b/engines/illusions/resources/talkresource.cpp
index 776f89e15a..af56020c7a 100644
--- a/engines/illusions/resources/talkresource.cpp
+++ b/engines/illusions/resources/talkresource.cpp
@@ -62,7 +62,7 @@ void TalkEntry::load(byte *dataStart, Common::SeekableReadStream &stream) {
 // TalkResource
 
 TalkResource::TalkResource()
-	: _talkEntriesCount(0), _talkEntries(0) {
+	: _talkEntriesCount(0), _talkEntries(nullptr) {
 }
 
 TalkResource::~TalkResource() {
@@ -153,7 +153,7 @@ TalkInstance *TalkInstanceList::findTalkItem(uint32 talkId) {
 		if ((*it)->_talkId == talkId)
 			return (*it);
 	}
-	return 0;
+	return nullptr;
 }
 
 TalkInstance *TalkInstanceList::findTalkItemBySceneId(uint32 sceneId) {
@@ -161,7 +161,7 @@ TalkInstance *TalkInstanceList::findTalkItemBySceneId(uint32 sceneId) {
 		if ((*it)->_sceneId == sceneId)
 			return (*it);
 	}
-	return 0;
+	return nullptr;
 }
 
 void TalkInstanceList::pauseBySceneId(uint32 sceneId) {
diff --git a/engines/illusions/resourcesystem.cpp b/engines/illusions/resourcesystem.cpp
index d09f4f1af2..9404d4d094 100644
--- a/engines/illusions/resourcesystem.cpp
+++ b/engines/illusions/resourcesystem.cpp
@@ -54,7 +54,7 @@ void Resource::loadData(BaseResourceReader *resReader) {
 
 void Resource::unloadData() {
 	free(_data);
-	_data = 0;
+	_data = nullptr;
 	_dataSize = 0;
 }
 
diff --git a/engines/illusions/screen.cpp b/engines/illusions/screen.cpp
index 8d870699c4..915befdb47 100644
--- a/engines/illusions/screen.cpp
+++ b/engines/illusions/screen.cpp
@@ -132,7 +132,7 @@ void SpriteDrawQueue::insertSurface(Graphics::Surface *surface, WidthHeight &dim
 	SpriteDrawQueueItem *item = new SpriteDrawQueueItem();
 	item->_surface = surface;
 	item->_dimensions = dimensions;
-	item->_drawFlags = 0;
+	item->_drawFlags = nullptr;
 	item->_kind = 0;
 	item->_drawPosition.x = -drawPosition.x;
 	item->_drawPosition.y = -drawPosition.y;
@@ -150,7 +150,7 @@ void SpriteDrawQueue::insertTextSurface(Graphics::Surface *surface, WidthHeight
 	item->_surface = surface;
 	item->_drawPosition = drawPosition;
 	item->_dimensions = dimensions;
-	item->_drawFlags = 0;
+	item->_drawFlags = nullptr;
 	item->_kind = 0;
 	item->_controlPosition.x = 0;
 	item->_controlPosition.y = 0;
diff --git a/engines/illusions/screentext.cpp b/engines/illusions/screentext.cpp
index 07cc96dc30..2e8e179916 100644
--- a/engines/illusions/screentext.cpp
+++ b/engines/illusions/screentext.cpp
@@ -32,7 +32,7 @@
 namespace Illusions {
 
 ScreenText::ScreenText(IllusionsEngine *vm)
-	: _vm(vm), _surface(0) {
+	: _vm(vm), _surface(nullptr) {
 }
 
 ScreenText::~ScreenText() {
@@ -202,7 +202,7 @@ void ScreenText::freeTextSurface() {
 	if (_surface) {
 		_surface->free();
 		delete _surface;
-		_surface = 0;
+		_surface = nullptr;
 	}
 }
 
diff --git a/engines/illusions/sequenceopcodes.cpp b/engines/illusions/sequenceopcodes.cpp
index 90b9c532f4..b37f3db3a8 100644
--- a/engines/illusions/sequenceopcodes.cpp
+++ b/engines/illusions/sequenceopcodes.cpp
@@ -57,7 +57,7 @@ typedef Common::Functor2Mem<Control*, OpCall&, void, SequenceOpcodes> SequenceOp
 void SequenceOpcodes::initOpcodes() {
 	// First clear everything
 	for (uint i = 0; i < 256; ++i) {
-		_opcodes[i] = 0;
+		_opcodes[i] = nullptr;
 	}
 	// Register opcodes
 	OPCODE(1, opYield);
@@ -132,7 +132,7 @@ void SequenceOpcodes::opSetFrameIndex(Control *control, OpCall &opCall) {
 			control->_actor->_entryTblPtr += 2;
 		} else {
 			control->_actor->_flags &= ~Illusions::ACTOR_FLAG_80;
-			control->_actor->_entryTblPtr = 0;
+			control->_actor->_entryTblPtr = nullptr;
 			control->_actor->_notifyThreadId2 = 0;
 			_vm->notifyThreadId(control->_actor->_notifyThreadId1);
 			opCall._result = 1;
@@ -147,10 +147,10 @@ void SequenceOpcodes::opSetFrameIndex(Control *control, OpCall &opCall) {
 }
 
 void SequenceOpcodes::opEndSequence(Control *control, OpCall &opCall) {
-	control->_actor->_seqCodeIp = 0;
+	control->_actor->_seqCodeIp = nullptr;
 	if (control->_actor->_flags & Illusions::ACTOR_FLAG_800) {
 		control->_actor->_flags &= ~Illusions::ACTOR_FLAG_800;
-		control->_actor->_frames = 0;
+		control->_actor->_frames = nullptr;
 		control->_actor->_frameIndex = 0;
 		control->_actor->_newFrameIndex = 0;
 		_vm->_resSys->unloadResourceById(control->_actor->_sequenceId);
diff --git a/engines/illusions/sound.cpp b/engines/illusions/sound.cpp
index d22d0bd892..e3d6d062a7 100644
--- a/engines/illusions/sound.cpp
+++ b/engines/illusions/sound.cpp
@@ -81,9 +81,9 @@ bool MusicPlayer::isPlaying() {
 MidiPlayer::MidiPlayer()
 	: _isIdle(true), _isPlaying(false), _isCurrentlyPlaying(false), _isLooped(false),
 	_loopedMusicId(0), _queuedMusicId(0), _loadedMusicId(0),
-	_data(0), _dataSize(0) {
+	_data(nullptr), _dataSize(0) {
 
-	_data = 0;
+	_data = nullptr;
 	_dataSize = 0;
 	_isGM = false;
 
@@ -186,7 +186,7 @@ void MidiPlayer::sysMidiPlay(uint32 musicId) {
 void MidiPlayer::sysMidiStop() {
 	Audio::MidiPlayer::stop();
 	delete[] _data;
-	_data = 0;
+	_data = nullptr;
 	_dataSize = 0;
 	_loadedMusicId = 0;
 }
@@ -300,7 +300,7 @@ bool VoicePlayer::isCued() {
 // Sound
 
 Sound::Sound(uint32 soundEffectId, uint32 soundGroupId, bool looping)
-	: _stream(0), _soundEffectId(soundEffectId), _soundGroupId(soundGroupId), _looping(looping) {
+	: _stream(nullptr), _soundEffectId(soundEffectId), _soundGroupId(soundGroupId), _looping(looping) {
 	load();
 }
 
@@ -322,7 +322,7 @@ void Sound::unload() {
 	debug(1, "Sound::unload() %08X", _soundEffectId);
 	stop();
 	delete _stream;
-	_stream = 0;
+	_stream = nullptr;
 }
 
 void Sound::play(int16 volume, int16 pan) {
@@ -480,7 +480,7 @@ Sound *SoundMan::getSound(uint32 soundEffectId) {
 		if ((*it)->_soundEffectId == soundEffectId)
 			return *it;
 	}
-	return 0;
+	return nullptr;
 }
 
 void SoundMan::updateMidi() {
diff --git a/engines/illusions/thread.cpp b/engines/illusions/thread.cpp
index 300f56604b..fa8a727716 100644
--- a/engines/illusions/thread.cpp
+++ b/engines/illusions/thread.cpp
@@ -168,7 +168,7 @@ Thread *ThreadList::findThread(uint32 threadId) {
 		if ((*it)->_threadId == threadId && !(*it)->_terminated)
 			return (*it);
 	}
-	return 0;
+	return nullptr;
 }
 
 void ThreadList::suspendId(uint32 threadId) {
diff --git a/engines/illusions/threads/talkthread.cpp b/engines/illusions/threads/talkthread.cpp
index f89c80d4a2..d4532c0cd6 100644
--- a/engines/illusions/threads/talkthread.cpp
+++ b/engines/illusions/threads/talkthread.cpp
@@ -66,13 +66,13 @@ TalkThread::TalkThread(IllusionsEngine *vm, uint32 threadId, uint32 callingThrea
 	_textStartTime = 0;
 	_textEndTime = 0;
 	_textDurationElapsed = 0;
-	_entryText = 0;
-	_currEntryText = 0;
+	_entryText = nullptr;
+	_currEntryText = nullptr;
 	_voiceDurationElapsed = 0;
 	_voiceDuration = duration;
 	_voiceStartTime = getCurrentTime();
 	_voiceEndTime = _voiceStartTime + duration;
-	_entryTblPtr = 0;
+	_entryTblPtr = nullptr;
 
 	if (callingThreadId) {
 		Thread *callingThread = _vm->_threads->findThread(callingThreadId);
@@ -106,7 +106,7 @@ int TalkThread::onUpdate() {
 	case 3:
 		talkEntry = getTalkResourceEntry(_talkId);
 		_flags = 0;
-		_currEntryText = 0;
+		_currEntryText = nullptr;
 		_entryText = talkEntry->_text;
 		_entryTblPtr = talkEntry->_tblPtr;
 		if (_sequenceId1) {
diff --git a/engines/illusions/threads/talkthread_duckman.cpp b/engines/illusions/threads/talkthread_duckman.cpp
index c7742a61c4..a7ea1b992d 100644
--- a/engines/illusions/threads/talkthread_duckman.cpp
+++ b/engines/illusions/threads/talkthread_duckman.cpp
@@ -79,14 +79,14 @@ int TalkThread_Duckman::onUpdate() {
 	case 2:
 		talkEntry = getTalkResourceEntry(_talkId);
 		_flags = 0;
-		_currEntryText = 0;
+		_currEntryText = nullptr;
 		_entryText = talkEntry->_text;
 		_entryTblPtr = talkEntry->_tblPtr;
 		if (_sequenceId1) {
 			_pauseCtrPtr = &_pauseCtr;
 			_pauseCtr = 0;
 		} else {
-			_pauseCtrPtr = 0;
+			_pauseCtrPtr = nullptr;
 			_flags |= 2;
 			_flags |= 1;
 		}


Commit: 7fa7b12c91ad34bf6051b47aa5cf647bb36f263b
    https://github.com/scummvm/scummvm/commit/7fa7b12c91ad34bf6051b47aa5cf647bb36f263b
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
KINGDOM: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/kingdom/detection.cpp


diff --git a/engines/kingdom/detection.cpp b/engines/kingdom/detection.cpp
index 937ba6fbf2..96e1d7c3e7 100644
--- a/engines/kingdom/detection.cpp
+++ b/engines/kingdom/detection.cpp
@@ -34,7 +34,7 @@ static const DebugChannelDef debugFlagList[] = {
 
 static const PlainGameDescriptor kingdomGames[] = {
 	{"kingdom", "Kingdom: The Far Reaches"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 namespace Kingdom {
@@ -55,7 +55,7 @@ static const ADGameDescription gameDescriptions[] = {
 	// Also detects the GOG.COM version
 	{
 		"kingdom",
-		0,
+		nullptr,
 		AD_ENTRY1s("KINGDOM.EXE", "64d3e03b963396ced402f3dc958765c0", 199693),
 		Common::EN_ANY,
 		Common::kPlatformDOS,
@@ -66,7 +66,7 @@ static const ADGameDescription gameDescriptions[] = {
 	// Kingdom 3DO, provided by Strangerke
 	{
 		"kingdom",
-		0,
+		nullptr,
 		AD_ENTRY1s("launchme", "60d2c64e3cb3e22859c4fadbc121b0db", 183452),
 		Common::EN_ANY,
 		Common::kPlatform3DO,


Commit: da751361a44eaa025e5bba0c8aa5208e010d8ee0
    https://github.com/scummvm/scummvm/commit/da751361a44eaa025e5bba0c8aa5208e010d8ee0
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
KYRA: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/kyra/detection.cpp
    engines/kyra/engine/kyra_hof.cpp
    engines/kyra/engine/kyra_lok.cpp
    engines/kyra/engine/kyra_mr.cpp
    engines/kyra/engine/kyra_v1.cpp
    engines/kyra/engine/kyra_v2.cpp
    engines/kyra/engine/scene_hof.cpp
    engines/kyra/engine/scene_lok.cpp
    engines/kyra/engine/scene_mr.cpp
    engines/kyra/engine/sprites.cpp
    engines/kyra/engine/timer_hof.cpp
    engines/kyra/engine/timer_lok.cpp
    engines/kyra/engine/timer_mr.cpp
    engines/kyra/graphics/animator_hof.cpp
    engines/kyra/graphics/animator_lok.cpp
    engines/kyra/graphics/animator_mr.cpp
    engines/kyra/graphics/animator_tim.cpp
    engines/kyra/graphics/animator_v2.cpp
    engines/kyra/graphics/screen.cpp
    engines/kyra/graphics/screen_lok.cpp
    engines/kyra/graphics/screen_mr.cpp
    engines/kyra/graphics/screen_v2.cpp
    engines/kyra/graphics/vqa.cpp
    engines/kyra/graphics/wsamovie.cpp
    engines/kyra/gui/debugger.cpp
    engines/kyra/gui/gui.cpp
    engines/kyra/gui/gui_hof.cpp
    engines/kyra/gui/gui_lok.cpp
    engines/kyra/gui/gui_mr.cpp
    engines/kyra/gui/gui_v1.cpp
    engines/kyra/gui/gui_v2.cpp
    engines/kyra/gui/saveload.cpp
    engines/kyra/gui/saveload_hof.cpp
    engines/kyra/gui/saveload_lok.cpp
    engines/kyra/resource/resource.cpp
    engines/kyra/resource/resource_intern.cpp
    engines/kyra/resource/staticres.cpp
    engines/kyra/script/script.cpp
    engines/kyra/script/script_hof.cpp
    engines/kyra/script/script_lok.cpp
    engines/kyra/script/script_mr.cpp
    engines/kyra/script/script_tim.cpp
    engines/kyra/script/script_v2.cpp
    engines/kyra/sequence/seqplayer_lok.cpp
    engines/kyra/sequence/sequences_hof.cpp
    engines/kyra/sequence/sequences_lok.cpp
    engines/kyra/sequence/sequences_v2.cpp
    engines/kyra/sound/drivers/adlib.cpp
    engines/kyra/sound/drivers/audstream.cpp
    engines/kyra/sound/drivers/halestorm.cpp
    engines/kyra/sound/drivers/pcspeaker_v2.cpp
    engines/kyra/sound/sound.cpp
    engines/kyra/sound/sound_digital_mr.cpp
    engines/kyra/sound/sound_mac_lok.cpp
    engines/kyra/sound/sound_pc98_lok.cpp
    engines/kyra/sound/sound_pc98_v2.cpp
    engines/kyra/sound/sound_pc_midi.cpp
    engines/kyra/sound/sound_pc_v1.cpp
    engines/kyra/sound/sound_towns_lok.cpp
    engines/kyra/text/text_hof.cpp
    engines/kyra/text/text_mr.cpp


diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 6b3e3a008a..b3bf2325b3 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -48,7 +48,7 @@ static const DebugChannelDef debugFlagList[] = {
 const char *const directoryGlobs[] = {
 	"malcolm",
 	"data", // LOL GOG release
-	0
+	nullptr
 };
 
 const ADExtraGuiOptionsMap gameGuiOptions[] = {
diff --git a/engines/kyra/engine/kyra_hof.cpp b/engines/kyra/engine/kyra_hof.cpp
index 8a104727eb..ed5ead79eb 100644
--- a/engines/kyra/engine/kyra_hof.cpp
+++ b/engines/kyra/engine/kyra_hof.cpp
@@ -49,11 +49,11 @@ const KyraEngine_v2::EngineDesc KyraEngine_HoF::_hofEngineDesc = {
 };
 
 KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _hofEngineDesc), _updateFunctor(this, &KyraEngine_HoF::update) {
-	_screen = 0;
-	_text = 0;
+	_screen = nullptr;
+	_text = nullptr;
 
-	_gamePlayBuffer = 0;
-	_cCodeBuffer = _optionsBuffer = _chapterBuffer = 0;
+	_gamePlayBuffer = nullptr;
+	_cCodeBuffer = _optionsBuffer = _chapterBuffer = nullptr;
 
 	_overwriteSceneFacing = false;
 	_mainCharX = _mainCharY = -1;
@@ -77,12 +77,12 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn
 	_lastIdleScript = -1;
 	_useSceneIdleAnim = false;
 
-	_currentTalkSections.STATim = 0;
-	_currentTalkSections.TLKTim = 0;
-	_currentTalkSections.ENDTim = 0;
+	_currentTalkSections.STATim = nullptr;
+	_currentTalkSections.TLKTim = nullptr;
+	_currentTalkSections.ENDTim = nullptr;
 
 	memset(&_invWsa, 0, sizeof(_invWsa));
-	_itemAnimDefinition = 0;
+	_itemAnimDefinition = nullptr;
 	_nextAnimItem = 0;
 
 	for (int i = 0; i < 15; i++)
@@ -93,23 +93,23 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn
 	_scriptCountDown = 0;
 	_dbgPass = 0;
 
-	_gamePlayBuffer = 0;
+	_gamePlayBuffer = nullptr;
 	_inventorySaved = false;
 	memset(&_sceneShapeTable, 0, sizeof(_sceneShapeTable));
 
-	_talkObjectList = 0;
-	_shapeDescTable = 0;
-	_gfxBackUpRect = 0;
-	_sceneList = 0;
+	_talkObjectList = nullptr;
+	_shapeDescTable = nullptr;
+	_gfxBackUpRect = nullptr;
+	_sceneList = nullptr;
 	memset(&_sceneAnimMovie, 0, sizeof(_sceneAnimMovie));
 	memset(&_wsaSlots, 0, sizeof(_wsaSlots));
 	memset(&_buttonShapes, 0, sizeof(_buttonShapes));
 
 	_configTextspeed = 50;
 
-	_inventoryButtons = _buttonList = 0;
+	_inventoryButtons = _buttonList = nullptr;
 
-	_dlgBuffer = 0;
+	_dlgBuffer = nullptr;
 	_conversationState = new int8 *[19];
 	for (int i = 0; i < 19; i++)
 		_conversationState[i] = new int8[14];
@@ -143,7 +143,7 @@ KyraEngine_HoF::~KyraEngine_HoF() {
 	delete _text;
 	delete _gui;
 	delete _tim;
-	_text = 0;
+	_text = nullptr;
 	delete _invWsa.wsa;
 
 	delete[] _dlgBuffer;
@@ -208,7 +208,7 @@ Common::Error KyraEngine_HoF::init() {
 		return Common::kNoError;
 
 	_res->exists("PWGMOUSE.SHP", true);
-	uint8 *shapes = _res->fileData("PWGMOUSE.SHP", 0);
+	uint8 *shapes = _res->fileData("PWGMOUSE.SHP", nullptr);
 	assert(shapes);
 
 	for (int i = 0; i < 2; i++)
@@ -352,7 +352,7 @@ void KyraEngine_HoF::startup() {
 	loadInventoryShapes();
 
 	_screen->loadPalette("PALETTE.COL", _screen->getPalette(0));
-	_screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0);
+	_screen->loadBitmap("_PLAYFLD.CPS", 3, 3, nullptr);
 	_screen->copyPage(3, 0);
 
 	clearAnimObjects();
@@ -373,7 +373,7 @@ void KyraEngine_HoF::startup() {
 	if (_gameToLoad == -1) {
 		snd_playWanderScoreViaMap(52, 1);
 		enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
-		saveGameStateIntern(0, "New Game", 0);
+		saveGameStateIntern(0, "New Game", nullptr);
 	} else {
 		loadGameStateCheck(_gameToLoad);
 	}
@@ -399,7 +399,7 @@ void KyraEngine_HoF::runLoop() {
 			removeHandItem();
 			delay(5);
 			_drawNoShapeFlag = 0;
-			_gui->optionsButton(0);
+			_gui->optionsButton(nullptr);
 			_deathHandler = -1;
 
 			if (!_runFlag || shouldQuit())
@@ -731,34 +731,34 @@ void KyraEngine_HoF::updateMouse() {
 }
 
 void KyraEngine_HoF::cleanup() {
-	delete[] _inventoryButtons; _inventoryButtons = 0;
+	delete[] _inventoryButtons; _inventoryButtons = nullptr;
 
-	delete[] _gamePlayBuffer; _gamePlayBuffer = 0;
+	delete[] _gamePlayBuffer; _gamePlayBuffer = nullptr;
 
 	freeSceneShapePtrs();
 
 	if (_optionsBuffer != _cCodeBuffer)
 		delete[] _optionsBuffer;
-	_optionsBuffer = 0;
-	delete[] _cCodeBuffer; _cCodeBuffer = 0;
-	delete[] _chapterBuffer; _chapterBuffer = 0;
+	_optionsBuffer = nullptr;
+	delete[] _cCodeBuffer; _cCodeBuffer = nullptr;
+	delete[] _chapterBuffer; _chapterBuffer = nullptr;
 
-	delete[] _talkObjectList; _talkObjectList = 0;
-	delete[] _shapeDescTable; _shapeDescTable = 0;
+	delete[] _talkObjectList; _talkObjectList = nullptr;
+	delete[] _shapeDescTable; _shapeDescTable = nullptr;
 
-	delete[] _gfxBackUpRect; _gfxBackUpRect = 0;
+	delete[] _gfxBackUpRect; _gfxBackUpRect = nullptr;
 
 	for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i) {
 		delete _sceneAnimMovie[i];
-		_sceneAnimMovie[i] = 0;
+		_sceneAnimMovie[i] = nullptr;
 	}
 	for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i) {
 		delete _wsaSlots[i];
-		_wsaSlots[i] = 0;
+		_wsaSlots[i] = nullptr;
 	}
 	for (int i = 0; i < ARRAYSIZE(_buttonShapes); ++i) {
 		delete[] _buttonShapes[i];
-		_buttonShapes[i] = 0;
+		_buttonShapes[i] = nullptr;
 	}
 
 	_emc->unload(&_npcScriptData);
@@ -772,7 +772,7 @@ void KyraEngine_HoF::loadCCodeBuffer(const char *file) {
 	changeFileExtension(tempString);
 
 	delete[] _cCodeBuffer;
-	_cCodeBuffer = _res->fileData(tempString, 0);
+	_cCodeBuffer = _res->fileData(tempString, nullptr);
 }
 
 void KyraEngine_HoF::loadOptionsBuffer(const char *file) {
@@ -781,7 +781,7 @@ void KyraEngine_HoF::loadOptionsBuffer(const char *file) {
 	changeFileExtension(tempString);
 
 	delete[] _optionsBuffer;
-	_optionsBuffer = _res->fileData(tempString, 0);
+	_optionsBuffer = _res->fileData(tempString, nullptr);
 }
 
 void KyraEngine_HoF::loadChapterBuffer(int chapter) {
@@ -796,7 +796,7 @@ void KyraEngine_HoF::loadChapterBuffer(int chapter) {
 	changeFileExtension(tempString);
 
 	delete[] _chapterBuffer;
-	_chapterBuffer = _res->fileData(tempString, 0);
+	_chapterBuffer = _res->fileData(tempString, nullptr);
 	_currentChapter = chapter;
 }
 
@@ -914,14 +914,14 @@ void KyraEngine_HoF::fadeMessagePalette() {
 #pragma mark -
 
 void KyraEngine_HoF::loadMouseShapes() {
-	_screen->loadBitmap("_MOUSE.CSH", 3, 3, 0);
+	_screen->loadBitmap("_MOUSE.CSH", 3, 3, nullptr);
 
 	for (int i = 0; i <= 8; ++i)
 		addShapeToPool(_screen->getCPagePtr(3), i, i);
 }
 
 void KyraEngine_HoF::loadItemShapes() {
-	_screen->loadBitmap("_ITEMS.CSH", 3, 3, 0);
+	_screen->loadBitmap("_ITEMS.CSH", 3, 3, nullptr);
 
 	for (int i = 64; i <= 239; ++i)
 		addShapeToPool(_screen->getCPagePtr(3), i, i-64);
@@ -939,7 +939,7 @@ void KyraEngine_HoF::loadCharacterShapes(int shapes) {
 	_characterShapeFile = shapes;
 	file[2] = '0' + shapes;
 
-	uint8 *data = _res->fileData(file, 0);
+	uint8 *data = _res->fileData(file, nullptr);
 	for (int i = 9; i <= 32; ++i)
 		addShapeToPool(data, i, i-9);
 	delete[] data;
@@ -951,7 +951,7 @@ void KyraEngine_HoF::loadInventoryShapes() {
 	int curPageBackUp = _screen->_curPage;
 	_screen->_curPage = 2;
 
-	_screen->loadBitmap("_PLAYALL.CPS", 3, 3, 0);
+	_screen->loadBitmap("_PLAYALL.CPS", 3, 3, nullptr);
 
 	for (int i = 0; i < 10; ++i)
 		addShapeToPool(_screen->encodeShape(_inventoryX[i], _inventoryY[i], 16, 16, 0), 240+i);
@@ -1475,7 +1475,7 @@ void KyraEngine_HoF::snd_playSoundEffect(int track, int volume) {
 				break;
 			}
 		}
-		_sound->voicePlay(_ingameSoundList[file], 0, volume, prio, true);
+		_sound->voicePlay(_ingameSoundList[file], nullptr, volume, prio, true);
 	} else if (_flags.platform == Common::kPlatformDOS) {
 		if (_sound->getSfxType() == Sound::kMidiMT32)
 			track = track < _mt32SfxMapSize ? _mt32SfxMap[track] - 1 : -1;
@@ -1501,7 +1501,7 @@ void KyraEngine_HoF::loadInvWsa(const char *filename, int run_, int delayTime, i
 	if (!_invWsa.wsa)
 		_invWsa.wsa = new WSAMovie_v2(this);
 
-	if (!_invWsa.wsa->open(filename, wsaFlags, 0))
+	if (!_invWsa.wsa->open(filename, wsaFlags, nullptr))
 		error("Couldn't open inventory WSA file '%s'", filename);
 
 	_invWsa.curFrame = 0;
@@ -1542,7 +1542,7 @@ void KyraEngine_HoF::loadInvWsa(const char *filename, int run_, int delayTime, i
 void KyraEngine_HoF::closeInvWsa() {
 	_invWsa.wsa->close();
 	delete _invWsa.wsa;
-	_invWsa.wsa = 0;
+	_invWsa.wsa = nullptr;
 	_invWsa.running = false;
 }
 
@@ -1553,7 +1553,7 @@ void KyraEngine_HoF::updateInvWsa() {
 	if (_invWsa.timer > _system->getMillis())
 		return;
 
-	_invWsa.wsa->displayFrame(_invWsa.curFrame, _invWsa.page, 0, 0, 0, 0, 0);
+	_invWsa.wsa->displayFrame(_invWsa.curFrame, _invWsa.page, 0, 0, 0, nullptr, nullptr);
 
 	if (_invWsa.page)
 		_screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
@@ -1591,7 +1591,7 @@ void KyraEngine_HoF::displayInvWsaLastFrame() {
 	if (!_invWsa.wsa)
 		return;
 
-	_invWsa.wsa->displayFrame(_invWsa.lastFrame-1, _invWsa.page, 0, 0, 0, 0, 0);
+	_invWsa.wsa->displayFrame(_invWsa.lastFrame-1, _invWsa.page, 0, 0, 0, nullptr, nullptr);
 
 	if (_invWsa.page)
 		_screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
@@ -1612,7 +1612,7 @@ void KyraEngine_HoF::setCauldronState(uint8 state, bool paletteFade) {
 	file->seek(state*18, SEEK_SET);
 	_screen->getPalette(2).loadVGAPalette(*file, 241, 6);
 	delete file;
-	file = 0;
+	file = nullptr;
 
 	if (paletteFade) {
 		snd_playSoundEffect((state == 0) ? 0x6B : 0x66);
diff --git a/engines/kyra/engine/kyra_lok.cpp b/engines/kyra/engine/kyra_lok.cpp
index c71189f7d8..56989a6abb 100644
--- a/engines/kyra/engine/kyra_lok.cpp
+++ b/engines/kyra/engine/kyra_lok.cpp
@@ -38,45 +38,45 @@ namespace Kyra {
 KyraEngine_LoK::KyraEngine_LoK(OSystem *system, const GameFlags &flags)
 	: KyraEngine_v1(system, flags) {
 
-	_seq_Forest = _seq_KallakWriting = _seq_KyrandiaLogo = _seq_KallakMalcolm = 0;
-	_seq_MalcolmTree = _seq_WestwoodLogo = _seq_Demo1 = _seq_Demo2 = _seq_Demo3 = 0;
-	_seq_Demo4 = 0;
+	_seq_Forest = _seq_KallakWriting = _seq_KyrandiaLogo = _seq_KallakMalcolm = nullptr;
+	_seq_MalcolmTree = _seq_WestwoodLogo = _seq_Demo1 = _seq_Demo2 = _seq_Demo3 = nullptr;
+	_seq_Demo4 = nullptr;
 
-	_seq_WSATable = _seq_CPSTable = _seq_COLTable = _seq_textsTable = 0;
+	_seq_WSATable = _seq_CPSTable = _seq_COLTable = _seq_textsTable = nullptr;
 	_seq_WSATable_Size = _seq_CPSTable_Size = _seq_COLTable_Size = _seq_textsTable_Size = 0;
 
-	_roomFilenameTable = _characterImageTable = 0;
+	_roomFilenameTable = _characterImageTable = nullptr;
 	_roomFilenameTableSize = _characterImageTableSize = 0;
-	_itemList = _takenList = _placedList = _droppedList = _noDropList = 0;
+	_itemList = _takenList = _placedList = _droppedList = _noDropList = nullptr;
 	_itemList_Size = _takenList_Size = _placedList_Size = _droppedList_Size = _noDropList_Size = 0;
-	_putDownFirst = _waitForAmulet = _blackJewel = _poisonGone = _healingTip = 0;
+	_putDownFirst = _waitForAmulet = _blackJewel = _poisonGone = _healingTip = nullptr;
 	_putDownFirst_Size = _waitForAmulet_Size = _blackJewel_Size = _poisonGone_Size = _healingTip_Size = 0;
-	_thePoison = _fluteString = _wispJewelStrings = _magicJewelString = _flaskFull = _fullFlask = 0;
+	_thePoison = _fluteString = _wispJewelStrings = _magicJewelString = _flaskFull = _fullFlask = nullptr;
 	_thePoison_Size = _fluteString_Size = _wispJewelStrings_Size = 0;
 	_magicJewelString_Size = _flaskFull_Size = _fullFlask_Size = 0;
 
-	_defaultShapeTable = 0;
-	_healingShapeTable = _healingShape2Table = 0;
+	_defaultShapeTable = nullptr;
+	_healingShapeTable = _healingShape2Table = nullptr;
 	_defaultShapeTableSize = _healingShapeTableSize = _healingShape2TableSize = 0;
-	_posionDeathShapeTable = _fluteAnimShapeTable = 0;
+	_posionDeathShapeTable = _fluteAnimShapeTable = nullptr;
 	_posionDeathShapeTableSize = _fluteAnimShapeTableSize = 0;
-	_winterScrollTable = _winterScroll1Table = _winterScroll2Table = 0;
+	_winterScrollTable = _winterScroll1Table = _winterScroll2Table = nullptr;
 	_winterScrollTableSize = _winterScroll1TableSize = _winterScroll2TableSize = 0;
-	_drinkAnimationTable = _brandonToWispTable = _magicAnimationTable = _brandonStoneTable = 0;
+	_drinkAnimationTable = _brandonToWispTable = _magicAnimationTable = _brandonStoneTable = nullptr;
 	_drinkAnimationTableSize = _brandonToWispTableSize = _magicAnimationTableSize = _brandonStoneTableSize = 0;
-	_specialPalettes = 0;
-	_sprites = 0;
-	_animator = 0;
-	_seq = 0;
-	_characterList = 0;
-	_roomTable = 0;
-	_movFacingTable = 0;
-	_buttonData = 0;
-	_buttonDataListPtr = 0;
+	_specialPalettes = nullptr;
+	_sprites = nullptr;
+	_animator = nullptr;
+	_seq = nullptr;
+	_characterList = nullptr;
+	_roomTable = nullptr;
+	_movFacingTable = nullptr;
+	_buttonData = nullptr;
+	_buttonDataListPtr = nullptr;
 	memset(_shapes, 0, sizeof(_shapes));
 	memset(_movieObjects, 0, sizeof(_movieObjects));
-	_finalA = _finalB = _finalC = 0;
-	_endSequenceBackUpRect = 0;
+	_finalA = _finalB = _finalC = nullptr;
+	_endSequenceBackUpRect = nullptr;
 	memset(_panPagesTable, 0, sizeof(_panPagesTable));
 	memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
 	_currHeadShape = 0;
@@ -103,7 +103,7 @@ KyraEngine_LoK::~KyraEngine_LoK() {
 		if (_movieObjects[i])
 			_movieObjects[i]->close();
 		delete _movieObjects[i];
-		_movieObjects[i] = 0;
+		_movieObjects[i] = nullptr;
 	}
 
 	closeFinalWsa();
@@ -143,14 +143,14 @@ KyraEngine_LoK::~KyraEngine_LoK() {
 	delete[] _itemBkgBackUp[1];
 
 	for (int i = 0; i < ARRAYSIZE(_shapes); ++i) {
-		if (_shapes[i] != 0) {
+		if (_shapes[i] != nullptr) {
 			delete[] _shapes[i];
 			for (int i2 = 0; i2 < ARRAYSIZE(_shapes); i2++) {
 				if (_shapes[i2] == _shapes[i] && i2 != i) {
-					_shapes[i2] = 0;
+					_shapes[i2] = nullptr;
 				}
 			}
-			_shapes[i] = 0;
+			_shapes[i] = nullptr;
 		}
 	}
 
@@ -206,7 +206,7 @@ Common::Error KyraEngine_LoK::init() {
 	setupButtonData();
 
 	_paletteChanged = 1;
-	_currentCharacter = 0;
+	_currentCharacter = nullptr;
 	_characterList = new Character[11]();
 	assert(_characterList);
 
@@ -249,7 +249,7 @@ Common::Error KyraEngine_LoK::init() {
 
 	memset(_itemHtDat, 0, sizeof(_itemHtDat));
 	memset(_exitList, 0xFF, sizeof(_exitList));
-	_exitListPtr = 0;
+	_exitListPtr = nullptr;
 	_pathfinderFlag = _pathfinderFlag2 = 0;
 	_lastFindWayRet = 0;
 	_sceneChangeState = _loopFlag2 = 0;
@@ -277,12 +277,12 @@ Common::Error KyraEngine_LoK::init() {
 	_beadStateVar = 0;
 	_endSequenceSkipFlag = 0;
 	_unkEndSeqVar2 = 0;
-	_endSequenceBackUpRect = 0;
+	_endSequenceBackUpRect = nullptr;
 	_unkEndSeqVar4 = 0;
 	_unkEndSeqVar5 = 0;
 	_lastDisplayedPanPage = 0;
 	memset(_panPagesTable, 0, sizeof(_panPagesTable));
-	_finalA = _finalB = _finalC = 0;
+	_finalA = _finalB = _finalC = nullptr;
 	memset(&_kyragemFadingState, 0, sizeof(_kyragemFadingState));
 	_kyragemFadingState.gOffset = 0x13;
 	_kyragemFadingState.bOffset = 0x13;
@@ -415,10 +415,10 @@ void KyraEngine_LoK::startup() {
 			_menuDirectlyToLoad = true;
 			_screen->setMouseCursor(1, 1, _shapes[0]);
 			_screen->showMouse();
-			_gui->buttonMenuCallback(0);
+			_gui->buttonMenuCallback(nullptr);
 			_menuDirectlyToLoad = false;
 		} else if (!shouldQuit()) {
-			saveGameStateIntern(0, "New game", 0);
+			saveGameStateIntern(0, "New game", nullptr);
 		}
 	} else {
 		_screen->setFont(_flags.lang == Common::JA_JPN ? Screen::FID_SJIS_FNT : Screen::FID_8_FNT);
@@ -449,7 +449,7 @@ void KyraEngine_LoK::mainLoop() {
 				_sound->playTrack(15);
 			_screen->setMouseCursor(1, 1, _shapes[0]);
 			removeHandItem();
-			_gui->buttonMenuCallback(0);
+			_gui->buttonMenuCallback(nullptr);
 			_deathHandler = -1;
 		}
 
@@ -572,7 +572,7 @@ void KyraEngine_LoK::delayWithTicks(int ticks) {
 
 void KyraEngine_LoK::setupShapes123(const Shape *shapeTable, int endShape, int flags) {
 	for (int i = 123; i <= 172; ++i)
-		_shapes[i] = 0;
+		_shapes[i] = nullptr;
 
 	uint8 curImage = 0xFF;
 	int curPageBackUp = _screen->_curPage;
@@ -584,7 +584,7 @@ void KyraEngine_LoK::setupShapes123(const Shape *shapeTable, int endShape, int f
 		uint8 newImage = shapeTable[i - 123].imageIndex;
 		if (newImage != curImage && newImage != 0xFF) {
 			assert(_characterImageTable);
-			_screen->loadBitmap(_characterImageTable[newImage], 8, 8, 0);
+			_screen->loadBitmap(_characterImageTable[newImage], 8, 8, nullptr);
 			curImage = newImage;
 		}
 		_shapes[i] = _screen->encodeShape(shapeTable[i - 123].x << 3, shapeTable[i - 123].y, shapeTable[i - 123].w << 3, shapeTable[i - 123].h, shapeFlags);
@@ -600,7 +600,7 @@ void KyraEngine_LoK::setupShapes123(const Shape *shapeTable, int endShape, int f
 void KyraEngine_LoK::freeShapes123() {
 	for (int i = 123; i <= 172; ++i) {
 		delete[] _shapes[i];
-		_shapes[i] = 0;
+		_shapes[i] = nullptr;
 	}
 }
 
diff --git a/engines/kyra/engine/kyra_mr.cpp b/engines/kyra/engine/kyra_mr.cpp
index 55ec5374e1..759a547387 100644
--- a/engines/kyra/engine/kyra_mr.cpp
+++ b/engines/kyra/engine/kyra_mr.cpp
@@ -51,17 +51,17 @@ const KyraEngine_v2::EngineDesc KyraEngine_MR::_mrEngineDesc = {
 };
 
 KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _mrEngineDesc) {
-	_soundDigital = 0;
+	_soundDigital = nullptr;
 	_musicSoundChannel = -1;
 	_menuAudioFile = "TITLE1";
 	_lastMusicCommand = -1;
-	_itemBuffer1 = _itemBuffer2 = 0;
-	_scoreFile = 0;
-	_cCodeFile = 0;
-	_scenesFile = 0;
-	_itemFile = 0;
-	_gamePlayBuffer = 0;
-	_interface = _interfaceCommandLine = 0;
+	_itemBuffer1 = _itemBuffer2 = nullptr;
+	_scoreFile = nullptr;
+	_cCodeFile = nullptr;
+	_scenesFile = nullptr;
+	_itemFile = nullptr;
+	_gamePlayBuffer = nullptr;
+	_interface = _interfaceCommandLine = nullptr;
 	// The slightly larger interface is used in the Chinese version regardless of the actual language setting.
 	_interfaceCommandLineSize = flags.hasExtraLanguage ? 4800 : 3840;
 	_interfaceCommandLineH = _interfaceCommandLineSize / Screen::SCREEN_W;
@@ -69,12 +69,12 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi
 	_interfaceCommandLineY2 = 156 - _interfaceCommandLineH;
 	_interfaceSize = flags.hasExtraLanguage ? 18880 : 17920;
 	_interfaceH = _interfaceSize / Screen::SCREEN_W;
-	_costPalBuffer = 0;
+	_costPalBuffer = nullptr;
 	memset(_sceneShapes, 0, sizeof(_sceneShapes));
 	memset(_sceneAnimMovie, 0, sizeof(_sceneAnimMovie));
-	_gfxBackUpRect = 0;
-	_paletteOverlay = 0;
-	_sceneList = 0;
+	_gfxBackUpRect = nullptr;
+	_paletteOverlay = nullptr;
+	_sceneList = nullptr;
 	_mainCharacter.sceneId = 9;
 	_mainCharacter.height = 0x4C;
 	_mainCharacter.facing = 5;
@@ -82,16 +82,16 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi
 	_mainCharacter.walkspeed = 5;
 	memset(_activeItemAnim, 0, sizeof(_activeItemAnim));
 	_nextAnimItem = 0;
-	_text = 0;
+	_text = nullptr;
 	_commandLineY = 189;
 	_inventoryState = false;
 	memset(_characterAnimTable, 0, sizeof(_characterAnimTable));
 	_overwriteSceneFacing = false;
 	_maskPageMinY = _maskPageMaxY = 0;
-	_sceneStrings = 0;
+	_sceneStrings = nullptr;
 	_enterNewSceneLock = 0;
 	_mainCharX = _mainCharY = -1;
-	_animList = 0;
+	_animList = nullptr;
 	_drawNoShapeFlag = false;
 	_wasPlayingVQA = false;
 	_lastCharPalLayer = -1;
@@ -106,7 +106,7 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi
 	_loadingState = false;
 	_noStartupChat = false;
 	_pathfinderFlag = 0;
-	_talkObjectList = 0;
+	_talkObjectList = nullptr;
 	memset(&_chatScriptState, 0, sizeof(_chatScriptState));
 	memset(&_chatScriptData, 0, sizeof(_chatScriptData));
 	_voiceSoundChannel = -1;
@@ -118,12 +118,12 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi
 	_currentChapter = 1;
 	_unkHandleSceneChangeFlag = false;
 	memset(_sceneShapeDescs, 0, sizeof(_sceneShapeDescs));
-	_cnvFile = _dlgBuffer = 0;
+	_cnvFile = _dlgBuffer = nullptr;
 	_curDlgChapter = _curDlgIndex = _curDlgLang = -1;
 	_isStartupDialog = 0;
-	_stringBuffer = 0;
-	_menu = 0;
-	_menuAnim = 0;
+	_stringBuffer = nullptr;
+	_menu = nullptr;
+	_menuAnim = nullptr;
 	_dialogSceneAnim = _dialogSceneScript = -1;
 	memset(&_dialogScriptData, 0, sizeof(_dialogScriptData));
 	memset(&_dialogScriptState, 0, sizeof(_dialogScriptState));
@@ -132,20 +132,20 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi
 	_nextIdleAnim = 0;
 	_nextIdleType = false;
 	_inventoryScrollSpeed = -1;
-	_invWsa = 0;
+	_invWsa = nullptr;
 	_invWsaFrame = -1;
 	_score = 0;
 	memset(_scoreFlagTable, 0, sizeof(_scoreFlagTable));
-	_mainButtonData = 0;
-	_mainButtonList = 0;
+	_mainButtonData = nullptr;
+	_mainButtonList = nullptr;
 	_mainButtonListInitialized = false;
 	_enableInventory = true;
 	_goodConscienceShown = false;
 	_goodConscienceAnim = -1;
 	_goodConsciencePosition = false;
 	_menuDirectlyToLoad = false;
-	_optionsFile = 0;
-	_actorFile = 0;
+	_optionsFile = nullptr;
+	_actorFile = nullptr;
 	_chatAltFlag = false;
 	_albumChatActive = false;
 	memset(&_album, 0, sizeof(_album));
@@ -287,14 +287,14 @@ Common::Error KyraEngine_MR::go() {
 
 		for (int i = 0; i < 64 && !shouldQuit(); ++i) {
 			uint32 nextRun = _system->getMillis() + 3 * _tickLength;
-			_menuAnim->displayFrame(i, 0, 0, 0, 0, 0, 0);
+			_menuAnim->displayFrame(i, 0, 0, 0, 0, nullptr, nullptr);
 			_screen->updateScreen();
 			delayUntil(nextRun);
 		}
 
 		for (int i = 64; i > 29 && !shouldQuit(); --i) {
 			uint32 nextRun = _system->getMillis() + 3 * _tickLength;
-			_menuAnim->displayFrame(i, 0, 0, 0, 0, 0, 0);
+			_menuAnim->displayFrame(i, 0, 0, 0, 0, nullptr, nullptr);
 			_screen->updateScreen();
 			delayUntil(nextRun);
 		}
@@ -349,7 +349,7 @@ void KyraEngine_MR::initMainMenu() {
 
 	_menu = new MainMenu(this);
 	MainMenu::StaticData data = {
-		{ _mainMenuStrings[0], _mainMenuStrings[1], _mainMenuStrings[2], _mainMenuStrings[3], 0 },
+		{ _mainMenuStrings[0], _mainMenuStrings[1], _mainMenuStrings[2], _mainMenuStrings[3], nullptr },
 		{ 0x01, 0x04, 0x0C, 0x04, 0x00, 0x80, 0xFF },
 		{ 0x16, 0x19, 0x1A, 0x16 },
 		_lang == 3 ? Screen::FID_CHINESE_FNT : Screen::FID_8_FNT, 240
@@ -366,9 +366,9 @@ void KyraEngine_MR::initMainMenu() {
 
 void KyraEngine_MR::uninitMainMenu() {
 	delete _menuAnim;
-	_menuAnim = 0;
+	_menuAnim = nullptr;
 	delete _menu;
-	_menu = 0;
+	_menu = nullptr;
 }
 
 void KyraEngine_MR::playVQA(const char *name) {
@@ -514,7 +514,7 @@ void KyraEngine_MR::preinit() {
 }
 
 void KyraEngine_MR::initMouseShapes() {
-	uint8 *data = _res->fileData("MOUSE.SHP", 0);
+	uint8 *data = _res->fileData("MOUSE.SHP", nullptr);
 	assert(data);
 	for (int i = 0; i <= 6; ++i)
 		_gameShapes[i] = _screen->makeShapeCopy(data, i);
@@ -610,9 +610,9 @@ void KyraEngine_MR::startup() {
 	_res->exists("MOODOMTR.WSA", true);
 	_invWsa = new WSAMovie_v2(this);
 	assert(_invWsa);
-	_invWsa->open("MOODOMTR.WSA", 1, 0);
+	_invWsa->open("MOODOMTR.WSA", 1, nullptr);
 	_invWsaFrame = 6;
-	saveGameStateIntern(0, "New Game", 0);
+	saveGameStateIntern(0, "New Game", nullptr);
 	if (_gameToLoad == -1)
 		enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
 	else
@@ -637,12 +637,12 @@ void KyraEngine_MR::loadCostPal() {
 }
 
 void KyraEngine_MR::loadShadowShape() {
-	_screen->loadBitmap("SHADOW.CSH", 3, 3, 0);
+	_screen->loadBitmap("SHADOW.CSH", 3, 3, nullptr);
 	addShapeToPool(_screen->getCPagePtr(3), 421, 0);
 }
 
 void KyraEngine_MR::loadExtrasShapes() {
-	_screen->loadBitmap("EXTRAS.CSH", 3, 3, 0);
+	_screen->loadBitmap("EXTRAS.CSH", 3, 3, nullptr);
 	for (int i = 0; i < 20; ++i)
 		addShapeToPool(_screen->getCPagePtr(3), i+433, i);
 	addShapeToPool(_screen->getCPagePtr(3), 453, 20);
@@ -650,24 +650,24 @@ void KyraEngine_MR::loadExtrasShapes() {
 }
 
 void KyraEngine_MR::loadInterfaceShapes() {
-	_screen->loadBitmap("INTRFACE.CSH", 3, 3, 0);
+	_screen->loadBitmap("INTRFACE.CSH", 3, 3, nullptr);
 	for (int i = 422; i <= 432; ++i)
 		addShapeToPool(_screen->getCPagePtr(3), i, i-422);
 }
 
 void KyraEngine_MR::loadInterface() {
-	_screen->loadBitmap("INTRFACE.CPS", 3, 3, 0);
+	_screen->loadBitmap("INTRFACE.CPS", 3, 3, nullptr);
 	memcpy(_interface, _screen->getCPagePtr(3), _interfaceSize);
 	memcpy(_interfaceCommandLine, _screen->getCPagePtr(3), _interfaceCommandLineSize);
 }
 
 void KyraEngine_MR::initItems() {
-	_screen->loadBitmap("ITEMS.CSH", 3, 3, 0);
+	_screen->loadBitmap("ITEMS.CSH", 3, 3, nullptr);
 
 	for (int i = 248; i <= 319; ++i)
 		addShapeToPool(_screen->getCPagePtr(3), i, i-248);
 
-	_screen->loadBitmap("ITEMS2.CSH", 3, 3, 0);
+	_screen->loadBitmap("ITEMS2.CSH", 3, 3, nullptr);
 
 	for (int i = 320; i <= 397; ++i)
 		addShapeToPool(_screen->getCPagePtr(3), i, i-320);
@@ -910,7 +910,7 @@ void KyraEngine_MR::runLoop() {
 			removeHandItem();
 			delay(5);
 			_drawNoShapeFlag = 0;
-			_gui->optionsButton(0);
+			_gui->optionsButton(nullptr);
 			_deathHandler = -1;
 
 			if (!_runFlag || shouldQuit())
@@ -1249,7 +1249,7 @@ void KyraEngine_MR::restoreGfxRect32x32(int x, int y) {
 
 int KyraEngine_MR::loadLanguageFile(const char *file, uint8 *&buffer) {
 	delete[] buffer;
-	buffer = 0;
+	buffer = nullptr;
 
 	uint32 size = 0;
 	Common::String nBuf = file;
diff --git a/engines/kyra/engine/kyra_v1.cpp b/engines/kyra/engine/kyra_v1.cpp
index af29e4af7f..f537eb4ee6 100644
--- a/engines/kyra/engine/kyra_v1.cpp
+++ b/engines/kyra/engine/kyra_v1.cpp
@@ -34,12 +34,12 @@ namespace Kyra {
 
 KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
 	: Engine(system), _flags(flags), _rnd("kyra") {
-	_res = 0;
-	_sound = 0;
-	_text = 0;
-	_staticres = 0;
-	_timer = 0;
-	_emc = 0;
+	_res = nullptr;
+	_sound = nullptr;
+	_text = nullptr;
+	_staticres = nullptr;
+	_timer = nullptr;
+	_emc = nullptr;
 
 	_configRenderMode = Common::kRenderDefault;
 	_configNullSound = false;
@@ -50,7 +50,7 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
 		_gameSpeed = 60;
 	_tickLength = (uint8)(1000.0 / _gameSpeed);
 
-	_trackMap = 0;
+	_trackMap = nullptr;
 	_trackMapSize = 0;
 	_lastMusicCommand = -1;
 	_curSfxFile = _curMusicTheme = -1;
@@ -119,7 +119,7 @@ Common::Error KyraEngine_v1::init() {
 				else
 					type = Sound::kMidiGM;
 
-				MidiDriver *driver = 0;
+				MidiDriver *driver = nullptr;
 
 				if (musicType == MT_PCSPK) {
 					driver = new MidiDriver_PCSpeaker(_mixer);
@@ -260,7 +260,7 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag)
 				} else {
 					char savegameName[14];
 					sprintf(savegameName, "Quicksave %d", event.kbd.keycode - Common::KEYCODE_0);
-					saveGameStateIntern(saveLoadSlot, savegameName, 0);
+					saveGameStateIntern(saveLoadSlot, savegameName, nullptr);
 				}
 			} else if (event.kbd.hasFlags(Common::KBD_CTRL)) {
 				if (event.kbd.keycode == Common::KEYCODE_q) {
diff --git a/engines/kyra/engine/kyra_v2.cpp b/engines/kyra/engine/kyra_v2.cpp
index 79e6017aff..2bf6b1fd08 100644
--- a/engines/kyra/engine/kyra_v2.cpp
+++ b/engines/kyra/engine/kyra_v2.cpp
@@ -36,7 +36,7 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const Engi
 	_lastProcessedSceneScript = 0;
 	_specialSceneScriptRunFlag = false;
 
-	_itemList = 0;
+	_itemList = nullptr;
 	_itemListSize = 0;
 
 	_characterShapeFile = -1;
@@ -48,7 +48,7 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const Engi
 
 	Common::fill(_sceneSpecialScriptsTimer, ARRAYEND(_sceneSpecialScriptsTimer), 0);
 
-	_animObjects = 0;
+	_animObjects = nullptr;
 
 	_runFlag = true;
 	_showOutro = false;
@@ -56,7 +56,7 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const Engi
 	_animNeedUpdate = false;
 
 	_animShapeCount = 0;
-	_animShapeFiledata = 0;
+	_animShapeFiledata = nullptr;
 
 	_vocHigh = -1;
 	_chatVocHigh = -1;
@@ -67,7 +67,7 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const Engi
 
 	memset(_hiddenItems, -1, sizeof(_hiddenItems));
 
-	_screenBuffer = 0;
+	_screenBuffer = nullptr;
 
 	memset(&_mainCharacter, 0, sizeof(_mainCharacter));
 	memset(&_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory));
@@ -195,7 +195,7 @@ void KyraEngine_v2::remShapeFromPool(int idx) {
 uint8 *KyraEngine_v2::getShapePtr(int shape) const {
 	ShapeMap::iterator iter = _gameShapes.find(shape);
 	if (iter == _gameShapes.end())
-		return 0;
+		return nullptr;
 	return iter->_value;
 }
 
@@ -231,7 +231,7 @@ void KyraEngine_v2::moveCharacter(int facing, int x, int y) {
 }
 
 void KyraEngine_v2::updateCharPosWithUpdate() {
-	updateCharPos(0, 0);
+	updateCharPos(nullptr, 0);
 	update();
 }
 
diff --git a/engines/kyra/engine/scene_hof.cpp b/engines/kyra/engine/scene_hof.cpp
index 1d122a5a29..331d30c68f 100644
--- a/engines/kyra/engine/scene_hof.cpp
+++ b/engines/kyra/engine/scene_hof.cpp
@@ -36,7 +36,7 @@ void KyraEngine_HoF::enterNewScene(uint16 newScene, int facing, int unk1, int un
 			_screen->updateScreen();
 			openTalkFile(_currentTalkFile);
 		}
-		showMessage(0, 207);
+		showMessage(nullptr, 207);
 		_screen->updateScreen();
 	}
 
@@ -301,7 +301,7 @@ int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) {
 
 		int ret = 0;
 		if (moveTable == moveTableStart || moveTable[1] == 8)
-			ret = updateCharPos(0);
+			ret = updateCharPos(nullptr);
 		else
 			ret = updateCharPos(moveTable);
 
@@ -393,7 +393,7 @@ void KyraEngine_HoF::loadScenePal() {
 	char filename[14];
 	strcpy(filename, _sceneList[sceneId].filename1);
 	strcat(filename, ".COL");
-	_screen->loadBitmap(filename, 3, 3, 0);
+	_screen->loadBitmap(filename, 3, 3, nullptr);
 	_screen->getPalette(1).copy(_screen->getCPagePtr(3), 0, 128);
 	_screen->getPalette(1).fill(0, 1, 0);
 	memcpy(_scenePal, _screen->getCPagePtr(3)+336, 432);
@@ -404,7 +404,7 @@ void KyraEngine_HoF::loadSceneMsc() {
 	char filename[14];
 	strcpy(filename, _sceneList[sceneId].filename1);
 	strcat(filename, ".MSC");
-	_screen->loadBitmap(filename, 3, 5, 0);
+	_screen->loadBitmap(filename, 3, 5, nullptr);
 }
 
 void KyraEngine_HoF::startSceneScript(int unk1) {
@@ -416,7 +416,7 @@ void KyraEngine_HoF::startSceneScript(int unk1) {
 		strcpy(filename, "DOORX");
 	strcat(filename, ".CPS");
 
-	_screen->loadBitmap(filename, 3, 3, 0);
+	_screen->loadBitmap(filename, 3, 3, nullptr);
 	resetScaleTable();
 	_useCharPal = false;
 	memset(_charPalTable, 0, sizeof(_charPalTable));
@@ -532,7 +532,7 @@ void KyraEngine_HoF::initSceneAnims(int unk1) {
 	animState->needRefresh = 1;
 	animState->specialRefresh = 1;
 
-	_animList = 0;
+	_animList = nullptr;
 
 	AnimObj *charAnimState = animState;
 
@@ -564,7 +564,7 @@ void KyraEngine_HoF::initSceneAnims(int unk1) {
 		if (_sceneAnims[i].flags & 0x20)
 			animState->shapePtr = _sceneShapeTable[_sceneAnims[i].shapeIndex];
 		else
-			animState->shapePtr = 0;
+			animState->shapePtr = nullptr;
 
 		if (_sceneAnims[i].flags & 0x40) {
 			animState->shapeIndex3 = _sceneAnims[i].shapeIndex;
diff --git a/engines/kyra/engine/scene_lok.cpp b/engines/kyra/engine/scene_lok.cpp
index c26e0ccba1..85f4668e71 100644
--- a/engines/kyra/engine/scene_lok.cpp
+++ b/engines/kyra/engine/scene_lok.cpp
@@ -270,7 +270,7 @@ void KyraEngine_LoK::moveCharacterToPos(int character, int facing, int xpos, int
 }
 
 void KyraEngine_LoK::setCharacterPositionWithUpdate(int character) {
-	setCharacterPosition(character, 0);
+	setCharacterPosition(character, nullptr);
 	_sprites->updateSceneAnims();
 	_timer->update();
 	_animator->updateAllObjectShapes();
@@ -290,7 +290,7 @@ int KyraEngine_LoK::setCharacterPosition(int character, int *facingTable) {
 		_characterList[character].x1 += _charAddXPosTable[_characterList[character].facing];
 		_characterList[character].y1 += _charAddYPosTable[_characterList[character].facing];
 		if (_characterList[character].sceneId == _currentCharacter->sceneId)
-			setCharacterPositionHelper(character, 0);
+			setCharacterPositionHelper(character, nullptr);
 	}
 	return 0;
 }
@@ -384,7 +384,7 @@ void KyraEngine_LoK::loadSceneMsc() {
 	strcat(fileNameBuffer, ".MSC");
 	_screen->fillRect(0, 0, 319, 199, 0, 5);
 	_res->exists(fileNameBuffer, true);
-	_screen->loadBitmap(fileNameBuffer, 3, 5, 0);
+	_screen->loadBitmap(fileNameBuffer, 3, 5, nullptr);
 }
 
 void KyraEngine_LoK::startSceneScript(int brandonAlive) {
@@ -397,9 +397,9 @@ void KyraEngine_LoK::startSceneScript(int brandonAlive) {
 	_screen->clearPage(3);
 	_res->exists(fileNameBuffer, true);
 	// FIXME: check this hack for amiga version
-	_screen->loadBitmap(fileNameBuffer, 3, 3, (_flags.platform == Common::kPlatformAmiga ? &_screen->getPalette(0) : 0));
+	_screen->loadBitmap(fileNameBuffer, 3, 3, (_flags.platform == Common::kPlatformAmiga ? &_screen->getPalette(0) : nullptr));
 	_sprites->loadSceneShapes();
-	_exitListPtr = 0;
+	_exitListPtr = nullptr;
 
 	_scaleMode = 1;
 	for (int i = 0; i < 145; ++i)
@@ -949,7 +949,7 @@ int KyraEngine_LoK::processSceneChange(int *table, int unk1, int frameReset) {
 
 		int temp = 0;
 		if (table == tableStart || table[1] == 8)
-			temp = setCharacterPosition(0, 0);
+			temp = setCharacterPosition(0, nullptr);
 		else
 			temp = setCharacterPosition(0, table);
 
diff --git a/engines/kyra/engine/scene_mr.cpp b/engines/kyra/engine/scene_mr.cpp
index 237a50aae6..e7fcd4f9e1 100644
--- a/engines/kyra/engine/scene_mr.cpp
+++ b/engines/kyra/engine/scene_mr.cpp
@@ -33,7 +33,7 @@ void KyraEngine_MR::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
 	++_enterNewSceneLock;
 	_screen->hideMouse();
 
-	showMessage(0, 0xF0, 0xF0);
+	showMessage(nullptr, 0xF0, 0xF0);
 	if (_inventoryState)
 		hideInventory();
 
@@ -284,7 +284,7 @@ void KyraEngine_MR::enterNewSceneUnk2(int unk1) {
 
 void KyraEngine_MR::unloadScene() {
 	delete[] _sceneStrings;
-	_sceneStrings = 0;
+	_sceneStrings = nullptr;
 	_emc->unload(&_sceneScriptData);
 	freeSceneShapes();
 	freeSceneAnims();
@@ -293,7 +293,7 @@ void KyraEngine_MR::unloadScene() {
 void KyraEngine_MR::freeSceneShapes() {
 	for (uint i = 0; i < ARRAYSIZE(_sceneShapes); ++i) {
 		delete[] _sceneShapes[i];
-		_sceneShapes[i] = 0;
+		_sceneShapes[i] = nullptr;
 	}
 }
 
@@ -303,7 +303,7 @@ void KyraEngine_MR::loadScenePal() {
 	strcpy(filename, _sceneList[_mainCharacter.sceneId].filename1);
 	strcat(filename, ".COL");
 
-	_screen->loadBitmap(filename, 3, 3, 0);
+	_screen->loadBitmap(filename, 3, 3, nullptr);
 	_screen->getPalette(2).copy(_screen->getCPagePtr(3), 0, 144);
 	_screen->getPalette(2).fill(0, 1, 0);
 
@@ -330,13 +330,13 @@ void KyraEngine_MR::loadSceneMsc() {
 	minY = stream->readSint16LE();
 	height = stream->readSint16LE();
 	delete stream;
-	stream = 0;
+	stream = nullptr;
 	_maskPageMinY = minY;
 	_maskPageMaxY = minY + height - 1;
 
 	_screen->setShapePages(5, 3, _maskPageMinY, _maskPageMaxY);
 
-	_screen->loadBitmap(filename, 5, 5, 0, true);
+	_screen->loadBitmap(filename, 5, 5, nullptr, true);
 
 	// HACK
 	uint8 *data = new uint8[320*200];
@@ -371,7 +371,7 @@ void KyraEngine_MR::initSceneScript(int unk1) {
 	if (shapesCount > 0) {
 		strcpy(filename, scene.filename1);
 		strcat(filename, "9.CPS");
-		_screen->loadBitmap(filename, 3, 3, 0);
+		_screen->loadBitmap(filename, 3, 3, nullptr);
 		int pageBackUp = _screen->_curPage;
 		_screen->_curPage = 2;
 		for (int i = 0; i < shapesCount; ++i) {
@@ -387,11 +387,11 @@ void KyraEngine_MR::initSceneScript(int unk1) {
 		_screen->_curPage = pageBackUp;
 	}
 	delete stream;
-	stream = 0;
+	stream = nullptr;
 
 	strcpy(filename, scene.filename1);
 	strcat(filename, ".CPS");
-	_screen->loadBitmap(filename, 3, 3, 0);
+	_screen->loadBitmap(filename, 3, 3, nullptr);
 
 	Common::fill(_specialSceneScriptState, ARRAYEND(_specialSceneScriptState), false);
 	_sceneEnterX1 = 160;
@@ -465,7 +465,7 @@ void KyraEngine_MR::initSceneAnims(int unk1) {
 	_mainCharacter.x3 = _mainCharacter.x1 - (_charScale >> 4) - 1;
 	_mainCharacter.y3 = _mainCharacter.y1 - (_charScale >> 6) - 1;
 	obj->needRefresh = true;
-	_animList = 0;
+	_animList = nullptr;
 
 	for (int i = 0; i < 16; ++i) {
 		const SceneAnim &anim = _sceneAnims[i];
@@ -489,7 +489,7 @@ void KyraEngine_MR::initSceneAnims(int unk1) {
 		if ((anim.flags & 4) && anim.shapeIndex != -1)
 			obj->shapePtr = _sceneShapes[anim.shapeIndex];
 		else
-			obj->shapePtr = 0;
+			obj->shapePtr = nullptr;
 
 		if (anim.flags & 8) {
 			obj->shapeIndex3 = anim.shapeIndex;
@@ -525,7 +525,7 @@ void KyraEngine_MR::initSceneAnims(int unk1) {
 			obj->xPos1 = item.x;
 			obj->yPos1 = item.y;
 			animSetupPaletteEntry(obj);
-			obj->shapePtr = 0;
+			obj->shapePtr = nullptr;
 			obj->shapeIndex1 = obj->shapeIndex2 = item.id + 248;
 			obj->xPos2 = item.x;
 			obj->yPos2 = item.y;
@@ -636,7 +636,7 @@ int KyraEngine_MR::trySceneChange(int *moveTable, int unk1, int updateChar) {
 
 		int ret = 0;
 		if (moveTable == moveTableStart || moveTable[1] == 8)
-			ret = updateCharPos(0, 0);
+			ret = updateCharPos(nullptr, 0);
 		else
 			ret = updateCharPos(moveTable, 0);
 
diff --git a/engines/kyra/engine/sprites.cpp b/engines/kyra/engine/sprites.cpp
index c0e945a869..1abfe861f3 100644
--- a/engines/kyra/engine/sprites.cpp
+++ b/engines/kyra/engine/sprites.cpp
@@ -33,10 +33,10 @@ Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) : _rnd("kyraSprites") {
 	_res = vm->resource();
 	_screen = vm->screen();
 	_system = system;
-	_dat = 0;
+	_dat = nullptr;
 	memset(_anims, 0, sizeof(_anims));
 	memset(_sceneShapes, 0, sizeof(_sceneShapes));
-	_spriteDefStart = 0;
+	_spriteDefStart = nullptr;
 	memset(_drawLayerTable, 0, sizeof(_drawLayerTable));
 	_sceneAnimatorBeaconFlag = 0;
 }
@@ -55,9 +55,9 @@ void Sprites::setupSceneAnims() {
 
 	for (int i = 0; i < MAX_NUM_ANIMS; i++) {
 		delete[] _anims[i].background;
-		_anims[i].background = 0;
+		_anims[i].background = nullptr;
 
-		if (_anims[i].script != 0) {
+		if (_anims[i].script != nullptr) {
 			data = _anims[i].script;
 
 			assert(READ_LE_UINT16(data) == 0xFF86);
@@ -125,7 +125,7 @@ void Sprites::updateSceneAnims() {
 	uint16 sound;
 
 	for (int i = 0; i < MAX_NUM_ANIMS; i++) {
-		if (_anims[i].script == 0 || !_anims[i].play || (_anims[i].nextRun != 0 && _anims[i].nextRun > currTime))
+		if (_anims[i].script == nullptr || !_anims[i].play || (_anims[i].nextRun != 0 && _anims[i].nextRun > currTime))
 			continue;
 
 		data = _anims[i].curPos;
@@ -324,7 +324,7 @@ void Sprites::updateSceneAnims() {
 		case 0xFFAA:
 			data += 2;
 			debugC(6, kDebugLevelSprites, "func: Reset Brandon's sprite");
-			_vm->animator()->actors()->sceneAnimPtr = 0;
+			_vm->animator()->actors()->sceneAnimPtr = nullptr;
 			_vm->animator()->actors()->bkgdChangeFlag = 1;
 			_vm->animator()->actors()->refreshFlag = 1;
 			_vm->animator()->restoreAllObjectBackgrounds();
@@ -388,7 +388,7 @@ void Sprites::loadDat(const char *filename, SceneExits &exits) {
 	uint32 fileSize;
 
 	delete[] _dat;
-	_spriteDefStart = 0;
+	_spriteDefStart = nullptr;
 
 	_res->exists(filename, true);
 	_dat = _res->fileData(filename, &fileSize);
@@ -499,7 +499,7 @@ void Sprites::loadDat(const char *filename, SceneExits &exits) {
 void Sprites::freeSceneShapes() {
 	for (int i = 0; i < ARRAYSIZE(_sceneShapes); i++) {
 		delete[] _sceneShapes[i];
-		_sceneShapes[i] = 0;
+		_sceneShapes[i] = nullptr;
 	}
 }
 
@@ -510,7 +510,7 @@ void Sprites::loadSceneShapes() {
 	freeSceneShapes();
 	memset( _sceneShapes, 0, sizeof(_sceneShapes));
 
-	if (_spriteDefStart == 0)
+	if (_spriteDefStart == nullptr)
 		return;
 
 	int bakPage = _screen->_curPage;
diff --git a/engines/kyra/engine/timer_hof.cpp b/engines/kyra/engine/timer_hof.cpp
index 7a1d611e47..a71c5d8957 100644
--- a/engines/kyra/engine/timer_hof.cpp
+++ b/engines/kyra/engine/timer_hof.cpp
@@ -28,7 +28,7 @@ namespace Kyra {
 #define TimerV2(x) new Common::Functor1Mem<int, void, KyraEngine_HoF>(this, &KyraEngine_HoF::x)
 
 void KyraEngine_HoF::setupTimers() {
-	_timer->addTimer(0, 0, 5, 1);
+	_timer->addTimer(0, nullptr, 5, 1);
 	_timer->addTimer(1, TimerV2(timerFadeOutMessage), -1, 1);
 	_timer->addTimer(2, TimerV2(timerCauldronAnimation), 1, 1);
 	_timer->addTimer(3, TimerV2(timerFunc4), 1, 0);
diff --git a/engines/kyra/engine/timer_lok.cpp b/engines/kyra/engine/timer_lok.cpp
index 47f8d0c80b..18dcd9dbb9 100644
--- a/engines/kyra/engine/timer_lok.cpp
+++ b/engines/kyra/engine/timer_lok.cpp
@@ -30,16 +30,16 @@ namespace Kyra {
 
 void KyraEngine_LoK::setupTimers() {
 	for (int i = 0; i <= 4; ++i)
-		_timer->addTimer(i, 0, -1, 1);
+		_timer->addTimer(i, nullptr, -1, 1);
 
-	_timer->addTimer(5, 0,  5, 1);
-	_timer->addTimer(6, 0,  7, 1);
-	_timer->addTimer(7, 0,  8, 1);
-	_timer->addTimer(8, 0,  9, 1);
-	_timer->addTimer(9, 0,  7, 1);
+	_timer->addTimer(5, nullptr, 5, 1);
+	_timer->addTimer(6, nullptr, 7, 1);
+	_timer->addTimer(7, nullptr, 8, 1);
+	_timer->addTimer(8, nullptr, 9, 1);
+	_timer->addTimer(9, nullptr, 7, 1);
 
 	for (int i = 10; i <= 13; ++i)
-		_timer->addTimer(i, 0, 420, 1);
+		_timer->addTimer(i, nullptr, 420, 1);
 
 	_timer->addTimer(14, TimerV1(timerAsWillowispTimeout), 600, 1);
 	_timer->addTimer(15, TimerV1(timerUpdateHeadAnims), 11, 1);
@@ -48,19 +48,19 @@ void KyraEngine_LoK::setupTimers() {
 	_timer->addTimer(18, TimerV1(timerAsInvisibleTimeout), 600, 1);
 	_timer->addTimer(19, TimerV1(timerRedrawAmulet), 600, 1);
 
-	_timer->addTimer(20, 0, 7200, 1);
+	_timer->addTimer(20, nullptr, 7200, 1);
 	_timer->addTimer(21, TimerV1(timerLavenderRoseCreator), 18000, 1);
-	_timer->addTimer(22, 0, 7200, 1);
+	_timer->addTimer(22, nullptr, 7200, 1);
 
-	_timer->addTimer(23, 0, 10800, 1);
+	_timer->addTimer(23, nullptr, 10800, 1);
 	_timer->addTimer(24, TimerV1(timerAcornCreator), 10800, 1);
-	_timer->addTimer(25, 0, 10800, 1);
+	_timer->addTimer(25, nullptr, 10800, 1);
 	_timer->addTimer(26, TimerV1(timerBlueberryCreator), 10800, 1);
-	_timer->addTimer(27, 0, 10800, 1);
+	_timer->addTimer(27, nullptr, 10800, 1);
 
-	_timer->addTimer(28, 0, 21600, 1);
-	_timer->addTimer(29, 0, 7200, 1);
-	_timer->addTimer(30, 0, 10800, 1);
+	_timer->addTimer(28, nullptr, 21600, 1);
+	_timer->addTimer(29, nullptr, 7200, 1);
+	_timer->addTimer(30, nullptr, 10800, 1);
 
 	_timer->addTimer(31, TimerV1(timerFadeText), -1, 1);
 	_timer->addTimer(32, TimerV1(timerWillowispFrameTimer), 9, 1);
diff --git a/engines/kyra/engine/timer_mr.cpp b/engines/kyra/engine/timer_mr.cpp
index 544e36afa9..00c7e3f1a4 100644
--- a/engines/kyra/engine/timer_mr.cpp
+++ b/engines/kyra/engine/timer_mr.cpp
@@ -59,7 +59,7 @@ void KyraEngine_MR::timerRunSceneScript7(int arg) {
 
 void KyraEngine_MR::timerFleaDeath(int arg) {
 	_timer->setCountdown(4, 5400);
-	saveGameStateIntern(999, "Autosave", 0);
+	saveGameStateIntern(999, "Autosave", nullptr);
 	_screen->hideMouse();
 	_timer->disable(4);
 	runAnimationScript("FLEADTH1.EMC", 0, 0, 1, 1);
diff --git a/engines/kyra/graphics/animator_hof.cpp b/engines/kyra/graphics/animator_hof.cpp
index 0b8db62a9b..07eef82258 100644
--- a/engines/kyra/graphics/animator_hof.cpp
+++ b/engines/kyra/graphics/animator_hof.cpp
@@ -238,7 +238,7 @@ void KyraEngine_HoF::updateSceneAnim(int anim, int newFrame) {
 		animObject->shapeIndex3 = 0xFFFF;
 		animObject->animNum = 0xFFFF;
 	} else {
-		animObject->shapePtr = 0;
+		animObject->shapePtr = nullptr;
 		animObject->shapeIndex3 = newFrame;
 		animObject->animNum = anim;
 	}
@@ -283,7 +283,7 @@ void KyraEngine_HoF::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer)
 			y = obj->yPos2;
 		}
 
-		_sceneAnimMovie[obj->animNum]->displayFrame(obj->shapeIndex3, 2, x, y, int(flags | layer), 0, 0);
+		_sceneAnimMovie[obj->animNum]->displayFrame(obj->shapeIndex3, 2, x, y, int(flags | layer), nullptr, nullptr);
 	}
 }
 
diff --git a/engines/kyra/graphics/animator_lok.cpp b/engines/kyra/graphics/animator_lok.cpp
index 8fbd073e81..1668e02b5b 100644
--- a/engines/kyra/graphics/animator_lok.cpp
+++ b/engines/kyra/graphics/animator_lok.cpp
@@ -32,7 +32,7 @@ Animator_LoK::Animator_LoK(KyraEngine_LoK *vm, OSystem *system) {
 	_screen = vm->screen();
 	_initOk = false;
 	_system = system;
-	_screenObjects = _actors = _items = _sprites = _objectQueue = 0;
+	_screenObjects = _actors = _items = _sprites = _objectQueue = nullptr;
 	_noDrawShapesFlag = 0;
 
 	_actorBkgBackUp[0] = new uint8[_screen->getRectSize(8, 69)]();
@@ -60,7 +60,7 @@ void Animator_LoK::close() {
 	if (_initOk) {
 		_initOk = false;
 		delete[] _screenObjects;
-		_screenObjects = _actors = _items = _sprites = _objectQueue = 0;
+		_screenObjects = _actors = _items = _sprites = _objectQueue = nullptr;
 	}
 }
 
@@ -390,7 +390,7 @@ void Animator_LoK::animRemoveGameItem(int index) {
 	restoreAllObjectBackgrounds();
 
 	AnimObject *animObj = &_items[index];
-	animObj->sceneAnimPtr = 0;
+	animObj->sceneAnimPtr = nullptr;
 	animObj->animFrameNumber = -1;
 	animObj->refreshFlag = 1;
 	animObj->bkgdChangeFlag = 1;
@@ -463,16 +463,16 @@ Animator_LoK::AnimObject *Animator_LoK::objectRemoveQueue(AnimObject *queue, Ani
 
 	if (cur == queue) {
 		if (!cur)
-			return 0;
+			return nullptr;
 		return cur->nextAnimObject;
 	}
 
 	if (!cur->nextAnimObject) {
 		if (cur == rem) {
 			if (!prev)
-				return 0;
+				return nullptr;
 			else
-				prev->nextAnimObject = 0;
+				prev->nextAnimObject = nullptr;
 		}
 	} else {
 		if (cur == rem)
@@ -507,14 +507,14 @@ Animator_LoK::AnimObject *Animator_LoK::objectQueue(AnimObject *queue, AnimObjec
 		add->nextAnimObject = cur;
 	} else {
 		cur->nextAnimObject = add;
-		add->nextAnimObject = 0;
+		add->nextAnimObject = nullptr;
 	}
 	return queue;
 }
 
 void Animator_LoK::addObjectToQueue(AnimObject *object) {
 	if (!_objectQueue)
-		_objectQueue = objectAddHead(0, object);
+		_objectQueue = objectAddHead(nullptr, object);
 	else
 		_objectQueue = objectQueue(_objectQueue, object);
 }
@@ -524,7 +524,7 @@ void Animator_LoK::refreshObject(AnimObject *object) {
 	if (_objectQueue)
 		_objectQueue = objectQueue(_objectQueue, object);
 	else
-		_objectQueue = objectAddHead(0, object);
+		_objectQueue = objectAddHead(nullptr, object);
 }
 
 void Animator_LoK::makeBrandonFaceMouse() {
diff --git a/engines/kyra/graphics/animator_mr.cpp b/engines/kyra/graphics/animator_mr.cpp
index be987331e3..a67f1bfae7 100644
--- a/engines/kyra/graphics/animator_mr.cpp
+++ b/engines/kyra/graphics/animator_mr.cpp
@@ -118,7 +118,7 @@ void KyraEngine_MR::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) {
 				flags |= 0x8000;
 			x = obj->xPos2 - _sceneAnimMovie[obj->animNum]->xAdd();
 			y = obj->yPos2 - _sceneAnimMovie[obj->animNum]->yAdd();
-			_sceneAnimMovie[obj->animNum]->displayFrame(obj->shapeIndex3, 2, x, y, flags | layer, 0, 0);
+			_sceneAnimMovie[obj->animNum]->displayFrame(obj->shapeIndex3, 2, x, y, flags | layer, nullptr, nullptr);
 		}
 	}
 }
@@ -293,7 +293,7 @@ void KyraEngine_MR::updateSceneAnim(int anim, int newFrame) {
 		animObject->shapeIndex3 = 0xFFFF;
 		animObject->animNum = 0xFFFF;
 	} else {
-		animObject->shapePtr = 0;
+		animObject->shapePtr = nullptr;
 		animObject->shapeIndex3 = newFrame;
 		animObject->animNum = anim;
 	}
@@ -329,7 +329,7 @@ void KyraEngine_MR::setupSceneAnimObject(int animId, uint16 flags, int x, int y,
 		strcpy(anim.filename, filename);
 
 	if (flags & 8) {
-		_sceneAnimMovie[animId]->open(filename, 1, 0);
+		_sceneAnimMovie[animId]->open(filename, 1, nullptr);
 		if (_sceneAnimMovie[animId]->opened()) {
 			anim.wsaFlag = 1;
 			if (x2 == -1)
@@ -369,7 +369,7 @@ void KyraEngine_MR::setupSceneAnimObject(int animId, uint16 flags, int x, int y,
 	if ((anim.flags & 4) && anim.shapeIndex != -1)
 		obj->shapePtr = _sceneShapes[anim.shapeIndex];
 	else
-		obj->shapePtr = 0;
+		obj->shapePtr = nullptr;
 
 	if (anim.flags & 8) {
 		obj->shapeIndex3 = anim.shapeIndex;
diff --git a/engines/kyra/graphics/animator_tim.cpp b/engines/kyra/graphics/animator_tim.cpp
index 3ed6ddb449..e7084f4868 100644
--- a/engines/kyra/graphics/animator_tim.cpp
+++ b/engines/kyra/graphics/animator_tim.cpp
@@ -76,7 +76,7 @@ void TimAnimator::reset(int animIndex, bool clearStruct) {
 	anim->field_D = 0;
 	anim->enable = 0;
 	delete anim->wsa;
-	anim->wsa = 0;
+	anim->wsa = nullptr;
 
 	if (clearStruct) {
 		if (_useParts)
@@ -97,7 +97,7 @@ void TimAnimator::displayFrame(int animIndex, int page, int frame, int flags) {
 		page = 2;
 	// WORKAROUND for some bugged scripts that will try to display frames of non-existent animations
 	if (anim->wsa)
-		anim->wsa->displayFrame(frame, page, anim->x, anim->y, (flags == -1) ? (anim->wsaCopyParams & 0xF0FF) : flags, 0, 0);
+		anim->wsa->displayFrame(frame, page, anim->x, anim->y, (flags == -1) ? (anim->wsaCopyParams & 0xF0FF) : flags, nullptr, nullptr);
 	if (!page)
 		_screen->updateScreen();
 }
diff --git a/engines/kyra/graphics/animator_v2.cpp b/engines/kyra/graphics/animator_v2.cpp
index 6cda7cc84e..222d06247b 100644
--- a/engines/kyra/graphics/animator_v2.cpp
+++ b/engines/kyra/graphics/animator_v2.cpp
@@ -40,7 +40,7 @@ KyraEngine_v2::AnimObj *KyraEngine_v2::initAnimList(AnimObj *list, AnimObj *entr
 }
 
 KyraEngine_v2::AnimObj *KyraEngine_v2::addToAnimListSorted(AnimObj *list, AnimObj *add) {
-	add->nextObject = 0;
+	add->nextObject = nullptr;
 
 	if (!list)
 		return add;
@@ -65,16 +65,16 @@ KyraEngine_v2::AnimObj *KyraEngine_v2::addToAnimListSorted(AnimObj *list, AnimOb
 		add->nextObject = cur;
 	} else {
 		cur->nextObject = add;
-		add->nextObject = 0;
+		add->nextObject = nullptr;
 	}
 	return list;
 }
 
 KyraEngine_v2::AnimObj *KyraEngine_v2::deleteAnimListEntry(AnimObj *list, AnimObj *entry) {
 	if (!list)
-		return 0;
+		return nullptr;
 
-	AnimObj *old = 0;
+	AnimObj *old = nullptr;
 	AnimObj *cur = list;
 
 	while (true) {
@@ -91,15 +91,15 @@ KyraEngine_v2::AnimObj *KyraEngine_v2::deleteAnimListEntry(AnimObj *list, AnimOb
 
 	if (cur == list) {
 		if (!cur->nextObject)
-			return 0;
+			return nullptr;
 		cur = cur->nextObject;
 		return cur;
 	}
 
 	if (!cur->nextObject) {
 		if (!old)
-			return 0;
-		old->nextObject = 0;
+			return nullptr;
+		old->nextObject = nullptr;
 		return list;
 	}
 
@@ -171,7 +171,7 @@ void KyraEngine_v2::deleteItemAnimEntry(int item) {
 
 	restorePage3();
 
-	animObj->shapePtr = 0;
+	animObj->shapePtr = nullptr;
 	animObj->shapeIndex1 = 0xFFFF;
 	animObj->shapeIndex2 = 0xFFFF;
 	animObj->needRefresh = 1;
diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 16e3fc9bd2..5241a06d92 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -58,15 +58,15 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, co
 	_renderMode = Common::kRenderDefault;
 	_sjisMixedFontMode = false;
 
-	_screenPalette = _internFadePalette = 0;
-	_animBlockPtr = _textRenderBuffer = 0;
+	_screenPalette = _internFadePalette = nullptr;
+	_animBlockPtr = _textRenderBuffer = nullptr;
 	_textRenderBufferSize = 0;
 
 	_useHiColorScreen = _vm->gameFlags().useHiColorMode;
 	_useShapeShading = true;
 	_screenPageSize = SCREEN_PAGE_SIZE;
-	_16bitPalette = 0;
-	_16bitConversionPalette = 0;
+	_16bitPalette = nullptr;
+	_16bitConversionPalette = nullptr;
 	_16bitShadingLevel = 0;
 	_bytesPerPixel = 1;
 	_4bitPixelPacking = _useAmigaExtraColors = _isAmiga = _isSegaCD = _use16ColorMode = false;
@@ -76,8 +76,8 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, co
 	_fontStyles = 0;
 	_paletteChanged = true;
 	_textMarginRight = SCREEN_W;
-	_customDimTable = 0;
-	_curDim = 0;
+	_customDimTable = nullptr;
+	_curDim = nullptr;
 
 	_yTransOffs = 0;
 }
@@ -243,13 +243,13 @@ bool Screen::init() {
 	memset(_customDimTable, 0, sizeof(ScreenDim *) * _dimTableCount);
 
 	_curDimIndex = -1;
-	_curDim = 0;
+	_curDim = nullptr;
 	_charSpacing = 0;
 	_lineSpacing = 0;
 	for (int i = 0; i < ARRAYSIZE(_textColorsMap); ++i)
 		_textColorsMap[i] = i;
 	_textColorsMap16bit[0] = _textColorsMap16bit[1] = 0;
-	_animBlockPtr = NULL;
+	_animBlockPtr = nullptr;
 	_animBlockSize = 0;
 	_mouseLockCount = 1;
 	CursorMan.showMouse(false);
@@ -324,7 +324,7 @@ void Screen::enableHiColorMode(bool enabled) {
 			_16bitPalette = new uint16[1024];
 		memset(_16bitPalette, 0, 1024 * sizeof(uint16));
 		delete[] _16bitConversionPalette;
-		_16bitConversionPalette = 0;
+		_16bitConversionPalette = nullptr;
 		_bytesPerPixel = 2;
 	} else {
 		if (_useHiColorScreen) {
@@ -334,7 +334,7 @@ void Screen::enableHiColorMode(bool enabled) {
 		}
 
 		delete[] _16bitPalette;
-		_16bitPalette = 0;
+		_16bitPalette = nullptr;
 		_bytesPerPixel = 1;
 	}
 
@@ -1546,12 +1546,12 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 		1, 3, 2, 5, 4, 3, 2, 1
 	};
 
-	_dsShapeFadingTable = 0;
+	_dsShapeFadingTable = nullptr;
 	_dsShapeFadingLevel = 0;
-	_dsColorTable = 0;
-	_dsTransparencyTable1 = 0;
-	_dsTransparencyTable2 = 0;
-	_dsBackgroundFadingTable = 0;
+	_dsColorTable = nullptr;
+	_dsTransparencyTable1 = nullptr;
+	_dsTransparencyTable2 = nullptr;
+	_dsBackgroundFadingTable = nullptr;
 	_dsDrawLayer = 0;
 
 	if (flags & DSF_CUSTOM_PALETTE) {
@@ -1632,7 +1632,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 	static const DsPlotFunc dsPlotFunc[] = {
 		&Screen::drawShapePlotType0,		// used by Kyra 1 + 2
 		&Screen::drawShapePlotType1,		// used by Kyra 3
-		0,
+		nullptr,
 		&Screen::drawShapePlotType3_7,		// used by Kyra 3 (shadow)
 		&Screen::drawShapePlotType4,		// used by Kyra 1, 2 + 3
 		&Screen::drawShapePlotType5,		// used by Kyra 1
@@ -1640,27 +1640,27 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 		&Screen::drawShapePlotType3_7,		// used by Kyra 1 (invisibility)
 		&Screen::drawShapePlotType8,		// used by Kyra 2
 		&Screen::drawShapePlotType9,		// used by Kyra 1 + 3
-		0,
+		nullptr,
 		&Screen::drawShapePlotType11_15,	// used by Kyra 1 (invisibility) + Kyra 3 (shadow)
 		&Screen::drawShapePlotType12,		// used by Kyra 2
 		&Screen::drawShapePlotType13,		// used by Kyra 1
 		&Screen::drawShapePlotType14,		// used by Kyra 1 (invisibility)
 		&Screen::drawShapePlotType11_15,	// used by Kyra 1 (invisibility)
 		&Screen::drawShapePlotType16,		// used by LoL PC-98/16 Colors (teleporters),
-		0, 0, 0,
+		nullptr, nullptr, nullptr,
 		&Screen::drawShapePlotType20,		// used by LoL (heal spell effect)
 		&Screen::drawShapePlotType21,		// used by LoL (white tower spirits)
-		0, 0, 0, 0,	0, 0, 0, 0, 0, 0,
-		0,
+		nullptr, nullptr, nullptr, nullptr,	nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
+		nullptr,
 		&Screen::drawShapePlotType33,		// used by LoL (blood spots on the floor)
-		0, 0, 0,
+		nullptr, nullptr, nullptr,
 		&Screen::drawShapePlotType37,		// used by LoL (monsters)
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
 		&Screen::drawShapePlotType48,		// used by LoL (slime spots on the floor)
-		0, 0, 0,
+		nullptr, nullptr, nullptr,
 		&Screen::drawShapePlotType52,		// used by LoL (projectiles)
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0
+		nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
+		nullptr
 	};
 
 	int scaleCounterV = 0;
@@ -1748,7 +1748,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 		}
 
 		t *= -1;
-		const uint8 *srcBackUp = 0;
+		const uint8 *srcBackUp = nullptr;
 
 		do {
 			_dsOffscreenScaleVal1 = 0;
@@ -2741,7 +2741,7 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) {
 	uint8 table[274];
 	int tableIndex = 0;
 
-	uint8 *newShape = 0;
+	uint8 *newShape = nullptr;
 	newShape = new uint8[shapeSize+16];
 	assert(newShape);
 
@@ -2875,7 +2875,7 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) {
 int16 Screen::encodeShapeAndCalculateSize(uint8 *from, uint8 *to, int size_to) {
 	byte *fromPtrEnd = from + size_to;
 	bool skipPixel = true;
-	byte *tempPtr = 0;
+	byte *tempPtr = nullptr;
 	byte *toPtr = to;
 	byte *fromPtr = from;
 	byte *toPtr2 = to;
@@ -3450,7 +3450,7 @@ byte *Screen::getOverlayPtr(int page) {
 			return _sjisOverlayPtrs[5];
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void Screen::clearOverlayPage(int page) {
@@ -3568,10 +3568,10 @@ void Screen::crossFadeRegion(int x1, int y1, int x2, int y2, int w, int h, int s
 #pragma mark -
 
 DOSFont::DOSFont() {
-	_data = _widthTable = _heightTable = 0;
-	_colorMap = 0;
+	_data = _widthTable = _heightTable = nullptr;
+	_colorMap = nullptr;
 	_width = _height = _numGlyphs = 0;
-	_bitmapOffsets = 0;
+	_bitmapOffsets = nullptr;
 }
 
 bool DOSFont::load(Common::SeekableReadStream &file) {
@@ -3673,10 +3673,10 @@ void DOSFont::drawChar(uint16 c, byte *dst, int pitch, int) const {
 
 void DOSFont::unload() {
 	delete[] _data;
-	_data = _widthTable = _heightTable = 0;
-	_colorMap = 0;
+	_data = _widthTable = _heightTable = nullptr;
+	_colorMap = nullptr;
 	_width = _height = _numGlyphs = 0;
-	_bitmapOffsets = 0;
+	_bitmapOffsets = nullptr;
 }
 
 
@@ -3790,7 +3790,7 @@ void AMIGAFont::unload() {
 }
 
 SJISFont::SJISFont(Common::SharedPtr<Graphics::FontSJIS> &font, const uint8 invisColor, bool is16Color, bool drawOutline, int extraSpacing)
-	: _colorMap(0), _font(font), _invisColor(invisColor), _isTextMode(is16Color), _style(kStyleNone), _drawOutline(drawOutline), _sjisWidthOffset(extraSpacing) {
+	: _colorMap(nullptr), _font(font), _invisColor(invisColor), _isTextMode(is16Color), _style(kStyleNone), _drawOutline(drawOutline), _sjisWidthOffset(extraSpacing) {
 	assert(_font);
 	_sjisWidth = _font->getMaxFontWidth() >> 1;
 	_fontHeight = _font->getFontHeight() >> 1;
@@ -3840,14 +3840,14 @@ void SJISFont::drawChar(uint16 c, byte *dst, int pitch, int) const {
 
 #pragma mark -
 
-Palette::Palette(const int numColors) : _palData(0), _numColors(numColors) {
+Palette::Palette(const int numColors) : _palData(nullptr), _numColors(numColors) {
 	_palData = new uint8[numColors * 3]();
 	assert(_palData);
 }
 
 Palette::~Palette() {
 	delete[] _palData;
-	_palData = 0;
+	_palData = nullptr;
 }
 
 void Palette::loadVGAPalette(Common::ReadStream &stream, int startIndex, int colors) {
diff --git a/engines/kyra/graphics/screen_lok.cpp b/engines/kyra/graphics/screen_lok.cpp
index 48d60052c8..5fe81eab55 100644
--- a/engines/kyra/graphics/screen_lok.cpp
+++ b/engines/kyra/graphics/screen_lok.cpp
@@ -32,19 +32,19 @@ namespace Kyra {
 Screen_LoK::Screen_LoK(KyraEngine_LoK *vm, OSystem *system)
 	: Screen(vm, system, _screenDimTable, _screenDimTableCount) {
 	_vm = vm;
-	_unkPtr1 = _unkPtr2 = 0;
+	_unkPtr1 = _unkPtr2 = nullptr;
 	_bitBlitNum = 0;
 }
 
 Screen_LoK::~Screen_LoK() {
 	for (int i = 0; i < ARRAYSIZE(_saveLoadPage); ++i) {
 		delete[] _saveLoadPage[i];
-		_saveLoadPage[i] = 0;
+		_saveLoadPage[i] = nullptr;
 	}
 
 	for (int i = 0; i < ARRAYSIZE(_saveLoadPageOvl); ++i) {
 		delete[] _saveLoadPageOvl[i];
-		_saveLoadPageOvl[i] = 0;
+		_saveLoadPageOvl[i] = nullptr;
 	}
 
 	delete[] _unkPtr1;
@@ -154,7 +154,7 @@ void Screen_LoK::loadPageFromDisk(const char *file, int page) {
 
 	copyBlockToPage(page, 0, 0, SCREEN_W, SCREEN_H, _saveLoadPage[page / 2]);
 	delete[] _saveLoadPage[page / 2];
-	_saveLoadPage[page / 2] = 0;
+	_saveLoadPage[page / 2] = nullptr;
 
 	if (_saveLoadPageOvl[page / 2]) {
 		uint8 *dstPage = getOverlayPtr(page);
@@ -165,7 +165,7 @@ void Screen_LoK::loadPageFromDisk(const char *file, int page) {
 
 		memcpy(dstPage, _saveLoadPageOvl[page / 2], SCREEN_OVL_SJIS_SIZE);
 		delete[] _saveLoadPageOvl[page / 2];
-		_saveLoadPageOvl[page / 2] = 0;
+		_saveLoadPageOvl[page / 2] = nullptr;
 	}
 }
 
@@ -180,11 +180,11 @@ void Screen_LoK::queryPageFromDisk(const char *file, int page, uint8 *buffer) {
 
 void Screen_LoK::deletePageFromDisk(int page) {
 	delete[] _saveLoadPage[page / 2];
-	_saveLoadPage[page / 2] = 0;
+	_saveLoadPage[page / 2] = nullptr;
 
 	if (_saveLoadPageOvl[page / 2]) {
 		delete[] _saveLoadPageOvl[page / 2];
-		_saveLoadPageOvl[page / 2] = 0;
+		_saveLoadPageOvl[page / 2] = nullptr;
 	}
 }
 
diff --git a/engines/kyra/graphics/screen_mr.cpp b/engines/kyra/graphics/screen_mr.cpp
index e9523579ad..2471277970 100644
--- a/engines/kyra/graphics/screen_mr.cpp
+++ b/engines/kyra/graphics/screen_mr.cpp
@@ -131,7 +131,7 @@ void Screen_MR::drawFilledBox(int x1, int y1, int x2, int y2, uint8 c1, uint8 c2
 	drawClippedLine(x1, y2-1, x2-1, y2-1, c3);
 }
 
-Big5Font::Big5Font(const uint8 *oneByteData, int pitch) : Font(), _oneByteData(oneByteData), _twoByteData(0), _twoByteDataSize(0), _twoByteNumChar(0), _pitch(pitch), _border(false) {
+Big5Font::Big5Font(const uint8 *oneByteData, int pitch) : Font(), _oneByteData(oneByteData), _twoByteData(nullptr), _twoByteDataSize(0), _twoByteNumChar(0), _pitch(pitch), _border(false) {
 	assert(_oneByteData);
 	_textColor[0] = _textColor[1] = 0;
 }
@@ -142,7 +142,7 @@ Big5Font::~Big5Font() {
 
 bool Big5Font::load(Common::SeekableReadStream &data) {
 	delete[] _twoByteData;
-	_twoByteData = 0;
+	_twoByteData = nullptr;
 	_twoByteNumChar = _twoByteDataSize = 0;
 
 	if (!data.size())
diff --git a/engines/kyra/graphics/screen_v2.cpp b/engines/kyra/graphics/screen_v2.cpp
index b47a862dc6..ab22e186f5 100644
--- a/engines/kyra/graphics/screen_v2.cpp
+++ b/engines/kyra/graphics/screen_v2.cpp
@@ -27,7 +27,7 @@
 namespace Kyra {
 
 Screen_v2::Screen_v2(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, const int dimTableSize)
-	: Screen(vm, system, dimTable, dimTableSize), _wsaFrameAnimBuffer(0) {
+	: Screen(vm, system, dimTable, dimTableSize), _wsaFrameAnimBuffer(nullptr) {
 	_wsaFrameAnimBuffer = new uint8[1024];
 	assert(_wsaFrameAnimBuffer);
 }
@@ -194,7 +194,7 @@ const uint8 *Screen_v2::getPtrToShape(const uint8 *shpFile, int shape) {
 	uint16 shapes = READ_LE_UINT16(shpFile);
 
 	if (shapes <= shape)
-		return 0;
+		return nullptr;
 
 	uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2);
 
@@ -205,7 +205,7 @@ uint8 *Screen_v2::getPtrToShape(uint8 *shpFile, int shape) {
 	uint16 shapes = READ_LE_UINT16(shpFile);
 
 	if (shapes <= shape)
-		return 0;
+		return nullptr;
 
 	uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2);
 
@@ -235,7 +235,7 @@ uint16 Screen_v2::getShapeSize(const uint8 *shp) {
 uint8 *Screen_v2::makeShapeCopy(const uint8 *src, int index) {
 	const uint8 *shape = getPtrToShape(src, index);
 	if (!shape)
-		return 0;
+		return nullptr;
 
 	int size = getShapeSize(shape);
 
diff --git a/engines/kyra/graphics/vqa.cpp b/engines/kyra/graphics/vqa.cpp
index f15d545499..409a3bb31a 100644
--- a/engines/kyra/graphics/vqa.cpp
+++ b/engines/kyra/graphics/vqa.cpp
@@ -92,7 +92,7 @@ bool VQADecoder::loadStream(Common::SeekableReadStream *stream) {
 	bool foundVQHD = false;
 	bool foundFINF = false;
 
-	VQAAudioTrack *audioTrack = NULL;
+	VQAAudioTrack *audioTrack = nullptr;
 
 	// The information we need is stored in two chunks: VQHD and FINF. We
 	// need both of them before we can begin decoding the movie.
diff --git a/engines/kyra/graphics/wsamovie.cpp b/engines/kyra/graphics/wsamovie.cpp
index 92f85d4c86..d52879e74e 100644
--- a/engines/kyra/graphics/wsamovie.cpp
+++ b/engines/kyra/graphics/wsamovie.cpp
@@ -28,7 +28,7 @@
 namespace Kyra {
 
 WSAMovie_v1::WSAMovie_v1(KyraEngine_v1 *vm)
-	: Movie(vm), _frameData(0), _frameOffsTable(0), _offscreenBuffer(0), _deltaBuffer(0) {
+	: Movie(vm), _frameData(nullptr), _frameOffsTable(nullptr), _offscreenBuffer(nullptr), _deltaBuffer(nullptr) {
 }
 
 WSAMovie_v1::~WSAMovie_v1() {
@@ -49,7 +49,7 @@ int WSAMovie_v1::open(const char *filename, int offscreenDecode, Palette *palBuf
 	_width = READ_LE_UINT16(wsaData); wsaData += 2;
 	_height = READ_LE_UINT16(wsaData); wsaData += 2;
 	_deltaBufferSize = READ_LE_UINT16(wsaData); wsaData += 2;
-	_offscreenBuffer = NULL;
+	_offscreenBuffer = nullptr;
 	_flags = 0;
 	if (_vm->gameFlags().useAltShapeHeader) {
 		flags = READ_LE_UINT16(wsaData);
@@ -139,7 +139,7 @@ void WSAMovie_v1::displayFrame(int frameNum, int pageNum, int x, int y, uint16 f
 	_y = y;
 	_drawPage = pageNum;
 
-	uint8 *dst = 0;
+	uint8 *dst = nullptr;
 	if (_flags & WF_OFFSCREEN_DECODE)
 		dst = _offscreenBuffer;
 	else
@@ -220,7 +220,7 @@ void WSAMovie_v1::processFrame(int frameNum, uint8 *dst) {
 
 #pragma mark -
 
-WSAMovieAmiga::WSAMovieAmiga(KyraEngine_v1 *vm) : WSAMovie_v1(vm), _buffer(0) {}
+WSAMovieAmiga::WSAMovieAmiga(KyraEngine_v1 *vm) : WSAMovie_v1(vm), _buffer(nullptr) {}
 
 int WSAMovieAmiga::open(const char *filename, int offscreenDecode, Palette *palBuf) {
 	int res = WSAMovie_v1::open(filename, offscreenDecode, palBuf);
@@ -236,7 +236,7 @@ int WSAMovieAmiga::open(const char *filename, int offscreenDecode, Palette *palB
 void WSAMovieAmiga::close() {
 	if (_opened) {
 		delete[] _buffer;
-		_buffer = 0;
+		_buffer = nullptr;
 	}
 	WSAMovie_v1::close();
 }
@@ -338,7 +338,7 @@ void WSAMovieAmiga::processFrame(int frameNum, uint8 *dst) {
 	Screen::convertAmigaGfx(dst, _width, _height, 5, (_flags & WF_FLIPPED) != 0);
 
 	src = dst;
-	dst = 0;
+	dst = nullptr;
 	int dstPitch = 0;
 	if (_flags & WF_OFFSCREEN_DECODE) {
 		dst = _offscreenBuffer;
@@ -377,7 +377,7 @@ int WSAMovie_v2::open(const char *filename, int unk1, Palette *palBuf) {
 	_width = READ_LE_UINT16(wsaData); wsaData += 2;
 	_height = READ_LE_UINT16(wsaData); wsaData += 2;
 	_deltaBufferSize = READ_LE_UINT16(wsaData); wsaData += 2;
-	_offscreenBuffer = NULL;
+	_offscreenBuffer = nullptr;
 	_flags = 0;
 	flags = READ_LE_UINT16(wsaData); wsaData += 2;
 
diff --git a/engines/kyra/gui/debugger.cpp b/engines/kyra/gui/debugger.cpp
index 11e5469f3c..d3da73bb5e 100644
--- a/engines/kyra/gui/debugger.cpp
+++ b/engines/kyra/gui/debugger.cpp
@@ -81,7 +81,7 @@ bool Debugger::cmdLoadPalette(int argc, const char **argv) {
 		}
 
 		_vm->screen()->copyRegionToBuffer(5, 0, 0, 320, 200, buffer);
-		_vm->screen()->loadBitmap(argv[1], 5, 5, 0);
+		_vm->screen()->loadBitmap(argv[1], 5, 5, nullptr);
 		palette.copy(_vm->screen()->getCPagePtr(5), 0, 256);
 		_vm->screen()->copyBlockToPage(5, 0, 0, 320, 200, buffer);
 
diff --git a/engines/kyra/gui/gui.cpp b/engines/kyra/gui/gui.cpp
index 3b8f2c66c5..382d795003 100644
--- a/engines/kyra/gui/gui.cpp
+++ b/engines/kyra/gui/gui.cpp
@@ -34,7 +34,7 @@ namespace Kyra {
 GUI::GUI(KyraEngine_v1 *kyra) : _vm(kyra), _screen(kyra->screen()) {
 	_saveSlotsListUpdateNeeded = true;
 	_savegameListSize = 0;
-	_savegameList = 0;
+	_savegameList = nullptr;
 }
 
 GUI::~GUI() {
@@ -42,7 +42,7 @@ GUI::~GUI() {
 		for (int i = 0; i < _savegameListSize; i++)
 			delete[] _savegameList[i];
 		delete[] _savegameList;
-		_savegameList = 0;
+		_savegameList = nullptr;
 	}
 }
 
@@ -124,13 +124,13 @@ void GUI::updateSaveSlotsList(Common::String targetName, bool force) {
 					Util::convertUTF8ToDOS(*listEntry, buffSize);
 				delete in;
 			} else {
-				*listEntry = 0;
+				*listEntry = nullptr;
 				error("GUI::updateSavegameList(): Unexpected missing save file for slot: %d.", _saveSlots[i]);
 			}
 		}
 
 	} else {
-		_savegameList = 0;
+		_savegameList = nullptr;
 	}
 }
 
diff --git a/engines/kyra/gui/gui_hof.cpp b/engines/kyra/gui/gui_hof.cpp
index 15d6b5e894..911a997789 100644
--- a/engines/kyra/gui/gui_hof.cpp
+++ b/engines/kyra/gui/gui_hof.cpp
@@ -34,7 +34,7 @@ namespace Kyra {
 
 void KyraEngine_HoF::loadButtonShapes() {
 	const uint8 *src = _screen->getCPagePtr(3);
-	_screen->loadBitmap("_BUTTONS.CSH", 3, 3, 0);
+	_screen->loadBitmap("_BUTTONS.CSH", 3, 3, nullptr);
 
 	_gui->_scrollUpButton.data0ShapePtr = _buttonShapes[0] = _screen->makeShapeCopy(src, 0);
 	_gui->_scrollUpButton.data2ShapePtr = _buttonShapes[1] = _screen->makeShapeCopy(src, 1);
@@ -258,7 +258,7 @@ void KyraEngine_HoF::redrawInventory(int page) {
 
 void KyraEngine_HoF::scrollInventoryWheel() {
 	WSAMovie_v2 movie(this);
-	movie.open("INVWHEEL.WSA", 0, 0);
+	movie.open("INVWHEEL.WSA", 0, nullptr);
 	int frames = movie.opened() ? movie.frames() : 6;
 	memcpy(_screenBuffer, _screen->getCPagePtr(2), 64000);
 	uint8 overlay[0x100];
@@ -269,7 +269,7 @@ void KyraEngine_HoF::scrollInventoryWheel() {
 	bool breakFlag = false;
 	for (int i = 0; i <= 6 && !breakFlag; ++i) {
 		if (movie.opened()) {
-			movie.displayFrame(i % frames, 0, 0, 0, 0, 0, 0);
+			movie.displayFrame(i % frames, 0, 0, 0, 0, nullptr, nullptr);
 			_screen->updateScreen();
 		}
 
@@ -332,7 +332,7 @@ int KyraEngine_HoF::bookButton(Button *button) {
 	}
 
 	_screen->hideMouse();
-	showMessage(0, 0xCF);
+	showMessage(nullptr, 0xCF);
 	displayInvWsaLastFrame();
 	_bookNewPage = _bookCurPage;
 
@@ -421,29 +421,29 @@ void KyraEngine_HoF::loadBookBkgd() {
 			strcpy(filename, "_BOOKA.CPS");
 	}
 
-	_screen->loadBitmap(filename, 3, 3, 0);
+	_screen->loadBitmap(filename, 3, 3, nullptr);
 }
 
 void KyraEngine_HoF::showBookPage() {
 	char filename[16];
 
 	sprintf(filename, "PAGE%.01X.%s", _bookCurPage, _languageExtension[_lang]);
-	uint8 *leftPage = _res->fileData(filename, 0);
+	uint8 *leftPage = _res->fileData(filename, nullptr);
 	if (!leftPage) {
 		// some floppy version use a TXT extension
 		sprintf(filename, "PAGE%.01X.TXT", _bookCurPage);
-		leftPage = _res->fileData(filename, 0);
+		leftPage = _res->fileData(filename, nullptr);
 	}
 
 	int leftPageY = _bookPageYOffset[_bookCurPage];
 
 	sprintf(filename, "PAGE%.01X.%s", _bookCurPage+1, _languageExtension[_lang]);
-	uint8 *rightPage = 0;
+	uint8 *rightPage = nullptr;
 	if (_bookCurPage != _bookMaxPage) {
-		rightPage = _res->fileData(filename, 0);
+		rightPage = _res->fileData(filename, nullptr);
 		if (!rightPage) {
 			sprintf(filename, "PAGE%.01X.TXT", _bookCurPage);
-			rightPage = _res->fileData(filename, 0);
+			rightPage = _res->fileData(filename, nullptr);
 		}
 	}
 
@@ -476,7 +476,7 @@ void KyraEngine_HoF::bookLoop() {
 	GUI_V2_BUTTON(bookButtons[4], 0x28, 0, 0, 1, 1, 1, 0x4487, 0, 0xAA, 0x08, 0x8E, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
 	bookButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookNextPage);
 
-	Button *buttonList = 0;
+	Button *buttonList = nullptr;
 
 	for (uint i = 0; i < ARRAYSIZE(bookButtons); ++i)
 		buttonList = _gui->addButtonToList(buttonList, &bookButtons[i]);
@@ -581,7 +581,7 @@ int KyraEngine_HoF::cauldronClearButton(Button *button) {
 	snd_playSoundEffect(0x25);
 	loadInvWsa("PULL.WSA", 1, 6, 0, -1, -1, 1);
 	loadInvWsa("CAULD00.WSA", 1, 7, 0, 0xD4, 0x0F, 1);
-	showMessage(0, 0xCF);
+	showMessage(nullptr, 0xCF);
 	setCauldronState(0, 0);
 	clearCauldronTable();
 	snd_playSoundEffect(0x57);
@@ -638,7 +638,7 @@ int KyraEngine_HoF::cauldronButton(Button *button) {
 				snd_playSoundEffect(0x6C);
 				++_cauldronUseCount;
 				if (_cauldronStateTable[_cauldronState] <= _cauldronUseCount && _cauldronUseCount) {
-					showMessage(0, 0xCF);
+					showMessage(nullptr, 0xCF);
 					setCauldronState(0, true);
 					clearCauldronTable();
 				}
@@ -672,7 +672,7 @@ int GUI_HoF::optionsButton(Button *button) {
 	if (!_screen->isMouseVisible() && button)
 		return 0;
 
-	_vm->showMessage(0, 0xCF);
+	_vm->showMessage(nullptr, 0xCF);
 
 	if (_vm->_mouseState < -1) {
 		_vm->_mouseState = -1;
@@ -709,7 +709,7 @@ int GUI_HoF::optionsButton(Button *button) {
 
 		_loadedSave = false;
 
-		loadMenu(0);
+		loadMenu(nullptr);
 
 		if (_loadedSave) {
 			if (_restartGame)
diff --git a/engines/kyra/gui/gui_lok.cpp b/engines/kyra/gui/gui_lok.cpp
index 8b81c02109..b144d3c3a9 100644
--- a/engines/kyra/gui/gui_lok.cpp
+++ b/engines/kyra/gui/gui_lok.cpp
@@ -180,7 +180,7 @@ int KyraEngine_LoK::buttonAmuletCallback(Button *caller) {
 
 GUI_LoK::GUI_LoK(KyraEngine_LoK *vm, Screen_LoK *screen) : GUI_v1(vm), _vm(vm), _screen(screen) {
 	_lastScreenUpdate = 0;
-	_menu = 0;
+	_menu = nullptr;
 	_pressFlag = false;
 	initStaticResource();
 	_scrollUpFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::scrollUp);
@@ -243,7 +243,7 @@ int GUI_LoK::processButtonList(Button *list, uint16 inputFlag, int8 mouseWheel)
 
 		int x = list->x;
 		int y = list->y;
-		assert(_screen->getScreenDim(list->dimTableIndex) != 0);
+		assert(_screen->getScreenDim(list->dimTableIndex) != nullptr);
 
 		if (x < 0)
 			x += _screen->getScreenDim(list->dimTableIndex)->w << 3;
@@ -307,7 +307,7 @@ void GUI_LoK::processButton(Button *button) {
 		return;
 
 	int processType = 0;
-	const uint8 *shape = 0;
+	const uint8 *shape = nullptr;
 	Button::Callback callback;
 
 	int flags = (button->flags2 & 5);
@@ -333,7 +333,7 @@ void GUI_LoK::processButton(Button *button) {
 
 	int x = button->x;
 	int y = button->y;
-	assert(_screen->getScreenDim(button->dimTableIndex) != 0);
+	assert(_screen->getScreenDim(button->dimTableIndex) != nullptr);
 	if (x < 0)
 		x += _screen->getScreenDim(button->dimTableIndex)->w << 3;
 
@@ -503,7 +503,7 @@ int GUI_LoK::buttonMenuCallback(Button *caller) {
 
 	_toplevelMenu = 0;
 	if (_vm->_menuDirectlyToLoad) {
-		loadGameMenu(0);
+		loadGameMenu(nullptr);
 	} else {
 		if (!caller)
 			_toplevelMenu = 4;
@@ -966,7 +966,7 @@ void GUI_LoK::setupControls(Menu &menu) {
 			menu.item[4].labelString = _textSpeedString;
 		} else {
 			menu.item[4].enabled = 0;
-			menu.item[4].labelString = 0;
+			menu.item[4].labelString = nullptr;
 		}
 
 		switch (_vm->_configVoice) {
@@ -988,7 +988,7 @@ void GUI_LoK::setupControls(Menu &menu) {
 			clickableOffset = 5;
 
 		menu.item[4].enabled = 0;
-		menu.item[4].labelString = 0;
+		menu.item[4].labelString = nullptr;
 	}
 
 	switch (_vm->_configTextspeed) {
diff --git a/engines/kyra/gui/gui_mr.cpp b/engines/kyra/gui/gui_mr.cpp
index 21bec38197..7c569ba671 100644
--- a/engines/kyra/gui/gui_mr.cpp
+++ b/engines/kyra/gui/gui_mr.cpp
@@ -36,7 +36,7 @@ namespace Kyra {
 
 void KyraEngine_MR::loadButtonShapes() {
 	_res->exists("BUTTONS.SHP", true);
-	uint8 *data = _res->fileData("BUTTONS.SHP", 0);
+	uint8 *data = _res->fileData("BUTTONS.SHP", nullptr);
 	assert(data);
 	for (int i = 0; i <= 10; ++i)
 		addShapeToPool(data, 0x1C7+i, i);
@@ -59,7 +59,7 @@ void KyraEngine_MR::loadButtonShapes() {
 }
 
 int KyraEngine_MR::callbackButton1(Button *button) {
-	const uint8 *shapePtr = 0;
+	const uint8 *shapePtr = nullptr;
 	if (button->index == 1)
 		shapePtr = getShapePtr(0x1CD);
 	else if (button->index == 22)
@@ -74,7 +74,7 @@ int KyraEngine_MR::callbackButton1(Button *button) {
 }
 
 int KyraEngine_MR::callbackButton2(Button *button) {
-	const uint8 *shapePtr = 0;
+	const uint8 *shapePtr = nullptr;
 	if (button->index == 1)
 		shapePtr = getShapePtr(0x1CE);
 	else if (button->index == 22)
@@ -89,7 +89,7 @@ int KyraEngine_MR::callbackButton2(Button *button) {
 }
 
 int KyraEngine_MR::callbackButton3(Button *button) {
-	const uint8 *shapePtr = 0;
+	const uint8 *shapePtr = nullptr;
 	if (button->index == 1)
 		shapePtr = getShapePtr(0x1CE);
 	else if (button->index == 22)
@@ -369,10 +369,10 @@ void KyraEngine_MR::drawMalcolmsMoodPointer(int frame, int page) {
 		frame = 13;
 
 	if (page == 0) {
-		_invWsa->displayFrame(frame, 0, 0, 0, 0, 0, 0);
+		_invWsa->displayFrame(frame, 0, 0, 0, 0, nullptr, nullptr);
 		_screen->updateScreen();
 	} else if (page == 30) {
-		_invWsa->displayFrame(frame, 2, 0, -_interfaceCommandLineY2, 0, 0, 0);
+		_invWsa->displayFrame(frame, 2, 0, -_interfaceCommandLineY2, 0, nullptr, nullptr);
 	}
 
 	_invWsaFrame = frame;
@@ -669,7 +669,7 @@ void KyraEngine_MR::showAlbum() {
 		error("Couldn't load ALBUM");
 
 	if (!queryGameFlag(0x8B))
-		_album.wsa->open("ALBMGNTH.WSA", 1, 0);
+		_album.wsa->open("ALBMGNTH.WSA", 1, nullptr);
 	_album.backUpRect = new uint8[3100];
 	assert(_album.backUpRect);
 	_album.backUpPage = new uint8[64000];
@@ -690,10 +690,10 @@ void KyraEngine_MR::showAlbum() {
 	loadAlbumPageWSA();
 
 	if (_album.leftPage.wsa->opened())
-		_album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, 0, 0);
+		_album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, nullptr, nullptr);
 
 	if (_album.rightPage.wsa->opened())
-		_album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, 0, 0);
+		_album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, nullptr, nullptr);
 
 	printAlbumPageText();
 	_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
@@ -716,11 +716,11 @@ void KyraEngine_MR::showAlbum() {
 	_screen->fadePalette(_screen->getPalette(0), 9);
 
 	delete[] _album.backUpRect;
-	_album.backUpRect = 0;
+	_album.backUpRect = nullptr;
 	delete[] _album.backUpPage;
-	_album.backUpPage = 0;
+	_album.backUpPage = nullptr;
 	delete[] _album.file;
-	_album.file = 0;
+	_album.file = nullptr;
 
 	_eventList.clear();
 }
@@ -740,7 +740,7 @@ void KyraEngine_MR::loadAlbumPage() {
 	}
 
 	_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 4, Screen::CR_NO_P_CHECK);
-	_screen->loadBitmap(filename.c_str(), 3, 3, 0);
+	_screen->loadBitmap(filename.c_str(), 3, 3, nullptr);
 }
 
 void KyraEngine_MR::loadAlbumPageWSA() {
@@ -756,13 +756,13 @@ void KyraEngine_MR::loadAlbumPageWSA() {
 
 	if (_album.curPage) {
 		filename = Common::String::format("PAGE%x.WSA", _album.curPage);
-		_album.leftPage.wsa->open(filename.c_str(), 1, 0);
+		_album.leftPage.wsa->open(filename.c_str(), 1, nullptr);
 		_album.leftPage.maxFrame = _album.leftPage.wsa->frames()-1;
 	}
 
 	if (_album.curPage != 14) {
 		filename = Common::String::format("PAGE%x.WSA", _album.curPage+1);
-		_album.rightPage.wsa->open(filename.c_str(), 1, 0);
+		_album.rightPage.wsa->open(filename.c_str(), 1, nullptr);
 		_album.rightPage.maxFrame = _album.rightPage.wsa->frames()-1;
 	}
 }
@@ -827,7 +827,7 @@ void KyraEngine_MR::processAlbum() {
 	GUI_V2_BUTTON(albumButtons[4], 40, 0, 0, 1, 1, 1, 0x4487, 0, 170,   8, 142, 180, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
 	albumButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::albumNextPage);
 
-	Button *buttonList = 0;
+	Button *buttonList = nullptr;
 	for (int i = 0; i < 5; ++i)
 		buttonList = _gui->addButtonToList(buttonList, &albumButtons[i]);
 
@@ -851,10 +851,10 @@ void KyraEngine_MR::processAlbum() {
 			loadAlbumPageWSA();
 
 			if (_album.leftPage.wsa->opened())
-				_album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, 0, 0);
+				_album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, nullptr, nullptr);
 
 			if (_album.rightPage.wsa->opened())
-				_album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, 0, 0);
+				_album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, nullptr, nullptr);
 
 			printAlbumPageText();
 
@@ -907,7 +907,7 @@ void KyraEngine_MR::albumUpdateAnims() {
 
 	nextRun = _album.leftPage.timer + 5 * _tickLength;
 	if (nextRun < _system->getMillis() && _album.leftPage.wsa->opened()) {
-		_album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, 0, 0);
+		_album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 2, _albumWSAX[_album.nextPage+0], _albumWSAY[_album.nextPage+0], 0x4000, nullptr, nullptr);
 		_screen->copyRegion(40, 17, 40, 17, 87, 73, 2, 0, Screen::CR_NO_P_CHECK);
 
 		++_album.leftPage.curFrame;
@@ -926,7 +926,7 @@ void KyraEngine_MR::albumUpdateAnims() {
 
 	nextRun = _album.rightPage.timer + 5 * _tickLength;
 	if (nextRun < _system->getMillis() && _album.rightPage.wsa->opened()) {
-		_album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, 0, 0);
+		_album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 2, _albumWSAX[_album.nextPage+1], _albumWSAY[_album.nextPage+1], 0x4000, nullptr, nullptr);
 		_screen->copyRegion(194, 20, 194, 20, 85, 69, 2, 0, Screen::CR_NO_P_CHECK);
 
 		++_album.rightPage.curFrame;
@@ -944,13 +944,13 @@ void KyraEngine_MR::albumUpdateAnims() {
 void KyraEngine_MR::albumAnim1() {
 	for (int i = 6; i >= 3; --i) {
 		albumRestoreRect();
-		_album.wsa->displayFrame(i, 2, -100, 90, 0x4000, 0, 0);
+		_album.wsa->displayFrame(i, 2, -100, 90, 0x4000, nullptr, nullptr);
 		albumUpdateRect();
 		delayWithTicks(1);
 	}
 
 	albumRestoreRect();
-	_album.wsa->displayFrame(14, 2, -100, 90, 0x4000, 0, 0);
+	_album.wsa->displayFrame(14, 2, -100, 90, 0x4000, nullptr, nullptr);
 	albumUpdateRect();
 	delayWithTicks(1);
 }
@@ -958,7 +958,7 @@ void KyraEngine_MR::albumAnim1() {
 void KyraEngine_MR::albumAnim2() {
 	for (int i = 3; i <= 6; ++i) {
 		albumRestoreRect();
-		_album.wsa->displayFrame(i, 2, -100, 90, 0x4000, 0, 0);
+		_album.wsa->displayFrame(i, 2, -100, 90, 0x4000, nullptr, nullptr);
 		albumUpdateRect();
 		delayWithTicks(1);
 	}
@@ -1188,7 +1188,7 @@ int GUI_MR::optionsButton(Button *button) {
 
 	_screen->setFontStyles(_screen->_currentFont, Font::kStyleNone);
 
-	_vm->showMessage(0, 0xF0, 0xF0);
+	_vm->showMessage(nullptr, 0xF0, 0xF0);
 
 	if (_vm->_mouseState < -1) {
 		_vm->_mouseState = -1;
@@ -1221,7 +1221,7 @@ int GUI_MR::optionsButton(Button *button) {
 		_loadedSave = false;
 
 		--_loadMenu.numberOfItems;
-		loadMenu(0);
+		loadMenu(nullptr);
 		++_loadMenu.numberOfItems;
 
 		if (_loadedSave) {
diff --git a/engines/kyra/gui/gui_v1.cpp b/engines/kyra/gui/gui_v1.cpp
index 43f2d4a721..1f8bec7324 100644
--- a/engines/kyra/gui/gui_v1.cpp
+++ b/engines/kyra/gui/gui_v1.cpp
@@ -31,7 +31,7 @@
 namespace Kyra {
 
 GUI_v1::GUI_v1(KyraEngine_v1 *kyra) : GUI(kyra), _text(kyra->text()) {
-	_menuButtonList = 0;
+	_menuButtonList = nullptr;
 
 	_redrawButtonFunctor = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::redrawButtonCallback);
 	_redrawShadedButtonFunctor = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::redrawShadedButtonCallback);
@@ -41,7 +41,7 @@ Button *GUI_v1::addButtonToList(Button *list, Button *newButton) {
 	if (!newButton)
 		return list;
 
-	newButton->nextButton = 0;
+	newButton->nextButton = nullptr;
 
 	if (list) {
 		Button *cur = list;
@@ -68,7 +68,7 @@ void GUI_v1::initMenuLayout(Menu &menu) {
 }
 
 void GUI_v1::initMenu(Menu &menu) {
-	_menuButtonList = 0;
+	_menuButtonList = nullptr;
 
 	int textX;
 	int textY;
@@ -107,7 +107,7 @@ void GUI_v1::initMenu(Menu &menu) {
 
 		if (i < 7) {
 			Button *menuButtonData = getButtonListData() + i;
-			menuButtonData->nextButton = 0;
+			menuButtonData->nextButton = nullptr;
 			menuButtonData->x = x1;
 			menuButtonData->y = y1;
 			menuButtonData->width  = menu.item[i].width - 1;
@@ -173,7 +173,7 @@ void GUI_v1::initMenu(Menu &menu) {
 		scrollUpButton->x = menu.scrollUpButtonX + menu.x;
 		scrollUpButton->y = menu.scrollUpButtonY + menu.y;
 		scrollUpButton->buttonCallback = getScrollUpButtonHandler();
-		scrollUpButton->nextButton = 0;
+		scrollUpButton->nextButton = nullptr;
 		scrollUpButton->mouseWheel = -1;
 
 		_menuButtonList = addButtonToList(_menuButtonList, scrollUpButton);
@@ -183,7 +183,7 @@ void GUI_v1::initMenu(Menu &menu) {
 		scrollDownButton->x = menu.scrollDownButtonX + menu.x;
 		scrollDownButton->y = menu.scrollDownButtonY + menu.y;
 		scrollDownButton->buttonCallback = getScrollDownButtonHandler();
-		scrollDownButton->nextButton = 0;
+		scrollDownButton->nextButton = nullptr;
 		scrollDownButton->mouseWheel = 1;
 
 		_menuButtonList = addButtonToList(_menuButtonList, scrollDownButton);
@@ -414,7 +414,7 @@ int GUI_v1::getMenuCenterStringX(const Common::String &str, int x1, int x2) {
 
 #pragma mark -
 
-MainMenu::MainMenu(KyraEngine_v1 *vm) : _vm(vm), _screen(0) {
+MainMenu::MainMenu(KyraEngine_v1 *vm) : _vm(vm), _screen(nullptr) {
 	_screen = _vm->screen();
 	_nextUpdate = 0;
 	_system = g_system;
@@ -433,7 +433,7 @@ void MainMenu::updateAnimation() {
 		if (now > _nextUpdate) {
 			_nextUpdate = now + _anim.delay * _vm->tickLength();
 
-			_anim.anim->displayFrame(_animIntern.curFrame, 0, 0, 0, 0, 0, 0);
+			_anim.anim->displayFrame(_animIntern.curFrame, 0, 0, 0, 0, nullptr, nullptr);
 			_animIntern.curFrame += _animIntern.direction;
 			if (_animIntern.curFrame < _anim.startFrame) {
 				_animIntern.curFrame = _anim.startFrame;
diff --git a/engines/kyra/gui/gui_v2.cpp b/engines/kyra/gui/gui_v2.cpp
index bc2cdcde5f..cb4d496c50 100644
--- a/engines/kyra/gui/gui_v2.cpp
+++ b/engines/kyra/gui/gui_v2.cpp
@@ -31,12 +31,12 @@
 namespace Kyra {
 
 GUI_v2::GUI_v2(KyraEngine_v2 *vm) : GUI_v1(vm), _vm(vm), _screen(vm->screen_v2()) {
-	_backUpButtonList = _specialProcessButton = 0;
+	_backUpButtonList = _specialProcessButton = nullptr;
 	_buttonListChanged = false;
 	_lastScreenUpdate = 0;
 	_flagsModifier = 0;
 
-	_currentMenu = 0;
+	_currentMenu = nullptr;
 	_isDeathMenu = false;
 	_isSaveMenu = false;
 	_isLoadMenu = false;
@@ -67,7 +67,7 @@ void GUI_v2::processButton(Button *button) {
 	int entry = button->flags2 & 5;
 
 	byte val1 = 0, val2 = 0, val3 = 0;
-	const uint8 *dataPtr = 0;
+	const uint8 *dataPtr = nullptr;
 	Button::Callback callback;
 	if (entry == 1) {
 		val1 = button->data1Val1;
@@ -135,7 +135,7 @@ int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag, int8 mouseWh
 		return inputFlag & 0x7FFF;
 
 	if (_backUpButtonList != buttonList || _buttonListChanged) {
-		_specialProcessButton = 0;
+		_specialProcessButton = nullptr;
 		//flagsModifier |= 0x2200;
 		_backUpButtonList = buttonList;
 		_buttonListChanged = false;
@@ -177,7 +177,7 @@ int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag, int8 mouseWh
 	if (_specialProcessButton) {
 		buttonList = _specialProcessButton;
 		if (_specialProcessButton->flags & 8)
-			_specialProcessButton = 0;
+			_specialProcessButton = nullptr;
 	}
 
 	int returnValue = 0;
@@ -330,13 +330,13 @@ int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag, int8 mouseWh
 		}
 
 		if ((flags & 0x8800) == 0x8800) {
-			_specialProcessButton = 0;
+			_specialProcessButton = nullptr;
 			if (!progress || (buttonList->flags & 4))
 				buttonList->flags2 &= ~6;
 		}
 
 		if (!progress && buttonList == _specialProcessButton && !(buttonList->flags & 0x40))
-			_specialProcessButton = 0;
+			_specialProcessButton = nullptr;
 
 		if ((buttonList->flags2 & 0x18) != ((buttonList->flags2 & 3) << 3))
 			processButton(buttonList);
@@ -443,7 +443,7 @@ void GUI_v2::setupSavegameNames(Menu &menu, int num) {
 	KyraEngine_v2::SaveHeader header;
 	Common::InSaveFile *in;
 	for (int i = startSlot; i < num && uint(_savegameOffset + i) < _saveSlots.size(); ++i) {
-		if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header)) != 0) {
+		if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header)) != nullptr) {
 			Common::String s = header.description;
 			s = Util::convertUTF8ToDOS(s);
 
@@ -780,7 +780,7 @@ const char *GUI_v2::nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8
 			}
 		} else if (_keyPressed.keycode == Common::KEYCODE_ESCAPE || _cancelNameInput) {
 			running = false;
-			return 0;
+			return nullptr;
 		} else if ((_keyPressed.keycode == Common::KEYCODE_BACKSPACE || _keyPressed.keycode == Common::KEYCODE_DELETE) && curPos > 0) {
 			drawTextfieldBlock(x2, y2, c2);
 			--curPos;
diff --git a/engines/kyra/gui/saveload.cpp b/engines/kyra/gui/saveload.cpp
index 270f686677..b812d930d4 100644
--- a/engines/kyra/gui/saveload.cpp
+++ b/engines/kyra/gui/saveload.cpp
@@ -132,16 +132,16 @@ WARN_UNUSED_RESULT KyraEngine_v1::ReadSaveHeaderError KyraEngine_v1::readSaveHea
 				return kRSHEIoError;
 		}
 	} else {
-		header.thumbnail = 0;
+		header.thumbnail = nullptr;
 	}
 
 	return ((in->err() || in->eos()) ? kRSHEIoError : kRSHENoError);
 }
 
 Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filename, SaveHeader &header, bool checkID) {
-	Common::SeekableReadStream *in = 0;
+	Common::SeekableReadStream *in = nullptr;
 	if (!(in = _saveFileMan->openForLoading(filename)))
-		return 0;
+		return nullptr;
 
 	ReadSaveHeaderError errorCode = KyraEngine_v1::readSaveHeader(in, header);
 	if (errorCode != kRSHENoError) {
@@ -153,7 +153,7 @@ Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filena
 			warning("Load failed '%s'", filename);
 
 		delete in;
-		return 0;
+		return nullptr;
 	}
 
 	if (!header.originalSave) {
@@ -161,7 +161,7 @@ Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filena
 			if (header.gameID != _flags.gameID && checkID) {
 				warning("Trying to load saved game from other game (saved game: %u, running game: %u)", header.gameID, _flags.gameID);
 				delete in;
-				return 0;
+				return nullptr;
 			}
 		}
 
@@ -171,15 +171,15 @@ Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filena
 			if ((header.flags & GF_FLOPPY) && (_flags.isTalkie || _flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) {
 				warning("Can not load DOS Floppy savefile for this (non DOS Floppy) gameversion");
 				delete in;
-				return 0;
+				return nullptr;
 			} else if ((header.flags & GF_TALKIE) && !(_flags.isTalkie)) {
 				warning("Can not load DOS CD-ROM savefile for this (non DOS CD-ROM) gameversion");
 				delete in;
-				return 0;
+				return nullptr;
 			} else if (checkID && ((header.flags & GF_FMTOWNS) && !(_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98))) {
 				warning("Can not load FM-TOWNS/PC98 savefile for this (non FM-TOWNS/PC98) gameversion");
 				delete in;
-				return 0;
+				return nullptr;
 			}
 		}
 	}
@@ -189,12 +189,12 @@ Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filena
 
 Common::OutSaveFile *KyraEngine_v1::openSaveForWriting(const char *filename, const char *saveName, const Graphics::Surface *thumbnail) const {
 	if (shouldQuit())
-		return 0;
+		return nullptr;
 
-	Common::WriteStream *out = 0;
+	Common::WriteStream *out = nullptr;
 	if (!(out = _saveFileMan->openForSaving(filename))) {
 		warning("Can't create file '%s', game not saved", filename);
-		return 0;
+		return nullptr;
 	}
 
 	// Savegame version
@@ -212,10 +212,10 @@ Common::OutSaveFile *KyraEngine_v1::openSaveForWriting(const char *filename, con
 	if (out->err()) {
 		warning("Can't write file '%s'. (Disk full?)", filename);
 		delete out;
-		return 0;
+		return nullptr;
 	}
 
-	Graphics::Surface *genThumbnail = 0;
+	Graphics::Surface *genThumbnail = nullptr;
 	if (!thumbnail)
 		thumbnail = genThumbnail = generateSaveThumbnail();
 
diff --git a/engines/kyra/gui/saveload_hof.cpp b/engines/kyra/gui/saveload_hof.cpp
index ebfbffe1f8..44b948b408 100644
--- a/engines/kyra/gui/saveload_hof.cpp
+++ b/engines/kyra/gui/saveload_hof.cpp
@@ -286,12 +286,12 @@ Common::Error KyraEngine_HoF::loadGameState(int slot) {
 	if (loadedZTable != _characterShapeFile)
 		loadCharacterShapes(_characterShapeFile);
 
-	_screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0);
+	_screen->loadBitmap("_PLAYFLD.CPS", 3, 3, nullptr);
 	if (!queryGameFlag(1))
 		_screen->copyRegion(0xCE, 0x90, 0xCE, 0x90, 0x2C, 0x2C, 2, 0, Screen::CR_NO_P_CHECK);
 	if (!queryGameFlag(2))
 		_screen->copyRegion(0xFA, 0x90, 0xFA, 0x90, 0x46, 0x2C, 2, 0, Screen::CR_NO_P_CHECK);
-	_screen->loadBitmap("_PLAYALL.CPS", 3, 3, 0);
+	_screen->loadBitmap("_PLAYALL.CPS", 3, 3, nullptr);
 	if (queryGameFlag(1))
 		_screen->copyRegion(0xCE, 0x90, 0xCE, 0x90, 0x2C, 0x2C, 2, 0, Screen::CR_NO_P_CHECK);
 	if (queryGameFlag(2))
diff --git a/engines/kyra/gui/saveload_lok.cpp b/engines/kyra/gui/saveload_lok.cpp
index 16232ce82f..3d0b0097c2 100644
--- a/engines/kyra/gui/saveload_lok.cpp
+++ b/engines/kyra/gui/saveload_lok.cpp
@@ -163,7 +163,7 @@ Common::Error KyraEngine_LoK::loadGameState(int slot) {
 	loadMainScreen(8);
 
 	if (queryGameFlag(0x2D)) {
-		_screen->loadBitmap("AMULET3.CPS", 10, 10, 0);
+		_screen->loadBitmap("AMULET3.CPS", 10, 10, nullptr);
 		if (!queryGameFlag(0xF1)) {
 			for (int i = 0x55; i <= 0x5A; ++i) {
 				if (queryGameFlag(i))
diff --git a/engines/kyra/resource/resource.cpp b/engines/kyra/resource/resource.cpp
index 30d8c518d0..4a376e532c 100644
--- a/engines/kyra/resource/resource.cpp
+++ b/engines/kyra/resource/resource.cpp
@@ -72,7 +72,7 @@ bool Resource::reset() {
 			static const char *const list[] = {
 				"ADL.PAK", "CHAPTER1.VRM", "COL.PAK", "FINALE.PAK", "INTRO1.PAK", "INTRO2.PAK",
 				"INTRO3.PAK", "INTRO4.PAK", "MISC.PAK", "SND.PAK", "STARTUP.PAK", "XMI.PAK",
-				"CAVE.APK", "DRAGON1.APK", "DRAGON2.APK", "LAGOON.APK", 0
+				"CAVE.APK", "DRAGON1.APK", "DRAGON2.APK", "LAGOON.APK", nullptr
 			};
 
 			loadProtectedFiles(list);
@@ -136,7 +136,7 @@ bool Resource::reset() {
 
 		if (!_vm->gameFlags().isTalkie && !_vm->gameFlags().isDemo) {
 			static const char *const list[] = {
-				"GENERAL.PAK", 0
+				"GENERAL.PAK", nullptr
 			};
 
 			loadProtectedFiles(list);
@@ -280,7 +280,7 @@ void Resource::listFiles(const Common::String &pattern, Common::ArchiveMemberLis
 uint8 *Resource::fileData(const char *file, uint32 *size) {
 	Common::SeekableReadStream *stream = createReadStream(file);
 	if (!stream)
-		return 0;
+		return nullptr;
 
 	uint32 bufferSize = stream->size();
 	uint8 *buffer = new uint8[bufferSize];
@@ -327,7 +327,7 @@ Common::SeekableReadStream *Resource::createReadStream(const Common::String &fil
 
 Common::SeekableReadStreamEndian *Resource::createEndianAwareReadStream(const Common::String &file, int endianness) {
 	Common::SeekableReadStream *stream = _files.createReadStreamForMember(file);
-	return stream ? new EndianAwareStreamWrapper(stream, (endianness == kForceBE) ? true : (endianness == kForceLE ? false : _bigEndianPlatForm)) : 0;
+	return stream ? new EndianAwareStreamWrapper(stream, (endianness == kForceBE) ? true : (endianness == kForceLE ? false : _bigEndianPlatForm)) : nullptr;
 }
 
 Common::Archive *Resource::loadArchive(const Common::String &name, Common::ArchiveMemberPtr member) {
@@ -338,9 +338,9 @@ Common::Archive *Resource::loadArchive(const Common::String &name, Common::Archi
 	Common::SeekableReadStream *stream = member->createReadStream();
 
 	if (!stream)
-		return 0;
+		return nullptr;
 
-	Common::Archive *archive = 0;
+	Common::Archive *archive = nullptr;
 	for (LoaderList::const_iterator i = _loaders.begin(); i != _loaders.end(); ++i) {
 		if ((*i)->checkFilename(name)) {
 			if ((*i)->isLoadable(name, *stream)) {
@@ -356,7 +356,7 @@ Common::Archive *Resource::loadArchive(const Common::String &name, Common::Archi
 	delete stream;
 
 	if (!archive)
-		return 0;
+		return nullptr;
 
 	_archiveCache[name] = archive;
 	return archive;
@@ -369,7 +369,7 @@ Common::Archive *Resource::loadInstallerArchive(const Common::String &file, cons
 
 	Common::Archive *archive = InstallerLoader::load(this, file, ext, offset);
 	if (!archive)
-		return 0;
+		return nullptr;
 
 	_archiveCache[file] = archive;
 	return archive;
diff --git a/engines/kyra/resource/resource_intern.cpp b/engines/kyra/resource/resource_intern.cpp
index 7cdff075cd..01f87b4817 100644
--- a/engines/kyra/resource/resource_intern.cpp
+++ b/engines/kyra/resource/resource_intern.cpp
@@ -65,11 +65,11 @@ Common::SeekableReadStream *PlainArchive::createReadStreamForMember(const Common
 	Common::String name = path.toString();
 	FileMap::const_iterator fDesc = _files.find(name);
 	if (fDesc == _files.end())
-		return 0;
+		return nullptr;
 
 	Common::SeekableReadStream *parent = _file->createReadStream();
 	if (!parent)
-		return 0;
+		return nullptr;
 
 	return new Common::SeekableSubReadStream(parent, fDesc->_value.offset, fDesc->_value.offset + fDesc->_value.size, DisposeAfterUse::YES);
 }
@@ -97,7 +97,7 @@ TlkArchive::~TlkArchive() {
 
 bool TlkArchive::hasFile(const Common::Path &path) const {
 	Common::String name = path.toString();
-	return (findFile(name) != 0);
+	return (findFile(name) != nullptr);
 }
 
 int TlkArchive::listMembers(Common::ArchiveMemberList &list) const {
@@ -123,11 +123,11 @@ Common::SeekableReadStream *TlkArchive::createReadStreamForMember(const Common::
 	Common::String name = path.toString();
 	const uint32 *fileDesc = findFile(name);
 	if (!fileDesc)
-		return 0;
+		return nullptr;
 
 	Common::SeekableReadStream *parent = _file->createReadStream();
 	if (!parent)
-		return 0;
+		return nullptr;
 
 	parent->seek(fileDesc[1], SEEK_SET);
 	const uint32 size = parent->readUint32LE();
@@ -141,11 +141,11 @@ const uint32 *TlkArchive::findFile(const Common::String &name) const {
 	uppercaseName.toUppercase();
 
 	if (!uppercaseName.hasSuffix(".AUD"))
-		return 0;
+		return nullptr;
 
 	uint32 id;
 	if (sscanf(uppercaseName.c_str(), "%08u.AUD", &id) != 1)
-		return 0;
+		return nullptr;
 
 	// Binary search for the file entry
 	int leftIndex = 0;
@@ -167,7 +167,7 @@ const uint32 *TlkArchive::findFile(const Common::String &name) const {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 // -> CachedArchive implementation
@@ -220,7 +220,7 @@ Common::SeekableReadStream *CachedArchive::createReadStreamForMember(const Commo
 	Common::String name = path.toString();
 	FileMap::const_iterator fDesc = _files.find(name);
 	if (fDesc == _files.end())
-		return 0;
+		return nullptr;
 
 	return new Common::MemoryReadStream(fDesc->_value.data, fDesc->_value.size, DisposeAfterUse::NO);
 }
@@ -297,11 +297,11 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe
 Common::Archive *ResLoaderPak::load(Common::ArchiveMemberPtr memberFile, Common::SeekableReadStream &stream) const {
 	int32 filesize = stream.size();
 	if (filesize < 4)
-		return 0;
+		return nullptr;
 
 	Common::ScopedPtr<PlainArchive> result(new PlainArchive(memberFile));
 	if (!result)
-		return 0;
+		return nullptr;
 
 	int32 startoffset = 0, endoffset = 0;
 	bool switchEndian = false;
@@ -319,21 +319,21 @@ Common::Archive *ResLoaderPak::load(Common::ArchiveMemberPtr memberFile, Common:
 		// The start offset of a file should never be in the filelist
 		if (startoffset < stream.pos() || startoffset > filesize || startoffset < 0) {
 			warning("PAK file '%s' is corrupted", memberFile->getName().c_str());
-			return 0;
+			return nullptr;
 		}
 
 		file = readString(stream);
 
 		if (stream.eos()) {
 			warning("PAK file '%s' is corrupted", memberFile->getName().c_str());
-			return 0;
+			return nullptr;
 		}
 
 		// Quit now if we encounter an empty string
 		if (file.empty()) {
 			if (firstFile) {
 				warning("PAK file '%s' is corrupted", memberFile->getName().c_str());
-				return 0;
+				return nullptr;
 			} else {
 				break;
 			}
@@ -344,7 +344,7 @@ Common::Archive *ResLoaderPak::load(Common::ArchiveMemberPtr memberFile, Common:
 
 		if (endoffset < 0 && stream.pos() != firstOffset) {
 			warning("PAK file '%s' is corrupted", memberFile->getName().c_str());
-			return 0;
+			return nullptr;
 		}
 
 		if (!endoffset || stream.pos() == firstOffset)
@@ -414,7 +414,7 @@ Common::Archive *ResLoaderInsMalcolm::load(Common::ArchiveMemberPtr memberFile,
 	Common::List<Common::String> filenames;
 	Common::ScopedPtr<PlainArchive> result(new PlainArchive(memberFile));
 	if (!result)
-		return 0;
+		return nullptr;
 
 	// thanks to eriktorbjorn for this code (a bit modified though)
 	stream.seek(3, SEEK_SET);
@@ -611,7 +611,7 @@ private:
 	uint16 *_tables16[3];
 };
 
-FileExpander::FileExpander() : _src(0) {
+FileExpander::FileExpander() : _src(nullptr) {
 	_tables[0] = new uint8[3914];
 	assert(_tables[0]);
 
@@ -779,7 +779,7 @@ bool FileExpander::process(uint8 *dst, const uint8 *src, uint32 outsize, uint32
 	}
 
 	delete _src;
-	_src = 0;
+	_src = nullptr;
 
 	return true;
 }
@@ -787,7 +787,7 @@ bool FileExpander::process(uint8 *dst, const uint8 *src, uint32 outsize, uint32
 void FileExpander::generateTables(uint8 srcIndex, uint8 dstIndex, uint8 dstIndex2, int cnt) {
 	uint8 *tbl1 = _tables[srcIndex];
 	uint8 *tbl2 = _tables[dstIndex];
-	uint8 *tbl3 = dstIndex2 == 0xFF ? 0 : _tables[dstIndex2];
+	uint8 *tbl3 = dstIndex2 == 0xFF ? nullptr : _tables[dstIndex2];
 
 	if (!cnt)
 		return;
@@ -958,7 +958,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
 	InsArchive newArchive;
 	Common::List<InsArchive> archives;
 
-	Common::SeekableReadStream *tmpFile = 0;
+	Common::SeekableReadStream *tmpFile = nullptr;
 
 	for (int8 currentFile = 1; currentFile; currentFile++) {
 		sprintf(filenameExt, extension.c_str(), currentFile);
@@ -995,7 +995,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
 		bytesleft -= cs;
 
 		delete tmpFile;
-		tmpFile = 0;
+		tmpFile = nullptr;
 
 		pos += cs;
 		if (cs == size) {
@@ -1021,8 +1021,8 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
 	CachedArchive::InputEntry newEntry;
 	uint32 insize = 0;
 	uint32 outsize = 0;
-	uint8 *inbuffer = 0;
-	uint8 *outbuffer = 0;
+	uint8 *inbuffer = nullptr;
+	uint8 *outbuffer = nullptr;
 	uint32 inPart1 = 0;
 	uint32 inPart2 = 0;
 	uint8 compressionType = 0;
@@ -1055,7 +1055,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
 				if (pos > size) {
 					pos -= size;
 					delete tmpFile;
-					tmpFile = 0;
+					tmpFile = nullptr;
 					continue;
 				}
 			} else {
@@ -1070,7 +1070,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
 						memcpy(outbuffer, inbuffer, outsize);
 
 					delete[] inbuffer;
-					inbuffer = 0;
+					inbuffer = nullptr;
 
 					newEntry.data = outbuffer;
 					newEntry.size = outsize;
@@ -1160,7 +1160,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
 							memcpy(outbuffer, inbuffer, outsize);
 
 						delete[] inbuffer;
-						inbuffer = 0;
+						inbuffer = nullptr;
 						newEntry.data = outbuffer;
 						newEntry.size = outsize;
 						newEntry.name = entryStr;
@@ -1190,7 +1190,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
 				}
 			}
 			delete tmpFile;
-			tmpFile = 0;
+			tmpFile = nullptr;
 		}
 	}
 
diff --git a/engines/kyra/resource/staticres.cpp b/engines/kyra/resource/staticres.cpp
index b0d77a633b..29d47ac544 100644
--- a/engines/kyra/resource/staticres.cpp
+++ b/engines/kyra/resource/staticres.cpp
@@ -150,7 +150,7 @@ bool StaticResource::loadStaticResourceFile() {
 			continue;
 		}
 
-		delete file; file = 0;
+		delete file; file = nullptr;
 
 		if (!res->loadPakFile(staticDataFilename(), *i))
 			continue;
@@ -209,7 +209,7 @@ bool StaticResource::tryKyraDatLoad() {
 	}
 
 	delete index;
-	index = 0;
+	index = nullptr;
 
 	if (!found)
 		return false;
@@ -282,7 +282,7 @@ bool StaticResource::init() {
 		{ kEoBNpcData, proc(loadEoBNpcData), proc(freeEoBNpcData) },
 #endif
 
-		{ 0, 0, 0 }
+		{ 0, nullptr, nullptr }
 	};
 #undef proc
 	_fileLoader = fileTypeTable;
@@ -335,7 +335,7 @@ bool StaticResource::prefetchId(int id) {
 		return true;
 	}
 
-	const void *ptr = 0;
+	const void *ptr = nullptr;
 	int type = -1, size = -1;
 
 	if (checkResList(id, type, ptr, size))
@@ -396,36 +396,36 @@ bool StaticResource::checkResList(int id, int &type, const void *&ptr, int &size
 
 const StaticResource::FileType *StaticResource::getFiletype(int type) {
 	if (!_fileLoader)
-		return 0;
+		return nullptr;
 
 	for (int i = 0; _fileLoader[i].load; ++i) {
 		if (_fileLoader[i].type == type)
 			return &_fileLoader[i];
 	}
 
-	return 0;
+	return nullptr;
 }
 
 const void *StaticResource::getData(int id, int requesttype, int &size) {
-	const void *ptr = 0;
+	const void *ptr = nullptr;
 	int type = -1;
 	size = 0;
 
 	if (checkResList(id, type, ptr, size)) {
 		if (type == requesttype)
 			return ptr;
-		return 0;
+		return nullptr;
 	}
 
 	if (!prefetchId(id))
-		return 0;
+		return nullptr;
 
 	if (checkResList(id, type, ptr, size)) {
 		if (type == requesttype)
 			return ptr;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 bool StaticResource::loadDummy(Common::SeekableReadStream &stream, void *&ptr, int &size) {
@@ -582,7 +582,7 @@ bool StaticResource::loadHoFSequenceData(Common::SeekableReadStream &stream, voi
 			size += (num_c * sizeof(FrameControl));
 
 		} else {
-			tmp_n[i].wsaControl = 0;
+			tmp_n[i].wsaControl = nullptr;
 		}
 	}
 
@@ -642,7 +642,7 @@ void StaticResource::freeDummy(void *&ptr, int &size) {
 void StaticResource::freeRawData(void *&ptr, int &size) {
 	uint8 *data = (uint8 *)ptr;
 	delete[] data;
-	ptr = 0;
+	ptr = nullptr;
 	size = 0;
 }
 
@@ -651,28 +651,28 @@ void StaticResource::freeStringTable(void *&ptr, int &size) {
 	while (size--)
 		delete[] data[size];
 	delete[] data;
-	ptr = 0;
+	ptr = nullptr;
 	size = 0;
 }
 
 void StaticResource::freeShapeTable(void *&ptr, int &size) {
 	Shape *data = (Shape *)ptr;
 	delete[] data;
-	ptr = 0;
+	ptr = nullptr;
 	size = 0;
 }
 
 void StaticResource::freeAmigaSfxTable(void *&ptr, int &size) {
 	AmigaSfxTable *data = (AmigaSfxTable *)ptr;
 	delete[] data;
-	ptr = 0;
+	ptr = nullptr;
 	size = 0;
 }
 
 void StaticResource::freeRoomTable(void *&ptr, int &size) {
 	Room *data = (Room *)ptr;
 	delete[] data;
-	ptr = 0;
+	ptr = nullptr;
 	size = 0;
 }
 
@@ -692,7 +692,7 @@ void StaticResource::freeHoFSequenceData(void *&ptr, int &size) {
 	delete[] h->nestedSeq;
 
 	delete h;
-	ptr = 0;
+	ptr = nullptr;
 	size = 0;
 }
 
@@ -701,7 +701,7 @@ void StaticResource::freeHoFSeqItemAnimData(void *&ptr, int &size) {
 	for (int i = 0; i < size; i++)
 		delete[] d[i].frames;
 	delete[] d;
-	ptr = 0;
+	ptr = nullptr;
 	size = 0;
 }
 
@@ -710,7 +710,7 @@ void StaticResource::freeItemAnimDefinition(void *&ptr, int &size) {
 	for (int i = 0; i < size; i++)
 		delete[] d[i].frames;
 	delete[] d;
-	ptr = 0;
+	ptr = nullptr;
 	size = 0;
 }
 
@@ -791,7 +791,7 @@ void KyraEngine_LoK::initStaticResource() {
 		assert(_roomTable);
 
 		memcpy(_roomTable, tempRoomList, _roomTableSize * sizeof(Room));
-		tempRoomList = 0;
+		tempRoomList = nullptr;
 
 		_staticres->unloadId(k1RoomList);
 	}
@@ -804,7 +804,7 @@ void KyraEngine_LoK::initStaticResource() {
 		assert(_defaultShapeTable);
 
 		memcpy(_defaultShapeTable, tempShapeTable, _defaultShapeTableSize * sizeof(Shape));
-		tempShapeTable = 0;
+		tempShapeTable = nullptr;
 
 		_staticres->unloadId(k1DefaultShapes);
 	}
@@ -837,7 +837,7 @@ void KyraEngine_LoK::initStaticResource() {
 }
 
 void KyraEngine_LoK::loadMouseShapes() {
-	_screen->loadBitmap("MOUSE.CPS", 3, 3, 0);
+	_screen->loadBitmap("MOUSE.CPS", 3, 3, nullptr);
 	_screen->_curPage = 2;
 	_shapes[0] = _screen->encodeShape(0, 0, 8, 10, 0);
 	_shapes[1] = _screen->encodeShape(0, 0x17, 0x20, 7, 0);
@@ -847,7 +847,7 @@ void KyraEngine_LoK::loadMouseShapes() {
 	_shapes[5] = _screen->encodeShape(0x80, 0x12, 0x10, 11, 0);
 	_shapes[6] = _screen->encodeShape(0x90, 0x12, 0x10, 10, 0);
 	_shapes[360] = _screen->encodeShape(0x28, 0, 0x10, 13, 0);
-	_screen->setMouseCursor(1, 1, 0);
+	_screen->setMouseCursor(1, 1, nullptr);
 	_screen->setMouseCursor(1, 1, _shapes[0]);
 	_screen->setShapePages(5, 3);
 }
@@ -860,12 +860,12 @@ void KyraEngine_LoK::loadCharacterShapes() {
 		assert(i < _defaultShapeTableSize);
 		Shape *shape = &_defaultShapeTable[i];
 		if (shape->imageIndex == 0xFF) {
-			_shapes[i + 7] = 0;
+			_shapes[i + 7] = nullptr;
 			continue;
 		}
 		if (shape->imageIndex != curImage) {
 			assert(shape->imageIndex < _characterImageTableSize);
-			_screen->loadBitmap(_characterImageTable[shape->imageIndex], 3, 3, 0);
+			_screen->loadBitmap(_characterImageTable[shape->imageIndex], 3, 3, nullptr);
 			curImage = shape->imageIndex;
 		}
 		_shapes[i + 7] = _screen->encodeShape(shape->x << 3, shape->y, shape->w << 3, shape->h, 1);
@@ -874,7 +874,7 @@ void KyraEngine_LoK::loadCharacterShapes() {
 }
 
 void KyraEngine_LoK::loadSpecialEffectShapes() {
-	_screen->loadBitmap("EFFECTS.CPS", 3, 3, 0);
+	_screen->loadBitmap("EFFECTS.CPS", 3, 3, nullptr);
 	_screen->_curPage = 2;
 
 	int currShape;
@@ -894,10 +894,10 @@ void KyraEngine_LoK::loadSpecialEffectShapes() {
 void KyraEngine_LoK::loadItems() {
 	int shape;
 
-	_screen->loadBitmap("JEWELS3.CPS", 3, 3, 0);
+	_screen->loadBitmap("JEWELS3.CPS", 3, 3, nullptr);
 	_screen->_curPage = 2;
 
-	_shapes[323] = 0;
+	_shapes[323] = nullptr;
 
 	for (shape = 1; shape < 6; shape++)
 		_shapes[323 + shape] = _screen->encodeShape((shape - 1) * 32, 0, 32, 17, 0);
@@ -921,7 +921,7 @@ void KyraEngine_LoK::loadItems() {
 		_shapes[shape] = _screen->encodeShape((shape - 355) * 32, 85,  32, 17, 0);
 
 
-	_screen->loadBitmap("ITEMS.CPS", 3, 3, 0);
+	_screen->loadBitmap("ITEMS.CPS", 3, 3, nullptr);
 	_screen->_curPage = 2;
 
 	for (int i = 0; i < 107; i++) {
@@ -937,7 +937,7 @@ void KyraEngine_LoK::loadItems() {
 }
 
 void KyraEngine_LoK::loadButtonShapes() {
-	_screen->loadBitmap("BUTTONS2.CPS", 3, 3, 0);
+	_screen->loadBitmap("BUTTONS2.CPS", 3, 3, nullptr);
 	_screen->_curPage = 2;
 	_gui->_scrollUpButton.data0ShapePtr = _screen->encodeShape(0, 0, 24, 14, 1);
 	_gui->_scrollUpButton.data1ShapePtr = _screen->encodeShape(24, 0, 24, 14, 1);
@@ -954,19 +954,19 @@ void KyraEngine_LoK::loadMainScreen(int page) {
 	if (((_flags.lang == Common::EN_ANY || _flags.lang == Common::RU_RUS) && !_flags.isTalkie && _flags.platform == Common::kPlatformDOS) || _flags.platform == Common::kPlatformAmiga)
 		_screen->loadBitmap("MAIN15.CPS", page, page, &_screen->getPalette(0));
 	else if (_flags.lang == Common::EN_ANY || _flags.lang == Common::JA_JPN || (_flags.isTalkie && _flags.lang == Common::IT_ITA))
-		_screen->loadBitmap("MAIN_ENG.CPS", page, page, 0);
+		_screen->loadBitmap("MAIN_ENG.CPS", page, page, nullptr);
 	else if (_flags.lang == Common::FR_FRA || (_flags.lang == Common::ES_ESP && _flags.isTalkie)  /* Spanish fan made over French CD version */ )
-		_screen->loadBitmap("MAIN_FRE.CPS", page, page, 0);
+		_screen->loadBitmap("MAIN_FRE.CPS", page, page, nullptr);
 	else if (_flags.lang == Common::DE_DEU)
-		_screen->loadBitmap("MAIN_GER.CPS", page, page, 0);
+		_screen->loadBitmap("MAIN_GER.CPS", page, page, nullptr);
 	else if (_flags.lang == Common::ES_ESP)
-		_screen->loadBitmap("MAIN_SPA.CPS", page, page, 0);
+		_screen->loadBitmap("MAIN_SPA.CPS", page, page, nullptr);
 	else if (_flags.lang == Common::IT_ITA)
-		_screen->loadBitmap("MAIN_ITA.CPS", page, page, 0);
+		_screen->loadBitmap("MAIN_ITA.CPS", page, page, nullptr);
 	else if (_flags.lang == Common::RU_RUS)
-		_screen->loadBitmap("MAIN_ENG.CPS", page, page, 0);
+		_screen->loadBitmap("MAIN_ENG.CPS", page, page, nullptr);
 	else if (_flags.lang == Common::HE_ISR)
-		_screen->loadBitmap("MAIN_HEB.CPS", page, page, 0);
+		_screen->loadBitmap("MAIN_HEB.CPS", page, page, nullptr);
 	else
 		warning("no main graphics file found");
 
@@ -1004,16 +1004,16 @@ void KyraEngine_HoF::initStaticResource() {
 		_sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
 		_sound->initAudioResourceInfo(kMusicFinale, &resInfoFinale);
 	} else if (_flags.platform == Common::kPlatformFMTowns) {
-		SoundResourceInfo_TownsPC98V2 resInfoIntro(0, 0, "intro%d.twn", (const uint16*)_cdaTrackTableIntro, _cdaTrackTableIntroSize >> 1);
-		SoundResourceInfo_TownsPC98V2 resInfoIngame(0, 0, "km%02d.twn", (const uint16*)_cdaTrackTableIngame, _cdaTrackTableIngameSize >> 1);
-		SoundResourceInfo_TownsPC98V2 resInfoFinale(0, 0, "finale%d.twn", (const uint16*)_cdaTrackTableFinale, _cdaTrackTableFinaleSize >> 1);
+		SoundResourceInfo_TownsPC98V2 resInfoIntro(nullptr, 0, "intro%d.twn", (const uint16*)_cdaTrackTableIntro, _cdaTrackTableIntroSize >> 1);
+		SoundResourceInfo_TownsPC98V2 resInfoIngame(nullptr, 0, "km%02d.twn", (const uint16*)_cdaTrackTableIngame, _cdaTrackTableIngameSize >> 1);
+		SoundResourceInfo_TownsPC98V2 resInfoFinale(nullptr, 0, "finale%d.twn", (const uint16*)_cdaTrackTableFinale, _cdaTrackTableFinaleSize >> 1);
 		_sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
 		_sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
 		_sound->initAudioResourceInfo(kMusicFinale, &resInfoFinale);
 	} else if (_flags.platform == Common::kPlatformPC98) {
-		SoundResourceInfo_TownsPC98V2 resInfoIntro(0, 0, "intro%d.86", 0, 0);
-		SoundResourceInfo_TownsPC98V2 resInfoIngame(0, 0, "km%02d.86", 0, 0);
-		SoundResourceInfo_TownsPC98V2 resInfoFinale(0, 0, "finale%d.86", 0, 0);
+		SoundResourceInfo_TownsPC98V2 resInfoIntro(nullptr, 0, "intro%d.86", nullptr, 0);
+		SoundResourceInfo_TownsPC98V2 resInfoIngame(nullptr, 0, "km%02d.86", nullptr, 0);
+		SoundResourceInfo_TownsPC98V2 resInfoFinale(nullptr, 0, "finale%d.86", nullptr, 0);
 		_sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
 		_sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
 		_sound->initAudioResourceInfo(kMusicFinale, &resInfoFinale);
@@ -1127,52 +1127,52 @@ void GUI_LoK::initStaticResource() {
 	Button::Callback loadGameMenuFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::loadGameMenu);
 	Button::Callback cancelSubMenuFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::cancelSubMenu);
 
-	GUI_V1_MENU(_menu[0], -1, -1, 0x100, 0x8B, 248, 249, 250, 0, 251, -1, 8, 0, 5, -1, -1, -1, -1);
-	GUI_V1_MENU_ITEM(_menu[0].item[0], 1, 0, 0, 0, -1, -1, 0x1E, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[0].item[1], 1, 0, 0, 0, -1, -1, 0x2F, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[0].item[2], 1, 0, 0, 0, -1, -1, 0x40, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[0].item[3], 1, 0, 0, 0, -1, -1, 0x51, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[0].item[4], 1, 0, 0, 0, -1,  0, 0x6E, 0xDC, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
+	GUI_V1_MENU(_menu[0], -1, -1, 0x100, 0x8B, 248, 249, 250, nullptr, 251, -1, 8, 0, 5, -1, -1, -1, -1);
+	GUI_V1_MENU_ITEM(_menu[0].item[0], 1, 0, 0, 0, -1, -1, 0x1E, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[0].item[1], 1, 0, 0, 0, -1, -1, 0x2F, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[0].item[2], 1, 0, 0, 0, -1, -1, 0x40, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[0].item[3], 1, 0, 0, 0, -1, -1, 0x51, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[0].item[4], 1, 0, 0, 0, -1,  0, 0x6E, 0xDC, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
 	_menu[0].item[0].callback = loadGameMenuFunctor;
 	_menu[0].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::saveGameMenu);
 	_menu[0].item[2].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::gameControlsMenu);
 	_menu[0].item[3].callback = quitPlayingFunctor;
 	_menu[0].item[4].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::resumeGame);
 
-	GUI_V1_MENU(_menu[1], -1, -1, 0x140, 0x38, 248, 249, 250, 0, 254, -1, 8, 0, 2, -1, -1, -1, -1);
-	GUI_V1_MENU_ITEM(_menu[1].item[0], 1, 0, 0, 0, 0x18, 0, 0x1E, 0x48, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[1].item[1], 1, 0, 0, 0, 0xD8, 0, 0x1E, 0x48, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
+	GUI_V1_MENU(_menu[1], -1, -1, 0x140, 0x38, 248, 249, 250, nullptr, 254, -1, 8, 0, 2, -1, -1, -1, -1);
+	GUI_V1_MENU_ITEM(_menu[1].item[0], 1, 0, 0, 0, 0x18, 0, 0x1E, 0x48, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[1].item[1], 1, 0, 0, 0, 0xD8, 0, 0x1E, 0x48, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
 	_menu[1].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::quitConfirmYes);
 	_menu[1].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::quitConfirmNo);
 
-	GUI_V1_MENU(_menu[2], -1, -1, 0x120, 0xA0, 248, 249, 250, 0, 251, -1, 8, 0, 6, 132, 22, 132, 124);
-	GUI_V1_MENU_ITEM(_menu[2].item[0], 1, 0, 0, 0, -1, 255, 0x27, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[2].item[1], 1, 0, 0, 0, -1, 255, 0x38, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[2].item[2], 1, 0, 0, 0, -1, 255, 0x49, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[2].item[3], 1, 0, 0, 0, -1, 255, 0x5A, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[2].item[4], 1, 0, 0, 0, -1, 255, 0x6B, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[2].item[5], 1, 0, 0, 0, 0xB8, 0, 0x86, 0x58, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
+	GUI_V1_MENU(_menu[2], -1, -1, 0x120, 0xA0, 248, 249, 250, nullptr, 251, -1, 8, 0, 6, 132, 22, 132, 124);
+	GUI_V1_MENU_ITEM(_menu[2].item[0], 1, 0, 0, 0, -1, 255, 0x27, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[2].item[1], 1, 0, 0, 0, -1, 255, 0x38, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[2].item[2], 1, 0, 0, 0, -1, 255, 0x49, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[2].item[3], 1, 0, 0, 0, -1, 255, 0x5A, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[2].item[4], 1, 0, 0, 0, -1, 255, 0x6B, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[2].item[5], 1, 0, 0, 0, 0xB8, 0, 0x86, 0x58, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
 	_menu[2].item[5].callback = cancelSubMenuFunctor;
 
-	GUI_V1_MENU(_menu[3], -1, -1, 288, 67, 248, 249, 250, 0, 251, -1, 8, 0, 2, -1, -1, -1, -1);
-	GUI_V1_MENU_ITEM(_menu[3].item[0], 1, 0, 0, 0, 24, 0, 44, 85, 15, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[3].item[1], 1, 0, 0, 0, 179, 0, 44, 85, 15, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
+	GUI_V1_MENU(_menu[3], -1, -1, 288, 67, 248, 249, 250, nullptr, 251, -1, 8, 0, 2, -1, -1, -1, -1);
+	GUI_V1_MENU_ITEM(_menu[3].item[0], 1, 0, 0, 0, 24, 0, 44, 85, 15, 252, 253, -1, 255, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[3].item[1], 1, 0, 0, 0, 179, 0, 44, 85, 15, 252, 253, -1, 255, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
 	_menu[3].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::savegameConfirm);
 	_menu[3].item[1].callback = cancelSubMenuFunctor;
 
-	GUI_V1_MENU(_menu[4], -1, -1, 0xD0, 0x4C, 248, 249, 250, 0, 251, -1, 8, 0, 2, -1, -1, -1, -1);
-	GUI_V1_MENU_ITEM(_menu[4].item[0], 1, 0, 0, 0, -1, -1, 0x1E, 0xB4, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[4].item[1], 1, 0, 0, 0, -1, -1, 0x2F, 0xB4, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
+	GUI_V1_MENU(_menu[4], -1, -1, 0xD0, 0x4C, 248, 249, 250, nullptr, 251, -1, 8, 0, 2, -1, -1, -1, -1);
+	GUI_V1_MENU_ITEM(_menu[4].item[0], 1, 0, 0, 0, -1, -1, 0x1E, 0xB4, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[4].item[1], 1, 0, 0, 0, -1, -1, 0x2F, 0xB4, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
 	_menu[4].item[0].callback = loadGameMenuFunctor;
 	_menu[4].item[1].callback = quitPlayingFunctor;
 
-	GUI_V1_MENU(_menu[5], -1, -1, 0x130, 0x99, 248, 249, 250, 0, 251, -1, 8, 0, 6, -1, -1, -1, -1);
-	GUI_V1_MENU_ITEM(_menu[5].item[0], 1, 0, 0, 0, 0xA5, 0, 0x1E, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x20, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[5].item[1], 1, 0, 0, 0, 0xA5, 0, 0x2F, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x31, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[5].item[2], 1, 0, 0, 0, 0xA5, 0, 0x40, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x42, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[5].item[3], 1, 0, 0, 0, 0xA5, 0, 0x51, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x53, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[5].item[4], 1, 0, 0, 0, 0xA5, 0, 0x62, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x65, 0, 0);
-	GUI_V1_MENU_ITEM(_menu[5].item[5], 1, 0, 0, 0,   -1, 0, 0x7F, 0x6C, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
+	GUI_V1_MENU(_menu[5], -1, -1, 0x130, 0x99, 248, 249, 250, nullptr, 251, -1, 8, 0, 6, -1, -1, -1, -1);
+	GUI_V1_MENU_ITEM(_menu[5].item[0], 1, 0, 0, 0, 0xA5, 0, 0x1E, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0x10, 0x20, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[5].item[1], 1, 0, 0, 0, 0xA5, 0, 0x2F, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0x10, 0x31, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[5].item[2], 1, 0, 0, 0, 0xA5, 0, 0x40, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0x10, 0x42, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[5].item[3], 1, 0, 0, 0, 0xA5, 0, 0x51, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0x10, 0x53, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[5].item[4], 1, 0, 0, 0, 0xA5, 0, 0x62, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, nullptr, 0x10, 0x65, 0, 0);
+	GUI_V1_MENU_ITEM(_menu[5].item[5], 1, 0, 0, 0,   -1, 0, 0x7F, 0x6C, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, nullptr, 0, 0, 0, 0);
 	_menu[5].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeMusic);
 	_menu[5].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeSounds);
 	_menu[5].item[2].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeWalk);
@@ -1233,7 +1233,7 @@ void KyraEngine_LoK::setupButtonData() {
 
 	for (int i = 1; i < 15; ++i)
 		_buttonDataListPtr[i - 1] = &_buttonData[i];
-	_buttonDataListPtr[14] = 0;
+	_buttonDataListPtr[14] = nullptr;
 }
 
 const uint8 KyraEngine_LoK::_magicMouseItemStartFrame[] = {
diff --git a/engines/kyra/script/script.cpp b/engines/kyra/script/script.cpp
index b53de0475a..0e7a44171e 100644
--- a/engines/kyra/script/script.cpp
+++ b/engines/kyra/script/script.cpp
@@ -27,7 +27,7 @@
 #include "common/endian.h"
 
 namespace Kyra {
-EMCInterpreter::EMCInterpreter(KyraEngine_v1 *vm) : _vm(vm), _scriptData(0), _filename(0) {
+EMCInterpreter::EMCInterpreter(KyraEngine_v1 *vm) : _vm(vm), _scriptData(nullptr), _filename(nullptr) {
 #define OPCODE(x) { &EMCInterpreter::x, #x }
 	static const OpcodeEntry opcodes[] = {
 		// 0x00
@@ -128,8 +128,8 @@ bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Commo
 
 	Common::strlcpy(_scriptData->filename, filename, 13);
 
-	_scriptData = 0;
-	_filename = 0;
+	_scriptData = nullptr;
+	_filename = nullptr;
 
 	return true;
 }
@@ -142,13 +142,13 @@ void EMCInterpreter::unload(EMCData *data) {
 	delete[] data->ordr;
 	delete[] data->data;
 
-	data->text = 0;
-	data->ordr = data->data = 0;
+	data->text = nullptr;
+	data->ordr = data->data = nullptr;
 }
 
 void EMCInterpreter::init(EMCState *scriptStat, const EMCData *data) {
 	scriptStat->dataPtr = data;
-	scriptStat->ip = 0;
+	scriptStat->ip = nullptr;
 	scriptStat->stack[EMCState::kStackLastEntry] = 0;
 	scriptStat->bp = EMCState::kStackSize+1;
 	scriptStat->sp = EMCState::kStackLastEntry;
@@ -219,7 +219,7 @@ bool EMCInterpreter::run(EMCState *script) {
 		(this->*(_opcodes[opcode].proc))(script);
 	}
 
-	return (script->ip != 0);
+	return (script->ip != nullptr);
 }
 
 #pragma mark -
@@ -247,7 +247,7 @@ void EMCInterpreter::op_pushRetOrPos(EMCState *script) {
 		break;
 
 	default:
-		script->ip = 0;
+		script->ip = nullptr;
 	}
 }
 
@@ -275,7 +275,7 @@ void EMCInterpreter::op_popRetOrPos(EMCState *script) {
 
 	case 1:
 		if (script->sp >= EMCState::kStackLastEntry) {
-			script->ip = 0;
+			script->ip = nullptr;
 		} else {
 			script->bp = script->stack[script->sp++];
 			script->ip = script->dataPtr->data + script->stack[script->sp++];
@@ -283,7 +283,7 @@ void EMCInterpreter::op_popRetOrPos(EMCState *script) {
 		break;
 
 	default:
-		script->ip = 0;
+		script->ip = nullptr;
 	}
 }
 
@@ -348,7 +348,7 @@ void EMCInterpreter::op_negate(EMCState *script) {
 
 	default:
 		warning("Unknown negation func: %d", _parameter);
-		script->ip = 0;
+		script->ip = nullptr;
 	}
 }
 
@@ -438,14 +438,14 @@ void EMCInterpreter::op_eval(EMCState *script) {
 	}
 
 	if (error)
-		script->ip = 0;
+		script->ip = nullptr;
 	else
 		script->stack[--script->sp] = ret;
 }
 
 void EMCInterpreter::op_setRetAndJmp(EMCState *script) {
 	if (script->sp >= EMCState::kStackLastEntry) {
-		script->ip = 0;
+		script->ip = nullptr;
 	} else {
 		script->retValue = script->stack[script->sp++];
 		uint16 temp = script->stack[script->sp++];
diff --git a/engines/kyra/script/script_hof.cpp b/engines/kyra/script/script_hof.cpp
index 802a9f4603..f114278e5c 100644
--- a/engines/kyra/script/script_hof.cpp
+++ b/engines/kyra/script/script_hof.cpp
@@ -139,7 +139,7 @@ int KyraEngine_HoF::o2_meanWhileScene(EMCState *script) {
 	const char *cpsfile = stackPosString(0);
 	const char *palfile = stackPosString(1);
 
-	_screen->loadBitmap(cpsfile, 3, 3, 0);
+	_screen->loadBitmap(cpsfile, 3, 3, nullptr);
 	_screen->copyPalette(2, 0);
 	_screen->loadPalette(palfile, _screen->getPalette(2));
 	_screen->fillRect(0, 0, 319, 199, 207);
@@ -181,7 +181,7 @@ int KyraEngine_HoF::o2_displayWsaFrame(EMCState *script) {
 
 	_screen->hideMouse();
 	const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
-	_wsaSlots[slot]->displayFrame(frame, dstPage, x, y, copyParam | 0xC000, 0, 0);
+	_wsaSlots[slot]->displayFrame(frame, dstPage, x, y, copyParam | 0xC000, nullptr, nullptr);
 	_screen->updateScreen();
 
 	if (backUp)
@@ -213,7 +213,7 @@ int KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(EMCState *script) {
 		if (startFrame < endFrame) {
 			for (int i = startFrame; i <= endFrame; ++i) {
 				const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
-				_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, 0, 0);
+				_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, nullptr, nullptr);
 
 				if (!skipFlag()) {
 					_screen->updateScreen();
@@ -223,7 +223,7 @@ int KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(EMCState *script) {
 		} else {
 			for (int i = startFrame; i >= endFrame; --i) {
 				const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
-				_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, 0, 0);
+				_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, nullptr, nullptr);
 
 				if (!skipFlag()) {
 					_screen->updateScreen();
@@ -242,7 +242,7 @@ int KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(EMCState *script) {
 int KyraEngine_HoF::o2_wsaOpen(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_wsaOpen(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
 	assert(stackPos(1) >= 0 && stackPos(1) < ARRAYSIZE(_wsaSlots));
-	_wsaSlots[stackPos(1)]->open(stackPosString(0), 1, 0);
+	_wsaSlots[stackPos(1)]->open(stackPosString(0), 1, nullptr);
 	return 0;
 }
 
@@ -259,7 +259,7 @@ int KyraEngine_HoF::o2_displayWsaSequentialFrames(EMCState *script) {
 
 	while (currentFrame <= lastFrame) {
 		const uint32 endTime = _system->getMillis() + frameDelay;
-		_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, 0, 0);
+		_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, nullptr, nullptr);
 		if (!skipFlag()) {
 			_screen->updateScreen();
 			delayUntil(endTime);
@@ -287,7 +287,7 @@ int KyraEngine_HoF::o2_displayWsaSequence(EMCState *script) {
 
 	while (currentFrame <= lastFrame) {
 		const uint32 endTime = _system->getMillis() + frameDelay;
-		_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, 0, 0);
+		_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, nullptr, nullptr);
 		if (!skipFlag()) {
 			if (doUpdate)
 				update();
@@ -775,14 +775,14 @@ int KyraEngine_HoF::o2_showLetter(EMCState *script) {
 
 	_screen->hideMouse();
 
-	showMessage(0, 0xCF);
+	showMessage(nullptr, 0xCF);
 	displayInvWsaLastFrame();
 	backUpPage0();
 
 	_screen->copyPalette(2, 0);
 
 	_screen->clearPage(3);
-	_screen->loadBitmap("_NOTE.CPS", 3, 3, 0);
+	_screen->loadBitmap("_NOTE.CPS", 3, 3, nullptr);
 
 	sprintf(filename, "_NTEPAL%.1d.COL", letter+1);
 	_screen->loadPalette(filename, _screen->getPalette(0));
@@ -790,11 +790,11 @@ int KyraEngine_HoF::o2_showLetter(EMCState *script) {
 	_screen->fadeToBlack(0x14);
 
 	sprintf(filename, "LETTER%.1d.%s", letter, _languageExtension[_lang]);
-	uint8 *letterBuffer = _res->fileData(filename, 0);
+	uint8 *letterBuffer = _res->fileData(filename, nullptr);
 	if (!letterBuffer) {
 		// some floppy versions use a TXT extension
 		sprintf(filename, "LETTER%.1d.TXT", letter);
-		letterBuffer = _res->fileData(filename, 0);
+		letterBuffer = _res->fileData(filename, nullptr);
 	}
 
 	if (letterBuffer) {
@@ -811,7 +811,7 @@ int KyraEngine_HoF::o2_showLetter(EMCState *script) {
 
 	bool running = true;
 	while (running) {
-		int inputFlag = checkInput(0);
+		int inputFlag = checkInput(nullptr);
 		removeInputTop();
 
 		if (inputFlag == 198 || inputFlag == 199)
@@ -865,11 +865,11 @@ int KyraEngine_HoF::o2_defineSceneAnim(EMCState *script) {
 	anim.height = stackPos(7);
 	anim.specialSize = stackPos(9);
 	anim.shapeIndex = stackPos(11);
-	if (stackPosString(12) != 0)
+	if (stackPosString(12) != nullptr)
 		strcpy(anim.filename, stackPosString(12));
 
 	if (anim.flags & 0x40) {
-		if (!_sceneAnimMovie[animId]->open(anim.filename, 1, 0))
+		if (!_sceneAnimMovie[animId]->open(anim.filename, 1, nullptr))
 			error("couldn't load '%s'", anim.filename);
 
 		if (_sceneAnimMovie[animId]->xAdd() || _sceneAnimMovie[animId]->yAdd())
@@ -1194,7 +1194,7 @@ int KyraEngine_HoF::o2_setupSceneAnimation(EMCState *script) {
 		strcpy(anim.filename, stackPosString(12));
 
 	if (flags & 0x40) {
-		_sceneAnimMovie[index]->open(stackPosString(12), 0, 0);
+		_sceneAnimMovie[index]->open(stackPosString(12), 0, nullptr);
 		if (_sceneAnimMovie[index]->xAdd() || _sceneAnimMovie[index]->yAdd())
 			anim.wsaFlag = 1;
 		else
@@ -1221,7 +1221,7 @@ int KyraEngine_HoF::o2_setupSceneAnimation(EMCState *script) {
 	if ((anim.flags & 0x20) && anim.shapeIndex >= 0)
 		obj->shapePtr = _sceneShapeTable[anim.shapeIndex];
 	else
-		obj->shapePtr = 0;
+		obj->shapePtr = nullptr;
 
 	if (anim.flags & 0x40) {
 		obj->shapeIndex3 = anim.shapeIndex;
@@ -1405,7 +1405,7 @@ int KyraEngine_HoF::o2_demoFinale(EMCState *script) {
 
 	_screen->clearPage(0);
 	_screen->loadPalette("THANKS.COL", _screen->getPalette(0));
-	_screen->loadBitmap("THANKS.CPS", 3, 3, 0);
+	_screen->loadBitmap("THANKS.CPS", 3, 3, nullptr);
 	_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
 
 	_screen->_curPage = 0;
@@ -1492,7 +1492,7 @@ typedef Common::Functor2Mem<const TIM *, const uint16 *, int, KyraEngine_HoF> TI
 #define OpcodeTimUnImpl() _timOpcodes.push_back(new TIMOpcodeV2(this, 0))
 
 void KyraEngine_HoF::setupOpcodeTable() {
-	Common::Array<const Opcode *> *table = 0;
+	Common::Array<const Opcode *> *table = nullptr;
 
 	_opcodes.reserve(176);
 	SetOpcodeTable(_opcodes);
diff --git a/engines/kyra/script/script_lok.cpp b/engines/kyra/script/script_lok.cpp
index 613c250f33..3e5e0a51d8 100644
--- a/engines/kyra/script/script_lok.cpp
+++ b/engines/kyra/script/script_lok.cpp
@@ -402,7 +402,7 @@ int KyraEngine_LoK::o1_openWSAFile(EMCState *script) {
 	const char *filename = stackPosString(0);
 	int wsaIndex = stackPos(1);
 
-	_movieObjects[wsaIndex]->open(filename, (stackPos(3) != 0) ? 1 : 0, 0);
+	_movieObjects[wsaIndex]->open(filename, (stackPos(3) != 0) ? 1 : 0, nullptr);
 	assert(_movieObjects[wsaIndex]->opened());
 
 	return 0;
@@ -435,7 +435,7 @@ int KyraEngine_LoK::o1_runWSAFromBeginningToEnd(EMCState *script) {
 	while (running) {
 		const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
 
-		_movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos, 0, 0, 0);
+		_movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos, 0, nullptr, nullptr);
 		if (wsaFrame >= _movieObjects[wsaIndex]->frames())
 			running = false;
 
@@ -456,7 +456,7 @@ int KyraEngine_LoK::o1_displayWSAFrame(EMCState *script) {
 	int wsaIndex = stackPos(4);
 	_screen->hideMouse();
 	const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
-	_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
+	_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, nullptr, nullptr);
 	delayUntil(continueTime, false, true);
 	_screen->showMouse();
 	return 0;
@@ -488,7 +488,7 @@ int KyraEngine_LoK::o1_runWSAFrames(EMCState *script) {
 	_screen->hideMouse();
 	for (; startFrame <= endFrame; ++startFrame) {
 		const uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
-		_movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos, 0, 0, 0);
+		_movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos, 0, nullptr, nullptr);
 		delayUntil(nextRun, false, true);
 	}
 	_screen->showMouse();
@@ -675,7 +675,7 @@ int KyraEngine_LoK::o1_displayWSAFrameOnHidPage(EMCState *script) {
 
 	_screen->hideMouse();
 	const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
-	_movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos, 0, 0, 0);
+	_movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos, 0, nullptr, nullptr);
 	delayUntil(continueTime, false, true);
 	_screen->showMouse();
 
@@ -740,7 +740,7 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
 	// does not use the specified paramaeters like these, it is safe to enable
 	// it for all versions.
 	if (startFrame == 18 && endFrame == 18 && waitTime == 10 && wsaIndex == 0 && _currentRoom == 45) {
-		_movieObjects[wsaIndex]->displayFrame(18, 0, xpos, ypos, 0, 0, 0);
+		_movieObjects[wsaIndex]->displayFrame(18, 0, xpos, ypos, 0, nullptr, nullptr);
 		// We call delayMillis manually here to avoid the screen getting
 		// updated.
 		_system->delayMillis(waitTime * _tickLength);
@@ -754,7 +754,7 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
 			int frame = startFrame;
 			while (endFrame >= frame) {
 				const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
-				_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
+				_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, nullptr, nullptr);
 				delayUntil(continueTime, false, true);
 				++frame;
 			}
@@ -762,7 +762,7 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
 			int frame = startFrame;
 			while (endFrame <= frame) {
 				const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
-				_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
+				_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, nullptr, nullptr);
 				delayUntil(continueTime, false, true);
 				--frame;
 			}
@@ -1014,7 +1014,7 @@ int KyraEngine_LoK::o1_walkCharacterToPoint(EMCState *script) {
 		if (forceContinue || !running)
 			continue;
 
-		setCharacterPosition(character, 0);
+		setCharacterPosition(character, nullptr);
 		++curPos;
 
 		delayUntil(nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis(), true, true);
@@ -1029,15 +1029,15 @@ int KyraEngine_LoK::o1_specialEventDisplayBrynnsNote(EMCState *script) {
 	_screen->savePageToDisk("SEENPAGE.TMP", 0);
 	if (_flags.isTalkie) {
 		if (_flags.lang == Common::EN_ANY || _flags.lang == Common::IT_ITA)
-			_screen->loadBitmap("NOTEENG.CPS", 3, 3, 0);
+			_screen->loadBitmap("NOTEENG.CPS", 3, 3, nullptr);
 		else if (_flags.lang == Common::FR_FRA)
-			_screen->loadBitmap("NOTEFRE.CPS", 3, 3, 0);
+			_screen->loadBitmap("NOTEFRE.CPS", 3, 3, nullptr);
 		else if (_flags.lang == Common::DE_DEU)
-			_screen->loadBitmap("NOTEGER.CPS", 3, 3, 0);
+			_screen->loadBitmap("NOTEGER.CPS", 3, 3, nullptr);
 		else if (_flags.lang == Common::RU_RUS)
-			_screen->loadBitmap("NOTEENG.CPS", 3, 3, 0);
+			_screen->loadBitmap("NOTEENG.CPS", 3, 3, nullptr);
 	} else {
-		_screen->loadBitmap("NOTE.CPS", 3, 3, 0);
+		_screen->loadBitmap("NOTE.CPS", 3, 3, nullptr);
 	}
 	_screen->copyRegion(63, 8, 63, 8, 194, 128, 2, 0);
 	_screen->updateScreen();
@@ -1267,7 +1267,7 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_makeAmuletAppear(%p) ()", (const void *)script);
 	Movie *amulet = createWSAMovie();
 	assert(amulet);
-	amulet->open("AMULET.WSA", 1, 0);
+	amulet->open("AMULET.WSA", 1, nullptr);
 
 	if (amulet->opened()) {
 		assert(_amuleteAnim);
@@ -1286,7 +1286,7 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
 			if (code == 14)
 				snd_playSoundEffect(0x73);
 
-			amulet->displayFrame(code, 0, 224, 152, 0, 0, 0);
+			amulet->displayFrame(code, 0, 224, 152, 0, nullptr, nullptr);
 			delayUntil(nextTime, false, true);
 		}
 		_screen->showMouse();
@@ -1339,7 +1339,7 @@ int KyraEngine_LoK::o1_waitForConfirmationMouseClick(EMCState *script) {
 
 		updateInput();
 
-		int input = checkInput(0, false) & 0xFF;
+		int input = checkInput(nullptr, false) & 0xFF;
 		removeInputTop();
 		if (input == 200)
 			break;
@@ -1770,7 +1770,7 @@ typedef Common::Functor1Mem<EMCState *, int, KyraEngine_LoK> OpcodeV1;
 #define SetOpcodeTable(x) table = &x;
 #define Opcode(x) table->push_back(new OpcodeV1(this, &KyraEngine_LoK::x))
 void KyraEngine_LoK::setupOpcodeTable() {
-	Common::Array<const Opcode *> *table = 0;
+	Common::Array<const Opcode *> *table = nullptr;
 
 	_opcodes.reserve(157);
 	SetOpcodeTable(_opcodes);
diff --git a/engines/kyra/script/script_mr.cpp b/engines/kyra/script/script_mr.cpp
index 4a7e44788d..71029b5dc1 100644
--- a/engines/kyra/script/script_mr.cpp
+++ b/engines/kyra/script/script_mr.cpp
@@ -284,7 +284,7 @@ int KyraEngine_MR::o3_updateScore(EMCState *script) {
 
 int KyraEngine_MR::o3_makeSecondChanceSave(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_makeSecondChanceSave(%p) ()", (const void *)script);
-	saveGameStateIntern(999, "Autosave", 0);
+	saveGameStateIntern(999, "Autosave", nullptr);
 	return 0;
 }
 
@@ -776,7 +776,7 @@ int KyraEngine_MR::o3_daggerWarning(EMCState *script) {
 		y += yInc;
 	}
 
-	const char *str = 0;
+	const char *str = nullptr;
 	int x = 0;
 
 	str = (const char *)getTableEntry(_cCodeFile, 120);
@@ -798,7 +798,7 @@ int KyraEngine_MR::o3_daggerWarning(EMCState *script) {
 	_screen->showMouse();
 
 	while (!shouldQuit()) {
-		int keys = checkInput(0);
+		int keys = checkInput(nullptr);
 		removeInputTop();
 
 		if (keys == 198 || keys == 199) {
@@ -886,7 +886,7 @@ int KyraEngine_MR::o3_defineSceneAnim(EMCState *script) {
 		strcpy(anim.filename, filename);
 
 	if (flags & 8) {
-		_sceneAnimMovie[animId]->open(filename, 1, 0);
+		_sceneAnimMovie[animId]->open(filename, 1, nullptr);
 		if (_sceneAnimMovie[animId]->opened()) {
 			anim.wsaFlag = 1;
 			if (x2 == -1)
@@ -1150,7 +1150,7 @@ typedef Common::Functor1Mem<EMCState *, int, KyraEngine_MR> OpcodeV3;
 #define Opcode(x) table->push_back(new OpcodeV3(this, &KyraEngine_MR::x))
 #define OpcodeUnImpl() table->push_back(new OpcodeV3(this, 0))
 void KyraEngine_MR::setupOpcodeTable() {
-	Common::Array<const Opcode *> *table = 0;
+	Common::Array<const Opcode *> *table = nullptr;
 
 	_opcodes.reserve(176);
 	SetOpcodeTable(_opcodes);
diff --git a/engines/kyra/script/script_tim.cpp b/engines/kyra/script/script_tim.cpp
index b92ae96ec1..08be89ce1d 100644
--- a/engines/kyra/script/script_tim.cpp
+++ b/engines/kyra/script/script_tim.cpp
@@ -34,7 +34,7 @@
 
 namespace Kyra {
 
-TIMInterpreter::TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSystem *system) : _vm(engine), _screen(screen_v2), _system(system), _currentTim(0) {
+TIMInterpreter::TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSystem *system) : _vm(engine), _screen(screen_v2), _system(system), _currentTim(nullptr) {
 #define COMMAND(x) { &TIMInterpreter::x, #x }
 #define COMMAND_UNIMPL() { 0, 0 }
 #define cmd_return(n) cmd_return_##n
@@ -86,7 +86,7 @@ TIMInterpreter::TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSys
 	_commands = commandProcs;
 	_commandsSize = ARRAYSIZE(commandProcs);
 
-	_langData = 0;
+	_langData = nullptr;
 	_textDisplayed = false;
 	_textAreaBuffer = new uint8[320*40];
 	assert(_textAreaBuffer);
@@ -95,11 +95,11 @@ TIMInterpreter::TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSys
 	else
 		_drawPage2 = 8;
 
-	_animator = new TimAnimator(0, screen_v2, 0, false);
+	_animator = new TimAnimator(nullptr, screen_v2, nullptr, false);
 
 	_palDelayInc = _palDiff = _palDelayAcc = 0;
 	_abortFlag = 0;
-	_tim = 0;
+	_tim = nullptr;
 }
 
 TIMInterpreter::~TIMInterpreter() {
@@ -137,7 +137,7 @@ bool TIMInterpreter::callback(Common::IFFChunk &chunk) {
 
 TIM *TIMInterpreter::load(const char *filename, const Common::Array<const TIMOpcode *> *opcodes) {
 	if (!_vm->resource()->exists(filename))
-		return 0;
+		return nullptr;
 
 	Common::SeekableReadStream *stream = _vm->resource()->createReadStream(filename);
 	if (!stream)
@@ -175,7 +175,7 @@ TIM *TIMInterpreter::load(const char *filename, const Common::Array<const TIMOpc
 	_tim->lolCharacter = 0;
 
 	TIM *r = _tim;
-	_tim = 0;
+	_tim = nullptr;
 	return r;
 }
 
@@ -186,12 +186,12 @@ void TIMInterpreter::unload(TIM *&tim) const {
 	delete[] tim->text;
 	delete[] tim->avtl;
 	delete tim;
-	tim = 0;
+	tim = nullptr;
 }
 
 void TIMInterpreter::setLangData(const char *filename) {
 	delete[] _langData;
-	_langData = _vm->resource()->fileData(filename, 0);
+	_langData = _vm->resource()->fileData(filename, nullptr);
 }
 
 int TIMInterpreter::exec(TIM *tim, bool loop) {
@@ -244,7 +244,7 @@ int TIMInterpreter::exec(TIM *tim, bool loop) {
 					break;
 
 				case 22:
-					cur.loopIp = 0;
+					cur.loopIp = nullptr;
 					break;
 
 				default:
@@ -299,7 +299,7 @@ void TIMInterpreter::displayText(uint16 textId, int16 flags) {
 
 	const bool sjisMode = (_vm->gameFlags().lang == Common::JA_JPN && _vm->gameFlags().use16ColorMode);
 	if (filename[0] && (_vm->speechEnabled() || !_vm->gameFlags().isTalkie))
-		_vm->sound()->voicePlay(filename, 0, 255, 255, !_vm->gameFlags().isTalkie);
+		_vm->sound()->voicePlay(filename, nullptr, 255, 255, !_vm->gameFlags().isTalkie);
 
 	if (text[0] == '$')
 		text = strchr(text + 1, '$') + 1;
@@ -460,7 +460,7 @@ void TIMInterpreter::setupTextPalette(uint index, int fadePalette) {
 }
 
 int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y, int, int offscreenBuffer, uint16 wsaFlags) {
-	Movie *wsa = 0;
+	Movie *wsa = nullptr;
 
 	const bool isLoLDemo = _vm->gameFlags().isDemo && !_vm->gameFlags().isTalkie && _vm->game() == GI_LOL;
 
@@ -491,7 +491,7 @@ int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y
 			wsa = new WSAMovie_v2(_vm);
 		assert(wsa);
 
-		wsa->open(file.c_str(), wsaOpenFlags, (index == 1) ? &_screen->getPalette(0) : 0);
+		wsa->open(file.c_str(), wsaOpenFlags, (index == 1) ? &_screen->getPalette(0) : nullptr);
 	}
 
 	if (wsa && wsa->opened()) {
@@ -517,7 +517,7 @@ int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y
 		}
 
 		if (wsaFlags & 2) {
-			_screen->fadePalette(_screen->getPalette(1), 15, 0);
+			_screen->fadePalette(_screen->getPalette(1), 15, nullptr);
 			_screen->clearPage(_drawPage2);
 			if (_drawPage2)
 				_screen->checkedPageUpdate(8, 4);
@@ -535,14 +535,14 @@ int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y
 				_screen->updateScreen();
 			}
 
-			wsa->displayFrame(0, 0, x, y, 0, 0, 0);
+			wsa->displayFrame(0, 0, x, y, 0, nullptr, nullptr);
 		}
 
 		if (wsaFlags & 2)
-			_screen->fadePalette(_screen->getPalette(0), 30, 0);
+			_screen->fadePalette(_screen->getPalette(0), 30, nullptr);
 	} else {
 		if (wsaFlags & 2) {
-			_screen->fadePalette(_screen->getPalette(1), 15, 0);
+			_screen->fadePalette(_screen->getPalette(1), 15, nullptr);
 			_screen->clearPage(_drawPage2);
 			if (_drawPage2)
 				_screen->checkedPageUpdate(8, 4);
@@ -560,7 +560,7 @@ int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y
 		}
 
 		if (wsaFlags & 2)
-			_screen->fadePalette(_screen->getPalette(0), 30, 0);
+			_screen->fadePalette(_screen->getPalette(0), 30, nullptr);
 	}
 
 	_animator->init(index, wsa, x, y, wsaFlags, 0);
@@ -575,14 +575,14 @@ int TIMInterpreter::freeAnimStruct(int index) {
 
 char *TIMInterpreter::getTableEntry(uint idx) {
 	if (!_langData)
-		return 0;
+		return nullptr;
 	else
 		return (char *)(_langData + READ_LE_UINT16(_langData + (idx<<1)));
 }
 
 const char *TIMInterpreter::getCTableEntry(uint idx) const {
 	if (!_langData)
-		return 0;
+		return nullptr;
 	else
 		return (const char *)(_langData + READ_LE_UINT16(_langData + (idx<<1)));
 }
@@ -593,7 +593,7 @@ int TIMInterpreter::execCommand(int cmd, const uint16 *param) {
 		return 0;
 	}
 
-	if (_commands[cmd].proc == 0) {
+	if (_commands[cmd].proc == nullptr) {
 		warning("Calling unimplemented TIM command %d from file '%s'", cmd, _currentTim->filename);
 		return 0;
 	}
@@ -613,7 +613,7 @@ int TIMInterpreter::cmd_initFunc0(const uint16 *param) {
 
 int TIMInterpreter::cmd_stopCurFunc(const uint16 *param) {
 	if (_currentFunc < TIM::kCountFuncs)
-		_currentTim->func[_currentFunc].ip = 0;
+		_currentTim->func[_currentFunc].ip = nullptr;
 	if (!_currentFunc)
 		_finished = true;
 	return -2;
@@ -621,7 +621,7 @@ int TIMInterpreter::cmd_stopCurFunc(const uint16 *param) {
 
 void TIMInterpreter::stopAllFuncs(TIM *tim) {
 	for (int i = 0; i < TIM::kCountFuncs; ++i)
-		tim->func[i].ip = 0;
+		tim->func[i].ip = nullptr;
 }
 
 int TIMInterpreter::cmd_initWSA(const uint16 *param) {
@@ -672,7 +672,7 @@ int TIMInterpreter::cmd_initFunc(const uint16 *param) {
 int TIMInterpreter::cmd_stopFunc(const uint16 *param) {
 	uint16 func = *param;
 	assert(func < TIM::kCountFuncs);
-	_currentTim->func[func].ip = 0;
+	_currentTim->func[func].ip = nullptr;
 	return 1;
 }
 
@@ -736,7 +736,7 @@ int TIMInterpreter::cmd_playVocFile(const uint16 *param) {
 	const int volume = (param[1] * 255) / 100;
 
 	if (index < ARRAYSIZE(_vocFiles) && !_vocFiles[index].empty())
-		_vm->sound()->voicePlay(_vocFiles[index].c_str(), 0, volume, 255, true);
+		_vm->sound()->voicePlay(_vocFiles[index].c_str(), nullptr, volume, 255, true);
 	else if (index == 7 && !_vm->gameFlags().isTalkie)
 		_vm->sound()->playTrack(index);
 	else
@@ -784,7 +784,7 @@ int TIMInterpreter::cmd_continueLoop(const uint16 *param) {
 }
 
 int TIMInterpreter::cmd_resetLoopIp(const uint16 *param) {
-	_currentTim->func[_currentFunc].loopIp = 0;
+	_currentTim->func[_currentFunc].loopIp = nullptr;
 	return 1;
 }
 
@@ -828,7 +828,7 @@ int TIMInterpreter::cmd_initFuncNow(const uint16 *param) {
 int TIMInterpreter::cmd_stopFuncNow(const uint16 *param) {
 	uint16 func = *param;
 	assert(func < TIM::kCountFuncs);
-	_currentTim->func[func].ip = 0;
+	_currentTim->func[func].ip = nullptr;
 	_currentTim->func[func].lastTime = _currentTim->func[func].nextTime = _system->getMillis();
 	return 1;
 }
diff --git a/engines/kyra/script/script_v2.cpp b/engines/kyra/script/script_v2.cpp
index 8177d14f6f..092c14d538 100644
--- a/engines/kyra/script/script_v2.cpp
+++ b/engines/kyra/script/script_v2.cpp
@@ -119,7 +119,7 @@ int KyraEngine_v2::o2_delay(EMCState *script) {
 	if (stackPos(1)) {
 		uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength;
 		while (_system->getMillis() < maxWaitTime) {
-			int inputFlag = checkInput(0);
+			int inputFlag = checkInput(nullptr);
 			removeInputTop();
 
 			if (inputFlag == 198 || inputFlag == 199)
@@ -159,7 +159,7 @@ int KyraEngine_v2::o2_waitForConfirmationClick(EMCState *script) {
 	uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength;
 
 	while (_system->getMillis() < maxWaitTime) {
-		int inputFlag = checkInput(0);
+		int inputFlag = checkInput(nullptr);
 		removeInputTop();
 
 		if (inputFlag == 198 || inputFlag == 199) {
diff --git a/engines/kyra/sequence/seqplayer_lok.cpp b/engines/kyra/sequence/seqplayer_lok.cpp
index c2f753c413..57c59b766c 100644
--- a/engines/kyra/sequence/seqplayer_lok.cpp
+++ b/engines/kyra/sequence/seqplayer_lok.cpp
@@ -39,12 +39,12 @@ SeqPlayer::SeqPlayer(KyraEngine_LoK *vm, OSystem *system) {
 	_res = vm->resource();
 
 	_copyViewOffs = false;
-	_specialBuffer = 0;
+	_specialBuffer = nullptr;
 
 	for (int i = 0; i < ARRAYSIZE(_handShapes); ++i)
-		_handShapes[i] = 0;
+		_handShapes[i] = nullptr;
 	for (int i = 0; i < ARRAYSIZE(_seqMovies); ++i)
-		_seqMovies[i].movie = 0;
+		_seqMovies[i].movie = nullptr;
 }
 
 SeqPlayer::~SeqPlayer() {
@@ -55,12 +55,12 @@ SeqPlayer::~SeqPlayer() {
 			continue;
 		_seqMovies[i].movie->close();
 		delete _seqMovies[i].movie;
-		_seqMovies[i].movie = 0;
+		_seqMovies[i].movie = nullptr;
 	}
 }
 
 uint8 *SeqPlayer::setPanPages(int pageNum, int shape) {
-	uint8 *panPage = 0;
+	uint8 *panPage = nullptr;
 	const uint8 *data = _screen->getCPagePtr(pageNum);
 	uint16 numShapes = READ_LE_UINT16(data);
 	if (shape < numShapes) {
@@ -108,7 +108,7 @@ void SeqPlayer::makeHandShapes() {
 void SeqPlayer::freeHandShapes() {
 	for (int i = 0; i < ARRAYSIZE(_handShapes); ++i) {
 		delete[] _handShapes[i];
-		_handShapes[i] = 0;
+		_handShapes[i] = nullptr;
 	}
 }
 
@@ -119,7 +119,7 @@ void SeqPlayer::s1_wsaOpen() {
 	_seqWsaCurDecodePage = _seqMovies[wsaObj].page = (offscreenDecode == 0) ? 0 : 3;
 	if (!_seqMovies[wsaObj].movie)
 		_seqMovies[wsaObj].movie = _vm->createWSAMovie();
-	_seqMovies[wsaObj].movie->open(_vm->seqWSATable()[wsaObj], offscreenDecode, 0);
+	_seqMovies[wsaObj].movie->open(_vm->seqWSATable()[wsaObj], offscreenDecode, nullptr);
 	_seqMovies[wsaObj].frame = 0;
 	_seqMovies[wsaObj].numFrames = _seqMovies[wsaObj].movie->frames() - 1;
 }
@@ -138,7 +138,7 @@ void SeqPlayer::s1_wsaPlayFrame() {
 	_seqMovies[wsaObj].pos.x = READ_LE_UINT16(_seqData); _seqData += 2;
 	_seqMovies[wsaObj].pos.y = *_seqData++;
 	assert(_seqMovies[wsaObj].movie);
-	_seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, 0, 0);
+	_seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, nullptr, nullptr);
 	_seqMovies[wsaObj].frame = frame;
 }
 
@@ -150,7 +150,7 @@ void SeqPlayer::s1_wsaPlayNextFrame() {
 		frame = 0;
 		_seqMovies[wsaObj].frame = 0;
 	}
-	_seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, 0, 0);
+	_seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, nullptr, nullptr);
 }
 
 void SeqPlayer::s1_wsaPlayPrevFrame() {
@@ -161,7 +161,7 @@ void SeqPlayer::s1_wsaPlayPrevFrame() {
 		frame = _seqMovies[wsaObj].numFrames;
 		_seqMovies[wsaObj].frame = frame;
 	} else {
-		_seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, 0, 0);
+		_seqMovies[wsaObj].movie->displayFrame(frame, _seqMovies[wsaObj].page, _seqMovies[wsaObj].pos.x, _seqMovies[wsaObj].pos.y, 0, nullptr, nullptr);
 	}
 }
 
@@ -214,7 +214,7 @@ void SeqPlayer::s1_loopInc() {
 		_seqData = _seqLoopTable[seqLoop].ptr;
 	} else if (_seqLoopTable[seqLoop].count == 0) {
 		_seqLoopTable[seqLoop].count = 0xFFFF;
-		_seqLoopTable[seqLoop].ptr = 0;
+		_seqLoopTable[seqLoop].ptr = nullptr;
 	} else {
 		--_seqLoopTable[seqLoop].count;
 		_seqData = _seqLoopTable[seqLoop].ptr;
@@ -338,7 +338,7 @@ void SeqPlayer::s1_copyRegion() {
 
 void SeqPlayer::s1_copyRegionSpecial() {
 	static const uint8 colorMap[] = { 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0 };
-	const char *copyStr = 0;
+	const char *copyStr = nullptr;
 	if (!_vm->gameFlags().isTalkie)
 		copyStr = "Copyright (c) 1992 Westwood Studios";
 	else
@@ -595,7 +595,7 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
 	_seqWsaCurDecodePage = 0;
 
 	for (int i = 0; i < 20; ++i) {
-		_seqLoopTable[i].ptr = 0;
+		_seqLoopTable[i].ptr = nullptr;
 		_seqLoopTable[i].count = 0xFFFF;
 	}
 
@@ -669,11 +669,11 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
 		_screen->updateScreen();
 	}
 	delete[] _specialBuffer;
-	_specialBuffer = 0;
+	_specialBuffer = nullptr;
 
 	for (uint i = 0; i < ARRAYSIZE(_seqMovies); ++i) {
 		delete _seqMovies[i].movie;
-		_seqMovies[i].movie = 0;
+		_seqMovies[i].movie = nullptr;
 	}
 	return seqSkippedFlag;
 }
diff --git a/engines/kyra/sequence/sequences_hof.cpp b/engines/kyra/sequence/sequences_hof.cpp
index 5ba27c31ad..3bf4ea3ed2 100644
--- a/engines/kyra/sequence/sequences_hof.cpp
+++ b/engines/kyra/sequence/sequences_hof.cpp
@@ -224,7 +224,7 @@ private:
 
 	// HOF credits
 	void playHoFTalkieCredits();
-	void displayHoFTalkieScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData = 0, const char *const *specialData = 0);
+	void displayHoFTalkieScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData = nullptr, const char *const *specialData = nullptr);
 
 	bool _talkieFinaleExtraFlag;
 
@@ -336,27 +336,27 @@ private:
 #endif // ENABLE_LOL
 };
 
-SeqPlayer_HOF *SeqPlayer_HOF::_instance = 0;
+SeqPlayer_HOF *SeqPlayer_HOF::_instance = nullptr;
 
 SeqPlayer_HOF::SeqPlayer_HOF(KyraEngine_v1 *vm, Screen_v2 *screen, OSystem *system, bool startupSaveLoadable) : _vm(vm), _screen(screen), _system(system), _startupSaveLoadable(startupSaveLoadable), _tickLength(1000000/60) {
 	// We use a static pointer for pauseEngine functionality. Since we don't
 	// ever need more than one SeqPlayer_HOF object at the same time we keep
 	// this simple and just add an assert to detect typos, regressions, etc.
-	assert(_instance == 0);
+	assert(_instance == nullptr);
 
 	memset(_animSlots, 0, sizeof(_animSlots));
 	memset(_textSlots, 0, sizeof(_textSlots));
 	memset(_hofDemoActiveItemAnim, 0, sizeof(_hofDemoActiveItemAnim));
 
-	_screenHoF = _vm->game() == GI_KYRA2 ? (Screen_HoF*)screen : 0;
-	_config = 0;
+	_screenHoF = _vm->game() == GI_KYRA2 ? (Screen_HoF*)screen : nullptr;
+	_config = nullptr;
 	_result = 0;
-	_sequenceSoundList = 0;
-	_hofDemoAnimData = 0;
-	_hofDemoShapeData = 0;
+	_sequenceSoundList = nullptr;
+	_hofDemoAnimData = nullptr;
+	_hofDemoShapeData = nullptr;
 	_isFinale = false;
 	_preventLooping = false;
-	_menu = 0;
+	_menu = nullptr;
 	_abortRequested = false;
 	_pauseStart = 0;
 
@@ -399,7 +399,7 @@ SeqPlayer_HOF::SeqPlayer_HOF(KyraEngine_v1 *vm, Screen_v2 *screen, OSystem *syst
 				delete[] _sequenceSoundList[i];
 		}
 		delete[] _sequenceSoundList;
-		_sequenceSoundList = 0;
+		_sequenceSoundList = nullptr;
 	}
 
 	const char *const *seqSoundList = _vm->staticres()->loadStrings(k2SeqplaySfxFiles, _sequenceSoundListSize);
@@ -425,7 +425,7 @@ SeqPlayer_HOF::SeqPlayer_HOF(KyraEngine_v1 *vm, Screen_v2 *screen, OSystem *syst
 			strcpy(tmpSndLst[i], seqSoundList[i]);
 	}
 
-	tlkfiles = seqSoundList = 0;
+	tlkfiles = seqSoundList = nullptr;
 	_vm->staticres()->unloadId(k2SeqplayTlkFiles);
 	_vm->staticres()->unloadId(k2SeqplaySfxFiles);
 	_sequenceSoundList = tmpSndLst;
@@ -439,7 +439,7 @@ SeqPlayer_HOF::SeqPlayer_HOF(KyraEngine_v1 *vm, Screen_v2 *screen, OSystem *syst
 	if (_vm->gameFlags().isDemo && !_vm->gameFlags().isTalkie) {
 		if (_vm->game() == GI_KYRA2) {
 			_hofDemoAnimData = _vm->staticres()->loadHoFSeqItemAnimData(k2SeqplayShapeAnimData, tempSize);
-			uint8 *shp = _vm->resource()->fileData("ICONS.SHP", 0);
+			uint8 *shp = _vm->resource()->fileData("ICONS.SHP", nullptr);
 			uint32 outsize = READ_LE_UINT16(shp + 4);
 			_hofDemoShapeData = new uint8[outsize];
 			Screen::decodeFrame4(shp + 10, _hofDemoShapeData, outsize);
@@ -449,7 +449,7 @@ SeqPlayer_HOF::SeqPlayer_HOF(KyraEngine_v1 *vm, Screen_v2 *screen, OSystem *syst
 		}
 	} else {
 		const MainMenu::StaticData data = {
-			{ _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98], 0 },
+			{ _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98], nullptr },
 			{ 0x01, 0x04, 0x0C, 0x04, 0x00, 0xD7, 0xD6 },
 			{ 0xD8, 0xDA, 0xD9, 0xD8 },
 			(_vm->gameFlags().lang == Common::JA_JPN) ? Screen::FID_SJIS_FNT : Screen::FID_8_FNT, 240
@@ -463,7 +463,7 @@ SeqPlayer_HOF::SeqPlayer_HOF(KyraEngine_v1 *vm, Screen_v2 *screen, OSystem *syst
 }
 
 SeqPlayer_HOF::~SeqPlayer_HOF() {
-	_instance = 0;
+	_instance = nullptr;
 
 	if (_sequenceSoundList) {
 		for (int i = 0; i < _sequenceSoundListSize; i++) {
@@ -471,7 +471,7 @@ SeqPlayer_HOF::~SeqPlayer_HOF() {
 				delete[] _sequenceSoundList[i];
 		}
 		delete[] _sequenceSoundList;
-		_sequenceSoundList = NULL;
+		_sequenceSoundList = nullptr;
 	}
 
 	delete[] _tempString;
@@ -562,21 +562,21 @@ void SeqPlayer_HOF::pause(bool toggle) {
 
 void SeqPlayer_HOF::setupCallbacks() {
 #define SCB(x) &SeqPlayer_HOF::cbHOF_##x
-	static const SeqProc seqCallbacksHoF[] = { 0, SCB(westwood), SCB(title), SCB(overview), SCB(library), SCB(hand), SCB(point), SCB(zanfaun), SCB(funters), SCB(ferb), SCB(fish), SCB(fheep), SCB(farmer), SCB(fuards), SCB(firates), SCB(frash) };
-	static const SeqProc nestedSeqCallbacksHoF[] = { SCB(figgle), SCB(over1), SCB(over2), SCB(forest), SCB(dragon), SCB(darm), SCB(library2), SCB(library2), SCB(marco), SCB(hand1a), SCB(hand1b), SCB(hand1c), SCB(hand2), SCB(hand3), 0 };
+	static const SeqProc seqCallbacksHoF[] = { nullptr, SCB(westwood), SCB(title), SCB(overview), SCB(library), SCB(hand), SCB(point), SCB(zanfaun), SCB(funters), SCB(ferb), SCB(fish), SCB(fheep), SCB(farmer), SCB(fuards), SCB(firates), SCB(frash) };
+	static const SeqProc nestedSeqCallbacksHoF[] = { SCB(figgle), SCB(over1), SCB(over2), SCB(forest), SCB(dragon), SCB(darm), SCB(library2), SCB(library2), SCB(marco), SCB(hand1a), SCB(hand1b), SCB(hand1c), SCB(hand2), SCB(hand3), nullptr };
 #undef SCB
 #define SCB(x) &SeqPlayer_HOF::cbHOFDEMO_##x
 	static const SeqProc seqCallbacksHoFDemo[] = {	SCB(virgin), SCB(westwood), SCB(title), SCB(hill), SCB(outhome), SCB(wharf), SCB(dinob), SCB(fisher) };
-	static const SeqProc nestedSeqCallbacksHoFDemo[] = { SCB(wharf2), SCB(dinob2), SCB(water), SCB(bail), SCB(dig), 0 };
+	static const SeqProc nestedSeqCallbacksHoFDemo[] = { SCB(wharf2), SCB(dinob2), SCB(water), SCB(bail), SCB(dig), nullptr };
 #undef SCB
 #ifdef ENABLE_LOL
 #define SCB(x) &SeqPlayer_HOF::cbLOLDEMO_##x
 	static const SeqProc seqCallbacksLoLDemo[] = { SCB(scene1), 0, SCB(scene2), 0, SCB(scene3), 0, SCB(scene4), 0, SCB(scene5), SCB(text5), SCB(scene6), 0 };
 #undef SCB
 #else
-	static const SeqProc seqCallbacksLoLDemo[] = { 0 };
+	static const SeqProc seqCallbacksLoLDemo[] = { nullptr };
 #endif
-	static const SeqProc nestedSeqCallbacksLoLDemo[] = { 0 };
+	static const SeqProc nestedSeqCallbacksLoLDemo[] = { nullptr };
 
 	static const SeqProc *const seqCallbacks[] = { seqCallbacksHoF, seqCallbacksHoFDemo, seqCallbacksLoLDemo};
 	static const SeqProc *const nestedSeqCallbacks[] = { nestedSeqCallbacksHoF, nestedSeqCallbacksHoFDemo, nestedSeqCallbacksLoLDemo};
@@ -664,12 +664,12 @@ void SeqPlayer_HOF::playScenes() {
 		}
 
 		if (_config->seqProc[_curScene] && !(_vm->gameFlags().isDemo && !_vm->gameFlags().isTalkie))
-			(this->*_config->seqProc[_curScene])(0, 0, 0, -1);
+			(this->*_config->seqProc[_curScene])(nullptr, 0, 0, -1);
 
 		if (sq.flags & 1) {
 			anim.open(sq.wsaFile, 0, &_screen->getPalette(0));
 			if (!(sq.flags & 2))
-				anim.displayFrame(0, 2, sq.xPos, sq.yPos, 0x4000, 0, 0);
+				anim.displayFrame(0, 2, sq.xPos, sq.yPos, 0x4000, nullptr, nullptr);
 		}
 
 		if (sq.flags & 4) {
@@ -710,7 +710,7 @@ void SeqPlayer_HOF::playScenes() {
 				updateAllNestedAnimations();
 
 				if (_config->seqProc[_curScene])
-					(this->*_config->seqProc[_curScene])(0, 0, 0, 0);
+					(this->*_config->seqProc[_curScene])(nullptr, 0, 0, 0);
 
 				updateSubTitles();
 
@@ -727,7 +727,7 @@ void SeqPlayer_HOF::playScenes() {
 		}
 
 		if (_config->seqProc[_curScene] && !(_vm->gameFlags().isDemo && !_vm->gameFlags().isTalkie))
-			(this->*_config->seqProc[_curScene])(0, 0, 0, -2);
+			(this->*_config->seqProc[_curScene])(nullptr, 0, 0, -2);
 
 		uint32 textTimeOut = ticksTillSubTitlesTimeout();
 		setCountDown(MAX<uint32>(textTimeOut, sq.timeout));
@@ -927,7 +927,7 @@ void SeqPlayer_HOF::nestedFrameFadeTransition(const char *cmpFile) {
 	_screen->copyPage(10, 2);
 	_screen->copyPage(4, 10);
 	_screen->clearPage(6);
-	_screen->loadBitmap(cmpFile, 6, 6, 0);
+	_screen->loadBitmap(cmpFile, 6, 6, nullptr);
 	_screen->copyPage(12, 4);
 
 	for (int i = 0; i < 3; i++) {
@@ -994,7 +994,7 @@ void SeqPlayer_HOF::playAnimation(WSAMovie_v2 *wsaObj, int startFrame, int lastF
 			(this->*callback)(wsaObj, x, y, wsaObj ? _animCurrentFrame % wsaObj->frames() : _animCurrentFrame);
 
 		if (wsaObj)
-			wsaObj->displayFrame(_animCurrentFrame % wsaObj->frames(), 2, x, y, 0, 0, 0);
+			wsaObj->displayFrame(_animCurrentFrame % wsaObj->frames(), 2, x, y, 0, nullptr, nullptr);
 
 		_screen->copyPage(2, 12);
 
@@ -1071,7 +1071,7 @@ void SeqPlayer_HOF::playDialogueAnimation(uint16 strID, uint16 soundID, int text
 		setCountDown(_animDuration);
 
 		if (wsaObj)
-			wsaObj->displayFrame(curframe % wsaObj->frames(), 2, animPosX, animPosY, 0, 0, 0);
+			wsaObj->displayFrame(curframe % wsaObj->frames(), 2, animPosX, animPosY, 0, nullptr, nullptr);
 
 		_screen->copyPage(2, 12);
 		updateSubTitles();
@@ -1121,11 +1121,11 @@ void SeqPlayer_HOF::startNestedAnimation(int animSlot, int sequenceID) {
 
 	_animSlots[animSlot].movie->close();
 
-	_animSlots[animSlot].movie->open(s.wsaFile, 0, 0);
+	_animSlots[animSlot].movie->open(s.wsaFile, 0, nullptr);
 
 	if (!_animSlots[animSlot].movie->opened()) {
 		delete _animSlots[animSlot].movie;
-		_animSlots[animSlot].movie = 0;
+		_animSlots[animSlot].movie = nullptr;
 		return;
 	}
 
@@ -1163,7 +1163,7 @@ void SeqPlayer_HOF::unloadNestedAnimation(int animSlot) {
 	if (_animSlots[animSlot].movie) {
 		_animSlots[animSlot].movie->close();
 		delete _animSlots[animSlot].movie;
-		_animSlots[animSlot].movie = 0;
+		_animSlots[animSlot].movie = nullptr;
 	}
 }
 
@@ -1177,7 +1177,7 @@ void SeqPlayer_HOF::doNestedFrameTransition(int transitionType, int animSlot) {
 	case 0:
 		xa = -_animSlots[animSlot].movie->xAdd();
 		ya = -_animSlots[animSlot].movie->yAdd();
-		_animSlots[animSlot].movie->displayFrame(0, 8, xa, ya, 0, 0, 0);
+		_animSlots[animSlot].movie->displayFrame(0, 8, xa, ya, 0, nullptr, nullptr);
 		nestedFrameAnimTransition(8, 2, 7, 8, _animSlots[animSlot].movie->xAdd(), _animSlots[animSlot].movie->yAdd(),
 							_animSlots[animSlot].movie->width(), _animSlots[animSlot].movie->height(), 1, 2);
 		break;
@@ -1185,7 +1185,7 @@ void SeqPlayer_HOF::doNestedFrameTransition(int transitionType, int animSlot) {
 	case 1:
 		xa = -_animSlots[animSlot].movie->xAdd();
 		ya = -_animSlots[animSlot].movie->yAdd();
-		_animSlots[animSlot].movie->displayFrame(0, 8, xa, ya, 0, 0, 0);
+		_animSlots[animSlot].movie->displayFrame(0, 8, xa, ya, 0, nullptr, nullptr);
 		nestedFrameAnimTransition(8, 2, 7, 8, _animSlots[animSlot].movie->xAdd(), _animSlots[animSlot].movie->yAdd(),
 							_animSlots[animSlot].movie->width(), _animSlots[animSlot].movie->height(), 1, 1);
 		break;
@@ -1194,21 +1194,21 @@ void SeqPlayer_HOF::doNestedFrameTransition(int transitionType, int animSlot) {
 		waitForSubTitlesTimeout();
 		xa = -_animSlots[animSlot].movie->xAdd();
 		ya = -_animSlots[animSlot].movie->yAdd();
-		_animSlots[animSlot].movie->displayFrame(21, 8, xa, ya, 0, 0, 0);
+		_animSlots[animSlot].movie->displayFrame(21, 8, xa, ya, 0, nullptr, nullptr);
 		nestedFrameAnimTransition(8, 2, 7, 8, _animSlots[animSlot].movie->xAdd(), _animSlots[animSlot].movie->yAdd(),
 							_animSlots[animSlot].movie->width(), _animSlots[animSlot].movie->height(), 0, 2);
 		break;
 
 	case 3:
 		_screen->copyPage(2, 10);
-		_animSlots[animSlot].movie->displayFrame(0, 2, 0, 0, 0, 0, 0);
+		_animSlots[animSlot].movie->displayFrame(0, 2, 0, 0, 0, nullptr, nullptr);
 		_screen->copyPage(2, 12);
 		nestedFrameFadeTransition("scene2.cmp");
 		break;
 
 	case 4:
 		_screen->copyPage(2, 10);
-		_animSlots[animSlot].movie->displayFrame(0, 2, 0, 0, 0, 0, 0);
+		_animSlots[animSlot].movie->displayFrame(0, 2, 0, 0, 0, nullptr, nullptr);
 		_screen->copyPage(2, 12);
 		nestedFrameFadeTransition("scene3.cmp");
 		break;
@@ -1238,10 +1238,10 @@ bool SeqPlayer_HOF::updateNestedAnimation(int animSlot) {
 
 	if (_animSlots[animSlot].movie) {
 		if (_animSlots[animSlot].flags & 0x20) {
-			_animSlots[animSlot].movie->displayFrame(_animSlots[animSlot].control[currentFrame].index, 2, _animSlots[animSlot].x, _animSlots[animSlot].y, 0x4000, 0, 0);
+			_animSlots[animSlot].movie->displayFrame(_animSlots[animSlot].control[currentFrame].index, 2, _animSlots[animSlot].x, _animSlots[animSlot].y, 0x4000, nullptr, nullptr);
 			_animSlots[animSlot].frameDelay = _animSlots[animSlot].control[currentFrame].delay;
 		} else {
-			_animSlots[animSlot].movie->displayFrame(currentFrame % _animSlots[animSlot].movie->frames(), 2, _animSlots[animSlot].x, _animSlots[animSlot].y, 0x4000, 0, 0);
+			_animSlots[animSlot].movie->displayFrame(currentFrame % _animSlots[animSlot].movie->frames(), 2, _animSlots[animSlot].x, _animSlots[animSlot].y, 0x4000, nullptr, nullptr);
 		}
 	}
 
@@ -1291,7 +1291,7 @@ bool SeqPlayer_HOF::updateNestedAnimation(int animSlot) {
 
 void SeqPlayer_HOF::playSoundEffect(uint16 id, int16 vol) {
 	assert(id < _sequenceSoundListSize);
-	_vm->sound()->voicePlay(_sequenceSoundList[id], 0, vol);
+	_vm->sound()->voicePlay(_sequenceSoundList[id], nullptr, vol);
 }
 
 void SeqPlayer_HOF::playSoundAndDisplaySubTitle(uint16 id) {
@@ -1300,7 +1300,7 @@ void SeqPlayer_HOF::playSoundAndDisplaySubTitle(uint16 id) {
 	if (id < 12 && !(_vm->gameFlags().isDemo && !_vm->gameFlags().isTalkie) && _vm->textEnabled())
 		displaySubTitle(id, 160, 168, _textDuration[id], 160);
 
-	_vm->sound()->voicePlay(_sequenceSoundList[id], 0);
+	_vm->sound()->voicePlay(_sequenceSoundList[id], nullptr);
 }
 
 void SeqPlayer_HOF::printFadingText(uint16 strID, int x, int y, const uint8 *colorMap, uint8 textcolor) {
@@ -1437,7 +1437,7 @@ char *SeqPlayer_HOF::preprocessString(const char *srcStr, int width) {
 	}
 	dstStr[lineStart + linePos] = 0;
 
-	return strlen(_tempString) ? dstStr : 0;
+	return strlen(_tempString) ? dstStr : nullptr;
 }
 
 void SeqPlayer_HOF::waitForSubTitlesTimeout() {
@@ -1505,7 +1505,7 @@ void SeqPlayer_HOF::playHoFTalkieCredits() {
 	memcpy(dataPtr, talkieCredits, talkieCreditsSize);
 	_vm->staticres()->unloadId(k2SeqplayCredits);
 
-	displayHoFTalkieScrollText(dataPtr, &d, 2, 6, 5, 1, Screen::FID_GOLDFONT_FNT, Screen::FID_GOLDFONT_FNT, 0, talkieCreditsSpecial);
+	displayHoFTalkieScrollText(dataPtr, &d, 2, 6, 5, 1, Screen::FID_GOLDFONT_FNT, Screen::FID_GOLDFONT_FNT, nullptr, talkieCreditsSpecial);
 	delayTicks(8);
 
 	delete[] dataPtr;
@@ -1536,7 +1536,7 @@ void SeqPlayer_HOF::displayHoFTalkieScrollText(uint8 *data, const ScreenDim *d,
 		ScrollTextData() {
 			x = 0;      // 0  11
 			y = 0;		// 2  13
-			text = 0;	// 4  15
+			text = nullptr;	// 4  15
 			unk1 = 0;   // 8  19
 			height = 0; // 9  20
 			adjust = 0; // 10 21
@@ -3090,8 +3090,8 @@ int SeqPlayer_HOF::cbHOFDEMO_fisher(WSAMovie_v2 *wsaObj, int x, int y, int frm)
 			return 0;
 
 		if (!_callbackCurrentFrame) {
-			_screen->loadBitmap("adtext.cps", 4, 4, 0);
-			_screen->loadBitmap("adtext2.cps", 6, 6, 0);
+			_screen->loadBitmap("adtext.cps", 4, 4, nullptr);
+			_screen->loadBitmap("adtext2.cps", 6, 6, nullptr);
 			_screen->copyPageMemory(6, 0, 4, 64000, 1024);
 			_screen->copyPageMemory(6, 1023, 6, 0, 64000);
 			_scrollProgressCounter = 0;
@@ -3374,14 +3374,14 @@ void KyraEngine_HoF::seq_showStarcraftLogo() {
 		return;
 	}
 	_screen->hideMouse();
-	ci->displayFrame(0, 2, 0, 0, 0, 0, 0);
+	ci->displayFrame(0, 2, 0, 0, 0, nullptr, nullptr);
 	_screen->copyPage(2, 0);
 	_screen->fadeFromBlack();
 	for (int i = 1; i < endframe; i++) {
 		uint32 end = _system->getMillis() + 50;
 		if (skipFlag())
 			break;
-		ci->displayFrame(i, 2, 0, 0, 0, 0, 0);
+		ci->displayFrame(i, 2, 0, 0, 0, nullptr, nullptr);
 		_screen->copyPage(2, 0);
 		_screen->updateScreen();
 		uint32 cur = _system->getMillis();
@@ -3392,7 +3392,7 @@ void KyraEngine_HoF::seq_showStarcraftLogo() {
 	}
 	if (!skipFlag()) {
 		uint32 end = _system->getMillis() + 50;
-		ci->displayFrame(0, 2, 0, 0, 0, 0, 0);
+		ci->displayFrame(0, 2, 0, 0, 0, nullptr, nullptr);
 		_screen->copyPage(2, 0);
 		_screen->updateScreen();
 		uint32 cur = _system->getMillis();
@@ -3447,7 +3447,7 @@ void LoLEngine::pauseDemoPlayer(bool toggle) {
 
 void KyraEngine_HoF::seq_makeBookOrCauldronAppear(int type) {
 	_screen->hideMouse();
-	showMessage(0, 0xCF);
+	showMessage(nullptr, 0xCF);
 
 	if (type == 1)
 		seq_makeBookAppear();
@@ -3455,7 +3455,7 @@ void KyraEngine_HoF::seq_makeBookOrCauldronAppear(int type) {
 		loadInvWsa("CAULDRON.WSA", 1, 6, 0, -2, -2, 1);
 
 	_screen->copyRegionToBuffer(2, 0, 0, 320, 200, _screenBuffer);
-	_screen->loadBitmap("_PLAYALL.CPS", 3, 3, 0);
+	_screen->loadBitmap("_PLAYALL.CPS", 3, 3, nullptr);
 
 	static const uint8 bookCauldronRects[] = {
 		0x46, 0x90, 0x7F, 0x2B,	// unknown rect (maybe unused?)
@@ -3484,7 +3484,7 @@ void KyraEngine_HoF::seq_makeBookAppear() {
 
 	displayInvWsaLastFrame();
 
-	showMessage(0, 0xCF);
+	showMessage(nullptr, 0xCF);
 
 	loadInvWsa("BOOK2.WSA", 0, 4, 2, -1, -1, 0);
 
@@ -3501,7 +3501,7 @@ void KyraEngine_HoF::seq_makeBookAppear() {
 
 		_screen->copyBlockToPage(_invWsa.page, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, rect);
 
-		_invWsa.wsa->displayFrame(_invWsa.curFrame, _invWsa.page, 0, 0, 0x4000, 0, 0);
+		_invWsa.wsa->displayFrame(_invWsa.curFrame, _invWsa.page, 0, 0, 0x4000, nullptr, nullptr);
 
 		if (_invWsa.page)
 			_screen->copyRegion(_invWsa.x, _invWsa.y, _invWsa.x, _invWsa.y, _invWsa.w, _invWsa.h, _invWsa.page, 0, Screen::CR_NO_P_CHECK);
diff --git a/engines/kyra/sequence/sequences_lok.cpp b/engines/kyra/sequence/sequences_lok.cpp
index d8ad498846..f193aef349 100644
--- a/engines/kyra/sequence/sequences_lok.cpp
+++ b/engines/kyra/sequence/sequences_lok.cpp
@@ -46,7 +46,7 @@ void KyraEngine_LoK::seq_demo() {
 	_screen->fadeToBlack();
 
 	_screen->clearPage(0);
-	_screen->loadBitmap("TOP.CPS", 7, 7, 0);
+	_screen->loadBitmap("TOP.CPS", 7, 7, nullptr);
 	_screen->loadBitmap("BOTTOM.CPS", 5, 5, &_screen->getPalette(0));
 	_screen->copyRegion(0, 91, 0, 8, 320, 103, 6, 0);
 	_screen->copyRegion(0, 0, 0, 111, 320, 64, 6, 0);
@@ -141,7 +141,7 @@ bool KyraEngine_LoK::seq_introPublisherLogos() {
 		}
 	} else if (_flags.platform == Common::kPlatformMacintosh && _res->exists("MP_GOLD.CPS")) {
 		_screen->loadPalette("MP_GOLD.COL", _screen->getPalette(0));
-		_screen->loadBitmap("MP_GOLD.CPS", 3, 3, 0);
+		_screen->loadBitmap("MP_GOLD.CPS", 3, 3, nullptr);
 		_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
 		_screen->updateScreen();
 		_screen->fadeFromBlack();
@@ -158,13 +158,13 @@ bool KyraEngine_LoK::seq_introLogos() {
 
 	if (_flags.platform == Common::kPlatformAmiga) {
 		_screen->loadPaletteTable("INTRO.PAL", 0);
-		_screen->loadBitmap("BOTTOM.CPS", 3, 5, 0);
-		_screen->loadBitmap("TOP.CPS", 3, 3, 0);
+		_screen->loadBitmap("BOTTOM.CPS", 3, 5, nullptr);
+		_screen->loadBitmap("TOP.CPS", 3, 3, nullptr);
 		_screen->copyRegion(0, 0, 0, 111, 320, 64, 2, 0);
 		_screen->copyRegion(0, 91, 0, 8, 320, 109, 2, 0);
 		_screen->copyRegion(0, 0, 0, 0, 320, 190, 0, 2);
 	} else {
-		_screen->loadBitmap("TOP.CPS", 7, 7, 0);
+		_screen->loadBitmap("TOP.CPS", 7, 7, nullptr);
 		_screen->loadBitmap("BOTTOM.CPS", 5, 5, &_screen->getPalette(0));
 		_screen->copyRegion(0, 91, 0, 8, 320, 103, 6, 0);
 		_screen->copyRegion(0, 0, 0, 111, 320, 64, 6, 0);
@@ -358,7 +358,7 @@ void KyraEngine_LoK::seq_createAmuletJewel(int jewel, int page, int noSound, int
 			delayWithTicks(3);
 		}
 
-		const uint16 *opcodes = 0;
+		const uint16 *opcodes = nullptr;
 		switch (jewel - 1) {
 		case 0:
 			opcodes = specialJewelTable1;
@@ -1049,16 +1049,16 @@ int KyraEngine_LoK::seq_playEnd() {
 
 		_finalA = createWSAMovie();
 		assert(_finalA);
-		_finalA->open("finala.wsa", 1, 0);
+		_finalA->open("finala.wsa", 1, nullptr);
 
 		_finalB = createWSAMovie();
 		assert(_finalB);
-		_finalB->open("finalb.wsa", 1, 0);
+		_finalB->open("finalb.wsa", 1, nullptr);
 
 		_finalC = createWSAMovie();
 		assert(_finalC);
 		_endSequenceNeedLoading = 0;
-		_finalC->open("finalc.wsa", 1, 0);
+		_finalC->open("finalc.wsa", 1, nullptr);
 
 		_screen->_curPage = 0;
 		_beadStateVar = 0;
@@ -1110,7 +1110,7 @@ int KyraEngine_LoK::seq_playEnd() {
 
 			_finalA = createWSAMovie();
 			assert(_finalA);
-			_finalA->open("finald.wsa", 1, 0);
+			_finalA->open("finald.wsa", 1, nullptr);
 
 			delayUntil(nextTime);
 			snd_playSoundEffect(0x40);
@@ -1121,13 +1121,13 @@ int KyraEngine_LoK::seq_playEnd() {
 				else if (i == 20)
 					snd_playSoundEffect(_flags.platform == Common::kPlatformPC98 ? 0x13 : 0x0E);
 				nextTime = _system->getMillis() + 8 * _tickLength;
-				_finalA->displayFrame(i, 0, 8, 8, 0, 0, 0);
+				_finalA->displayFrame(i, 0, 8, 8, 0, nullptr, nullptr);
 				_screen->updateScreen();
 			}
 
 			nextTime = _system->getMillis() + 300 * _tickLength;
 			delete _finalA;
-			_finalA = 0;
+			_finalA = nullptr;
 			delayUntil(nextTime);
 
 			seq_playEnding();
@@ -1250,7 +1250,7 @@ void KyraEngine_LoK::seq_playCredits() {
 	if (_flags.platform == Common::kPlatformFMTowns && _configMusic == 1)
 		snd_playWanderScoreViaMap(53, 1);
 
-	uint8 *buffer = 0;
+	uint8 *buffer = nullptr;
 	uint32 size = 0;
 
 	if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
@@ -1360,7 +1360,7 @@ void KyraEngine_LoK::seq_playCredits() {
 			_screen->updateScreen();
 		}
 
-		if (checkInput(0, false)) {
+		if (checkInput(nullptr, false)) {
 			removeInputTop();
 			finished = true;
 		}
@@ -1482,7 +1482,7 @@ void KyraEngine_LoK::seq_playCreditsAmiga() {
 			*specialString = 0;
 		}
 
-		if (checkInput(0, false)) {
+		if (checkInput(nullptr, false)) {
 			removeInputTop();
 			break;
 		}
@@ -1503,7 +1503,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
 
 	case 2:
 		if (_system->getMillis() >= _malcolmTimer2) {
-			_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, 0, 0);
+			_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, nullptr, nullptr);
 			_screen->updateScreen();
 			_malcolmTimer2 = _system->getMillis() + 8 * _tickLength;
 			++_malcolmFrame;
@@ -1518,7 +1518,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
 		if (_system->getMillis() < _malcolmTimer1) {
 			if (_system->getMillis() >= _malcolmTimer2) {
 				_malcolmFrame = _rnd.getRandomNumberRng(14, 17);
-				_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, 0, 0);
+				_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, nullptr, nullptr);
 				_screen->updateScreen();
 				_malcolmTimer2 = _system->getMillis() + 8 * _tickLength;
 			}
@@ -1530,7 +1530,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
 
 	case 4:
 		if (_system->getMillis() >= _malcolmTimer2) {
-			_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, 0, 0);
+			_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, nullptr, nullptr);
 			_screen->updateScreen();
 			_malcolmTimer2 = _system->getMillis() + 8 * _tickLength;
 			++_malcolmFrame;
@@ -1544,7 +1544,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
 
 	case 5:
 		if (_system->getMillis() >= _malcolmTimer2) {
-			_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, 0, 0);
+			_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, nullptr, nullptr);
 			_screen->updateScreen();
 			_malcolmTimer2 = _system->getMillis() + 8 * _tickLength;
 			++_malcolmFrame;
@@ -1558,7 +1558,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
 	case 6:
 		if (_unkEndSeqVar4) {
 			if (_malcolmFrame <= 33 && _system->getMillis() >= _malcolmTimer2) {
-				_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, 0, 0);
+				_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, nullptr, nullptr);
 				_screen->updateScreen();
 				_malcolmTimer2 = _system->getMillis() + 8 * _tickLength;
 				++_malcolmFrame;
@@ -1583,7 +1583,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
 
 	case 8:
 		if (_system->getMillis() >= _malcolmTimer2) {
-			_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, 0, 0);
+			_finalA->displayFrame(_malcolmFrame, 0, 8, 46, 0, nullptr, nullptr);
 			_screen->updateScreen();
 			_malcolmTimer2 = _system->getMillis() + 8 * _tickLength;
 			++_malcolmFrame;
@@ -1600,7 +1600,7 @@ int KyraEngine_LoK::handleMalcolmFlag() {
 		snd_playSoundEffect(12);
 		for (int i = 0; i < 18; ++i) {
 			_malcolmTimer2 = _system->getMillis() + 4 * _tickLength;
-			_finalC->displayFrame(i, 0, 16, 50, 0, 0, 0);
+			_finalC->displayFrame(i, 0, 16, 50, 0, nullptr, nullptr);
 			_screen->updateScreen();
 			delayUntil(_malcolmTimer2);
 		}
@@ -1801,14 +1801,14 @@ int KyraEngine_LoK::handleBeadState() {
 					uint32 nextRun = 0;
 					for (int i = 0; i < 8; ++i) {
 						nextRun = _system->getMillis() + _tickLength;
-						_finalB->displayFrame(i, 0, 224, 8, 0, 0, 0);
+						_finalB->displayFrame(i, 0, 224, 8, 0, nullptr, nullptr);
 						_screen->updateScreen();
 						delayUntil(nextRun);
 					}
 					snd_playSoundEffect(0x0D);
 					for (int i = 7; i >= 0; --i) {
 						nextRun = _system->getMillis() + _tickLength;
-						_finalB->displayFrame(i, 0, 224, 8, 0, 0, 0);
+						_finalB->displayFrame(i, 0, 224, 8, 0, nullptr, nullptr);
 						_screen->updateScreen();
 						delayUntil(nextRun);
 					}
@@ -1919,7 +1919,7 @@ int KyraEngine_LoK::processBead(int x, int y, int &x2, int &y2, BeadState *ptr)
 
 void KyraEngine_LoK::setupPanPages() {
 	_screen->savePageToDisk("BKGD.PG", 2);
-	_screen->loadBitmap("BEAD.CPS", 3, 3, 0);
+	_screen->loadBitmap("BEAD.CPS", 3, 3, nullptr);
 	if (_flags.platform == Common::kPlatformMacintosh || _flags.platform == Common::kPlatformAmiga) {
 		int pageBackUp = _screen->_curPage;
 		_screen->_curPage = 2;
@@ -1949,20 +1949,20 @@ void KyraEngine_LoK::setupPanPages() {
 
 void KyraEngine_LoK::freePanPages() {
 	delete[] _endSequenceBackUpRect;
-	_endSequenceBackUpRect = 0;
+	_endSequenceBackUpRect = nullptr;
 	for (int i = 0; i <= 19; ++i) {
 		delete[] _panPagesTable[i];
-		_panPagesTable[i] = 0;
+		_panPagesTable[i] = nullptr;
 	}
 }
 
 void KyraEngine_LoK::closeFinalWsa() {
 	delete _finalA;
-	_finalA = 0;
+	_finalA = nullptr;
 	delete _finalB;
-	_finalB = 0;
+	_finalB = nullptr;
 	delete _finalC;
-	_finalC = 0;
+	_finalC = nullptr;
 	freePanPages();
 	_endSequenceNeedLoading = 1;
 }
diff --git a/engines/kyra/sequence/sequences_v2.cpp b/engines/kyra/sequence/sequences_v2.cpp
index 5e08849a22..ef7f412b2a 100644
--- a/engines/kyra/sequence/sequences_v2.cpp
+++ b/engines/kyra/sequence/sequences_v2.cpp
@@ -41,17 +41,17 @@ void KyraEngine_v2::runAnimationScript(const char *filename, int allowSkip, int
 
 	if (_animShapeFiledata && newShapes) {
 		uninitAnimationShapes(_animShapeCount, _animShapeFiledata);
-		_animShapeFiledata = 0;
+		_animShapeFiledata = nullptr;
 		_animShapeCount = 0;
 	}
 
 	while (_emc->isValid(&_animationScriptState))
 		_emc->run(&_animationScriptState);
 
-	uint8 *fileData = 0;
+	uint8 *fileData = nullptr;
 
 	if (newShapes)
-		_animShapeFiledata = _res->fileData(_animShapeFilename, 0);
+		_animShapeFiledata = _res->fileData(_animShapeFilename, nullptr);
 
 	fileData = _animShapeFiledata;
 
@@ -68,7 +68,7 @@ void KyraEngine_v2::runAnimationScript(const char *filename, int allowSkip, int
 	if (shapeUnload) {
 		uninitAnimationShapes(_animShapeCount, fileData);
 		_animShapeCount = 0;
-		_animShapeFiledata = 0;
+		_animShapeFiledata = nullptr;
 	}
 
 	_emc->unload(&_animationScriptData);
diff --git a/engines/kyra/sound/drivers/adlib.cpp b/engines/kyra/sound/drivers/adlib.cpp
index 4b0f7ba3fa..5e1da07caa 100644
--- a/engines/kyra/sound/drivers/adlib.cpp
+++ b/engines/kyra/sound/drivers/adlib.cpp
@@ -270,7 +270,7 @@ private:
 	OPL::OPL *_adlib;
 
 	struct QueueEntry {
-		QueueEntry() : data(0), id(0), volume(0) {}
+		QueueEntry() : data(nullptr), id(0), volume(0) {}
 		QueueEntry(uint8 *ptr, uint8 track, uint8 vol) : data(ptr), id(track), volume(vol) {}
 		uint8 *data;
 		uint8 id;
@@ -452,7 +452,7 @@ void AdLibDriver::startSound(int track, int volume) {
 	// We used to drop the new sound here, but that isn't the behavior of the original code.
 	// It would cause more issues than do any good. Now, we just have a debug message and
 	// then drop the oldest sound, like the original driver...
-	if (_programQueueEnd == _programQueueStart && _programQueue[_programQueueEnd].data != 0)
+	if (_programQueueEnd == _programQueueStart && _programQueue[_programQueueEnd].data != nullptr)
 		debugC(3, kDebugLevelSound, "AdLibDriver: Program queue full, dropping track %d", _programQueue[_programQueueEnd].id);
 
 	_programQueue[_programQueueEnd] = QueueEntry(trackData, track, volume);
@@ -463,7 +463,7 @@ bool AdLibDriver::isChannelPlaying(int channel) const {
 	Common::StackLock lock(_mutex);
 
 	assert(channel >= 0 && channel <= 9);
-	return (_channels[channel].dataptr != 0);
+	return (_channels[channel].dataptr != nullptr);
 }
 
 void AdLibDriver::stopAllChannels() {
@@ -474,7 +474,7 @@ void AdLibDriver::stopAllChannels() {
 
 		Channel &chan = _channels[_curChannel];
 		chan.priority = 0;
-		chan.dataptr = 0;
+		chan.dataptr = nullptr;
 
 		if (channel != 9)
 			noteOff(chan);
@@ -1723,7 +1723,7 @@ int AdLibDriver::update_clearChannel(Channel &channel, const uint8 *values) {
 	// Stop channel
 	Channel &channel2 = _channels[_curChannel];
 	channel2.duration = channel2.priority = 0;
-	channel2.dataptr = 0;
+	channel2.dataptr = nullptr;
 	channel2.opExtraLevel2 = 0;
 
 	if (_curChannel != 9) {
diff --git a/engines/kyra/sound/drivers/audstream.cpp b/engines/kyra/sound/drivers/audstream.cpp
index fe026154a7..7ac3f4d49a 100644
--- a/engines/kyra/sound/drivers/audstream.cpp
+++ b/engines/kyra/sound/drivers/audstream.cpp
@@ -77,8 +77,8 @@ const int8 AUDStream::WSTable4Bit[] = {
 };
 
 AUDStream::AUDStream(Common::SeekableReadStream *stream) : _stream(stream), _endOfData(true), _rate(0),
-	_processedSize(0), _totalSize(0), _length(0, 1), _bytesLeft(0), _outBuffer(0),
-	_outBufferOffset(0), _outBufferSize(0), _inBuffer(0), _inBufferSize(0) {
+	_processedSize(0), _totalSize(0), _length(0, 1), _bytesLeft(0), _outBuffer(nullptr),
+	_outBufferOffset(0), _outBufferSize(0), _inBuffer(nullptr), _inBufferSize(0) {
 
 	if (_stream->size() < 8) {
 		warning("No AUD file: too short");
diff --git a/engines/kyra/sound/drivers/halestorm.cpp b/engines/kyra/sound/drivers/halestorm.cpp
index 157b7f179a..ab8d773eae 100644
--- a/engines/kyra/sound/drivers/halestorm.cpp
+++ b/engines/kyra/sound/drivers/halestorm.cpp
@@ -86,9 +86,9 @@ static int DEBUG_BUFFERS_COUNT = 0;
 class ShStBuffer {
 public:
 	ShStBuffer(const ShStBuffer &buff) : ptr(buff.ptr), len(buff.len), lifes(buff.lifes) { if (lifes) (*lifes)++; }
-	ShStBuffer(const void *p, uint32 cb, bool allocate = false) : ptr((const uint8*)p), len(cb), lifes(0) { if (allocate) memcpy(crtbuf(), p, cb); }
-	ShStBuffer() : ShStBuffer(0, 0) {}
-	ShStBuffer(Common::SeekableReadStream *s) : len(s ? s->size() : 0), lifes(0) { s->read(crtbuf(), len); }
+	ShStBuffer(const void *p, uint32 cb, bool allocate = false) : ptr((const uint8*)p), len(cb), lifes(nullptr) { if (allocate) memcpy(crtbuf(), p, cb); }
+	ShStBuffer() : ShStBuffer(nullptr, 0) {}
+	ShStBuffer(Common::SeekableReadStream *s) : len(s ? s->size() : 0), lifes(nullptr) { s->read(crtbuf(), len); }
 	~ShStBuffer() { dcrlif(); }
 	void operator=(Common::SeekableReadStream *s) { operator=(ShStBuffer(s)); }
 	void operator=(const ShStBuffer &buff) {
@@ -387,8 +387,8 @@ public:
 
 public:
 	struct HSSoundEffectVoice {
-		HSSoundEffectVoice() : enabled(false), loopStartDuration(0), loopEndDuration(0), duration(0), sync(0), dataPtr(0), numSamples(0), rate(0), loopStart(0), loopEnd(0),
-			resId(0), numLoops(0), b4(0), vblProc(0), cb(0), baseNote(60) {}
+		HSSoundEffectVoice() : enabled(false), loopStartDuration(0), loopEndDuration(0), duration(0), sync(0), dataPtr(nullptr), numSamples(0), rate(0), loopStart(0), loopEnd(0),
+			resId(0), numLoops(0), b4(0), vblProc(nullptr), cb(nullptr), baseNote(60) {}
 		bool enabled;
 		uint32 loopStartDuration;
 		uint32 loopEndDuration;
@@ -485,8 +485,8 @@ private:
 
 HSAudioStream::HSAudioStream(HSLowLevelDriver *drv, uint32 scummVMOutputrate, uint32 deviceRate, uint32 feedBufferSize, bool output16Bit) : Audio::AudioStream(), _drv(drv),
 _outputRate(scummVMOutputrate), _intRate(deviceRate), _buffSize(feedBufferSize), _outputByteSize(output16Bit ? 2 : 1), _isStereo(false), _vblSmpQty(0), _vblSmpQtyRem(0),
-_vblCountDown(0), _vblCountDownRem(0), _buffPos(0), _buffStart(0), _buffEnd(0), _rateConvCnt(0), _volMusic(0x10000), _volSfx(0x10000),
-_vblCbProc(0) {
+_vblCountDown(0), _vblCountDownRem(0), _buffPos(nullptr), _buffStart(nullptr), _buffEnd(nullptr), _rateConvCnt(0), _volMusic(0x10000), _volSfx(0x10000),
+_vblCbProc(nullptr) {
 	assert(drv);
 	_vblSmpQty = scummVMOutputrate / 60;
 	_vblSmpQtyRem = scummVMOutputrate % 60;
@@ -560,11 +560,11 @@ void HSAudioStream::runVblTasl() {
 		(*_vblCbProc)();
 }
 
-HSLowLevelDriver::HSLowLevelDriver(SoundMacRes *res, Common::Mutex &mutex) : _res(res), _vcstr(0), _mutex(mutex), _sampleConvertBuffer(0), _interpolationTable(0), _transCycleLenDef(0),
-_interpolationTable2(0), _amplitudeScaleBuffer(0), _songFlags(0), _amplitudeScaleFlags(0), _interpolationMode(kNone), _numChanMusic(0), _convertUnitSize(0), _numChanSfx(0),
-_midiCurCmd(0), _convertBufferNumUnits(0), _songLoop(false), _chan(0), _samplesPerTick(0), _smpTransLen(0), _transCycleLenInter(0), _updateTypeHq(0), _instruments(0), _songData(),
-_midiData(), _trackState(0), _sndInterpolateType(0), _song_transpose(0), _song_tickLen(0), _song_tempo(0), _song_ticksPerSecond(0), _song_internalTempo(0), _midiFastForward(false),
-_midiBusy(false), _pcmDstBufferSize(370), _midiMaxNotesPlayed(0), _songTicker(0), _transBuffer(0), _wtable(0), _wtableCount(0), _convertUnitSizeLast(0), _numChanSfxLast(0),
+HSLowLevelDriver::HSLowLevelDriver(SoundMacRes *res, Common::Mutex &mutex) : _res(res), _vcstr(nullptr), _mutex(mutex), _sampleConvertBuffer(nullptr), _interpolationTable(nullptr), _transCycleLenDef(0),
+_interpolationTable2(nullptr), _amplitudeScaleBuffer(nullptr), _songFlags(0), _amplitudeScaleFlags(0), _interpolationMode(kNone), _numChanMusic(0), _convertUnitSize(0), _numChanSfx(0),
+_midiCurCmd(0), _convertBufferNumUnits(0), _songLoop(false), _chan(nullptr), _samplesPerTick(0), _smpTransLen(0), _transCycleLenInter(0), _updateTypeHq(0), _instruments(nullptr), _songData(),
+_midiData(), _trackState(nullptr), _sndInterpolateType(0), _song_transpose(0), _song_tickLen(0), _song_tempo(0), _song_ticksPerSecond(0), _song_internalTempo(0), _midiFastForward(false),
+_midiBusy(false), _pcmDstBufferSize(370), _midiMaxNotesPlayed(0), _songTicker(0), _transBuffer(nullptr), _wtable(nullptr), _wtableCount(0), _convertUnitSizeLast(0), _numChanSfxLast(0),
 _wtableCount2(0), _pmDataTrm(0x8000) {
 #define HSOPC(x)	_hsOpcodes.push_back(new HSOpcode(this, &HSLowLevelDriver::x))
 	HSOPC(cmd_startSong);
@@ -663,7 +663,7 @@ template<typename T> void HSLowLevelDriver::generateData(T *dst, uint32 len) {
 
 int HSLowLevelDriver::cmd_startSong(va_list &arg) {
 	Common::SeekableReadStream *song = _res->getResource(va_arg(arg, int), 'SONG');
-	Common::SeekableReadStream *midi = 0;
+	Common::SeekableReadStream *midi = nullptr;
 	if (song) {
 		uint16 idm = song->readUint16BE();
 		if (!(midi = _res->getResource(idm, 'MIDI')))
@@ -758,11 +758,11 @@ int HSLowLevelDriver::cmd_releaseSongData(va_list &arg) {
 int HSLowLevelDriver::cmd_deinit(va_list &arg) {
 	send(7);
 	delete[] _sampleConvertBuffer;
-	_sampleConvertBuffer = 0;
+	_sampleConvertBuffer = nullptr;
 	delete[] _amplitudeScaleBuffer;
-	_amplitudeScaleBuffer = 0;
+	_amplitudeScaleBuffer = nullptr;
 	delete[] _interpolationTable;
-	_interpolationTable = 0;
+	_interpolationTable = nullptr;
 	return 0;
 }
 
@@ -815,7 +815,7 @@ int HSLowLevelDriver::cmd_playSoundEffect(va_list &arg) {
 	chan->pmData = &_pmDataTrm;
 	chan->stateCur.dataPos = vc->dataPtr;
 	chan->dataEnd = vc->dataPtr + vc->numSamples;
-	chan->loopStart = chan->loopEnd = 0;
+	chan->loopStart = chan->loopEnd = nullptr;
 	chan->numLoops = &vc->numLoops;
 	chan->imode = _interpolationMode ? kSimple : kNone;
 
@@ -982,7 +982,7 @@ void HSLowLevelDriver::createTables() {
 	if (_sampleConvertBuffer) {
 		if (_convertUnitSize != _convertUnitSizeLast || _numChanSfx != _numChanSfxLast || _convertBufferNumUnits - _numChanSfx != _numChanMusic) {
 			delete[] _sampleConvertBuffer;
-			_sampleConvertBuffer = 0;
+			_sampleConvertBuffer = nullptr;
 		}
 	}
 
@@ -1595,8 +1595,8 @@ void HSLowLevelDriver::noteOn(uint8 part, uint8 prg, uint8 note, uint8 velo, uin
 		return;
 	}
 
-	const uint8 *snd = 0;
-	const NoteRangeSubset *nrs = 0;
+	const uint8 *snd = nullptr;
+	const NoteRangeSubset *nrs = nullptr;
 	uint16 note2 = 0;
 	uint16 flags = 0;
 	uint8 flags2 = 0;
@@ -1668,7 +1668,7 @@ void HSLowLevelDriver::noteOn(uint8 part, uint8 prg, uint8 note, uint8 velo, uin
 		return;
 
 	int busy = 0;
-	HSSoundChannel *chan = 0;
+	HSSoundChannel *chan = nullptr;
 
 	for (int i = 0; i < _numChanMusic && !chan; ++i) {
 		HSSoundChannel *c = &_chan[i];
@@ -1719,7 +1719,7 @@ void HSLowLevelDriver::noteOn(uint8 part, uint8 prg, uint8 note, uint8 velo, uin
 
 	chan->stateCur.dataPos = snd + 22;
 	chan->dataEnd = chan->stateCur.dataPos + READ_BE_UINT32(snd + 4);
-	chan->loopStart = chan->loopEnd = 0;
+	chan->loopStart = chan->loopEnd = nullptr;
 	uint32 loopStart = READ_BE_UINT32(snd + 12);
 	uint32 loopEnd = READ_BE_UINT32(snd + 16);
 
@@ -1728,7 +1728,7 @@ void HSLowLevelDriver::noteOn(uint8 part, uint8 prg, uint8 note, uint8 velo, uin
 		chan->loopEnd = chan->stateCur.dataPos + loopEnd;
 	}
 
-	chan->numLoops = 0;
+	chan->numLoops = nullptr;
 	chan->imode = (!(flags & 0x8000) && (((_songFlags & 0x2000) || ((_songFlags & 0x1000) && (flags2 & 0x80 || _sndInterpolateType == n))))) ? _interpolationMode : kNone;
 
 	chan->prg = prg;
@@ -1904,10 +1904,10 @@ const uint32 HSLowLevelDriver::_periods[156] = {
 	0x00658598, 0x006b93da, 0x0071fd4c, 0x0078c1f0
 };
 
-HSSoundSystem *HSSoundSystem::_refInstance = 0;
+HSSoundSystem *HSSoundSystem::_refInstance = nullptr;
 int HSSoundSystem::_refCount = 0;
 
-HSSoundSystem::HSSoundSystem(SoundMacRes *res, Audio::Mixer *mixer) : _res(res), _mixer(mixer), _driver(0), _voicestr(0), _vblTask(0), _sampleSlots(0), _voices(0), _sync(0),
+HSSoundSystem::HSSoundSystem(SoundMacRes *res, Audio::Mixer *mixer) : _res(res), _mixer(mixer), _driver(nullptr), _voicestr(nullptr), _vblTask(nullptr), _sampleSlots(nullptr), _voices(nullptr), _sync(0),
 _numChanSfx(0), _numSampleSlots(0), _currentSong(-1), _ready(false), _isFading(false), _sfxDuration(0), _fadeState(0), _fadeStep(0), _fadeStepTicksCounter(0), _fadeDirection(false),
 _fadeComplete(false), _fadeStepTicks(0), _volumeMusic(Audio::Mixer::kMaxMixerVolume), _volumeSfx(Audio::Mixer::kMaxMixerVolume), _mutex(mixer->mutex()) {
 	DEBUG_BUFFERS_COUNT = 0;
@@ -1926,9 +1926,9 @@ HSSoundSystem::~HSSoundSystem() {
 HSSoundSystem *HSSoundSystem::open(SoundMacRes *res, Audio::Mixer *mixer) {
 	_refCount++;
 
-	if (_refCount == 1 && _refInstance == 0)
+	if (_refCount == 1 && _refInstance == nullptr)
 		_refInstance = new HSSoundSystem(res, mixer);
-	else if (_refCount < 2 || _refInstance == 0)
+	else if (_refCount < 2 || _refInstance == nullptr)
 		error("HSSoundSystem::open(): Internal ref management failure");
 
 	return _refInstance;
@@ -1942,7 +1942,7 @@ void HSSoundSystem::close() {
 
 	if (!_refCount) {
 		delete _refInstance;
-		_refInstance = 0;
+		_refInstance = nullptr;
 	}
 }
 
@@ -2003,7 +2003,7 @@ void HSSoundSystem::releaseSamples() {
 		releaseSamplesFromSlot(_sampleSlots[i]);
 
 	delete[] _sampleSlots;
-	_sampleSlots = 0;
+	_sampleSlots = nullptr;
 	_numSampleSlots = 0;
 }
 
@@ -2032,7 +2032,7 @@ void HSSoundSystem::startSoundEffect(int id, int rate) {
 		slot->reverse = false;
 	}
 
-	playSamples(slot->samples, slot->numSamples, rate ? rate : slot->rate, id, 0, 0, 0, 0, 0, 0);
+	playSamples(slot->samples, slot->numSamples, rate ? rate : slot->rate, id, 0, 0, 0, 0, nullptr, nullptr);
 }
 
 void HSSoundSystem::enqueueSoundEffect(int id, int rate, int note) {
@@ -2241,7 +2241,7 @@ void HSSoundSystem::setupSfxChannels(int num) {
 	for (int i = 0; i < _numChanSfx; ++i)
 		delete _voices[i];
 	delete[] _voices;
-	_voices = 0;
+	_voices = nullptr;
 
 	_numChanSfx = num;
 	if (num <= 0)
@@ -2254,7 +2254,7 @@ void HSSoundSystem::setupSfxChannels(int num) {
 }
 
 HSSoundSystem::HSSoundEffectVoice *HSSoundSystem::findFreeVoice() const {
-	HSSoundEffectVoice *chan = 0;
+	HSSoundEffectVoice *chan = nullptr;
 	for (int i = 0; i < _numChanSfx; ++i) {
 		if (_voices[i] && !_voices[i]->enabled) {
 			chan = _voices[i];
@@ -2289,7 +2289,7 @@ HSSoundSystem::HSSoundEffectVoice *HSSoundSystem::findVoice(uint16 id) const {
 		if (_voices[i] && _voices[i]->resId == id)
 			return _voices[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 int HSSoundSystem::doCommandIntern(int cmd, ...) {
@@ -2303,8 +2303,8 @@ int HSSoundSystem::doCommandIntern(int cmd, ...) {
 
 bool HSSoundSystem::loadSamplesIntoSlot(uint16 id, SampleSlot &slot, bool registerOnly) const {
 	slot.resId = id;
-	slot.data = 0;
-	uint8 *data = 0;
+	slot.data = nullptr;
+	uint8 *data = nullptr;
 
 	if (registerOnly)
 		return true;
@@ -2340,7 +2340,7 @@ bool HSSoundSystem::loadSamplesIntoSlot(uint16 id, SampleSlot &slot, bool regist
 	} else if (type) {
 		warning("SoundSystem::loadSamplesIntoSlot(): Unexpected resource header type '%d' encountered", type);
 		delete[] data;
-		data = 0;
+		data = nullptr;
 	}
 
 	slot.data = data;
@@ -2354,11 +2354,11 @@ void HSSoundSystem::deltaDecompress(uint8 *out, uint8 *in, uint32 outSize, uint3
 
 void HSSoundSystem::releaseSamplesFromSlot(SampleSlot &slot) {
 	delete[] slot.data;
-	slot.data = slot.samples = 0;
+	slot.data = slot.samples = nullptr;
 }
 
 HSSoundSystem::SampleSlot *HSSoundSystem::findSampleSlot(int id) const {
-	SampleSlot *res = 0;
+	SampleSlot *res = nullptr;
 	for (int i = 0; i <_numSampleSlots; ++i) {
 		SampleSlot &s = _sampleSlots[i];
 		if (s.resId != id)
@@ -2631,13 +2631,13 @@ bool HSTriangulizer::process(const ShStBuffer &src, uint8 *dst, uint16, uint16)
 	return true;
 }
 
-HalestormDriver::HalestormDriver(SoundMacRes *res, Audio::Mixer *mixer) : _hs(0) {
+HalestormDriver::HalestormDriver(SoundMacRes *res, Audio::Mixer *mixer) : _hs(nullptr) {
 	_hs = HSSoundSystem::open(res, mixer);
 }
 
 HalestormDriver::~HalestormDriver() {
 	HSSoundSystem::close();
-	_hs = 0;
+	_hs = nullptr;
 }
 
 bool HalestormDriver::init(bool hiQuality, InterpolationMode imode, bool output16bit) {
diff --git a/engines/kyra/sound/drivers/pcspeaker_v2.cpp b/engines/kyra/sound/drivers/pcspeaker_v2.cpp
index 110addefd8..26c928dc03 100644
--- a/engines/kyra/sound/drivers/pcspeaker_v2.cpp
+++ b/engines/kyra/sound/drivers/pcspeaker_v2.cpp
@@ -48,7 +48,7 @@ MidiDriver_PCSpeaker::MidiDriver_PCSpeaker(Audio::Mixer *mixer)
 MidiDriver_PCSpeaker::~MidiDriver_PCSpeaker() {
 	_mixer->stopHandle(_mixerSoundHandle);
 	delete _speaker;
-	_speaker = 0;
+	_speaker = nullptr;
 }
 
 void MidiDriver_PCSpeaker::send(uint32 data) {
diff --git a/engines/kyra/sound/sound.cpp b/engines/kyra/sound/sound.cpp
index 478ffcaf8a..ec774d90cb 100644
--- a/engines/kyra/sound/sound.cpp
+++ b/engines/kyra/sound/sound.cpp
@@ -80,7 +80,7 @@ int32 Sound::voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volum
 Audio::SeekableAudioStream *Sound::getVoiceStream(const char *file) const {
 	Common::String filename;
 
-	Audio::SeekableAudioStream *audioStream = 0;
+	Audio::SeekableAudioStream *audioStream = nullptr;
 	for (int i = 0; _supportedCodecs[i].fileext; ++i) {
 		filename = file;
 		filename += _supportedCodecs[i].fileext;
@@ -95,7 +95,7 @@ Audio::SeekableAudioStream *Sound::getVoiceStream(const char *file) const {
 
 	if (!audioStream) {
 		warning("Couldn't load sound file '%s'", file);
-		return 0;
+		return nullptr;
 	} else {
 		return audioStream;
 	}
@@ -362,7 +362,7 @@ const Sound::SpeechCodecs Sound::_supportedCodecs[] = {
 	{ ".FLA", Audio::makeFLACStream },
 #endif // USE_FLAC
 
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 } // End of namespace Kyra
diff --git a/engines/kyra/sound/sound_digital_mr.cpp b/engines/kyra/sound/sound_digital_mr.cpp
index 9f4cf8cfa4..700217dc76 100644
--- a/engines/kyra/sound/sound_digital_mr.cpp
+++ b/engines/kyra/sound/sound_digital_mr.cpp
@@ -36,7 +36,7 @@ namespace Kyra {
 class KyraAudioStream : public Audio::SeekableAudioStream {
 public:
 	KyraAudioStream(Audio::SeekableAudioStream *impl) : _impl(impl), _rate(impl->getRate()), _fadeSamples(0), _fadeCount(0), _fading(0), _endOfData(false) {}
-	~KyraAudioStream() override { delete _impl; _impl = 0; }
+	~KyraAudioStream() override { delete _impl; _impl = nullptr; }
 
 	int readBuffer(int16 *buffer, const int numSamples) override;
 	bool isStereo() const override { return _impl->isStereo(); }
@@ -104,7 +104,7 @@ int KyraAudioStream::readBuffer(int16 *buffer, const int numSamples) {
 
 SoundDigital_MR::SoundDigital_MR(KyraEngine_MR *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
 	for (uint i = 0; i < ARRAYSIZE(_sounds); ++i)
-		_sounds[i].stream = 0;
+		_sounds[i].stream = nullptr;
 }
 
 SoundDigital_MR::~SoundDigital_MR() {
@@ -113,7 +113,7 @@ SoundDigital_MR::~SoundDigital_MR() {
 }
 
 int SoundDigital_MR::playSound(const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume, bool loop, int channel) {
-	Sound *use = 0;
+	Sound *use = nullptr;
 	if (channel != -1 && channel < ARRAYSIZE(_sounds)) {
 		stopSound(channel);
 		use = &_sounds[channel];
@@ -148,7 +148,7 @@ int SoundDigital_MR::playSound(const char *filename, uint8 priority, Audio::Mixe
 		}
 	}
 
-	Common::SeekableReadStream *stream = 0;
+	Common::SeekableReadStream *stream = nullptr;
 	int usedCodec = -1;
 	for (int i = 0; _supportedCodecs[i].fileext; ++i) {
 		Common::String file = filename;
@@ -178,7 +178,7 @@ int SoundDigital_MR::playSound(const char *filename, uint8 priority, Audio::Mixe
 	assert(use->stream);
 	if (use->stream->endOfData()) {
 		delete use->stream;
-		use->stream = 0;
+		use->stream = nullptr;
 
 		return -1;
 	}
@@ -212,7 +212,7 @@ void SoundDigital_MR::stopSound(int channel) {
 
 	assert(channel >= 0 && channel < ARRAYSIZE(_sounds));
 	_mixer->stopHandle(_sounds[channel].handle);
-	_sounds[channel].stream = 0;
+	_sounds[channel].stream = nullptr;
 }
 
 void SoundDigital_MR::stopAllSounds() {
@@ -242,7 +242,7 @@ const SoundDigital_MR::AudioCodecs SoundDigital_MR::_supportedCodecs[] = {
 	{ ".MP3", Audio::makeMP3Stream },
 #endif // USE_MAD
 	{ ".AUD", makeAUDStream },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 } // End of namespace Kyra
diff --git a/engines/kyra/sound/sound_mac_lok.cpp b/engines/kyra/sound/sound_mac_lok.cpp
index 493af0b860..8651cd82a2 100644
--- a/engines/kyra/sound/sound_mac_lok.cpp
+++ b/engines/kyra/sound/sound_mac_lok.cpp
@@ -37,7 +37,7 @@
 
 namespace Kyra {
 
-SoundMacRes::SoundMacRes() : _macRes(0) {
+SoundMacRes::SoundMacRes() : _macRes(nullptr) {
 	_macRes = new Common::MacResManager();
 }
 
@@ -113,7 +113,7 @@ bool SoundMacRes::init() {
 }
 
 Common::SeekableReadStream *SoundMacRes::getResource(uint16 id, uint32 type) {
-	Common::SeekableReadStream *res = 0;
+	Common::SeekableReadStream *res = nullptr;
 	for (Common::StringArray::iterator i = _resFiles.begin(); i != _resFiles.end(); ++i) {
 		if (!_macRes->open(Common::Path(*i)))
 			warning("SoundMacRes::getResource(): Error opening data file: '%s'", i->c_str());
@@ -129,7 +129,7 @@ void SoundMacRes::setQuality(bool hi) {
 	_resFiles.push_back(_kyraMacExe);
 }
 
-SoundMac::SoundMac(KyraEngine_v1 *vm, Audio::Mixer *mixer) : Sound(vm, mixer), _driver(0), _res(0), _currentResourceSet(-1), _resIDMusic(0), _ready(false) {
+SoundMac::SoundMac(KyraEngine_v1 *vm, Audio::Mixer *mixer) : Sound(vm, mixer), _driver(nullptr), _res(nullptr), _currentResourceSet(-1), _resIDMusic(nullptr), _ready(false) {
 }
 
 SoundMac::~SoundMac() {
diff --git a/engines/kyra/sound/sound_pc98_lok.cpp b/engines/kyra/sound/sound_pc98_lok.cpp
index 478f65aec2..0632d11cb9 100644
--- a/engines/kyra/sound/sound_pc98_lok.cpp
+++ b/engines/kyra/sound/sound_pc98_lok.cpp
@@ -30,7 +30,7 @@
 namespace Kyra {
 
 SoundPC98_LoK::SoundPC98_LoK(KyraEngine_v1 *vm, Audio::Mixer *mixer) :
-	Sound(vm, mixer), _musicTrackData(0), _sfxTrackData(0), _lastTrack(-1), _driver(0), _currentResourceSet(0) {
+	Sound(vm, mixer), _musicTrackData(nullptr), _sfxTrackData(nullptr), _lastTrack(-1), _driver(nullptr), _currentResourceSet(0) {
 	memset(&_resInfo, 0, sizeof(_resInfo));
 }
 
@@ -39,7 +39,7 @@ SoundPC98_LoK::~SoundPC98_LoK() {
 	delete[] _sfxTrackData;
 	delete _driver;
 	for (int i = 0; i < 3; i++)
-		initAudioResourceInfo(i, 0);
+		initAudioResourceInfo(i, nullptr);
 }
 
 bool SoundPC98_LoK::init() {
@@ -53,7 +53,7 @@ bool SoundPC98_LoK::init() {
 void SoundPC98_LoK::initAudioResourceInfo(int set, void *info) {
 	if (set >= kMusicIntro && set <= kMusicFinale) {
 		delete _resInfo[set];
-		_resInfo[set] = info ? new Common::String(((SoundResourceInfo_PC98*)info)->pattern) : 0;
+		_resInfo[set] = info ? new Common::String(((SoundResourceInfo_PC98*)info)->pattern) : nullptr;
 	}
 }
 
@@ -71,7 +71,7 @@ bool SoundPC98_LoK::hasSoundFile(uint file) const {
 void SoundPC98_LoK::loadSoundFile(uint) {
 	if (_currentResourceSet == kMusicIntro) {
 		delete[] _sfxTrackData;
-		_sfxTrackData = 0;
+		_sfxTrackData = nullptr;
 
 		int dataSize = 0;
 		const uint8 *tmp = _vm->staticres()->loadRawData(k1PC98IntroSfx, dataSize);
@@ -88,7 +88,7 @@ void SoundPC98_LoK::loadSoundFile(uint) {
 
 void SoundPC98_LoK::loadSoundFile(Common::String file) {
 	delete[] _sfxTrackData;
-	_sfxTrackData = _vm->resource()->fileData(file.c_str(), 0);
+	_sfxTrackData = _vm->resource()->fileData(file.c_str(), nullptr);
 }
 
 void SoundPC98_LoK::playTrack(uint8 track) {
@@ -101,7 +101,7 @@ void SoundPC98_LoK::playTrack(uint8 track) {
 
 	Common::String musicFile = Common::String::format(resPattern(), track);
 	delete[] _musicTrackData;
-	_musicTrackData = _vm->resource()->fileData(musicFile.c_str(), 0);
+	_musicTrackData = _vm->resource()->fileData(musicFile.c_str(), nullptr);
 	if (_musicEnabled)
 		_driver->loadMusicData(_musicTrackData);
 
diff --git a/engines/kyra/sound/sound_pc98_v2.cpp b/engines/kyra/sound/sound_pc98_v2.cpp
index 59cbf7843e..80eddc31df 100644
--- a/engines/kyra/sound/sound_pc98_v2.cpp
+++ b/engines/kyra/sound/sound_pc98_v2.cpp
@@ -35,7 +35,7 @@
 namespace Kyra {
 
 SoundTownsPC98_v2::SoundTownsPC98_v2(KyraEngine_v1 *vm, Audio::Mixer *mixer) :
-	Sound(vm, mixer), _currentSFX(0), _musicTrackData(0), _sfxTrackData(0), _lastTrack(-1), _driver(0), _useFmSfx(false), _currentResourceSet(0) {
+	Sound(vm, mixer), _currentSFX(nullptr), _musicTrackData(nullptr), _sfxTrackData(nullptr), _lastTrack(-1), _driver(nullptr), _useFmSfx(false), _currentResourceSet(0) {
 	memset(&_resInfo, 0, sizeof(_resInfo));
 }
 
@@ -44,7 +44,7 @@ SoundTownsPC98_v2::~SoundTownsPC98_v2() {
 	delete[] _sfxTrackData;
 	delete _driver;
 	for (int i = 0; i < 3; i++)
-		initAudioResourceInfo(i, 0);
+		initAudioResourceInfo(i, nullptr);
 }
 
 bool SoundTownsPC98_v2::init() {
@@ -91,7 +91,7 @@ bool SoundTownsPC98_v2::init() {
 void SoundTownsPC98_v2::initAudioResourceInfo(int set, void *info) {
 	if (set >= kMusicIntro && set <= kMusicFinale) {
 		delete _resInfo[set];
-		_resInfo[set] = info ? new SoundResourceInfo_TownsPC98V2(*(SoundResourceInfo_TownsPC98V2*)info) : 0;
+		_resInfo[set] = info ? new SoundResourceInfo_TownsPC98V2(*(SoundResourceInfo_TownsPC98V2*)info) : nullptr;
 	}
 }
 
@@ -104,13 +104,13 @@ void SoundTownsPC98_v2::selectAudioResourceSet(int set) {
 
 bool SoundTownsPC98_v2::hasSoundFile(uint file) const {
 	if (file < res()->fileListSize)
-		return (res()->fileList[file] != 0);
+		return (res()->fileList[file] != nullptr);
 	return false;
 }
 
 void SoundTownsPC98_v2::loadSoundFile(Common::String file) {
 	delete[] _sfxTrackData;
-	_sfxTrackData = _vm->resource()->fileData(file.c_str(), 0);
+	_sfxTrackData = _vm->resource()->fileData(file.c_str(), nullptr);
 }
 
 void SoundTownsPC98_v2::process() {
@@ -133,13 +133,13 @@ void SoundTownsPC98_v2::playTrack(uint8 track) {
 
 	beginFadeOut();
 
-	Common::String musicFile = res()->pattern ? Common::String::format(res()->pattern, track) : (res()->fileList ? res()->fileList[track] : 0);
+	Common::String musicFile = res()->pattern ? Common::String::format(res()->pattern, track) : (res()->fileList ? res()->fileList[track] : nullptr);
 	if (musicFile.empty())
 		return;
 
 	delete[] _musicTrackData;
 
-	_musicTrackData = _vm->resource()->fileData(musicFile.c_str(), 0);
+	_musicTrackData = _vm->resource()->fileData(musicFile.c_str(), nullptr);
 	_driver->loadMusicData(_musicTrackData, true);
 
 	if (_musicEnabled == 2 && trackNum != -1) {
@@ -195,7 +195,7 @@ int32 SoundTownsPC98_v2::voicePlay(const char *file, Audio::SoundHandle *handle,
 
 	Common::String fileName = Common::String::format( _vm->game() == GI_LOL ? patternLOL : patternHOF, file);
 
-	uint8 *data = _vm->resource()->fileData(fileName.c_str(), 0);
+	uint8 *data = _vm->resource()->fileData(fileName.c_str(), nullptr);
 	uint8 *src = data;
 	if (!src)
 		return 0;
diff --git a/engines/kyra/sound/sound_pc_midi.cpp b/engines/kyra/sound/sound_pc_midi.cpp
index 15b1e0436a..575c20cfad 100644
--- a/engines/kyra/sound/sound_pc_midi.cpp
+++ b/engines/kyra/sound/sound_pc_midi.cpp
@@ -34,18 +34,18 @@ namespace Kyra {
 
 SoundMidiPC::SoundMidiPC(KyraEngine_v1 *vm, Audio::Mixer *mixer, MidiDriver *driver, kType type) : Sound(vm, mixer) {
 	_driver = driver;
-	_output = 0;
+	_output = nullptr;
 
-	_musicFile = _sfxFile = 0;
+	_musicFile = _sfxFile = nullptr;
 	_currentResourceSet = 0;
 	memset(&_resInfo, 0, sizeof(_resInfo));
 
-	_music = MidiParser::createParser_XMIDI(MidiParser::defaultXMidiCallback, NULL, 0);
+	_music = MidiParser::createParser_XMIDI(MidiParser::defaultXMidiCallback, nullptr, 0);
 	assert(_music);
 	_music->property(MidiParser::mpDisableAllNotesOffMidiEvents, true);
 	_music->property(MidiParser::mpDisableAutoStartPlayback, true);
 	for (int i = 0; i < 3; ++i) {
-		_sfx[i] = MidiParser::createParser_XMIDI(MidiParser::defaultXMidiCallback, NULL, i + 1);
+		_sfx[i] = MidiParser::createParser_XMIDI(MidiParser::defaultXMidiCallback, nullptr, i + 1);
 		assert(_sfx[i]);
 		_sfx[i]->property(MidiParser::mpDisableAllNotesOffMidiEvents, true);
 		_sfx[i]->property(MidiParser::mpDisableAutoStartPlayback, true);
@@ -84,7 +84,7 @@ SoundMidiPC::SoundMidiPC(KyraEngine_v1 *vm, Audio::Mixer *mixer, MidiDriver *dri
 
 SoundMidiPC::~SoundMidiPC() {
 	Common::StackLock lock(_mutex);
-	_output->setTimerCallback(0, 0);
+	_output->setTimerCallback(nullptr, nullptr);
 
 	delete _music;
 	for (int i = 0; i < 3; ++i)
@@ -99,7 +99,7 @@ SoundMidiPC::~SoundMidiPC() {
 	delete[] _musicFile;
 
 	for (int i = 0; i < 3; i++)
-		initAudioResourceInfo(i, 0);
+		initAudioResourceInfo(i, nullptr);
 }
 
 bool SoundMidiPC::init() {
@@ -125,8 +125,8 @@ bool SoundMidiPC::init() {
 	_output->setTimerCallback(this, SoundMidiPC::onTimer);
 
 	// Load MT-32 and GM initialization files
-	const char* midiFile = 0;
-	const char* pakFile = 0;
+	const char* midiFile = nullptr;
+	const char* pakFile = nullptr;
 	if (_nativeMT32 && _type == kMidiMT32) {
 		if (_vm->game() == GI_KYRA1) {
 			midiFile = "INTRO";
@@ -210,7 +210,7 @@ void SoundMidiPC::updateVolumeSettings() {
 void SoundMidiPC::initAudioResourceInfo(int set, void *info) {
 	if (set >= kMusicIntro && set <= kMusicFinale) {
 		delete _resInfo[set];
-		_resInfo[set] = info ? new SoundResourceInfo_PC(*(SoundResourceInfo_PC*)info) : 0;
+		_resInfo[set] = info ? new SoundResourceInfo_PC(*(SoundResourceInfo_PC*)info) : nullptr;
 	}
 }
 
@@ -223,7 +223,7 @@ void SoundMidiPC::selectAudioResourceSet(int set) {
 
 bool SoundMidiPC::hasSoundFile(uint file) const {
 	if (file < res()->fileListSize)
-		return (res()->fileList[file] != 0);
+		return (res()->fileList[file] != nullptr);
 	return false;
 }
 
diff --git a/engines/kyra/sound/sound_pc_v1.cpp b/engines/kyra/sound/sound_pc_v1.cpp
index 1cfb97d9f8..c471a464be 100644
--- a/engines/kyra/sound/sound_pc_v1.cpp
+++ b/engines/kyra/sound/sound_pc_v1.cpp
@@ -41,10 +41,10 @@ const int SoundPC_v1::_kyra1SoundTriggers[] = {
 const int SoundPC_v1::_kyra1NumSoundTriggers = ARRAYSIZE(SoundPC_v1::_kyra1SoundTriggers);
 
 SoundPC_v1::SoundPC_v1(KyraEngine_v1 *vm, Audio::Mixer *mixer, kType type)
-	: Sound(vm, mixer), _driver(0), _trackEntries(), _soundDataPtr(0), _type(type) {
+	: Sound(vm, mixer), _driver(nullptr), _trackEntries(), _soundDataPtr(nullptr), _type(type) {
 	memset(_trackEntries, 0, sizeof(_trackEntries));
 
-	_soundTriggers = 0;
+	_soundTriggers = nullptr;
 	_numSoundTriggers = 0;
 	_sfxPlayingSound = -1;
 	_soundFileLoaded.clear();
@@ -89,7 +89,7 @@ SoundPC_v1::~SoundPC_v1() {
 	delete _driver;
 	delete[] _soundDataPtr;
 	for (int i = 0; i < 3; i++)
-		initAudioResourceInfo(i, 0);
+		initAudioResourceInfo(i, nullptr);
 }
 
 bool SoundPC_v1::init() {
@@ -187,7 +187,7 @@ void SoundPC_v1::resetTrigger() {
 void SoundPC_v1::initAudioResourceInfo(int set, void *info) {
 	if (set >= kMusicIntro && set <= kMusicFinale) {
 		delete _resInfo[set];
-		_resInfo[set] = info ? new SoundResourceInfo_PC(*(SoundResourceInfo_PC*)info) : 0;
+		_resInfo[set] = info ? new SoundResourceInfo_PC(*(SoundResourceInfo_PC*)info) : nullptr;
 	}
 }
 
@@ -200,7 +200,7 @@ void SoundPC_v1::selectAudioResourceSet(int set) {
 
 bool SoundPC_v1::hasSoundFile(uint file) const {
 	if (file < res()->fileListSize)
-		return (res()->fileList[file] != 0);
+		return (res()->fileList[file] != nullptr);
 	return false;
 }
 
@@ -223,7 +223,7 @@ void SoundPC_v1::internalLoadFile(Common::String file) {
 	if (_soundDataPtr)
 		haltTrack();
 
-	uint8 *fileData = 0; uint32 fileSize = 0;
+	uint8 *fileData = nullptr; uint32 fileSize = 0;
 
 	fileData = _vm->resource()->fileData(file.c_str(), &fileSize);
 	if (!fileData) {
diff --git a/engines/kyra/sound/sound_towns_lok.cpp b/engines/kyra/sound/sound_towns_lok.cpp
index e50dfa83ca..83d5b88b4a 100644
--- a/engines/kyra/sound/sound_towns_lok.cpp
+++ b/engines/kyra/sound/sound_towns_lok.cpp
@@ -32,8 +32,8 @@
 namespace Kyra {
 
 SoundTowns_LoK::SoundTowns_LoK(KyraEngine_v1 *vm, Audio::Mixer *mixer)
-	: Sound(vm, mixer), _lastTrack(-1), _musicTrackData(0), _sfxFileData(0), _cdaPlaying(0),
-	_sfxFileIndex((uint)-1), _musicFadeTable(0), _sfxWDTable(0), _sfxBTTable(0), _sfxChannel(0x46), _currentResourceSet(0) {
+	: Sound(vm, mixer), _lastTrack(-1), _musicTrackData(nullptr), _sfxFileData(nullptr), _cdaPlaying(0),
+	_sfxFileIndex((uint)-1), _musicFadeTable(nullptr), _sfxWDTable(nullptr), _sfxBTTable(nullptr), _sfxChannel(0x46), _currentResourceSet(0) {
 	memset(&_resInfo, 0, sizeof(_resInfo));
 	_player = new EuphonyPlayer(_mixer);
 }
@@ -45,7 +45,7 @@ SoundTowns_LoK::~SoundTowns_LoK() {
 	delete[] _musicTrackData;
 	delete[] _sfxFileData;
 	for (int i = 0; i < 3; i++)
-		initAudioResourceInfo(i, 0);
+		initAudioResourceInfo(i, nullptr);
 }
 
 bool SoundTowns_LoK::init() {
@@ -127,7 +127,7 @@ void SoundTowns_LoK::haltTrack() {
 void SoundTowns_LoK::initAudioResourceInfo(int set, void *info) {
 	if (set >= kMusicIntro && set <= kMusicFinale) {
 		delete _resInfo[set];
-		_resInfo[set] = info ? new SoundResourceInfo_Towns(*(SoundResourceInfo_Towns*)info) : 0;
+		_resInfo[set] = info ? new SoundResourceInfo_Towns(*(SoundResourceInfo_Towns*)info) : nullptr;
 	}
 }
 
@@ -140,7 +140,7 @@ void SoundTowns_LoK::selectAudioResourceSet(int set) {
 
 bool SoundTowns_LoK::hasSoundFile(uint file) const {
 	if (file < res()->fileListSize)
-		return (res()->fileList[file] != 0);
+		return (res()->fileList[file] != nullptr);
 	return false;
 }
 
@@ -149,7 +149,7 @@ void SoundTowns_LoK::loadSoundFile(uint file) {
 		return;
 	_sfxFileIndex = file;
 	delete[] _sfxFileData;
-	_sfxFileData = _vm->resource()->fileData(res()->fileList[file], 0);
+	_sfxFileData = _vm->resource()->fileData(res()->fileList[file], nullptr);
 }
 
 void SoundTowns_LoK::playSoundEffect(uint16 track, uint8) {
@@ -320,7 +320,7 @@ void SoundTowns_LoK::beginFadeOut() {
 }
 
 bool SoundTowns_LoK::loadInstruments() {
-	uint8 *twm = _vm->resource()->fileData("twmusic.pak", 0);
+	uint8 *twm = _vm->resource()->fileData("twmusic.pak", nullptr);
 	if (!twm)
 		return false;
 
@@ -347,7 +347,7 @@ bool SoundTowns_LoK::loadInstruments() {
 }
 
 void SoundTowns_LoK::playEuphonyTrack(uint32 offset, int loop) {
-	uint8 *twm = _vm->resource()->fileData("twmusic.pak", 0);
+	uint8 *twm = _vm->resource()->fileData("twmusic.pak", nullptr);
 	Screen::decodeFrame4(twm + 19312 + offset, _musicTrackData, 50570);
 	delete[] twm;
 
diff --git a/engines/kyra/text/text_hof.cpp b/engines/kyra/text/text_hof.cpp
index dad25b7b4d..220e145bab 100644
--- a/engines/kyra/text/text_hof.cpp
+++ b/engines/kyra/text/text_hof.cpp
@@ -289,7 +289,7 @@ void KyraEngine_HoF::objectChatProcess(const char *script) {
 		_emc->run(&_chatScriptState);
 
 	_animShapeFilename[2] = _characterShapeFile + '0';
-	uint8 *shapeBuffer = _res->fileData(_animShapeFilename, 0);
+	uint8 *shapeBuffer = _res->fileData(_animShapeFilename, nullptr);
 	if (shapeBuffer) {
 		int shapeCount = initAnimationShapes(shapeBuffer);
 
@@ -436,7 +436,7 @@ void KyraEngine_HoF::updateDlgBuffer() {
 		filename += 'G';
 
 	delete[] _dlgBuffer;
-	_dlgBuffer = _res->fileData(filename.c_str(), 0);
+	_dlgBuffer = _res->fileData(filename.c_str(), nullptr);
 }
 
 void KyraEngine_HoF::loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2) {
diff --git a/engines/kyra/text/text_mr.cpp b/engines/kyra/text/text_mr.cpp
index f3c5808f8a..3f1d16bc55 100644
--- a/engines/kyra/text/text_mr.cpp
+++ b/engines/kyra/text/text_mr.cpp
@@ -597,7 +597,7 @@ void KyraEngine_MR::albumChatWaitToFinish() {
 				frame = 13;
 
 			albumRestoreRect();
-			_album.wsa->displayFrame(frame, 2, -100, 90, 0x4000, 0, 0);
+			_album.wsa->displayFrame(frame, 2, -100, 90, 0x4000, nullptr, nullptr);
 			albumUpdateRect();
 
 			nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(4, 8) * _tickLength;


Commit: 4c473a5e4dc7333f0fe89100be29db0ac05c0a51
    https://github.com/scummvm/scummvm/commit/4c473a5e4dc7333f0fe89100be29db0ac05c0a51
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
LAB: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/lab/detection.cpp


diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index fe77b04844..98742a1c25 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -33,7 +33,7 @@
 
 static const PlainGameDescriptor lab_setting[] = {
 	{ "lab", "Labyrinth of Time" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const ADGameDescription labDescriptions[] = {
@@ -64,7 +64,7 @@ static const ADGameDescription labDescriptions[] = {
 			{ "doors",   0, "d77536010e7e5ae17ee066323ceb9585", 2537 }, // game/doors
 			{ "noteold.fon", 0, "6c1d90ad55149556e79d3f7bfddb4bd7", 9252 }, // game/spict/noteold.fon
 			{ "wyrmkeep",0, "97c7064c54c28b952d37c4ebff6efa50", 52286 }, // game/spict/intro
-			{ NULL, 0, NULL, 0 }
+			{ nullptr, 0, nullptr, 0 }
 		},
 		Common::EN_ANY,
 		Common::kPlatformWindows,
@@ -90,7 +90,7 @@ static const char *const directoryGlobs[] = {
 		"rooms",
 		"h2",
 		"intro",
-		0
+		nullptr
 };
 
 


Commit: f8881f661bf3a36d27d0597d4a27bab2c3ea31ed
    https://github.com/scummvm/scummvm/commit/f8881f661bf3a36d27d0597d4a27bab2c3ea31ed
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
LASTEXPRESS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/lastexpress/data/animation.cpp
    engines/lastexpress/data/archive.cpp
    engines/lastexpress/data/background.cpp
    engines/lastexpress/data/cursor.cpp
    engines/lastexpress/data/font.cpp
    engines/lastexpress/data/scene.cpp
    engines/lastexpress/data/sequence.cpp
    engines/lastexpress/data/snd.cpp
    engines/lastexpress/data/subtitle.cpp
    engines/lastexpress/debug.cpp
    engines/lastexpress/detection.cpp
    engines/lastexpress/entities/entity.cpp
    engines/lastexpress/entities/waiter2.cpp
    engines/lastexpress/fight/fight.cpp
    engines/lastexpress/fight/fighter.cpp
    engines/lastexpress/game/action.cpp
    engines/lastexpress/game/beetle.cpp
    engines/lastexpress/game/entities.cpp
    engines/lastexpress/game/inventory.cpp
    engines/lastexpress/game/logic.cpp
    engines/lastexpress/game/savegame.cpp
    engines/lastexpress/game/savepoint.cpp
    engines/lastexpress/game/scenes.cpp
    engines/lastexpress/game/state.cpp
    engines/lastexpress/lastexpress.cpp
    engines/lastexpress/menu/clock.cpp
    engines/lastexpress/menu/menu.cpp
    engines/lastexpress/menu/trainline.cpp
    engines/lastexpress/resource.cpp
    engines/lastexpress/sound/entry.cpp
    engines/lastexpress/sound/queue.cpp
    engines/lastexpress/sound/sound.cpp


diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp
index 148854e04d..dda3f661e8 100644
--- a/engines/lastexpress/data/animation.cpp
+++ b/engines/lastexpress/data/animation.cpp
@@ -39,7 +39,7 @@
 
 namespace LastExpress {
 
-Animation::Animation() : _stream(NULL), _currentChunk(NULL), _overlay(NULL), _background1(NULL), _background2(NULL), _backgroundCurrent(0), _audio(NULL), _startTime(0), _changed(false) {
+Animation::Animation() : _stream(nullptr), _currentChunk(nullptr), _overlay(nullptr), _background1(nullptr), _background2(nullptr), _backgroundCurrent(0), _audio(nullptr), _startTime(0), _changed(false) {
 }
 
 Animation::~Animation() {
@@ -55,7 +55,7 @@ void Animation::reset() {
 	_backgroundCurrent = 0;
 	_chunks.clear();
 
-	_currentChunk = NULL;
+	_currentChunk = nullptr;
 
 	SAFE_DELETE(_stream);
 }
@@ -101,7 +101,7 @@ bool Animation::process() {
 	if (!_currentChunk)
 		error("[Animation::process] Current chunk iterator is invalid");
 
-	if (_stream == NULL || _chunks.size() == 0)
+	if (_stream == nullptr || _chunks.size() == 0)
 		error("[Animation::process] Trying to show an animation before loading data");
 
 	// TODO: - subtract the time paused by the GUI
@@ -111,7 +111,7 @@ bool Animation::process() {
 	int32 currentFrame = (g_system->getMillis() - _startTime) * 3 / 100;
 
 	// Process all chunks until the current frame
-	while (!_changed && _currentChunk != NULL && currentFrame > _currentChunk->frame && !hasEnded()) {
+	while (!_changed && _currentChunk != nullptr && currentFrame > _currentChunk->frame && !hasEnded()) {
 		switch(_currentChunk->type) {
 		//TODO: some info chunks are probably subtitle/sync related
 		case kChunkTypeUnknown1:
diff --git a/engines/lastexpress/data/archive.cpp b/engines/lastexpress/data/archive.cpp
index bf143afce4..b59b5b001c 100644
--- a/engines/lastexpress/data/archive.cpp
+++ b/engines/lastexpress/data/archive.cpp
@@ -102,12 +102,12 @@ Common::SeekableReadStream *HPFArchive::createReadStreamForMember(const Common::
 	Common::String name = path.toString();
 	FileMap::const_iterator fDesc = _files.find(name);
 	if (fDesc == _files.end())
-		return NULL;
+		return nullptr;
 
 	Common::File *archive = new Common::File();
 	if (!archive->open(_filename)) {
 		delete archive;
-		return NULL;
+		return nullptr;
 	}
 
 	return new Common::SeekableSubReadStream(archive, fDesc->_value.offset * _archiveSectorSize, fDesc->_value.offset * _archiveSectorSize + fDesc->_value.size * _archiveSectorSize, DisposeAfterUse::YES);
diff --git a/engines/lastexpress/data/background.cpp b/engines/lastexpress/data/background.cpp
index 88538afe4a..e43de2ef99 100644
--- a/engines/lastexpress/data/background.cpp
+++ b/engines/lastexpress/data/background.cpp
@@ -33,7 +33,7 @@
 
 namespace LastExpress {
 
-Background::Background() : _data(NULL) {
+Background::Background() : _data(nullptr) {
 	memset(&_header, 0, sizeof(BackgroundHeader));
 }
 
@@ -104,7 +104,7 @@ byte *Background::decodeComponent(Common::SeekableReadStream *in, uint32 inSize,
 	// Create the destination array
 	byte *out = new byte[outSize]();
 	if (!out)
-		return NULL;
+		return nullptr;
 
 	// Initialize the decoding
 	uint32 inPos = 0;
diff --git a/engines/lastexpress/data/cursor.cpp b/engines/lastexpress/data/cursor.cpp
index 0a2e853258..75b59b720f 100644
--- a/engines/lastexpress/data/cursor.cpp
+++ b/engines/lastexpress/data/cursor.cpp
@@ -98,7 +98,7 @@ void Cursor::setStyle(CursorStyle style) {
 
 const uint16 *Cursor::getCursorImage(CursorStyle style) const {
 	if (!checkStyle(style))
-		return NULL;
+		return nullptr;
 
 	return _cursors[style].image;
 }
diff --git a/engines/lastexpress/data/font.cpp b/engines/lastexpress/data/font.cpp
index fb1b26582e..93edac6dac 100644
--- a/engines/lastexpress/data/font.cpp
+++ b/engines/lastexpress/data/font.cpp
@@ -29,7 +29,7 @@
 
 namespace LastExpress {
 
-Font::Font() : _numGlyphs(0), _glyphs(NULL), _glyphWidths(0) {
+Font::Font() : _numGlyphs(0), _glyphs(nullptr), _glyphWidths(nullptr) {
 	memset(&_palette, 0, sizeof(_palette));
 	memset(&_charMap, 0, sizeof(_charMap));
 }
diff --git a/engines/lastexpress/data/scene.cpp b/engines/lastexpress/data/scene.cpp
index 4e20e219d5..4e4fc5f7be 100644
--- a/engines/lastexpress/data/scene.cpp
+++ b/engines/lastexpress/data/scene.cpp
@@ -232,7 +232,7 @@ Common::String Scene::toString() {
 
 //////////////////////////////////////////////////////////////////////////
 // SceneLoader
-SceneLoader::SceneLoader() : _stream(NULL) {}
+SceneLoader::SceneLoader() : _stream(nullptr) {}
 
 SceneLoader::~SceneLoader() {
 	clear();
@@ -285,10 +285,10 @@ bool SceneLoader::load(Common::SeekableReadStream *stream) {
 
 Scene *SceneLoader::get(SceneIndex index) {
 	if (_scenes.empty())
-		return NULL;
+		return nullptr;
 
 	if (index > _scenes.size())
-		return NULL;
+		return nullptr;
 
 	// Load the hotspots if needed
 	_scenes[(uint)index]->loadHotspots(_stream);
diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp
index f43e2afdef..85e23d3176 100644
--- a/engines/lastexpress/data/sequence.cpp
+++ b/engines/lastexpress/data/sequence.cpp
@@ -76,7 +76,7 @@ void FrameInfo::read(Common::SeekableReadStream *in, bool isSequence) {
 
 // AnimFrame
 
-AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f, bool /* ignoreSubtype */) : _palette(NULL) {
+AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f, bool /* ignoreSubtype */) : _palette(nullptr) {
 	_palSize = 1;
 	// TODO: use just the needed rectangle
 	_image.create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
@@ -340,7 +340,7 @@ Sequence::~Sequence() {
 void Sequence::reset() {
 	_frames.clear();
 	delete _stream;
-	_stream = NULL;
+	_stream = nullptr;
 }
 
 Sequence *Sequence::load(Common::String name, Common::SeekableReadStream *stream, byte field30) {
@@ -348,7 +348,7 @@ Sequence *Sequence::load(Common::String name, Common::SeekableReadStream *stream
 
 	if (!sequence->load(stream, field30)) {
 		delete sequence;
-		return NULL;
+		return nullptr;
 	}
 
 	return sequence;
@@ -409,11 +409,11 @@ AnimFrame *Sequence::getFrame(uint16 index) {
 	FrameInfo *frame = getFrameInfo(index);
 
 	if (!frame)
-		return NULL;
+		return nullptr;
 
 	// Skip "invalid" frames
 	if (frame->compressionType == 0)
-		return NULL;
+		return nullptr;
 
 	debugC(9, kLastExpressDebugGraphics, "Decoding sequence %s: frame %d / %d", _name.c_str(), index, _frames.size() - 1);
 
@@ -427,7 +427,7 @@ SequenceFrame::~SequenceFrame() {
 		delete _sequence;
 	}
 
-	_sequence = NULL;
+	_sequence = nullptr;
 }
 
 Common::Rect SequenceFrame::draw(Graphics::Surface *surface) {
diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp
index 43865c3cdb..66cf577faf 100644
--- a/engines/lastexpress/data/snd.cpp
+++ b/engines/lastexpress/data/snd.cpp
@@ -489,12 +489,12 @@ uint32 SimpleSound::getTimeMS() {
 //////////////////////////////////////////////////////////////////////////
 // StreamedSound
 //////////////////////////////////////////////////////////////////////////
-StreamedSound::StreamedSound() : _as(NULL), _loaded(false) {}
+StreamedSound::StreamedSound() : _as(nullptr), _loaded(false) {}
 
 StreamedSound::~StreamedSound() {
 	stop(); // should execute before disposal of _as, so don't move in ~SimpleSound
 	delete _as;
-	_as = NULL;
+	_as = nullptr;
 }
 
 bool StreamedSound::load(Common::SeekableReadStream *stream, uint32 volume, bool looped, uint32 startBlock) {
@@ -563,7 +563,7 @@ AppendableSound::~AppendableSound() {
 	finish();
 	stop();
 
-	_as = NULL;
+	_as = nullptr;
 }
 
 void AppendableSound::queueBuffer(const byte *data, uint32 size) {
diff --git a/engines/lastexpress/data/subtitle.cpp b/engines/lastexpress/data/subtitle.cpp
index 3e0da8cb55..da618c9b54 100644
--- a/engines/lastexpress/data/subtitle.cpp
+++ b/engines/lastexpress/data/subtitle.cpp
@@ -40,8 +40,8 @@ namespace LastExpress {
 //////////////////////////////////////////////////////////////////////////
 class Subtitle {
 public:
-	Subtitle() : _timeStart(0), _timeStop(0), _topLength(0), _topText(NULL),
-		_bottomLength(0), _bottomText(NULL) {}
+	Subtitle() : _timeStart(0), _timeStop(0), _topLength(0), _topText(nullptr),
+		_bottomLength(0), _bottomText(nullptr) {}
 	~Subtitle() { reset(); }
 
 	bool load(Common::SeekableReadStream *in);
@@ -66,8 +66,8 @@ private:
 void Subtitle::reset() {
 	delete[] _topText;
 	delete[] _bottomText;
-	_topText = NULL;
-	_bottomText = NULL;
+	_topText = nullptr;
+	_bottomText = nullptr;
 }
 
 template<typename T>
@@ -76,7 +76,7 @@ T *newArray(size_t n) {
 		return new T[n];
 
 	// n is too large
-	return NULL;
+	return nullptr;
 }
 
 bool Subtitle::load(Common::SeekableReadStream *in) {
@@ -146,7 +146,7 @@ SubtitleManager::~SubtitleManager() {
 	reset();
 
 	// Zero passed pointers
-	_font = NULL;
+	_font = nullptr;
 }
 
 void SubtitleManager::reset() {
diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp
index 97bd4aa45e..fdcd337374 100644
--- a/engines/lastexpress/debug.cpp
+++ b/engines/lastexpress/debug.cpp
@@ -54,7 +54,7 @@
 
 namespace LastExpress {
 
-Debugger::Debugger(LastExpressEngine *engine) : _engine(engine), _command(NULL), _numParams(0), _commandParams(NULL) {
+Debugger::Debugger(LastExpressEngine *engine) : _engine(engine), _command(nullptr), _numParams(0), _commandParams(nullptr) {
 
 	//////////////////////////////////////////////////////////////////////////
 	// Register the debugger commands
@@ -97,11 +97,11 @@ Debugger::~Debugger() {
 	SAFE_DELETE(_soundStream);
 	resetCommand();
 
-	_command = NULL;
-	_commandParams = NULL;
+	_command = nullptr;
+	_commandParams = nullptr;
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -119,12 +119,12 @@ void Debugger::resetCommand() {
 			free(_commandParams[i]);
 
 	free(_commandParams);
-	_commandParams = NULL;
+	_commandParams = nullptr;
 	_numParams = 0;
 }
 
 int Debugger::getNumber(const char *arg) const {
-	return strtol(arg, (char **)NULL, 0);
+	return strtol(arg, (char **)nullptr, 0);
 }
 
 void Debugger::copyCommand(int argc, const char **argv) {
@@ -136,7 +136,7 @@ void Debugger::copyCommand(int argc, const char **argv) {
 
 	for (int i = 0; i < _numParams; i++) {
 		_commandParams[i] = (char *)malloc(strlen(argv[i]) + 1);
-		if (_commandParams[i] == NULL)
+		if (_commandParams[i] == nullptr)
 			error("[Debugger::copyCommand] Cannot allocate memory for command parameters");
 
 		memset(_commandParams[i], 0, strlen(argv[i]) + 1);
@@ -144,7 +144,7 @@ void Debugger::copyCommand(int argc, const char **argv) {
 	}
 
 	// Exit the debugger!
-	cmdExit(0, 0);
+	cmdExit(0, nullptr);
 }
 
 void Debugger::callCommand() {
@@ -343,7 +343,7 @@ bool Debugger::cmdShowFrame(int argc, const char **argv) {
 			_command = WRAP_METHOD(Debugger, cmdShowFrame);
 			copyCommand(argc, argv);
 
-			return cmdExit(0, 0);
+			return cmdExit(0, nullptr);
 		} else {
 			Sequence sequence(filename);
 			if (sequence.load(getArchive(filename))) {
@@ -405,7 +405,7 @@ bool Debugger::cmdShowBg(int argc, const char **argv) {
 			_command = WRAP_METHOD(Debugger, cmdShowBg);
 			copyCommand(argc, argv);
 
-			return cmdExit(0, 0);
+			return cmdExit(0, nullptr);
 		} else {
 			clearBg(GraphicsManager::kBackgroundC);
 
@@ -460,7 +460,7 @@ bool Debugger::cmdPlaySeq(int argc, const char **argv) {
 			_command = WRAP_METHOD(Debugger, cmdPlaySeq);
 			copyCommand(argc, argv);
 
-			return cmdExit(0, 0);
+			return cmdExit(0, nullptr);
 		} else {
 			Sequence *sequence = new Sequence(filename);
 			if (sequence->load(getArchive(filename))) {
@@ -577,7 +577,7 @@ bool Debugger::cmdPlaySbe(int argc, const char **argv) {
 			_command = WRAP_METHOD(Debugger, cmdPlaySbe);
 			copyCommand(argc, argv);
 
-			return cmdExit(0, 0);
+			return cmdExit(0, nullptr);
 		} else {
 			SubtitleManager subtitle(_engine->getFont());
 			if (subtitle.load(getArchive(filename))) {
@@ -643,7 +643,7 @@ bool Debugger::cmdPlayNis(int argc, const char **argv) {
 			_command = WRAP_METHOD(Debugger, cmdPlayNis);
 			copyCommand(argc, argv);
 
-			return cmdExit(0, 0);
+			return cmdExit(0, nullptr);
 		} else {
 			// Make sure we are not called in a loop
 			_numParams = 0;
@@ -700,7 +700,7 @@ bool Debugger::cmdLoadScene(int argc, const char **argv) {
 			_command = WRAP_METHOD(Debugger, cmdLoadScene);
 			copyCommand(argc, argv);
 
-			return cmdExit(0, 0);
+			return cmdExit(0, nullptr);
 		} else {
 
 			clearBg(GraphicsManager::kBackgroundAll);
@@ -881,7 +881,7 @@ bool Debugger::cmdBeetle(int argc, const char **argv) {
 			redrawScreen();
 
 			// Load the beetle game
-			Action *action = NULL;
+			Action *action = nullptr;
 			Beetle *beetle = new Beetle(_engine);
 			if (!beetle->isLoaded())
 				beetle->load();
@@ -912,7 +912,7 @@ bool Debugger::cmdBeetle(int argc, const char **argv) {
 					case Common::EVENT_MOUSEMOVE: {
 						// Update cursor
 						CursorStyle style = kCursorNormal;
-						SceneHotspot *hotspot = NULL;
+						SceneHotspot *hotspot = nullptr;
 						if (scene->checkHotSpot(ev.mouse, &hotspot)) {
 							if (!action)
 								action = new Action(_engine);
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index 694334e092..0aa3d9d25d 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -28,7 +28,7 @@ namespace LastExpress {
 static const PlainGameDescriptor lastExpressGames[] = {
 	// Games
 	{"lastexpress", "The Last Express"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
@@ -219,7 +219,7 @@ static const ADGameDescription gameDescriptions[] = {
 
 static const char *const directoryGlobs[] = {
 		"data", // GOG release
-		0
+		nullptr
 };
 
 class LastExpressMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp
index 447b556843..cf5141d298 100644
--- a/engines/lastexpress/entities/entity.cpp
+++ b/engines/lastexpress/entities/entity.cpp
@@ -172,7 +172,7 @@ void EntityData::saveLoadWithSerializer(Common::Serializer &s, const Common::Arr
 				(*paramsTypeSetters)[_data.callbacks[i]](&_parameters[i]);
 		}
 		Common::MemoryReadStream paramsStream(buf, sizeof(buf));
-		Common::Serializer paramsSerializer(&paramsStream, NULL);
+		Common::Serializer paramsSerializer(&paramsStream, nullptr);
 		for (uint i = 0; i < ARRAYSIZE(_parameters); i++)
 			_parameters[i].saveLoadWithSerializer(paramsSerializer);
 	}
@@ -198,7 +198,7 @@ Entity::~Entity() {
 	SAFE_DELETE(_data);
 
 	// Zero-out passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 void Entity::setup(ChapterIndex index) {
diff --git a/engines/lastexpress/entities/waiter2.cpp b/engines/lastexpress/entities/waiter2.cpp
index f009551498..159beea934 100644
--- a/engines/lastexpress/entities/waiter2.cpp
+++ b/engines/lastexpress/entities/waiter2.cpp
@@ -705,7 +705,7 @@ void Waiter2::serveTable(const SavePoint &savepoint, const char *seq1, EntityInd
 			getEntities()->clearSequences(kEntityWaiter2);
 			*parameter = 0;
 
-			if (parameter2 != NULL)
+			if (parameter2 != nullptr)
 				*parameter2 = 0;
 
 			callbackAction();
diff --git a/engines/lastexpress/fight/fight.cpp b/engines/lastexpress/fight/fight.cpp
index 7f7a06fdc6..8aeced1ee0 100644
--- a/engines/lastexpress/fight/fight.cpp
+++ b/engines/lastexpress/fight/fight.cpp
@@ -47,8 +47,8 @@
 namespace LastExpress {
 
 Fight::FightData::FightData() {
-	player = NULL;
-	opponent = NULL;
+	player = nullptr;
+	opponent = nullptr;
 
 	index = 0;
 
@@ -62,15 +62,15 @@ Fight::FightData::~FightData() {
 	SAFE_DELETE(opponent);
 }
 
-Fight::Fight(LastExpressEngine *engine) : _engine(engine), _data(NULL), _endType(kFightEndLost), _state(0), _handleTimer(false) {
+Fight::Fight(LastExpressEngine *engine) : _engine(engine), _data(nullptr), _endType(kFightEndLost), _state(0), _handleTimer(false) {
 }
 
 Fight::~Fight() {
 	clearData();
-	_data = NULL;
+	_data = nullptr;
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -108,7 +108,7 @@ void Fight::eventMouse(const Common::Event &ev) {
 
 		// Check hotspots
 		Scene *scene = getScenes()->get(getState()->scene);
-		SceneHotspot *hotspot = NULL;
+		SceneHotspot *hotspot = nullptr;
 
 		if (!scene->checkHotSpot(ev.mouse, &hotspot)) {
 			_engine->getCursor()->setStyle(kCursorNormal);
@@ -170,7 +170,7 @@ void Fight::handleTick(const Common::Event &ev, bool isProcessing) {
 	if (!_data || _data->index)
 		return;
 
-	SceneHotspot *hotspot = NULL;
+	SceneHotspot *hotspot = nullptr;
 	if (!getScenes()->get(getState()->scene)->checkHotSpot(ev.mouse, &hotspot) || !_data->player->canInteract((Fighter::FightAction)hotspot->action)) {
 		_engine->getCursor()->setStyle(kCursorNormal);
 	} else {
diff --git a/engines/lastexpress/fight/fighter.cpp b/engines/lastexpress/fight/fighter.cpp
index 6fd2a6421c..ff2e6ffc09 100644
--- a/engines/lastexpress/fight/fighter.cpp
+++ b/engines/lastexpress/fight/fighter.cpp
@@ -34,12 +34,12 @@
 namespace LastExpress {
 
 Fighter::Fighter(LastExpressEngine *engine) : _engine(engine) {
-	_opponent = NULL;
-	_fight = NULL;
+	_opponent = nullptr;
+	_fight = nullptr;
 
 	_sequenceIndex = 0;
-	_sequence = NULL;
-	_frame = NULL;
+	_sequence = nullptr;
+	_frame = nullptr;
 	_frameIndex = 0;
 
 	_field_24 = 0;
@@ -62,11 +62,11 @@ Fighter::~Fighter() {
 		SAFE_DELETE(_sequences[i]);
 
 	// Zero-out passed pointers
-	_sequence = NULL;
-	_opponent = NULL;
-	_fight = NULL;
+	_sequence = nullptr;
+	_opponent = nullptr;
+	_fight = nullptr;
 
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp
index 4e20e99586..64e2aaffa1 100644
--- a/engines/lastexpress/game/action.cpp
+++ b/engines/lastexpress/game/action.cpp
@@ -336,7 +336,7 @@ public:
 
 	Functor1MemConst(T *t, const FuncType &func) : _t(t), _func(func) {}
 
-	bool isValid() const override { return _func != 0 && _t != 0; }
+	bool isValid() const override { return _func != nullptr && _t != nullptr; }
 	Res operator()(Arg v1) const override {
 		return (_t->*_func)(v1);
 	}
@@ -400,7 +400,7 @@ Action::~Action() {
 	_actions.clear();
 
 	// Zero-out passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/game/beetle.cpp b/engines/lastexpress/game/beetle.cpp
index a92d252f0a..16fece1f50 100644
--- a/engines/lastexpress/game/beetle.cpp
+++ b/engines/lastexpress/game/beetle.cpp
@@ -32,13 +32,13 @@
 
 namespace LastExpress {
 
-Beetle::Beetle(LastExpressEngine *engine) : _engine(engine), _data(NULL) {}
+Beetle::Beetle(LastExpressEngine *engine) : _engine(engine), _data(nullptr) {}
 
 Beetle::~Beetle() {
 	SAFE_DELETE(_data);
 
 	// Free passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 void Beetle::load() {
@@ -104,9 +104,9 @@ void Beetle::load() {
 	_data->field_D9 = 10;
 	_data->coordOffset = 5;
 	_data->coordY = 178;
-	_data->currentSequence = 0;
+	_data->currentSequence = nullptr;
 	_data->offset = 0;
-	_data->frame = NULL;
+	_data->frame = nullptr;
 	_data->field_D5 = 0;
 	_data->indexes[0] = 29;
 	_data->field_DD = 0;
@@ -195,7 +195,7 @@ void Beetle::drawUpdate() {
 	if (!_data)
 		error("[Beetle::drawUpdate] Sequences have not been loaded");
 
-	if (_data->frame != NULL) {
+	if (_data->frame != nullptr) {
 		getScenes()->setCoordinates(_data->frame);
 		getScenes()->removeFromQueue(_data->frame);
 	}
@@ -243,7 +243,7 @@ void Beetle::drawUpdate() {
 		_data->currentFrame = 0;
 		if (_data->indexes[_data->offset] == 29) {
 			SAFE_DELETE(_data->frame);
-			_data->currentSequence = NULL; // pointer to existing sequence
+			_data->currentSequence = nullptr; // pointer to existing sequence
 			return;
 		}
 	}
diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp
index 165319b782..4b5d5d4526 100644
--- a/engines/lastexpress/game/entities.cpp
+++ b/engines/lastexpress/game/entities.cpp
@@ -187,7 +187,7 @@ Entities::~Entities() {
 	_entities.clear();
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -241,7 +241,7 @@ int Entities::getCompartments1(int index) const {
 // Savegame
 //////////////////////////////////////////////////////////////////////////
 void Entities::saveLoadWithSerializer(Common::Serializer &s) {
-	_header->saveLoadWithSerializer(s, NULL);
+	_header->saveLoadWithSerializer(s, nullptr);
 	for (uint i = 1; i < _entities.size(); i++)
 		_entities[i]->saveLoadWithSerializer(s);
 }
@@ -432,8 +432,8 @@ void Entities::updateFields() const {
 }
 
 void Entities::updateFrame(EntityIndex entityIndex) const {
-	Sequence *sequence = NULL;
-	int16 *currentFrame = NULL;
+	Sequence *sequence = nullptr;
+	int16 *currentFrame = nullptr;
 	bool found = false;
 
 	if (getData(entityIndex)->direction == kDirectionSwitch) {
@@ -518,7 +518,7 @@ void Entities::updateSequences() const {
 				data->sequence = data->sequence2;
 				data->sequenceName = data->sequenceName2;
 
-				data->sequence2 = NULL;
+				data->sequence2 = nullptr;
 				data->sequenceName2 = "";
 			}
 
@@ -1263,7 +1263,7 @@ void Entities::copySequenceData(EntityIndex entityIndex) const {
 		data->direction = data->directionSwitch;
 
 	// Clear sequence 3
-	data->sequence2 = NULL;
+	data->sequence2 = nullptr;
 	data->sequenceName2 = "";
 	data->field_4AA = false;
 	data->directionSwitch = kDirectionNone;
@@ -1430,7 +1430,7 @@ void Entities::drawSequences(EntityIndex entityIndex, EntityDirection direction,
 		} else {
 			data->sequence = data->sequence2;
 			data->sequenceName = data->sequenceName2;
-			data->sequence2 = NULL;
+			data->sequence2 = nullptr;
 		}
 
 		data->sequenceName2 = "";
diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp
index f25463492b..e37e9131ac 100644
--- a/engines/lastexpress/game/inventory.cpp
+++ b/engines/lastexpress/game/inventory.cpp
@@ -44,7 +44,7 @@ namespace LastExpress {
 
 Inventory::Inventory(LastExpressEngine *engine) : _engine(engine), _selectedItem(kItemNone), _highlightedItemIndex(0), _itemsShown(0),
 	_showingHourGlass(false), _blinkingDirection(1), _blinkingBrightness(0),
-	_useMagnifier(false), _portraitHighlighted(false), _isOpened(false), _eggHightlighted(false), _itemScene(NULL) {
+	_useMagnifier(false), _portraitHighlighted(false), _isOpened(false), _eggHightlighted(false), _itemScene(nullptr) {
 
 	//_inventoryRect = Common::Rect(0, 0, 32, 32);
 	_menuEggRect = Common::Rect(608, 448, 640, 480);
@@ -56,10 +56,10 @@ Inventory::Inventory(LastExpressEngine *engine) : _engine(engine), _selectedItem
 }
 
 Inventory::~Inventory() {
-	_itemScene = NULL;
+	_itemScene = nullptr;
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp
index 9aad0308eb..d365cb9675 100644
--- a/engines/lastexpress/game/logic.cpp
+++ b/engines/lastexpress/game/logic.cpp
@@ -79,7 +79,7 @@ Logic::~Logic() {
 	SAFE_DELETE(_state);
 
 	// Zero-out passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -236,7 +236,7 @@ void Logic::eventMouse(const Common::Event &ev) {
 
 	// Check hotspots
 	int location = 0;
-	SceneHotspot *hotspot = NULL;
+	SceneHotspot *hotspot = nullptr;
 	Scene *scene = getScenes()->get(getState()->scene);
 
 	for (Common::Array<SceneHotspot *>::iterator it = scene->getHotspots()->begin(); it != scene->getHotspots()->end(); ++it) {
@@ -551,7 +551,7 @@ void Logic::updateCursor(bool) const { /* the cursor is always updated, even whe
 			 && !getInventory()->isEggHighlighted()
 			 && !getInventory()->isMagnifierInUse()) {
 				int location = 0;
-				SceneHotspot *hotspot = NULL;
+				SceneHotspot *hotspot = nullptr;
 				Scene *scene = getScenes()->get(getState()->scene);
 
 				// Check all hotspots
diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp
index 8617ef1f19..477c8f3906 100644
--- a/engines/lastexpress/game/savegame.cpp
+++ b/engines/lastexpress/game/savegame.cpp
@@ -346,15 +346,15 @@ uint32 SavegameStream::readCompressed(void *dataPtr, uint32 dataSize) {
 // Constructors
 //////////////////////////////////////////////////////////////////////////
 
-SaveLoad::SaveLoad(LastExpressEngine *engine) : _engine(engine), _savegame(NULL), _gameTicksLastSavegame(0), _entity(kEntityPlayer) {
+SaveLoad::SaveLoad(LastExpressEngine *engine) : _engine(engine), _savegame(nullptr), _gameTicksLastSavegame(0), _entity(kEntityPlayer) {
 }
 
 SaveLoad::~SaveLoad() {
 	clear(true);
-	_savegame = NULL;
+	_savegame = nullptr;
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 void SaveLoad::initStream() {
@@ -382,7 +382,7 @@ void SaveLoad::flushStream(GameId id) {
 void SaveLoad::create(GameId id) {
 	initStream();
 
-	Common::Serializer ser(NULL, _savegame);
+	Common::Serializer ser(nullptr, _savegame);
 	SavegameMainHeader header;
 	header.saveLoadWithSerializer(ser);
 
@@ -396,7 +396,7 @@ uint32 SaveLoad::init(GameId id, bool resetHeaders) {
 	loadStream(id);
 
 	// Get the main header
-	Common::Serializer ser(_savegame, NULL);
+	Common::Serializer ser(_savegame, nullptr);
 	SavegameMainHeader mainHeader;
 	mainHeader.saveLoadWithSerializer(ser);
 	if (!mainHeader.isValid())
@@ -530,7 +530,7 @@ void SaveLoad::loadGame(uint32 index) {
 	header.brightness = getState()->brightness;
 	header.volume = getState()->volume;
 
-	Common::Serializer ser(NULL, _savegame);
+	Common::Serializer ser(nullptr, _savegame);
 	header.saveLoadWithSerializer(ser);
 
 	// TODO
@@ -564,7 +564,7 @@ void SaveLoad::saveGame(SavegameType type, EntityIndex entity, uint32 value) {
 
 		// Load entry header
 		SavegameEntryHeader entry;
-		Common::Serializer ser(_savegame, NULL);
+		Common::Serializer ser(_savegame, nullptr);
 		entry.saveLoadWithSerializer(ser);
 
 		if (!entry.isValid()) {
@@ -610,7 +610,7 @@ void SaveLoad::saveGame(SavegameType type, EntityIndex entity, uint32 value) {
 
 	// Write the main header
 	_savegame->seek(0);
-	Common::Serializer ser(NULL, _savegame);
+	Common::Serializer ser(nullptr, _savegame);
 	header.saveLoadWithSerializer(ser);
 
 	flushStream(getMenu()->getGameId());
@@ -636,7 +636,7 @@ bool SaveLoad::loadMainHeader(Common::InSaveFile *stream, SavegameMainHeader *he
 	// Rewind stream
 	stream->seek(0);
 
-	Common::Serializer ser(stream, NULL);
+	Common::Serializer ser(stream, nullptr);
 	header->saveLoadWithSerializer(ser);
 
 	// Validate the header
@@ -711,7 +711,7 @@ void SaveLoad::writeEntry(SavegameType type, EntityIndex entity, uint32 value) {
 	uint32 originalPosition = (uint32)_savegame->pos();
 
 	// Write header
-	Common::Serializer ser(NULL, _savegame);
+	Common::Serializer ser(nullptr, _savegame);
 	header.saveLoadWithSerializer(ser);
 
 	// Write game data
@@ -764,7 +764,7 @@ void SaveLoad::readEntry(SavegameType *type, EntityIndex *entity, uint32 *val, b
 
 	// Load entry header
 	SavegameEntryHeader entry;
-	Common::Serializer ser(_savegame, NULL);
+	Common::Serializer ser(_savegame, nullptr);
 	entry.saveLoadWithSerializer(ser);
 
 	if (!entry.isValid())
diff --git a/engines/lastexpress/game/savepoint.cpp b/engines/lastexpress/game/savepoint.cpp
index bd134c637c..4309846fe2 100644
--- a/engines/lastexpress/game/savepoint.cpp
+++ b/engines/lastexpress/game/savepoint.cpp
@@ -32,12 +32,12 @@ namespace LastExpress {
 
 SavePoints::SavePoints(LastExpressEngine *engine) : _engine(engine) {
 	for (int i = 0; i < 40; i++)
-		_callbacks[i] = NULL;
+		_callbacks[i] = nullptr;
 }
 
 SavePoints::~SavePoints() {
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -150,7 +150,7 @@ void SavePoints::call(EntityIndex entity2, EntityIndex entity1, ActionIndex acti
 	point.param.intValue = param;
 
 	Callback *callback = getCallback(entity1);
-	if (callback != NULL && callback->isValid()) {
+	if (callback != nullptr && callback->isValid()) {
 		debugC(8, kLastExpressDebugLogic, "Savepoint: entity1=%s, action=%s, entity2=%s, param=%d", ENTITY_NAME(entity1), ACTION_NAME(action), ENTITY_NAME(entity2), param);
 		(*callback)(point);
 	}
@@ -166,7 +166,7 @@ void SavePoints::call(EntityIndex entity2, EntityIndex entity1, ActionIndex acti
 	strncpy((char *)&point.param.charValue, param.c_str(), 6);
 
 	Callback *callback = getCallback(entity1);
-	if (callback != NULL && callback->isValid()) {
+	if (callback != nullptr && callback->isValid()) {
 		debugC(8, kLastExpressDebugLogic, "Savepoint: entity1=%s, action=%s, entity2=%s, param=%s", ENTITY_NAME(entity1), ACTION_NAME(action), ENTITY_NAME(entity2), param.c_str());
 		(*callback)(point);
 	}
@@ -183,7 +183,7 @@ void SavePoints::callAndProcess() {
 	while (isRunning) {
 
 		Callback *callback = getCallback(index);
-		if (callback != NULL && callback->isValid()) {
+		if (callback != nullptr && callback->isValid()) {
 			(*callback)(savepoint);
 			isRunning = getFlags()->isGameRunning;
 		}
diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp
index b68e5b0089..0db18f6a29 100644
--- a/engines/lastexpress/game/scenes.cpp
+++ b/engines/lastexpress/game/scenes.cpp
@@ -41,7 +41,7 @@ namespace LastExpress {
 
 SceneManager::SceneManager(LastExpressEngine *engine) : _engine(engine),
 	_flagNoEntity(false), _flagDrawEntities(false), _flagDrawSequences(false), _flagCoordinates(false),
-	_coords(0, 0, 480, 640), _clockHours(NULL), _clockMinutes(NULL) {
+	_coords(0, 0, 480, 640), _clockHours(nullptr), _clockMinutes(nullptr) {
 	_sceneLoader = new SceneLoader();
 }
 
@@ -61,7 +61,7 @@ SceneManager::~SceneManager() {
 	SAFE_DELETE(_sceneLoader);
 
 	// Zero-out passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/game/state.cpp b/engines/lastexpress/game/state.cpp
index e47eda5ebd..836794acf4 100644
--- a/engines/lastexpress/game/state.cpp
+++ b/engines/lastexpress/game/state.cpp
@@ -46,7 +46,7 @@ State::~State() {
 	SAFE_DELETE(_flags);
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 void State::reset() {
@@ -68,7 +68,7 @@ bool State::isNightTime() const {
 }
 
 void State::getHourMinutes(uint32 time, uint8 *hours, uint8 *minutes) {
-	if (hours == NULL || minutes == NULL)
+	if (hours == nullptr || minutes == nullptr)
 		error("[State::getHourMinutes] Invalid parameters passed");
 
 	*hours = (uint8)((time % 1296000) / 54000);
diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp
index ac3f631b0a..6741681e92 100644
--- a/engines/lastexpress/lastexpress.cpp
+++ b/engines/lastexpress/lastexpress.cpp
@@ -54,13 +54,13 @@ namespace LastExpress {
 
 LastExpressEngine::LastExpressEngine(OSystem *syst, const ADGameDescription *gd) :
 	Engine(syst), _gameDescription(gd),
-	_debugger(NULL), _random("lastexpress"), _cursor(NULL),
-	_font(NULL), _logic(NULL), _menu(NULL),
+	_debugger(nullptr), _random("lastexpress"), _cursor(nullptr),
+	_font(nullptr), _logic(nullptr), _menu(nullptr),
 	_lastFrameCount(0),
-	_graphicsMan(NULL), _resMan(NULL),
-	_sceneMan(NULL), _soundMan(NULL),
-	_eventMouse(NULL), _eventTick(NULL),
-	_eventMouseBackup(NULL), _eventTickBackup(NULL)
+	_graphicsMan(nullptr), _resMan(nullptr),
+	_sceneMan(nullptr), _soundMan(nullptr),
+	_eventMouse(nullptr), _eventTick(nullptr),
+	_eventMouseBackup(nullptr), _eventTickBackup(nullptr)
 	{
 	// Setup mixer
 	Engine::syncSoundSettings();
@@ -89,7 +89,7 @@ LastExpressEngine::~LastExpressEngine() {
 	SAFE_DELETE(_eventTickBackup);
 
 	// Zero passed pointers
-	_gameDescription = NULL;
+	_gameDescription = nullptr;
 }
 
 // TODO: which error should we return when some game files are missing/corrupted?
@@ -262,7 +262,7 @@ bool LastExpressEngine::handleEvents() {
 /// Event Handling
 ///////////////////////////////////////////////////////////////////////////////////
 void LastExpressEngine::backupEventHandlers() {
-	if (_eventMouseBackup != NULL || _eventTickBackup != NULL)
+	if (_eventMouseBackup != nullptr || _eventTickBackup != nullptr)
 		error("[LastExpressEngine::backupEventHandlers] backup event handlers are already set");
 
 	_eventMouseBackup = _eventMouse;
@@ -270,7 +270,7 @@ void LastExpressEngine::backupEventHandlers() {
 }
 
 void LastExpressEngine::restoreEventHandlers() {
-	if (_eventMouseBackup == NULL || _eventTickBackup == NULL)
+	if (_eventMouseBackup == nullptr || _eventTickBackup == nullptr)
 		error("[LastExpressEngine::restoreEventHandlers] restore called before backing up the event handlers");
 
 	// Cleanup previous event handlers
@@ -280,8 +280,8 @@ void LastExpressEngine::restoreEventHandlers() {
 	_eventMouse = _eventMouseBackup;
 	_eventTick = _eventTickBackup;
 
-	_eventMouseBackup = NULL;
-	_eventTickBackup = NULL;
+	_eventMouseBackup = nullptr;
+	_eventTickBackup = nullptr;
 }
 
 void LastExpressEngine::setEventHandlers(EventHandler::EventFunction *mouse, EventHandler::EventFunction *tick) {
diff --git a/engines/lastexpress/menu/clock.cpp b/engines/lastexpress/menu/clock.cpp
index fadb578de6..d9c85a4d9c 100644
--- a/engines/lastexpress/menu/clock.cpp
+++ b/engines/lastexpress/menu/clock.cpp
@@ -33,7 +33,7 @@
 
 namespace LastExpress {
 
-Clock::Clock(LastExpressEngine *engine) : _engine(engine), _frameMinutes(NULL), _frameHour(NULL), _frameSun(NULL), _frameDate(NULL) {
+Clock::Clock(LastExpressEngine *engine) : _engine(engine), _frameMinutes(nullptr), _frameHour(nullptr), _frameSun(nullptr), _frameDate(nullptr) {
 	_frameMinutes = new SequenceFrame(loadSequence("eggmin.seq"), 0, true);
 	_frameHour = new SequenceFrame(loadSequence("egghour.seq"), 0, true);
 	_frameSun = new SequenceFrame(loadSequence("sun.seq"), 0, true);
@@ -47,7 +47,7 @@ Clock::~Clock() {
 	SAFE_DELETE(_frameDate);
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 void Clock::clear() {
diff --git a/engines/lastexpress/menu/menu.cpp b/engines/lastexpress/menu/menu.cpp
index 07fadc6817..aa57f2217e 100644
--- a/engines/lastexpress/menu/menu.cpp
+++ b/engines/lastexpress/menu/menu.cpp
@@ -142,10 +142,10 @@ static const struct {
 // Menu
 //////////////////////////////////////////////////////////////////////////
 Menu::Menu(LastExpressEngine *engine) : _engine(engine),
-	_seqTooltips(NULL), _seqEggButtons(NULL), _seqButtons(NULL), _seqAcorn(NULL), _seqCity1(NULL), _seqCity2(NULL), _seqCity3(NULL), _seqCredits(NULL),
+	_seqTooltips(nullptr), _seqEggButtons(nullptr), _seqButtons(nullptr), _seqAcorn(nullptr), _seqCity1(nullptr), _seqCity2(nullptr), _seqCity3(nullptr), _seqCredits(nullptr),
 	_gameId(kGameBlue), _hasShownStartScreen(false), _hasShownIntro(false),
 	_isShowingCredits(false), _isGameStarted(false), _isShowingMenu(false),
-	_creditsSequenceIndex(0), _checkHotspotsTicks(15),  _mouseFlags(Common::EVENT_INVALID), _lastHotspot(NULL),
+	_creditsSequenceIndex(0), _checkHotspotsTicks(15),  _mouseFlags(Common::EVENT_INVALID), _lastHotspot(nullptr),
 	_currentTime(kTimeNone), _lowerTime(kTimeNone), _time(kTimeNone), _currentIndex(0), _index(0), _lastIndex(0), _delta(0), _handleTimeDelta(false) {
 
 	_clock = new Clock(_engine);
@@ -165,7 +165,7 @@ Menu::~Menu() {
 	SAFE_DELETE(_seqCity3);
 	SAFE_DELETE(_seqCredits);
 
-	_lastHotspot = NULL;
+	_lastHotspot = nullptr;
 
 	// Cleanup frames
 	for (MenuFrames::iterator it = _frames.begin(); it != _frames.end(); it++)
@@ -174,7 +174,7 @@ Menu::~Menu() {
 	_frames.clear();
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -252,7 +252,7 @@ void Menu::eventMouse(const Common::Event &ev) {
 		}
 	} else {
 		// Check for hotspots
-		SceneHotspot *hotspot = NULL;
+		SceneHotspot *hotspot = nullptr;
 		getScenes()->get(getState()->scene)->checkHotSpot(ev.mouse, &hotspot);
 
 		if (_lastHotspot != hotspot || ev.type == Common::EVENT_LBUTTONUP) {
@@ -961,7 +961,7 @@ void Menu::checkHotspots() {
 	if (_isShowingCredits)
 		return;
 
-	SceneHotspot *hotspot = NULL;
+	SceneHotspot *hotspot = nullptr;
 	getScenes()->get(getState()->scene)->checkHotSpot(getCoords(), &hotspot);
 
 	if (hotspot)
@@ -971,7 +971,7 @@ void Menu::checkHotspots() {
 }
 
 void Menu::hideOverlays() {
-	_lastHotspot = NULL;
+	_lastHotspot = nullptr;
 
 	// Hide all menu overlays
 	for (MenuFrames::iterator it = _frames.begin(); it != _frames.end(); it++)
diff --git a/engines/lastexpress/menu/trainline.cpp b/engines/lastexpress/menu/trainline.cpp
index fe6c7ca979..7b322b8da6 100644
--- a/engines/lastexpress/menu/trainline.cpp
+++ b/engines/lastexpress/menu/trainline.cpp
@@ -71,7 +71,7 @@ static const struct {
 	{210, kTimeCityConstantinople}
 };
 
-TrainLine::TrainLine(LastExpressEngine *engine) : _engine(engine), _frameLine1(NULL), _frameLine2(NULL) {
+TrainLine::TrainLine(LastExpressEngine *engine) : _engine(engine), _frameLine1(nullptr), _frameLine2(nullptr) {
 	_frameLine1 = new SequenceFrame(loadSequence("line1.seq"), 0, true);
 	_frameLine2 = new SequenceFrame(loadSequence("line2.seq"), 0, true);
 }
@@ -81,7 +81,7 @@ TrainLine::~TrainLine() {
 	SAFE_DELETE(_frameLine2);
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 void TrainLine::clear() {
diff --git a/engines/lastexpress/resource.cpp b/engines/lastexpress/resource.cpp
index 1d136bc9a0..97004ee1ce 100644
--- a/engines/lastexpress/resource.cpp
+++ b/engines/lastexpress/resource.cpp
@@ -133,7 +133,7 @@ Common::SeekableReadStream *ResourceManager::getFileStream(const Common::String
 	// Check if the file exits in the archive
 	if (!hasFile(name)) {
 		debugC(2, kLastExpressDebugResource, "Error opening file: %s", name.c_str());
-		return NULL;
+		return nullptr;
 	}
 
 	debugC(2, kLastExpressDebugResource, "Opening file: %s", name.c_str());
@@ -186,7 +186,7 @@ Common::SeekableReadStream *ResourceManager::createReadStreamForMember(const Com
 			return stream;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 
@@ -196,14 +196,14 @@ Background *ResourceManager::loadBackground(const Common::String &name) const {
 	// Open the resource
 	Common::SeekableReadStream *stream = createReadStreamForMember(name + ".bg");
 	if (!stream)
-		return NULL;
+		return nullptr;
 
 	// Create the new background & load the data
 	Background *bg = new Background();
 	if (!bg->load(stream)) {
 		delete bg;
 		// stream should be freed by the Background instance
-		return NULL;
+		return nullptr;
 	}
 
 	return bg;
@@ -213,14 +213,14 @@ Cursor *ResourceManager::loadCursor() const {
 	// Open the resource
 	Common::SeekableReadStream *stream = createReadStreamForMember("cursors.tbm");
 	if (!stream)
-		return NULL;
+		return nullptr;
 
 	// Create the new background
 	Cursor *c = new Cursor();
 	if (!c->load(stream)) {
 		delete c;
 		// stream should be freed by the Cursor instance
-		return NULL;
+		return nullptr;
 	}
 
 	return c;
@@ -230,14 +230,14 @@ Font *ResourceManager::loadFont() const {
 	// Open the resource
 	Common::SeekableReadStream *stream = createReadStreamForMember("font.dat");
 	if (!stream)
-		return NULL;
+		return nullptr;
 
 	// Create the new background
 	Font *f = new Font();
 	if (!f->load(stream)) {
 		delete f;
 		// stream should be freed by the Font instance
-		return NULL;
+		return nullptr;
 	}
 
 	return f;
diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp
index d73642d92a..5b10c23bea 100644
--- a/engines/lastexpress/sound/entry.cpp
+++ b/engines/lastexpress/sound/entry.cpp
@@ -48,7 +48,7 @@ SoundEntry::SoundEntry(LastExpressEngine *engine) : _engine(engine) {
 	_blockCount = 0;
 	_startTime = 0;
 
-	_stream = NULL;
+	_stream = nullptr;
 
 	_volumeWithoutNIS = 0;
 	_entity = kEntityPlayer;
@@ -56,9 +56,9 @@ SoundEntry::SoundEntry(LastExpressEngine *engine) : _engine(engine) {
 	_activateDelayMS = 0;
 	_priority = 0;
 
-	_subtitle = NULL;
+	_subtitle = nullptr;
 
-	_soundStream = NULL;
+	_soundStream = nullptr;
 }
 
 SoundEntry::~SoundEntry() {
@@ -68,11 +68,11 @@ SoundEntry::~SoundEntry() {
 
 	SAFE_DELETE(_soundStream);
 
-	_subtitle = NULL;
-	_stream = NULL;
+	_subtitle = nullptr;
+	_stream = nullptr;
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 void SoundEntry::open(Common::String name, SoundFlag flag, int priority) {
@@ -85,8 +85,8 @@ void SoundEntry::open(Common::String name, SoundFlag flag, int priority) {
 void SoundEntry::close() {
 	if (_soundStream) {
 		delete _soundStream; // stops the sound in destructor
-		_soundStream = NULL;
-		_stream = NULL; // disposed by _soundStream
+		_soundStream = nullptr;
+		_stream = nullptr; // disposed by _soundStream
 	}
 	_status |= kSoundFlagClosed;
 
@@ -433,16 +433,16 @@ void SoundEntry::saveLoadWithSerializer(Common::Serializer &s) {
 //////////////////////////////////////////////////////////////////////////
 SubtitleEntry::SubtitleEntry(LastExpressEngine *engine) : _engine(engine) {
 	_status = 0;
-	_sound = NULL;
-	_data = NULL;
+	_sound = nullptr;
+	_data = nullptr;
 }
 
 SubtitleEntry::~SubtitleEntry() {
 	SAFE_DELETE(_data);
 
 	// Zero-out passed pointers
-	_sound = NULL;
-	_engine = NULL;
+	_sound = nullptr;
+	_engine = nullptr;
 }
 
 void SubtitleEntry::load(Common::String filename, SoundEntry *soundEntry) {
@@ -502,13 +502,13 @@ void SubtitleEntry::close() {
 	if (this == getSoundQueue()->getCurrentSubtitle()) {
 		drawOnScreen();
 
-		getSoundQueue()->setCurrentSubtitle(NULL);
+		getSoundQueue()->setCurrentSubtitle(nullptr);
 		getSoundQueue()->setSubtitleFlag(0);
 	}
 }
 
 void SubtitleEntry::drawOnScreen() {
-	if (_data == NULL)
+	if (_data == nullptr)
 		return;
 
 	getSoundQueue()->setSubtitleFlag(getSoundQueue()->getSubtitleFlag() & -2);
diff --git a/engines/lastexpress/sound/queue.cpp b/engines/lastexpress/sound/queue.cpp
index 58b11f2402..bfd78c15e5 100644
--- a/engines/lastexpress/sound/queue.cpp
+++ b/engines/lastexpress/sound/queue.cpp
@@ -39,7 +39,7 @@ SoundQueue::SoundQueue(LastExpressEngine *engine) : _engine(engine) {
 	 _flag = 0;
 
 	_subtitlesFlag = 0;
-	_currentSubtitle = NULL;
+	_currentSubtitle = nullptr;
 	//_soundCacheData = NULL;
 }
 
@@ -52,11 +52,11 @@ SoundQueue::~SoundQueue() {
 		SAFE_DELETE(*i);
 	_subtitles.clear();
 
-	_currentSubtitle = NULL;
+	_currentSubtitle = nullptr;
 	//SAFE_DELETE(_soundCacheData);
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -93,7 +93,7 @@ void SoundQueue::updateQueue() {
 
 	for (Common::List<SoundEntry *>::iterator it = _soundList.begin(); it != _soundList.end(); ++it) {
 		SoundEntry *entry = *it;
-		if (entry == NULL)
+		if (entry == nullptr)
 			error("[SoundQueue::updateQueue] Invalid entry found in sound queue");
 
 		// Original removes the entry data from the cache and sets the archive as not loaded
@@ -145,7 +145,7 @@ void SoundQueue::destroyAllSound() {
 
 	for (Common::List<SoundEntry *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) {
 		SoundEntry *entry = (*i);
-		if (entry == NULL)
+		if (entry == nullptr)
 			error("[SoundQueue::destroyAllSound] Invalid entry found in sound queue");
 
 		// Delete entry
@@ -210,7 +210,7 @@ SoundEntry *SoundQueue::getEntry(EntityIndex index) {
 			return *i;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 SoundEntry *SoundQueue::getEntry(Common::String name) {
@@ -222,7 +222,7 @@ SoundEntry *SoundQueue::getEntry(Common::String name) {
 			return *i;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 SoundEntry *SoundQueue::getEntry(SoundTag tag) {
@@ -231,7 +231,7 @@ SoundEntry *SoundQueue::getEntry(SoundTag tag) {
 			return *i;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 uint32 SoundQueue::getEntryTime(EntityIndex index) {
@@ -243,16 +243,16 @@ uint32 SoundQueue::getEntryTime(EntityIndex index) {
 }
 
 bool SoundQueue::isBuffered(EntityIndex entity) {
-	return (getEntry(entity) != NULL);
+	return (getEntry(entity) != nullptr);
 }
 
 bool SoundQueue::isBuffered(Common::String filename, bool testForEntity) {
 	SoundEntry *entry = getEntry(filename);
 
 	if (testForEntity)
-		return entry != NULL && entry->getEntity() != kEntityPlayer;
+		return entry != nullptr && entry->getEntity() != kEntityPlayer;
 
-	return (entry != NULL);
+	return (entry != nullptr);
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -260,7 +260,7 @@ bool SoundQueue::isBuffered(Common::String filename, bool testForEntity) {
 //////////////////////////////////////////////////////////////////////////
 void SoundQueue::updateSubtitles() {
 	uint32 index = 0;
-	SubtitleEntry *subtitle = NULL;
+	SubtitleEntry *subtitle = nullptr;
 
 	for (Common::List<SubtitleEntry *>::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
 		uint32 current_index = 0;
diff --git a/engines/lastexpress/sound/sound.cpp b/engines/lastexpress/sound/sound.cpp
index 013a166ea8..af707eb816 100644
--- a/engines/lastexpress/sound/sound.cpp
+++ b/engines/lastexpress/sound/sound.cpp
@@ -127,7 +127,7 @@ SoundManager::~SoundManager() {
 	SAFE_DELETE(_queue);
 
 	// Zero passed pointers
-	_engine = NULL;
+	_engine = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -377,7 +377,7 @@ void SoundManager::playLocomotiveSound() {
 
 const char *SoundManager::getDialogName(EntityIndex entity) const {
 	if (_queue->isBuffered(kEntityTables4))
-		return NULL;
+		return nullptr;
 	switch (entity) {
 	case kEntityAnna:
 		if (getEvent(kEventAnnaDialogGoToJerusalem))
@@ -674,7 +674,7 @@ const char *SoundManager::getDialogName(EntityIndex entity) const {
 		break;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////


Commit: 429d8c9bc2a2c9023b95261b782b28b58173502a
    https://github.com/scummvm/scummvm/commit/429d8c9bc2a2c9023b95261b782b28b58173502a
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
LILLIPUT: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/lilliput/detection.cpp
    engines/lilliput/lilliput.cpp
    engines/lilliput/script.cpp


diff --git a/engines/lilliput/detection.cpp b/engines/lilliput/detection.cpp
index eac7b35960..31d35cd6b0 100644
--- a/engines/lilliput/detection.cpp
+++ b/engines/lilliput/detection.cpp
@@ -33,7 +33,7 @@ static const PlainGameDescriptor lilliputGames[] = {
 	// Games
 	{"robin", "Adventures of Robin Hood"},
 	{"rome", "Rome: Pathway to Power"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
@@ -50,7 +50,7 @@ static const LilliputGameDescription gameDescriptions[] = {
 	// Robin Hood English
 	{
 		{
-			"robin", 0,
+			"robin", nullptr,
 			AD_ENTRY2s("erules.prg", "92aaf84693a8948497ad57864fa31c2a", 71010,
 					   "isomap.dta", "bad97eae03a4db3e99565e39b0b3c06a", 16384),
 			Common::EN_ANY,
@@ -63,7 +63,7 @@ static const LilliputGameDescription gameDescriptions[] = {
 	// Robin Hood French
 	{
 		{
-			"robin", 0,
+			"robin", nullptr,
 			AD_ENTRY2s("frules.prg", "cf076c5ebfe8b3571e74a6a46d79426f", 76660,
 					   "isomap.dta", "bad97eae03a4db3e99565e39b0b3c06a", 16384),
 			Common::FR_FRA,
@@ -76,7 +76,7 @@ static const LilliputGameDescription gameDescriptions[] = {
 	// Robin Hood German
 	{
 		{
-			"robin", 0,
+			"robin", nullptr,
 			AD_ENTRY2s("grules.prg", "b53b7353dc1e841b206a64851e7bc58c", 78050,
 					   "isomap.dta", "bad97eae03a4db3e99565e39b0b3c06a", 16384),
 			Common::DE_DEU,
@@ -89,7 +89,7 @@ static const LilliputGameDescription gameDescriptions[] = {
 	// Robin Hood Italian
 	{
 		{
-			"robin", 0,
+			"robin", nullptr,
 			AD_ENTRY2s("irules.prg", "4d69ed3cda1e1d73585905517ea705d1", 75654,
 					   "isomap.dta", "bad97eae03a4db3e99565e39b0b3c06a", 16384),
 			Common::IT_ITA,
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index e7e1ac57a5..cda2691d03 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -38,7 +38,7 @@
 
 namespace Lilliput {
 
-LilliputEngine *LilliputEngine::s_Engine = 0;
+LilliputEngine *LilliputEngine::s_Engine = nullptr;
 
 static const byte _basisPalette[768] = {
 	0,  0,  0,  0,  0,  42, 0,  42, 0,  0,  42, 42,
@@ -112,7 +112,7 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
 	_system = syst;
 
 	setDebugger(new LilliputConsole(this));
-	_rnd = 0;
+	_rnd = nullptr;
 	_mousePos = Common::Point(0, 0);
 	_oldMousePos = Common::Point(0, 0);
 	_mouseDisplayPos = Common::Point(0, 0);
@@ -208,13 +208,13 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
 		_characterVariables[i] = 0;
 	}
 
-	_currentCharacterAttributes = NULL;
-	_bufferIdeogram = NULL;
-	_bufferMen = NULL;
-	_bufferMen2 = NULL;
-	_bufferIsoChars = NULL;
-	_bufferIsoMap = NULL;
-	_bufferCubegfx = NULL;
+	_currentCharacterAttributes = nullptr;
+	_bufferIdeogram = nullptr;
+	_bufferMen = nullptr;
+	_bufferMen2 = nullptr;
+	_bufferIsoChars = nullptr;
+	_bufferIsoMap = nullptr;
+	_bufferCubegfx = nullptr;
 
 	_sequencesArr = nullptr;
 	_packedStringIndex = nullptr;
@@ -2247,7 +2247,7 @@ void LilliputEngine::checkInterfaceActivationDelay() {
 void LilliputEngine::displayHeroismIndicator() {
 	debugC(2, kDebugEngine, "displayHeroismIndicator()");
 
-	if (_scriptHandler->_barAttrPtr == NULL)
+	if (_scriptHandler->_barAttrPtr == nullptr)
 		return;
 
 	int var1 = (_scriptHandler->_barAttrPtr[0] * 25) >> 8;
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 4d156b2e0a..026faffbbc 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -28,7 +28,7 @@
 
 namespace Lilliput {
 
-LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL) {
+LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(nullptr) {
 	_cubeSet = 0;
 	_lastRandomValue = 0;
 	_scriptForVal = 0;
@@ -47,7 +47,7 @@ LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL)
 	_monitoredAttr[1] = 1;
 	_monitoredAttr[2] = 2;
 	_monitoredAttr[3] = 3;
-	_barAttrPtr = NULL;
+	_barAttrPtr = nullptr;
 	_word1825E = Common::Point(0, 0);
 
 	for (int i = 0; i < 20; i++) {
@@ -1798,7 +1798,7 @@ byte LilliputScript::OC_CurrentCharacterVar0AndVar1Equals() {
 	byte var1 = _currScript->readUint16LE() & 0xFF;
 	byte var2 = _currScript->readUint16LE() & 0xFF;
 
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 
 	if ((var1 == _vm->_currentCharacterAttributes[0]) && (var2 == _vm->_currentCharacterAttributes[1]))
 		return 1;
@@ -1810,7 +1810,7 @@ byte LilliputScript::OC_CurrentCharacterVar0Equals() {
 	debugC(1, kDebugScript, "OC_CurrentCharacterVar0Equals()");
 
 	byte curByte = (_currScript->readUint16LE() & 0xFF);
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	if (_vm->_currentCharacterAttributes[0] == curByte)
 		return 1;
 	return 0;
@@ -1891,7 +1891,7 @@ byte LilliputScript::OC_skipNextOpcode() {
 byte LilliputScript::OC_CheckCurrentCharacterAttr2() {
 	debugC(1, kDebugScript, "OC_CheckCurrentCharacterAttr2()");
 
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	if (_vm->_currentCharacterAttributes[2] == 1)
 		return 1;
 	return 0;
@@ -1926,7 +1926,7 @@ byte LilliputScript::OC_CheckCurrentCharacterAttr0And() {
 byte LilliputScript::OC_IsCurrentCharacterAttr0LessEqualThan() {
 	debugC(1, kDebugScript, "OC_IsCurrentCharacterAttr0LessEqualThan()");
 
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	byte curByte = (_currScript->readUint16LE() & 0xFF);
 
 	if (curByte <= _vm->_currentCharacterAttributes[0])
@@ -1950,7 +1950,7 @@ byte LilliputScript::OC_isCarried() {
 byte LilliputScript::OC_CheckCurrentCharacterAttr1() {
 	debugC(1, kDebugScript, "OC_CheckCurrentCharacterAttr1()");
 
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	byte curByte = (_currScript->readUint16LE() & 0xFF);
 
 	if (_vm->_currentCharacterAttributes[1] == curByte)
@@ -1974,7 +1974,7 @@ byte LilliputScript::OC_isCurrentCharacterSpecial() {
 byte LilliputScript::OC_CurrentCharacterAttr3Equals1() {
 	debugC(1, kDebugScript, "OC_CurrentCharacterAttr3Equals1()");
 
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	if (_vm->_currentCharacterAttributes[3] == 1)
 		return 1;
 
@@ -2411,7 +2411,7 @@ void LilliputScript::OC_setHost() {
 void LilliputScript::OC_changeMapCube() {
 	debugC(1, kDebugScript, "OC_changeMapCube()");
 
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	Common::Point var1 = Common::Point(_vm->_currentCharacterAttributes[4], _vm->_currentCharacterAttributes[5]);
 	byte var2 = _vm->_currentCharacterAttributes[6];
 
@@ -2529,7 +2529,7 @@ void LilliputScript::OC_enableCurrentCharacterScript() {
 void LilliputScript::OC_IncCurrentCharacterVar1() {
 	debugC(1, kDebugScript, "OC_IncCurrentCharacterVar1()");
 
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	++_vm->_currentCharacterAttributes[1];
 }
 
@@ -2707,14 +2707,14 @@ void LilliputScript::OC_setCurrentCharacterAttr2() {
 	debugC(1, kDebugScript, "OC_setCurrentCharacterAttr2()");
 
 	int curWord = _currScript->readUint16LE();
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	_vm->_currentCharacterAttributes[2] = curWord & 0xFF;
 }
 
 void LilliputScript::OC_clearCurrentCharacterAttr2() {
 	debugC(1, kDebugScript, "OC_clearCurrentCharacterAttr2()");
 
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 	_vm->_currentCharacterAttributes[2] = 0;
 }
 
@@ -2985,7 +2985,7 @@ void LilliputScript::OC_setCurrentCharacterAttr3() {
 	debugC(1, kDebugScript, "OC_setCurrentCharacterAttr3()");
 
 	byte var1 = _currScript->readUint16LE() & 0xFF;
-	assert(_vm->_currentCharacterAttributes != NULL);
+	assert(_vm->_currentCharacterAttributes != nullptr);
 
 	_vm->_currentCharacterAttributes[3] = var1;
 }


Commit: 04eacfa7d35a28e832028f3ba98675e7a17d3dbc
    https://github.com/scummvm/scummvm/commit/04eacfa7d35a28e832028f3ba98675e7a17d3dbc
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
LURE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/lure/animseq.cpp
    engines/lure/debugger.cpp
    engines/lure/detection.cpp
    engines/lure/disk.cpp
    engines/lure/events.cpp
    engines/lure/fights.cpp
    engines/lure/game.cpp
    engines/lure/hotspots.cpp
    engines/lure/lure.cpp
    engines/lure/menu.cpp
    engines/lure/res.cpp
    engines/lure/res_struct.cpp
    engines/lure/room.cpp
    engines/lure/screen.cpp
    engines/lure/scripts.cpp
    engines/lure/sound.cpp
    engines/lure/strings.cpp
    engines/lure/surface.cpp


diff --git a/engines/lure/animseq.cpp b/engines/lure/animseq.cpp
index e03bf71f65..42e8ed5e33 100644
--- a/engines/lure/animseq.cpp
+++ b/engines/lure/animseq.cpp
@@ -156,7 +156,7 @@ AnimationSequence::AnimationSequence(uint16 screenId, Palette &palette,  bool fa
 	_isEGA = LureEngine::getReference().isEGA();
 	if (_isEGA) {
 		// Setup for EGA animation
-		_lineRefs = NULL;
+		_lineRefs = nullptr;
 
 		// Reset the palette and clear the screen for EGA decoding
 		screen.setPaletteEmpty(RES_PALETTE_ENTRIES);
@@ -169,8 +169,8 @@ AnimationSequence::AnimationSequence(uint16 screenId, Palette &palette,  bool fa
 		// Set pointers for animation
 		_pPixelsStart = _pPixels = pSrc;
 		_pPixelsEnd = _decodedData->data() + _decodedData->size() - 1;
-		_pLinesStart = _pLines = NULL;
-		_pLinesEnd = NULL;
+		_pLinesStart = _pLines = nullptr;
+		_pLinesEnd = nullptr;
 
 	} else {
 		// Setup for VGA animation
@@ -215,7 +215,7 @@ AnimAbortType AnimationSequence::show() {
 	// Loop through displaying the animations
 	while (_loops > 0) {
 		if (_pPixels < _pPixelsEnd && (_isEGA || _pLines < _pLinesEnd)) {
-			if ((soundFrame != NULL) && (soundFrame->rolandSoundId != 0xFF) && (frameCtr == 0))
+			if ((soundFrame != nullptr) && (soundFrame->rolandSoundId != 0xFF) && (frameCtr == 0))
 				Sound.musicInterface_Play(
 					Sound.isRoland() ? soundFrame->rolandSoundId : soundFrame->adlibSoundId, soundFrame->music);
 
@@ -242,10 +242,10 @@ AnimAbortType AnimationSequence::show() {
 		result = delay(_frameDelay * 1000 / 50);
 		if (result != ABORT_NONE) return result;
 
-		if ((soundFrame != NULL) && (++frameCtr == soundFrame->numFrames)) {
+		if ((soundFrame != nullptr) && (++frameCtr == soundFrame->numFrames)) {
 			frameCtr = 0;
 			++soundFrame;
-			if (soundFrame->numFrames == 0) soundFrame = NULL;
+			if (soundFrame->numFrames == 0) soundFrame = nullptr;
 		}
 	}
 
diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp
index 032186717d..cc2f8b5022 100644
--- a/engines/lure/debugger.cpp
+++ b/engines/lure/debugger.cpp
@@ -87,7 +87,7 @@ bool Debugger::cmd_enterRoom(int argc, const char **argv) {
 		int roomNumber = strToInt(argv[1]);
 
 		// Validate that it's an existing room
-		if (res.getRoom(roomNumber) == NULL) {
+		if (res.getRoom(roomNumber) == nullptr) {
 			debugPrintf("specified number was not a valid room\n");
 			return true;
 		}
@@ -214,12 +214,12 @@ bool Debugger::cmd_giveItem(int argc, const char **argv) {
 		itemHotspot = res.getHotspot(itemNum);
 		charHotspot = res.getHotspot(charNum);
 
-		if (itemHotspot == NULL) {
+		if (itemHotspot == nullptr) {
 			debugPrintf("The specified item does not exist\n");
 		} else if (itemNum < 0x408) {
 			debugPrintf("The specified item number is not an object\n");
 		} else if ((charNum < PLAYER_ID) || (charNum >= 0x408) ||
-				   (charHotspot == NULL)) {
+				   (charHotspot == nullptr)) {
 			debugPrintf("The specified character does not exist");
 		} else {
 			// Set the item's room number to be the destination character
@@ -317,7 +317,7 @@ bool Debugger::cmd_hotspot(int argc, const char **argv) {
 		debugPrintf("Character mode = %d, delay ctr = %d, pause ctr = %d\n",
 			hs->characterMode, hs->delayCtr, hs->pauseCtr);
 
-		if (h != NULL) {
+		if (h != nullptr) {
 			debugPrintf("Frame Number = %d of %d\n", h->frameNumber(), h->numFrames());
 			debugPrintf("Persistent = %s\n", h->persistant() ? "true" : "false");
 		}
@@ -453,7 +453,7 @@ bool Debugger::cmd_showAnim(int argc, const char **argv) {
 	// Get the animation Id
 	int animId = strToInt(argv[1]);
 	HotspotAnimData *data = res.getAnimation(animId);
-	if (data == NULL) {
+	if (data == nullptr) {
 		debugPrintf("No such animation Id exists\n");
 		return true;
 	}
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index 16195a37c9..b93e9d7250 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -31,7 +31,7 @@
 
 static const PlainGameDescriptor lureGames[] = {
 	{"lure", "Lure of the Temptress"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 
diff --git a/engines/lure/disk.cpp b/engines/lure/disk.cpp
index eebf299497..69c2735ee1 100644
--- a/engines/lure/disk.cpp
+++ b/engines/lure/disk.cpp
@@ -33,7 +33,7 @@
 
 namespace Lure {
 
-static Disk *int_disk = NULL;
+static Disk *int_disk = nullptr;
 
 Disk &Disk::getReference() {
 	return *int_disk;
@@ -41,13 +41,13 @@ Disk &Disk::getReference() {
 
 Disk::Disk() {
 	_fileNum = 0xff;
-	_fileHandle = NULL;
+	_fileHandle = nullptr;
 	int_disk = this;
 }
 
 Disk::~Disk() {
 	delete _fileHandle;
-	int_disk = NULL;
+	int_disk = nullptr;
 }
 
 uint8 Disk::indexOf(uint16 id, bool suppressError) {
diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp
index 3ad671211f..21126b14e4 100644
--- a/engines/lure/events.cpp
+++ b/engines/lure/events.cpp
@@ -31,7 +31,7 @@
 
 namespace Lure {
 
-static Mouse *int_mouse = NULL;
+static Mouse *int_mouse = nullptr;
 
 Mouse &Mouse::getReference() {
 	return *int_mouse;
@@ -146,7 +146,7 @@ void Mouse::waitForRelease() {
 
 /*--------------------------------------------------------------------------*/
 
-static Events *int_events = NULL;
+static Events *int_events = nullptr;
 
 Events::Events() {
 	int_events = this;
diff --git a/engines/lure/fights.cpp b/engines/lure/fights.cpp
index 847fce5f9e..63338cbe09 100644
--- a/engines/lure/fights.cpp
+++ b/engines/lure/fights.cpp
@@ -39,11 +39,11 @@ const FighterRecord initialFighterList[3] = {
 	0, 0, 0, 0, 0xDDC, PLAYER_ID}
 };
 
-FightsManager *int_fights = NULL;
+FightsManager *int_fights = nullptr;
 
 FightsManager::FightsManager() : _rnd(LureEngine::getReference().rnd()) {
 	int_fights = this;
-	_fightData = NULL;
+	_fightData = nullptr;
 	_mouseFlags = 0;
 	_keyDown = KS_UP;
 	reset();
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp
index e79f973ce4..8aa8d9e198 100644
--- a/engines/lure/game.cpp
+++ b/engines/lure/game.cpp
@@ -35,10 +35,10 @@
 
 namespace Lure {
 
-static Game *int_game = NULL;
+static Game *int_game = nullptr;
 
 bool Game::isCreated() {
-	return int_game != NULL;
+	return int_game != nullptr;
 }
 
 Game &Game::getReference() {
@@ -208,7 +208,7 @@ void Game::execute() {
 					case Common::KEYCODE_KP_PLUS:
 						if (_debugFlag) {
 							while (++roomNum <= 51)
-								if (res.getRoom(roomNum) != NULL) break;
+								if (res.getRoom(roomNum) != nullptr) break;
 							if (roomNum == 52) roomNum = 1;
 							room.setRoomNumber(roomNum);
 						}
@@ -217,7 +217,7 @@ void Game::execute() {
 					case Common::KEYCODE_KP_MINUS:
 						if (_debugFlag) {
 							if (roomNum == 1) roomNum = 55;
-							while (res.getRoom(--roomNum) == NULL)
+							while (res.getRoom(--roomNum) == nullptr)
 								;
 							room.setRoomNumber(roomNum);
 						}
@@ -406,7 +406,7 @@ void Game::displayChuteAnimation() {
 	delete anim;
 
 	if (result != ABORT_END_INTRO) {
-		anim = new AnimationSequence(CHUTE2_ANIM_ID, palette, true, 5, NULL, 4);
+		anim = new AnimationSequence(CHUTE2_ANIM_ID, palette, true, 5, nullptr, 4);
 		result = anim->show();
 		delete anim;
 	}
@@ -539,7 +539,7 @@ void Game::handleRightClickMenu() {
 		actions &= 0xFF7FFFFF;
 
 	action = NONE;
-	hotspot = NULL;
+	hotspot = nullptr;
 
 	bool breakFlag = false;
 	while (!breakFlag) {
@@ -627,14 +627,14 @@ void Game::handleRightClickMenu() {
 	if (action != NONE) {
 		player->stopWalking();
 
-		if (hotspot == NULL) {
+		if (hotspot == nullptr) {
 			doAction(action, 0, itemId);
 		} else {
 			if (action != TELL) {
 				// Add the hotspot name to the status line and then go do the action
 				if ((itemId != 0xffff) && (action != GIVE) && (action != USE)) {
 					HotspotData *itemHotspot = res.getHotspot(itemId);
-					if (itemHotspot != NULL)
+					if (itemHotspot != nullptr)
 						strings.getString(itemHotspot->nameId, statusLine);
 				}
 				else
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index 8df5e86943..45036fb840 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -43,8 +43,8 @@ Hotspot::Hotspot(HotspotData *res): _pathFinder(this) {
 	bool isEGA = LureEngine::getReference().isEGA();
 
 	_data = res;
-	_anim = NULL;
-	_frames = NULL;
+	_anim = nullptr;
+	_frames = nullptr;
 	_numFrames = 0;
 	_persistant = false;
 	_direction = NO_DIRECTION;
@@ -93,13 +93,13 @@ Hotspot::Hotspot(Hotspot *character, uint16 objType): _pathFinder(this) {
 	assert(character);
 
 	_originalId = objType;
-	_data = NULL;
-	_anim = NULL;
-	_frames = NULL;
+	_data = nullptr;
+	_anim = nullptr;
+	_frames = nullptr;
 	_numFrames = 0;
 	_persistant = false;
 	_hotspotId = 0xffff;
-	_override = NULL;
+	_override = nullptr;
 	_colorOffset = 0;
 	_destHotspotId = character->hotspotId();
 	_blockedOffset = 0;
@@ -163,14 +163,14 @@ Hotspot::Hotspot(Hotspot *character, uint16 objType): _pathFinder(this) {
 	_nameBuffer[0] = '\0';
 }
 
-Hotspot::Hotspot(): _pathFinder(NULL) {
-	_data = NULL;
-	_anim = NULL;
-	_frames = NULL;
+Hotspot::Hotspot(): _pathFinder(nullptr) {
+	_data = nullptr;
+	_anim = nullptr;
+	_frames = nullptr;
 	_numFrames = 0;
 	_persistant = false;
 	_hotspotId = 0xffff;
-	_override = NULL;
+	_override = nullptr;
 	_colorOffset = 0;
 	_destHotspotId = 0;
 	_blockedOffset = 0;
@@ -190,7 +190,7 @@ Hotspot::Hotspot(): _pathFinder(NULL) {
 	_widthCopy = 0;
 	_yCorrection = 0;
 	_frameCtr = 0;
-	_tickHandler = NULL;
+	_tickHandler = nullptr;
 	_frameWidth = _width;
 	_frameStartsUsed = false;
 	_tempDest.counter = 0;
@@ -209,10 +209,10 @@ void Hotspot::setAnimation(uint16 newAnimId) {
 		_data->animRecordId = newAnimId;
 
 	if (newAnimId == 0)
-		tempAnim = NULL;
+		tempAnim = nullptr;
 	else {
 		tempAnim = r.getAnimation(newAnimId);
-		if (tempAnim == NULL)
+		if (tempAnim == nullptr)
 			error("Hotspot %xh tried to set non-existent Animation Id: %xh", _hotspotId, newAnimId);
 	}
 
@@ -255,9 +255,9 @@ void Hotspot::setAnimation(HotspotAnimData *newRecord) {
 
 	if (_frames) {
 		delete _frames;
-		_frames = NULL;
+		_frames = nullptr;
 	}
-	_anim = NULL;
+	_anim = nullptr;
 	_numFrames = 0;
 	_frameNumber = 0;
 	if (!newRecord)
@@ -433,7 +433,7 @@ bool Hotspot::isActiveAnimation() {
 }
 
 uint16 Hotspot::nameId() const {
-	if (_data == NULL)
+	if (_data == nullptr)
 		return 0;
 	else
 		return _data->nameId;
@@ -564,7 +564,7 @@ void Hotspot::faceHotspot(HotspotData *hotspot) {
 		int xp, yp;
 
 		HotspotOverrideData *hsEntry = res.getHotspotOverride(hotspot->hotspotId);
-		if (hsEntry != NULL) {
+		if (hsEntry != nullptr) {
 			xp = x() - hsEntry->xs;
 			yp = y() + heightCopy() - (hsEntry->ys + hotspot->heightCopy);
 		} else {
@@ -589,7 +589,7 @@ void Hotspot::faceHotspot(HotspotData *hotspot) {
 
 void Hotspot::faceHotspot(uint16 id) {
 	HotspotData *hotspot = Resources::getReference().getHotspot(id);
-	assert(hotspot != NULL);
+	assert(hotspot != nullptr);
 	faceHotspot(hotspot);
 }
 
@@ -711,7 +711,7 @@ bool Hotspot::walkingStep() {
 }
 
 void Hotspot::updateMovement() {
-	assert(_data != NULL);
+	assert(_data != nullptr);
 	if (currentActions().action() == EXEC_HOTSPOT_SCRIPT) {
 		if (_data->coveredFlag) {
 			// Reset position and direction
@@ -814,8 +814,8 @@ void Hotspot::showMessage(uint16 messageId, uint16 destCharacterId) {
 		// Handle string display
 		idVal &= 0x7fff;
 		HotspotData *hotspotData = res.getHotspot(res.fieldList().getField(ACTIVE_HOTSPOT_ID));
-		const char *itemName = NULL;
-		if (hotspotData != NULL) {
+		const char *itemName = nullptr;
+		if (hotspotData != nullptr) {
 			StringData::getReference().getString(hotspotData->nameId, nameBuffer);
 			itemName = nameBuffer;
 		}
@@ -869,13 +869,13 @@ void Hotspot::handleTalkDialog() {
 
 			// Face the character to the hotspot
 			HotspotData *destHotspot = res.getHotspot(_data->talkDestCharacterId);
-			assert(destHotspot != NULL);
+			assert(destHotspot != nullptr);
 			faceHotspot(destHotspot);
 
 			// If the hotspot is also a character, then face it to the speaker
 			if (_data->talkDestCharacterId < FIRST_NONCHARACTER_ID) {
 				Hotspot *charHotspot = res.getActiveHotspot(_data->talkDestCharacterId);
-				if (charHotspot != NULL)
+				if (charHotspot != nullptr)
 					charHotspot->faceHotspot(resource());
 			}
 		}
@@ -891,7 +891,7 @@ void Hotspot::handleTalkDialog() {
 		--fields.textCtr2();
 	}*/
 
-	} else if ((room.talkDialog() != NULL) && (room.talkDialog()->isBuilding())) {
+	} else if ((room.talkDialog() != nullptr) && (room.talkDialog()->isBuilding())) {
 		return;
 
 	} else if (_data->talkCountdown > 0) {
@@ -1124,7 +1124,7 @@ bool Hotspot::characterWalkingCheck(uint16 id) {
 
 	default:
 		hotspot = res.getHotspot(id);
-		if (hotspot == NULL) {
+		if (hotspot == nullptr) {
 			// Should never come here, as all other constants are handled
 			warning("characterWalkingCheck done on unknown hotspot Id %xh", id);
 			xp = 78; yp = 162;
@@ -1243,10 +1243,10 @@ typedef void (Hotspot::*ActionProcPtr)(HotspotData *hotspot);
 
 void Hotspot::doAction() {
 	CurrentActionEntry &entry = currentActions().top();
-	HotspotData *hotspot = NULL;
+	HotspotData *hotspot = nullptr;
 
 	if (!entry.hasSupportData() || (entry.supportData().action() == NONE)) {
-		doAction(NONE, NULL);
+		doAction(NONE, nullptr);
 	} else {
 		if (entry.supportData().numParams() > 0)
 			hotspot = Resources::getReference().getHotspot(entry.supportData().param(
@@ -1259,10 +1259,10 @@ void Hotspot::doAction(Action action, HotspotData *hotspot) {
 	StringList &stringList = Resources::getReference().stringList();
 	int charId = _hotspotId;
 	debugC(ERROR_INTERMEDIATE, kLureDebugHotspots,  "Action charId=%xh Action=%d/%s",
-		charId, (int)action, (action > EXAMINE) ? NULL : stringList.getString((int)action));
+		charId, (int)action, (action > EXAMINE) ? nullptr : stringList.getString((int)action));
 
 	// Set the ACTIVE_HOTSPOT_ID and USE_HOTSPOT_ID fields
-	if (hotspot != NULL) {
+	if (hotspot != nullptr) {
 		ValueTableData &fields = Resources::getReference().fieldList();
 		fields.setField(ACTIVE_HOTSPOT_ID, hotspot->hotspotId);
 
@@ -1381,7 +1381,7 @@ void Hotspot::doAction(Action action, HotspotData *hotspot) {
 	}
 
 	debugC(ERROR_DETAILED, kLureDebugHotspots,  "Action charId=%xh Action=%d/%s Complete",
-		charId, (int)action, (action > EXAMINE) ? NULL : stringList.getString((int)action));
+		charId, (int)action, (action > EXAMINE) ? nullptr : stringList.getString((int)action));
 }
 
 void Hotspot::doNothing(HotspotData *hotspot) {
@@ -1665,7 +1665,7 @@ void Hotspot::doGive(HotspotData *hotspot) {
 			usedItem->roomNumber = hotspot->hotspotId;
 		} else if (sequenceOffset > 1) {
 			Hotspot *destCharacter = res.getActiveHotspot(hotspot->hotspotId);
-			if (destCharacter != NULL)
+			if (destCharacter != nullptr)
 				destCharacter->showMessage(sequenceOffset, hotspotId());
 		}
 	}
@@ -1836,7 +1836,7 @@ void Hotspot::doAsk(HotspotData *hotspot) {
 	uint16 sequenceOffset = res.getHotspotAction(hotspot->actionsOffset, ASK);
 
 	if (sequenceOffset >= 0x8000) {
-		if (destCharacter != NULL)
+		if (destCharacter != nullptr)
 			destCharacter->showMessage(sequenceOffset, hotspotId());
 	} else if (sequenceOffset != 0) {
 		sequenceOffset = Script::execute(sequenceOffset);
@@ -1844,9 +1844,9 @@ void Hotspot::doAsk(HotspotData *hotspot) {
 		if (sequenceOffset == 0) {
 			// Give item to character
 			usedHotspot->roomNumber = hotspotId();
-			if (destCharacter != NULL)
+			if (destCharacter != nullptr)
 				destCharacter->showMessage(32, hotspotId());
-		} else if ((sequenceOffset != 1) && (destCharacter != NULL)) {
+		} else if ((sequenceOffset != 1) && (destCharacter != nullptr)) {
 			destCharacter->showMessage(sequenceOffset, hotspotId());
 		}
 	}
@@ -2149,7 +2149,7 @@ void Hotspot::npcSupportOffsetConditional(HotspotData *hotspot) {
 	}
 
 	currentActions().top().setSupportData(newEntry);
-	HotspotData *hotspotData = (newEntry->numParams() == 0) ? NULL : res.getHotspot(
+	HotspotData *hotspotData = (newEntry->numParams() == 0) ? nullptr : res.getHotspot(
 		(newEntry->action() == USE) ? newEntry->param(1) : newEntry->param(0));
 	doAction(newEntry->action(), hotspotData);
 }
@@ -2170,7 +2170,7 @@ void Hotspot::npcDispatchAction(HotspotData *hotspot) {
 			charSchedules().getEntry(entry.param(0), entry.parent());
 		currentActions().top().setSupportData(newEntry);
 
-		HotspotData *hotspotData = (newEntry->numParams() == 0) ? NULL :
+		HotspotData *hotspotData = (newEntry->numParams() == 0) ? nullptr :
 			res.getHotspot(newEntry->param((newEntry->action() == USE) ? 1 : 0));
 		doAction(newEntry->action(), hotspotData);
 	}
@@ -2249,7 +2249,7 @@ void Hotspot::npcJumpAddress(HotspotData *hotspot) {
 	case 1:
 		player = res.getActiveHotspot(PLAYER_ID);
 		if (player->y() < 52) {
-			entry = res.charSchedules().getEntry(JUMP_ADDR_2_SUPPORT_ID, NULL);
+			entry = res.charSchedules().getEntry(JUMP_ADDR_2_SUPPORT_ID, nullptr);
 			assert(entry);
 
 			currentActions().clear();
@@ -3024,7 +3024,7 @@ void HotspotTickHandlers::playerAnimHandler(Hotspot &h) {
 		// Make sure there is no longer any destination
 		h.setDestHotspot(0);
 		h.updateMovement2(CHARMODE_IDLE);
-		h.doNothing(NULL);
+		h.doNothing(nullptr);
 		strcpy(room.statusLine(), "");
 		break;
 
@@ -3032,7 +3032,7 @@ void HotspotTickHandlers::playerAnimHandler(Hotspot &h) {
 		// Dispatch an action
 		h.setDestHotspot(0);
 
-		hotspot = NULL;
+		hotspot = nullptr;
 		if (actions.top().hasSupportData()) {
 			hsAction = actions.top().supportData().action();
 
@@ -3125,7 +3125,7 @@ void HotspotTickHandlers::playerAnimHandler(Hotspot &h) {
 
 		if (h.destHotspotId() != 0) {
 			RoomExitJoinData *joinRec = res.getExitJoin(h.destHotspotId());
-			if ((joinRec != NULL) && (joinRec->blocked)) {
+			if ((joinRec != nullptr) && (joinRec->blocked)) {
 				// Player is walking to a blocked room exit, so stop walking
 				actions.pop();
 				h.setOccupied(true);
@@ -3485,10 +3485,10 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
 		// Handle initial setup of talking options
 		// Reset talk entry pointer list
 		for (lineNum = 0; lineNum < MAX_TALK_SELECTIONS; ++lineNum)
-			talkSelections[lineNum] = NULL;
+			talkSelections[lineNum] = nullptr;
 
 		// Loop through list to find entries to display
-		_talkResponse = NULL;
+		_talkResponse = nullptr;
 		numLines = 0;
 		showSelections = false;
 
@@ -3564,7 +3564,7 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
 
 			// Have destination character show question speech bubble
 			charHotspot = res.getActiveHotspot(talkDestCharacter);
-			if (charHotspot != NULL)
+			if (charHotspot != nullptr)
 				charHotspot->showMessage(13, NOONE_ID);
 
 		} else if (mouse.lButton() && (selectedLine != 0)) {
@@ -3651,7 +3651,7 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
 		if (descId != TALK_MAGIC_ID) {
 			charHotspot = res.getActiveHotspot(talkDestCharacter);
 
-			if (charHotspot != NULL)
+			if (charHotspot != nullptr)
 				charHotspot->converse(PLAYER_ID, descId, true);
 		}
 		res.setTalkState(TALK_RESPONSE_WAIT);
@@ -3733,7 +3733,7 @@ void HotspotTickHandlers::grubAnimHandler(Hotspot &h) {
 	if (character->y() < 79) {
 		// If player is behind Grub, use Ratpouch if possible
 		Hotspot *ratpouch = res.getActiveHotspot(RATPOUCH_ID);
-		if ((ratpouch != NULL) && (ratpouch->roomNumber() == h.roomNumber()))
+		if ((ratpouch != nullptr) && (ratpouch->roomNumber() == h.roomNumber()))
 			character = ratpouch;
 	}
 
@@ -3762,16 +3762,16 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) {
 
 	if (h.frameCtr() == 0) {
 		// Barman not currently doing something
-		if (barEntry.currentCustomer != NULL) {
+		if (barEntry.currentCustomer != nullptr) {
 			// A customer has been set to be served
 			Hotspot *servee = res.getActiveHotspot(barEntry.currentCustomer->hotspotId);
-			if (servee != NULL) {
+			if (servee != nullptr) {
 				// Check whether the character is still at the bar
 				if ((servee->y() + servee->heightCopy()) >= ((barEntry.gridLine << 3) + 24)) {
 					// Customer has left - nullify their entry
 					barEntry.currentCustomer->hotspotId = 0;
 					barEntry.currentCustomer->serveFlags = 0;
-					barEntry.currentCustomer = NULL;
+					barEntry.currentCustomer = nullptr;
 				}
 				else if (servee->hotspotId() != PLAYER_ID) {
 					// Any other NPC character, so serve them
@@ -3790,7 +3790,7 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) {
 						// Clear entry from list
 						barEntry.currentCustomer->hotspotId = 0;
 						barEntry.currentCustomer->serveFlags = 0;
-						barEntry.currentCustomer = NULL;
+						barEntry.currentCustomer = nullptr;
 						// Set the barman to polish the bar
 						h.setFrameCtr(2);
 					}
@@ -3815,7 +3815,7 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) {
 		}
 
 		// At this point, no customers need servering. Empty the table
-		barEntry.currentCustomer = NULL;
+		barEntry.currentCustomer = nullptr;
 		for (int index = 0; index < NUM_SERVE_CUSTOMERS; ++index) {
 			barEntry.customers[index].hotspotId = 0;
 			barEntry.customers[index].serveFlags = 0;
@@ -4700,7 +4700,7 @@ bool Support::checkRoomChange(Hotspot &h) {
 		}
 	}
 
-	return (exitRec != NULL);
+	return (exitRec != nullptr);
 }
 
 void Support::characterChangeRoom(Hotspot &h, uint16 roomNumber,
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index 6c83049bd0..7824800e32 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -37,7 +37,7 @@
 
 namespace Lure {
 
-static LureEngine *int_engine = NULL;
+static LureEngine *int_engine = nullptr;
 
 LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc)
 	: Engine(system), _gameDescription(gameDesc), _rnd("lure") {
@@ -188,7 +188,7 @@ const char *LureEngine::generateSaveName(int slotNumber) {
 bool LureEngine::saveGame(uint8 slotNumber, Common::String &caption) {
 	Common::WriteStream *f = this->_saveFileMan->openForSaving(
 		generateSaveName(slotNumber));
-	if (f == NULL)
+	if (f == nullptr)
 		return false;
 
 	f->write("lure", 5);
@@ -212,7 +212,7 @@ bool LureEngine::saveGame(uint8 slotNumber, Common::String &caption) {
 bool LureEngine::loadGame(uint8 slotNumber) {
 	Common::ReadStream *f = this->_saveFileMan->openForLoading(
 		generateSaveName(slotNumber));
-	if (f == NULL)
+	if (f == nullptr)
 		return false;
 
 	// Check for header
@@ -257,8 +257,8 @@ void LureEngine::syncSoundSettings() {
 Common::String *LureEngine::detectSave(int slotNumber) {
 	Common::ReadStream *f = this->_saveFileMan->openForLoading(
 		generateSaveName(slotNumber));
-	if (f == NULL) return NULL;
-	Common::String *result = NULL;
+	if (f == nullptr) return nullptr;
+	Common::String *result = nullptr;
 
 	// Check for header
 	char buffer[5];
diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp
index 12a2fd44e9..5b47cbbde0 100644
--- a/engines/lure/menu.cpp
+++ b/engines/lure/menu.cpp
@@ -57,7 +57,7 @@ MenuRecord::MenuRecord(const MenuRecordBounds *bounds, int numParams, ...) {
 
 MenuRecord::~MenuRecord() {
 	free(_entries);
-	_entries = NULL;
+	_entries = nullptr;
 }
 
 const char *MenuRecord::getEntry(uint8 index) {
@@ -67,7 +67,7 @@ const char *MenuRecord::getEntry(uint8 index) {
 
 /*--------------------------------------------------------------------------*/
 
-static Menu *int_menu = NULL;
+static Menu *int_menu = nullptr;
 
 const MenuRecordLanguage menuList[] = {
 	{Common::EN_ANY, {{40, 87, 3, 7}, {127, 179, 13, 12}, {224, 281, 27, 10}}},
@@ -101,7 +101,7 @@ Menu::Menu() {
 	_menus[2] = new MenuRecord(&rec->menus[2], 3,
 		sl.getString(S_QUIT), sl.getString(S_SLOW_TEXT), sl.getString(S_SOUND_ON));
 
-	_selectedMenu = NULL;
+	_selectedMenu = nullptr;
 }
 
 Menu::~Menu() {
@@ -124,8 +124,8 @@ uint8 Menu::execute() {
 	system.copyRectToScreen(_menu->data(), FULL_SCREEN_WIDTH, 0, 0,
 		FULL_SCREEN_WIDTH, MENUBAR_Y_SIZE);
 
-	_selectedMenu = NULL;
-	_surfaceMenu = NULL;
+	_selectedMenu = nullptr;
+	_surfaceMenu = nullptr;
 	_selectedIndex = 0;
 
 	while (mouse.lButton() || mouse.rButton()) {
@@ -141,7 +141,7 @@ uint8 Menu::execute() {
 						toggleHighlight(_selectedMenu);
 						screen.updateArea(0, 0, FULL_SCREEN_WIDTH, _surfaceMenu->height() + 8);
 						delete _surfaceMenu;
-						_surfaceMenu = NULL;
+						_surfaceMenu = nullptr;
 						_selectedIndex = 0;
 					}
 
@@ -183,7 +183,7 @@ uint8 Menu::execute() {
 	// Restore the previous screen
 	screen.update();
 
-	if ((_selectedMenu == NULL) || (_selectedIndex == 0)) return MENUITEM_NONE;
+	if ((_selectedMenu == nullptr) || (_selectedIndex == 0)) return MENUITEM_NONE;
 	else if (_selectedMenu == _menus[0])
 		return MENUITEM_CREDITS;
 	else if (_selectedMenu == _menus[1]) {
@@ -217,7 +217,7 @@ MenuRecord *Menu::getMenuAt(int x) {
 		if ((x >= _menus[ctr]->hsxstart()) && (x <= _menus[ctr]->hsxend()))
 			return _menus[ctr];
 
-	return NULL;
+	return nullptr;
 }
 
 uint8 Menu::getIndexAt(uint16 x, uint16 y) {
diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index dc9ce29af8..8c2eb279f8 100644
--- a/engines/lure/res.cpp
+++ b/engines/lure/res.cpp
@@ -30,7 +30,7 @@
 
 namespace Lure {
 
-static Resources *int_resources = NULL;
+static Resources *int_resources = nullptr;
 
 Resources &Resources::getReference() {
 	return *int_resources;
@@ -97,7 +97,7 @@ void Resources::reset() {
 	_fieldList.reset();
 	_barmanLists.reset();
 	_talkState = TALK_NONE;
-	_activeTalkData = NULL;
+	_activeTalkData = nullptr;
 
 	reloadData();
 }
@@ -112,7 +112,7 @@ void Resources::reloadData() {
 	uint16 *v;
 
 	// Get the palette subset data
-	_paletteSubset = isEGA ? NULL : new Palette(ALT_PALETTE_RESOURCE_ID);
+	_paletteSubset = isEGA ? nullptr : new Palette(ALT_PALETTE_RESOURCE_ID);
 
 	// Load room data
 	mb = d.getEntry(ROOM_DATA_RESOURCE_ID);
@@ -359,7 +359,7 @@ void Resources::reloadData() {
 	_messagesData = d.getEntry(MESSAGES_LIST_RESOURCE_ID);
 	_talkDialogData = d.getEntry(TALK_DIALOG_RESOURCE_ID);
 
-	_activeTalkData = NULL;
+	_activeTalkData = nullptr;
 	_currentAction = NONE;
 	_talkState = TALK_NONE;
 	_talkSelection = 0;
@@ -377,7 +377,7 @@ RoomExitJoinData *Resources::getExitJoin(uint16 hotspotId) {
 			return rec;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 uint16 Resources::getHotspotScript(uint16 index) {
@@ -392,7 +392,7 @@ RoomData *Resources::getRoom(uint16 roomNumber) {
 		if (rec->roomNumber == roomNumber) return rec;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 bool Resources::checkHotspotExtent(HotspotData *hotspot) {
@@ -448,7 +448,7 @@ HotspotData *Resources::getHotspot(uint16 hotspotId) {
 		if (rec->hotspotId == hotspotId) return rec;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 Hotspot *Resources::getActiveHotspot(uint16 hotspotId) {
@@ -459,7 +459,7 @@ Hotspot *Resources::getActiveHotspot(uint16 hotspotId) {
 		if (rec->hotspotId() == hotspotId) return rec;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 
@@ -471,7 +471,7 @@ HotspotOverrideData *Resources::getHotspotOverride(uint16 hotspotId) {
 		if (rec->hotspotId == hotspotId) return rec;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 HotspotAnimData *Resources::getAnimation(uint16 animRecordId) {
@@ -482,7 +482,7 @@ HotspotAnimData *Resources::getAnimation(uint16 animRecordId) {
 		if (rec->animRecordId == animRecordId) return rec;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 int Resources::getAnimationIndex(HotspotAnimData *animData) {
@@ -512,7 +512,7 @@ TalkHeaderData *Resources::getTalkHeader(uint16 hotspotId) {
 		TalkHeaderData *rec = (*i).get();
 		if (rec->characterId == hotspotId) return rec;
 	}
-	return NULL;
+	return nullptr;
 }
 
 HotspotActionList *Resources::getHotspotActions(uint16 actionsOffset) {
@@ -548,12 +548,12 @@ uint16 englishLoadOffsets[] = {0x3afe, 0x41BD, 0x7167, 0x7172, 0x8617, 0x88ac, 0
 Hotspot *Resources::activateHotspot(uint16 hotspotId) {
 	Resources &resources = Resources::getReference();
 	HotspotData *res = getHotspot(hotspotId);
-	if (!res) return NULL;
+	if (!res) return nullptr;
 	res->roomNumber &= 0x7fff; // clear any suppression bit in room #
 
 	// Make sure that the hotspot isn't already active
 	Hotspot *h = getActiveHotspot(hotspotId);
-	if (h != NULL)
+	if (h != nullptr)
 		return h;
 
 	// If it's NPC with a schedule, then activate the schedule
@@ -650,7 +650,7 @@ Hotspot *Resources::activateHotspot(uint16 hotspotId) {
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 Hotspot *Resources::addHotspot(uint16 hotspotId) {
@@ -733,7 +733,7 @@ void Resources::copyCursorTo(Surface *s, uint8 cursorNum, int16 x, int16 y) {
 
 void Resources::setTalkData(uint16 offset) {
 	if (offset == 0) {
-		_activeTalkData = NULL;
+		_activeTalkData = nullptr;
 		return;
 	}
 
@@ -759,7 +759,7 @@ void Resources::saveToStream(Common::WriteStream *stream) {
 		HotspotData const &rec = **i;
 		if (!rec.npcSchedule.isEmpty()) {
 			Hotspot *h = getActiveHotspot(rec.hotspotId);
-			if (h == NULL) {
+			if (h == nullptr) {
 				stream->writeUint16LE(rec.hotspotId);
 				rec.npcSchedule.saveToStream(stream);
 			}
@@ -790,7 +790,7 @@ void Resources::loadFromStream(Common::ReadStream *stream) {
 	}
 
 	_talkState = TALK_NONE;
-	_activeTalkData = NULL;
+	_activeTalkData = nullptr;
 
 	if (saveVersion >= 31) {
 		// Load in any schedules for non-active NPCS
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index 286489da82..8603a3fe43 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -59,10 +59,10 @@ static const uint16 ewanExtraGraphic2[] = {
 	20,21,22,23,24,0};
 
 static const BarEntry default_barList[3] = {
-	{29, SID_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&basicPolish[0], &sidsFetch[0], NULL, NULL}, 13, NULL},
-	{32, NELLIE_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&nelliesScratch[0], &nelliesFetch[0], NULL, NULL}, 14, NULL},
+	{29, SID_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&basicPolish[0], &sidsFetch[0], nullptr, nullptr}, 13, nullptr},
+	{32, NELLIE_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&nelliesScratch[0], &nelliesFetch[0], nullptr, nullptr}, 14, nullptr},
 	{35, EWAN_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&ewansFetch[0], &ewansFetch[0],
-		&ewanExtraGraphic1[0], &ewanExtraGraphic2[0]}, 16, NULL}
+		&ewanExtraGraphic1[0], &ewanExtraGraphic2[0]}, 16, nullptr}
 };
 
 const RoomTranslationRecord roomTranslations[] = {
@@ -153,7 +153,7 @@ RoomExitData *RoomExitList::checkExits(int16 xp, int16 yp) {
 			return rec;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 // Room paths
@@ -629,7 +629,7 @@ HotspotActionList *HotspotActionSet::getActions(uint16 recordId) {
 		if (list->recordId == recordId) return list;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 // The following class holds the set of offsets for a character's talk set
@@ -832,7 +832,7 @@ void SequenceDelayList::loadFromStream(Common::ReadStream *stream) {
 // undergoes default argument promotion, which might be the case for enum
 // types.
 CharacterScheduleEntry::CharacterScheduleEntry(int theAction, ...) {
-	_parent = NULL;
+	_parent = nullptr;
 	_action = (Action)theAction;
 
 	va_list u_Arg;
@@ -904,17 +904,17 @@ CharacterScheduleEntry *CharacterScheduleEntry::next() {
 		for (i = _parent->begin(); i != _parent->end(); ++i) {
 			if ((*i).get() == this) {
 				++i;
-				CharacterScheduleEntry *result = (i == _parent->end()) ? NULL : (*i).get();
+				CharacterScheduleEntry *result = (i == _parent->end()) ? nullptr : (*i).get();
 				return result;
 			}
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 uint16 CharacterScheduleEntry::id() {
-	return (_parent == NULL) ? 0 : _parent->getId(this);
+	return (_parent == nullptr) ? 0 : _parent->getId(this);
 }
 
 CharacterScheduleSet::CharacterScheduleSet(CharacterScheduleResource *rec, uint16 setId) {
@@ -932,12 +932,12 @@ CharacterScheduleSet::CharacterScheduleSet(CharacterScheduleResource *rec, uint1
 
 CharacterScheduleEntry *CharacterScheduleList::getEntry(uint16 id, CharacterScheduleSet *currentSet) {
 	// Respond to the special no entry with no record
-	if (id == 0xffff) return NULL;
+	if (id == 0xffff) return nullptr;
 
 	// Handle jumps within a current set versus external jumps
 	if ((id >> 10) == 0) {
 		// Jump within current set
-		if (currentSet == NULL)
+		if (currentSet == nullptr)
 			error("Local support data jump encountered outside of a support data sequence");
 	} else {
 		// Inter-set jump - locate the appropriate set
@@ -1008,7 +1008,7 @@ RandomActionSet *RandomActionList::getRoom(uint16 roomNumber) {
 		if (v->roomNumber() == roomNumber)
 			return v;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void RandomActionSet::saveToStream(Common::WriteStream *stream) const {
@@ -1193,7 +1193,7 @@ BarEntry &BarmanLists::getDetails(uint16 roomNumber) {
 
 void BarmanLists::saveToStream(Common::WriteStream *stream) const {
 	for (int index = 0; index < 3; ++index) {
-		uint16 value = (_barList[index].currentCustomer == NULL) ? 0 :
+		uint16 value = (_barList[index].currentCustomer == nullptr) ? 0 :
 			(_barList[index].currentCustomer - &_barList[index].customers[0]) / sizeof(BarEntry) + 1;
 		stream->writeUint16LE(value);
 		for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) {
@@ -1210,7 +1210,7 @@ void BarmanLists::loadFromStream(Common::ReadStream *stream) {
 	reset();
 	for (int index = 0; index < numEntries; ++index) {
 		int16 value = stream->readUint16LE();
-		_barList[index].currentCustomer = ((value < 1) || (value > NUM_SERVE_CUSTOMERS)) ? NULL :
+		_barList[index].currentCustomer = ((value < 1) || (value > NUM_SERVE_CUSTOMERS)) ? nullptr :
 			&_barList[index].customers[value - 1];
 
 		for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) {
@@ -1316,13 +1316,13 @@ void ValueTableData::loadFromStream(Common::ReadStream *stream) {
 
 CurrentActionEntry::CurrentActionEntry(CurrentAction newAction, uint16 roomNum) {
 	_action = newAction;
-	_supportData = NULL;
+	_supportData = nullptr;
 	_dynamicSupportData = false;
 	_roomNumber = roomNum;
 }
 
 CurrentActionEntry::CurrentActionEntry(CurrentAction newAction, CharacterScheduleEntry *data, uint16 roomNum) {
-	assert(data->parent() != NULL);
+	assert(data->parent() != nullptr);
 	_action = newAction;
 	_supportData = data;
 	_dynamicSupportData = false;
@@ -1344,8 +1344,8 @@ CurrentActionEntry::CurrentActionEntry(CurrentActionEntry *src) {
 	_roomNumber = src->_roomNumber;
 	if (!_dynamicSupportData)
 		_supportData = src->_supportData;
-	else if (src->_supportData == NULL)
-		_supportData = NULL;
+	else if (src->_supportData == nullptr)
+		_supportData = nullptr;
 	else {
 		_supportData = new CharacterScheduleEntry(src->_supportData);
 	}
@@ -1385,7 +1385,7 @@ void CurrentActionEntry::saveToStream(Common::WriteStream *stream) const {
 CurrentActionEntry *CurrentActionEntry::loadFromStream(Common::ReadStream *stream) {
 	Resources &res = Resources::getReference();
 	uint8 actionNum = stream->readByte();
-	if (actionNum == 0xff) return NULL;
+	if (actionNum == 0xff) return nullptr;
 	CurrentActionEntry *result;
 
 	uint16 roomNumber = stream->readUint16LE();
@@ -1470,7 +1470,7 @@ void CurrentActionStack::loadFromStream(Common::ReadStream *stream) {
 	CurrentActionEntry *rec;
 
 	_actions.clear();
-	while ((rec = CurrentActionEntry::loadFromStream(stream)) != NULL)
+	while ((rec = CurrentActionEntry::loadFromStream(stream)) != nullptr)
 		_actions.push_back(ActionsList::value_type(rec));
 }
 
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp
index cb817abbca..ae1a013d73 100644
--- a/engines/lure/room.cpp
+++ b/engines/lure/room.cpp
@@ -98,12 +98,12 @@ RoomLayer::RoomLayer(uint16 screenId, bool backgroundLayer):
 Room::Room(): _screen(Screen::getReference()) {
 	int_room = this;
 
-	_roomData = NULL;
-	_talkDialog = NULL;
+	_roomData = nullptr;
+	_talkDialog = nullptr;
 	_hotspotId = 0;
 	_hotspotName[0] = '\0';
 	_statusLine[0] = '\0';
-	for (int ctr = 0; ctr < MAX_NUM_LAYERS; ++ctr) _layers[ctr] = NULL;
+	for (int ctr = 0; ctr < MAX_NUM_LAYERS; ++ctr) _layers[ctr] = nullptr;
 	_numLayers = 0;
 	_showInfo = false;
 	_isExit = false;
@@ -120,7 +120,7 @@ Room::~Room() {
 		delete _layers[layerNum];
 
 	delete _talkDialog;
-	int_room = NULL;
+	int_room = nullptr;
 }
 
 Room &Room::getReference() {
@@ -168,7 +168,7 @@ void Room::checkRoomHotspots() {
 	Mouse &m = Mouse::getReference();
 	Resources &res = Resources::getReference();
 	HotspotDataList &list = res.hotspotData();
-	HotspotData *entry = NULL;
+	HotspotData *entry = nullptr;
 	int16 currentX = m.x();
 	int16 currentY = m.y();
 	HotspotDataList::iterator i;
@@ -230,7 +230,7 @@ void Room::checkRoomHotspots() {
 	if (i == list.end()) {
 		_hotspotId = 0;
 		_hotspotNameId = 0;
-		_hotspot = NULL;
+		_hotspot = nullptr;
 	} else {
 		_hotspotNameId = entry->nameId;
 		_hotspot = entry;
@@ -319,10 +319,10 @@ void Room::addLayers(Hotspot &h) {
 		// Check foreground layers for an occupied one
 
 		int layerNum = 1;
-		while ((layerNum < 4) && (_layers[layerNum] != NULL) &&
+		while ((layerNum < 4) && (_layers[layerNum] != nullptr) &&
 				(_layers[layerNum]->getCell(xStart, yEnd) == 0xff))
 			++layerNum;
-		if ((layerNum == 4) || (_layers[layerNum] == NULL)) continue;
+		if ((layerNum == 4) || (_layers[layerNum] == nullptr)) continue;
 
 		int16 ye = yEnd - NUM_EDGE_RECTS;
 		for (int16 yCtr = 0; yCtr < numY; ++yCtr, --ye) {
@@ -335,10 +335,10 @@ void Room::addLayers(Hotspot &h) {
 void Room::addCell(int16 xp, int16 yp, int layerNum) {
 	Surface &s = _screen.screen();
 
-	while ((layerNum < 4) && (_layers[layerNum] != NULL) &&
+	while ((layerNum < 4) && (_layers[layerNum] != nullptr) &&
 			(_layers[layerNum]->getCell(xp + NUM_EDGE_RECTS, yp + NUM_EDGE_RECTS) >= 0xfe))
 		++layerNum;
-	if ((layerNum == 4) || (_layers[layerNum] == NULL)) return;
+	if ((layerNum == 4) || (_layers[layerNum] == nullptr)) return;
 
 	RoomLayer *layer = _layers[layerNum];
 
@@ -360,10 +360,10 @@ void Room::addCell(int16 xp, int16 yp, int layerNum) {
 
 void Room::blockMerge() {
 	for (int layerNum1 = 0; layerNum1 < 3; ++layerNum1) {
-		if (_layers[layerNum1] == NULL) break;
+		if (_layers[layerNum1] == nullptr) break;
 
 		for (int layerNum2 = layerNum1 + 1; layerNum2 < 4; ++layerNum2) {
-			if (_layers[layerNum2] == NULL) break;
+			if (_layers[layerNum2] == nullptr) break;
 
 			for (int yp = 0; yp < NUM_VERT_RECTS; ++yp) {
 				for (int xp = 0; xp < NUM_HORIZ_RECTS; ++xp) {
@@ -390,7 +390,7 @@ void Room::blockMerge() {
 
 void Room::layersPostProcess() {
 	for (int layerNum = 1; layerNum < 4; ++layerNum) {
-		if (_layers[layerNum] == NULL)
+		if (_layers[layerNum] == nullptr)
 			continue;
 
 		// Layer optimisation
@@ -481,7 +481,7 @@ void Room::update() {
 	if (_talkDialog)  {
 		// Make sure the character is still active and in the viewing room
 		Hotspot *talkCharacter = res.getActiveHotspot(res.getTalkingCharacter());
-		if ((talkCharacter != NULL) && (talkCharacter->roomNumber() == _roomNumber))
+		if ((talkCharacter != nullptr) && (talkCharacter->roomNumber() == _roomNumber))
 			_talkDialog->copyTo(&s, _talkDialogX, _talkDialogY);
 	}
 
@@ -506,7 +506,7 @@ void Room::update() {
 
 	// Debug - if the bottle object is on layer 0FEh, then display it's surface
 	Hotspot *displayHotspot = res.getActiveHotspot(BOTTLE_HOTSPOT_ID);
-	if ((displayHotspot != NULL) && (displayHotspot->layer() == 0xfe))
+	if ((displayHotspot != nullptr) && (displayHotspot->layer() == 0xfe))
 		displayHotspot->frames().copyTo(&s);
 
 	// If show information is turned on, show extra debugging information
@@ -568,7 +568,7 @@ void Room::setRoomNumber(uint16 newRoomNumber, bool showOverlay) {
 		for (int layerNum = 0; layerNum < _numLayers; ++layerNum) {
 			if (_layers[layerNum]) {
 				delete _layers[layerNum];
-				_layers[layerNum] = NULL;
+				_layers[layerNum] = nullptr;
 			}
 		}
 
@@ -697,7 +697,7 @@ void Room::setTalkDialog(uint16 srcCharacterId, uint16 destCharacterId, uint16 u
 
 	if (_talkDialog) {
 		delete _talkDialog;
-		_talkDialog = NULL;
+		_talkDialog = nullptr;
 	}
 /*
 	if (res.getTalkingCharacter() != 0) {
@@ -762,7 +762,7 @@ bool Room::checkInTalkDialog() {
 }
 
 void Room::saveToStream(Common::WriteStream *stream) {
-	if (_talkDialog == NULL)
+	if (_talkDialog == nullptr)
 		stream->writeUint16LE(0);
 	else
 		_talkDialog->saveToStream(stream);
@@ -778,7 +778,7 @@ void Room::loadFromStream(Common::ReadStream *stream) {
 
 	if (_talkDialog) {
 		delete _talkDialog;
-		_talkDialog = NULL;
+		_talkDialog = nullptr;
 	}
 
 	if (saveVersion >= 26)
diff --git a/engines/lure/screen.cpp b/engines/lure/screen.cpp
index e867459f8b..84f5809a74 100644
--- a/engines/lure/screen.cpp
+++ b/engines/lure/screen.cpp
@@ -31,7 +31,7 @@
 
 namespace Lure {
 
-static Screen *int_disk = NULL;
+static Screen *int_disk = nullptr;
 
 Screen &Screen::getReference() {
 	return *int_disk;
@@ -69,7 +69,7 @@ void Screen::setSystemPalette(Palette *p, uint16 start, uint16 num) {
 // Defaults the palette to an empty set
 
 void Screen::setPaletteEmpty(int numEntries) {
-	Palette emptyPalette(numEntries, NULL, RGB64);
+	Palette emptyPalette(numEntries, nullptr, RGB64);
 	setSystemPalette(&emptyPalette, 0, numEntries);
 	_palette->copyFrom(&emptyPalette);
 /*
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp
index 4239d041f5..2db92888db 100644
--- a/engines/lure/scripts.cpp
+++ b/engines/lure/scripts.cpp
@@ -71,7 +71,7 @@ void Script::setHotspotScript(uint16 hotspotId, uint16 scriptIndex, uint16 v3) {
 	uint16 offset = res.getHotspotScript(scriptIndex);
 	Hotspot *hotspot = res.getActiveHotspot(hotspotId);
 
-	if (hotspot != NULL) {
+	if (hotspot != nullptr) {
 		hotspot->setHotspotScript(offset);
 	} else {
 		HotspotData *hs = res.getHotspot(hotspotId);
@@ -561,7 +561,7 @@ void Script::checkWakeBrenda(uint16 v1, uint16 v2, uint16 v3) {
 
 void Script::displayMessage(uint16 messageId, uint16 characterId, uint16 destCharacterId) {
 	Hotspot *hotspot = Resources::getReference().getActiveHotspot(characterId);
-	if (hotspot != NULL)
+	if (hotspot != nullptr)
 		hotspot->showMessage(messageId, destCharacterId);
 }
 
@@ -589,7 +589,7 @@ void Script::setSupportData(uint16 hotspotId, uint16 index, uint16 v3) {
 
 	uint16 dataId = res.getCharOffset(index);
 	CharacterScheduleEntry *entry = res.charSchedules().getEntry(dataId);
-	assert(entry != NULL);
+	assert(entry != nullptr);
 
 	Hotspot *h = res.getActiveHotspot(hotspotId);
 	assert(h);
@@ -775,7 +775,7 @@ void Script::checkSound(uint16 soundNumber, uint16 v2, uint16 v3) {
 	Sound.tidySounds();
 
 	SoundDescResource *rec = Sound.findSound(soundNumber);
-	Resources::getReference().fieldList().setField(GENERAL, (rec != NULL) ? 1 : 0);
+	Resources::getReference().fieldList().setField(GENERAL, (rec != nullptr) ? 1 : 0);
 }
 
 typedef void(*SequenceMethodPtr)(uint16, uint16, uint16);
@@ -853,7 +853,7 @@ static const SequenceMethodRecord scriptMethods[] = {
 	{64, Script::randomToGeneral},
 	{65, Script::checkCellDoor},
 	{66, Script::checkSound},
-	{0xff, NULL}};
+	{0xff, nullptr}};
 
 static const char *scriptOpcodes[] = {
 	"ABORT", "ADD", "SUBTRACT", "MULTIPLY", "DIVIDE", "EQUALS", "NOT_EQUALS",
@@ -1104,7 +1104,7 @@ uint16 Script::execute(uint16 startOffset) {
 			if (gDebugLevel >= ERROR_DETAILED) {
 				// Set up the debug string for the method call
 				if (rec->methodIndex == 0xff) strcat(debugInfo, " INVALID INDEX");
-				else if (scriptMethodNames[param] == NULL) strcat(debugInfo, " UNKNOWN METHOD");
+				else if (scriptMethodNames[param] == nullptr) strcat(debugInfo, " UNKNOWN METHOD");
 				else {
 					strcat(debugInfo, " ");
 					Common::strlcat(debugInfo, scriptMethodNames[param], MAX_DESC_SIZE);
diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp
index 6e35182fa8..9138ad34f4 100644
--- a/engines/lure/sound.cpp
+++ b/engines/lure/sound.cpp
@@ -47,7 +47,7 @@ SoundManager::SoundManager() {
 
 	_descs = disk.getEntry(SOUND_DESC_RESOURCE_ID);
 	_numDescs = _descs->size() / sizeof(SoundDescResource);
-	_soundData = NULL;
+	_soundData = nullptr;
 	_paused = false;
 
 	MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32);
@@ -72,7 +72,7 @@ SoundManager::SoundManager() {
 
 SoundManager::~SoundManager() {
 	if (_driver)
-		_driver->setTimerCallback(this, NULL);
+		_driver->setTimerCallback(this, nullptr);
 
 	removeSounds();
 	_activeSounds.clear();
@@ -88,7 +88,7 @@ SoundManager::~SoundManager() {
 		_driver->stopAllNotes();
 		_driver->close();
 		delete _driver;
-		_driver = NULL;
+		_driver = nullptr;
 	}
 }
 
@@ -127,7 +127,7 @@ void SoundManager::loadSection(uint16 sectionId) {
 
 	if (_soundData) {
 		delete _soundData;
-		_driver->setTimerCallback(this, NULL);
+		_driver->setTimerCallback(this, nullptr);
 	}
 
 	_soundData = Disk::getReference().getEntry(sectionId);
@@ -137,7 +137,7 @@ void SoundManager::loadSection(uint16 sectionId) {
 }
 
 bool SoundManager::initCustomTimbres(bool canAbort) {
-	if (!_isRoland || !_nativeMT32 || _mt32Driver == NULL)
+	if (!_isRoland || !_nativeMT32 || _mt32Driver == nullptr)
 		return false;
 
 	if (!_soundData)
@@ -316,7 +316,7 @@ void SoundManager::addSound2(uint8 soundIndex) {
 	} else {
 		SoundDescResource &descEntry = soundDescs()[soundIndex];
 		SoundDescResource *rec = findSound(descEntry.soundNumber);
-		if (rec == NULL)
+		if (rec == nullptr)
 			// Sound isn't active, so go and add it
 			addSound(soundIndex, false);
 	}
@@ -378,7 +378,7 @@ SoundDescResource *SoundManager::findSound(uint8 soundNumber) {
 
 	// Signal that sound wasn't found
 	debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "SoundManager::findSound - sound not found");
-	return NULL;
+	return nullptr;
 }
 
 void SoundManager::tidySounds() {
@@ -500,7 +500,7 @@ void SoundManager::musicInterface_Play(uint8 soundNumber, bool isMusic, uint8 nu
 	if (soundNum > _soundsTotal)
 		error("Invalid sound index %d requested", soundNum);
 
-	if (_driver == NULL)
+	if (_driver == nullptr)
 		// Only play sounds if a sound driver is active
 		return;
 
@@ -763,7 +763,7 @@ MidiMusic::MidiMusic(MidiDriver_Multisource *driver, uint8 soundNum, bool isMus,
 	// Check whether the music data is compressed - if so, decompress it for the duration
 	// of playing the sound
 
-	_decompressedSound = NULL;
+	_decompressedSound = nullptr;
 	if ((*_soundData == 'C') || (*_soundData == 'c')) {
 		uint32 packedSize = size - 0x201;
 		_decompressedSound = Memory::allocate(packedSize * 2);
@@ -982,7 +982,7 @@ void MidiDriver_ADLIB_Lure::metaEvent(int8 source, byte type, byte *data, uint16
 }
 
 MidiDriver_ADLIB_Lure::InstrumentInfo MidiDriver_ADLIB_Lure::determineInstrument(uint8 channel, uint8 source, uint8 note) {
-	InstrumentInfo instrument = { 0, 0, 0 };
+	InstrumentInfo instrument = { 0, nullptr, 0 };
 
 	// Lure does not use a rhythm channel.
 	instrument.oplNote = note;
diff --git a/engines/lure/strings.cpp b/engines/lure/strings.cpp
index 9adec63516..aa536f09dd 100644
--- a/engines/lure/strings.cpp
+++ b/engines/lure/strings.cpp
@@ -29,13 +29,13 @@
 
 namespace Lure {
 
-StringData *int_strings = NULL;
+StringData *int_strings = nullptr;
 
 StringData::StringData() {
 	int_strings = this;
 	Disk &disk = Disk::getReference();
 
-	for (uint8 ctr = 0; ctr < MAX_NUM_CHARS; ++ctr) _chars[ctr] = NULL;
+	for (uint8 ctr = 0; ctr < MAX_NUM_CHARS; ++ctr) _chars[ctr] = nullptr;
 	_numChars = 0;
 	_names = Disk::getReference().getEntry(NAMES_RESOURCE_ID);
 	_strings[0] = disk.getEntry(STRINGS_RESOURCE_ID);
@@ -56,7 +56,7 @@ StringData::StringData() {
 }
 
 StringData::~StringData() {
-	int_strings = NULL;
+	int_strings = nullptr;
 
 	for (uint8 ctr = 0; ctr < MAX_NUM_CHARS; ++ctr)
 		if (_chars[ctr]) delete _chars[ctr];
@@ -166,7 +166,7 @@ char StringData::readCharacter() {
 		searchValue |= readBit() << (numBits - 1);
 
 		// Scan through list for a match
-		for (int index = 0; _chars[index] != NULL; ++index) {
+		for (int index = 0; _chars[index] != nullptr; ++index) {
 			if ((_chars[index]->_numBits == numBits) &&
 				(_chars[index]->_sequence == searchValue))
 				return _chars[index]->_ascii;
@@ -203,7 +203,7 @@ void StringData::getString(uint16 stringId, char *dest, const char *hotspotName,
 			const char *p = (ch == '1') ? hotspotName : characterName;
 			int article = !includeArticles ? 0 : ((ch == '1') ? hotspotArticle : characterArticle);
 
-			if (p != NULL) {
+			if (p != nullptr) {
 				if (article > 0) {
 					strcpy(destPos, stringList.getString(S_ARTICLE_LIST + article - 1));
 					strcat(destPos, p);
diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp
index ee54db41a1..4a7e06f547 100644
--- a/engines/lure/surface.cpp
+++ b/engines/lure/surface.cpp
@@ -38,8 +38,8 @@ namespace Lure {
 // These variables hold resources commonly used by the Surfaces, and must be initialized and freed
 // by the static Surface methods initialize and deinitailse
 
-static MemoryBlock *int_font = NULL;
-static MemoryBlock *int_dialog_frame = NULL;
+static MemoryBlock *int_font = nullptr;
+static MemoryBlock *int_dialog_frame = nullptr;
 static uint8 fontSize[256];
 static int numFontChars;
 
@@ -408,13 +408,13 @@ void Surface::wordWrap(char *text, uint16 width, char **&lines, uint8 &numLines)
 		char *wordEnd2 = strchr(wordStart, '\n');
 		if ((!wordEnd) || ((wordEnd2) && (wordEnd2 < wordEnd))) {
 			wordEnd = wordEnd2;
-			newLine = (wordEnd2 != NULL);
+			newLine = (wordEnd2 != nullptr);
 		} else {
 			newLine = false;
 		}
 
 		debugC(ERROR_DETAILED, kLureDebugStrings, "word scanning: start=%xh, after=%xh, newLine=%d",
-			(uint32)(wordStart - text), (uint32)((wordEnd == NULL) ? -1 : wordEnd - text), newLine ? 1 : 0);
+			(uint32)(wordStart - text), (uint32)((wordEnd == nullptr) ? -1 : wordEnd - text), newLine ? 1 : 0);
 
 		if (wordEnd) {
 			if (*wordEnd != '\0') --wordEnd;
@@ -637,7 +637,7 @@ void Dialog::show(uint16 stringId, const char *hotspotName, const char *characte
 }
 
 void Dialog::show(uint16 stringId) {
-	show(stringId, NULL, NULL);
+	show(stringId, nullptr, nullptr);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -786,21 +786,21 @@ TalkDialog::TalkDialog(uint16 characterId, uint16 destCharacterId, uint16 active
 	_descId = descId;
 
 	HotspotData *talkingChar = res.getHotspot(characterId);
-	HotspotData *destCharacter = (destCharacterId == 0) ? NULL :
+	HotspotData *destCharacter = (destCharacterId == 0) ? nullptr :
 		res.getHotspot(destCharacterId);
-	HotspotData *itemHotspot = (activeItemId == 0) ? NULL :
+	HotspotData *itemHotspot = (activeItemId == 0) ? nullptr :
 		res.getHotspot(activeItemId);
 	assert(talkingChar);
 
 	strings.getString(talkingChar->nameId & 0x1fff, srcCharName);
 
 	strcpy(destCharName, "");
-	if (destCharacter != NULL) {
+	if (destCharacter != nullptr) {
 		strings.getString(destCharacter->nameId, destCharName);
 		characterArticle = getArticle(descId, destCharacter->nameId);
 	}
 	strcpy(itemName, "");
-	if (itemHotspot != NULL) {
+	if (itemHotspot != nullptr) {
 		strings.getString(itemHotspot->nameId & 0x1fff, itemName);
 		hotspotArticle = getArticle(descId, itemHotspot->nameId);
 	}
@@ -887,7 +887,7 @@ void TalkDialog::saveToStream(Common::WriteStream *stream) {
 TalkDialog *TalkDialog::loadFromStream(Common::ReadStream *stream) {
 	uint16 characterId = stream->readUint16LE();
 	if (characterId == 0)
-		return NULL;
+		return nullptr;
 
 	uint16 destCharacterId = stream->readUint16LE();
 	uint16 activeItemId = stream->readUint16LE();
@@ -939,7 +939,7 @@ bool SaveRestoreDialog::show(bool saveDialog) {
 	Common::String **saveNames = (Common::String **)Memory::alloc(sizeof(Common::String *) * MAX_SAVEGAME_SLOTS);
 	int numSaves = 0;
 	while ((numSaves < MAX_SAVEGAME_SLOTS) &&
-		((saveNames[numSaves] = engine.detectSave(numSaves + 1)) != NULL))
+		((saveNames[numSaves] = engine.detectSave(numSaves + 1)) != nullptr))
 		++numSaves;
 
 	// For the save dialog, if all the slots have not been used up, create a
@@ -1141,7 +1141,7 @@ bool RestartRestoreDialog::show() {
 
 	// See if there are any savegames that can be restored
 	Common::String *firstSave = engine.detectSave(1);
-	bool restartFlag = (firstSave == NULL);
+	bool restartFlag = (firstSave == nullptr);
 	int highlightedButton = -1;
 
 	if (!restartFlag) {
@@ -1428,7 +1428,7 @@ void CopyProtectionDialog::chooseCharacters() {
 AudioInitIcon::AudioInitIcon() : _visible(false) {
 	if (LureEngine::getReference().isEGA()) {
 		// The icon is not shown on EGA
-		_iconSurface = 0;
+		_iconSurface = nullptr;
 	} else {
 		// Load icon
 		_iconSurface = new Surface(Disk::getReference().getEntry(AUDIO_INIT_ICON_RESOURCE_ID), 14, 14);


Commit: 619a6bafe342b9d65f6f4c2d3f1d9104f0c8f258
    https://github.com/scummvm/scummvm/commit/619a6bafe342b9d65f6f4c2d3f1d9104f0c8f258
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
MACVENTURE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/macventure/controls.cpp
    engines/macventure/datafiles.cpp
    engines/macventure/detection.cpp
    engines/macventure/gui.cpp
    engines/macventure/macventure.cpp
    engines/macventure/sound.cpp
    engines/macventure/world.cpp


diff --git a/engines/macventure/controls.cpp b/engines/macventure/controls.cpp
index 1db02999a5..71a2cda058 100644
--- a/engines/macventure/controls.cpp
+++ b/engines/macventure/controls.cpp
@@ -32,7 +32,7 @@
 
 namespace MacVenture {
 CommandButton::CommandButton() {
-	_gui = NULL;
+	_gui = nullptr;
 }
 
 CommandButton::CommandButton(ControlData data, Gui *g) {
diff --git a/engines/macventure/datafiles.cpp b/engines/macventure/datafiles.cpp
index ec5febd37a..376b107996 100644
--- a/engines/macventure/datafiles.cpp
+++ b/engines/macventure/datafiles.cpp
@@ -85,7 +85,7 @@ Common::SeekableReadStream *MacVentureEngine::getBorderFile(MVWindowType windowT
 	filename += (isActive ? "_act.bmp" : "_inac.bmp");
 	if (!_dataBundle->hasFile(filename)) {
 		warning("Missing border file '%s' in data bundle", filename.c_str());
-		return NULL;
+		return nullptr;
 	}
 
 	return _dataBundle->createReadStreamForMember(filename);
diff --git a/engines/macventure/detection.cpp b/engines/macventure/detection.cpp
index e5d895f547..d827ed34d6 100644
--- a/engines/macventure/detection.cpp
+++ b/engines/macventure/detection.cpp
@@ -58,7 +58,7 @@ static const PlainGameDescriptor macventureGames[] = {
 	{ "deja_vu", "Deja Vu"},
 	{ "deja_vu2", "Deja Vu II"},
 	{ "uninvited", "Uninvited."},
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 namespace MacVenture {
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index ef8fd82976..2a71ad344f 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -78,15 +78,15 @@ static const Graphics::MacMenuData menuSubItems[] = {
 	//{ kMenuAbout,		"About",			kMenuActionAbout, 0, true},
 
 	{ kMenuFile,		"New",				kMenuActionNew, 0, true },
-	{ kMenuFile,		NULL,				0, 0, false },
+	{ kMenuFile,		nullptr,				0, 0, false },
 	{ kMenuFile,		"Open...",			kMenuActionOpen, 0, true },
 	{ kMenuFile,		"Save",				kMenuActionSave, 0, true },
 	{ kMenuFile,		"Save as...",		kMenuActionSaveAs, 0, true },
-	{ kMenuFile,		NULL,				0, 0, false },
+	{ kMenuFile,		nullptr,				0, 0, false },
 	{ kMenuFile,		"Quit",				kMenuActionQuit, 0, true },
 
 	{ kMenuEdit,		"Undo",				kMenuActionUndo, 'Z', false },
-	{ kMenuEdit,		NULL,				0, 0, false },
+	{ kMenuEdit,		nullptr,				0, 0, false },
 	{ kMenuEdit,		"Cut",				kMenuActionCut, 'K', false },
 	{ kMenuEdit,		"Copy",				kMenuActionCopy, 'C', false },
 	{ kMenuEdit,		"Paste",			kMenuActionPaste, 'V', false },
@@ -95,7 +95,7 @@ static const Graphics::MacMenuData menuSubItems[] = {
 	{ kMenuSpecial,		"Clean Up",			kMenuActionCleanUp, 0, false },
 	{ kMenuSpecial,		"Mess Up",			kMenuActionMessUp, 0, false },
 
-	{ 0,				NULL,				0, 0, false }
+	{ 0,				nullptr,				0, 0, false }
 };
 
 
@@ -112,16 +112,16 @@ void menuCommandsCallback(int action, Common::String &text, void *data);
 Gui::Gui(MacVentureEngine *engine, Common::MacResManager *resman) {
 	_engine = engine;
 	_resourceManager = resman;
-	_windowData = NULL;
-	_controlData = NULL;
+	_windowData = nullptr;
+	_controlData = nullptr;
 	_draggedObj.id = 0;
 	_draggedObj.pos = Common::Point(0, 0);
-	_dialog = NULL;
+	_dialog = nullptr;
 
 	_cursor = new Cursor(this);
 
 	_consoleText = new ConsoleText(this);
-	_graphics = NULL;
+	_graphics = nullptr;
 
 	initGUI();
 }
@@ -931,7 +931,7 @@ void Gui::showPrebuiltDialog(PrebuiltDialogs type) {
 }
 
 bool Gui::isDialogOpen() {
-	return _dialog != NULL;
+	return _dialog != nullptr;
 }
 
 void Gui::setTextInput(const Common::String &str) {
@@ -940,7 +940,7 @@ void Gui::setTextInput(const Common::String &str) {
 
 void Gui::closeDialog() {
 	delete _dialog;
-	_dialog = NULL;
+	_dialog = nullptr;
 }
 
 void Gui::getTextFromUser() {
@@ -1037,7 +1037,7 @@ Graphics::MacWindow *Gui::findWindow(WindowReference reference) {
 	}
 	switch (reference) {
 	case MacVenture::kNoWindow:
-		return NULL;
+		return nullptr;
 	case MacVenture::kCommandsWindow:
 		return _controlsWindow;
 	case MacVenture::kMainGameWindow:
@@ -1051,9 +1051,9 @@ Graphics::MacWindow *Gui::findWindow(WindowReference reference) {
 	case MacVenture::kDiplomaWindow:
 		return _diplomaWindow;
 	default:
-		return NULL;
+		return nullptr;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void Gui::ensureInventoryOpen(WindowReference reference, ObjID id) {
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 25f39687a2..9e611feccb 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -64,21 +64,21 @@ MacVentureEngine::MacVentureEngine(OSystem *syst, const ADGameDescription *gameD
 	_gameDescription = gameDesc;
 	_rnd = new Common::RandomSource("macventure");
 
-	_resourceManager = NULL;
-	_globalSettings = NULL;
-	_gui = NULL;
-	_world = NULL;
-	_scriptEngine = NULL;
-	_filenames = NULL;
+	_resourceManager = nullptr;
+	_globalSettings = nullptr;
+	_gui = nullptr;
+	_world = nullptr;
+	_scriptEngine = nullptr;
+	_filenames = nullptr;
 
-	_decodingDirectArticles = NULL;
-	_decodingNamingArticles = NULL;
-	_decodingIndirectArticles = NULL;
-	_textHuffman = NULL;
+	_decodingDirectArticles = nullptr;
+	_decodingNamingArticles = nullptr;
+	_decodingIndirectArticles = nullptr;
+	_textHuffman = nullptr;
 
-	_soundManager = NULL;
+	_soundManager = nullptr;
 
-	_dataBundle = NULL;
+	_dataBundle = nullptr;
 
 	debug("MacVenture::MacVentureEngine()");
 }
diff --git a/engines/macventure/sound.cpp b/engines/macventure/sound.cpp
index f09612f41a..034c03d8c7 100644
--- a/engines/macventure/sound.cpp
+++ b/engines/macventure/sound.cpp
@@ -38,7 +38,7 @@ namespace MacVenture {
 
 // SoundManager
 SoundManager::SoundManager(MacVentureEngine *engine, Audio::Mixer *mixer) {
-	_container = NULL;
+	_container = nullptr;
 	Common::String filename = engine->getFilePath(kSoundPathID);
 	_container = new Container(filename);
 	_mixer = mixer;
diff --git a/engines/macventure/world.cpp b/engines/macventure/world.cpp
index b8b7aeaf59..9aafabb5df 100644
--- a/engines/macventure/world.cpp
+++ b/engines/macventure/world.cpp
@@ -38,8 +38,8 @@ namespace MacVenture {
 World::World(MacVentureEngine *engine, Common::MacResManager *resMan) {
 	_resourceManager = resMan;
 	_engine = engine;
-	_saveGame = NULL;
-	_gameText = NULL;
+	_saveGame = nullptr;
+	_gameText = nullptr;
 
 	startNewGame();
 


Commit: 6333092801076b5e5e952543061f6272efb3be44
    https://github.com/scummvm/scummvm/commit/6333092801076b5e5e952543061f6272efb3be44
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
MADE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/made/database.cpp
    engines/made/detection.cpp
    engines/made/made.cpp
    engines/made/music.cpp
    engines/made/pmvplayer.cpp
    engines/made/resource.cpp
    engines/made/screen.cpp
    engines/made/scriptfuncs.cpp


diff --git a/engines/made/database.cpp b/engines/made/database.cpp
index 1e7209a629..ecc77e5771 100644
--- a/engines/made/database.cpp
+++ b/engines/made/database.cpp
@@ -39,7 +39,7 @@ namespace Made {
 	< 0x7FFE  object
 */
 
-Object::Object() : _objData(NULL), _freeData(false) {
+Object::Object() : _objData(nullptr), _freeData(false) {
 	_objSize = 0;
 }
 
@@ -52,7 +52,7 @@ const char *Object::getString() {
 	if (getClass() == 0x7FFF)
 		return (const char*)getData();
 	else
-		return NULL;
+		return nullptr;
 }
 
 void Object::setString(const char *str) {
@@ -327,7 +327,7 @@ void GameDatabase::setObjectString(int16 index, const char *str) {
 int16 *GameDatabase::findObjectPropertyCached(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
 	uint32 id = (objectIndex << 16) | propertyId;
 	ObjectPropertyCacheMap::iterator iter = _objectPropertyCache.find(id);
-	int16 *propertyPtr = NULL;
+	int16 *propertyPtr = nullptr;
 	if (iter != _objectPropertyCache.end()) {
 		propertyPtr = (*iter)._value;
 	} else {
@@ -386,7 +386,7 @@ void GameDatabase::dumpObject(int16 index) {
 
 /* GameDatabaseV2 */
 
-GameDatabaseV2::GameDatabaseV2(MadeEngine *vm) : GameDatabase(vm), _gameText(NULL) {
+GameDatabaseV2::GameDatabaseV2(MadeEngine *vm) : GameDatabase(vm), _gameText(nullptr) {
 }
 
 GameDatabaseV2::~GameDatabaseV2() {
@@ -550,7 +550,7 @@ int16 *GameDatabaseV2::findObjectProperty(int16 objectIndex, int16 propertyId, i
 	// Now check in the object hierarchy of the given object
 	int16 parentObjectIndex = obj->getClass();
 	if (parentObjectIndex == 0) {
-		return NULL;
+		return nullptr;
 	}
 
 	while (parentObjectIndex != 0) {
@@ -587,7 +587,7 @@ int16 *GameDatabaseV2::findObjectProperty(int16 objectIndex, int16 propertyId, i
 	}
 
 	debug(1, "findObjectProperty(%04X, %04X) Property not found", objectIndex, propertyId);
-	return NULL;
+	return nullptr;
 
 }
 
@@ -783,7 +783,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i
 	// Now check in the object hierarchy of the given object
 	int16 parentObjectIndex = obj->getClass();
 	if (parentObjectIndex == 0) {
-		return NULL;
+		return nullptr;
 	}
 
 	while (parentObjectIndex != 0) {
@@ -829,13 +829,13 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i
 
 	}
 
-	return NULL;
+	return nullptr;
 
 }
 
 const char *GameDatabaseV3::getString(uint16 offset) {
 	// Not used in version 3 games
-	return NULL;
+	return nullptr;
 }
 
 } // End of namespace Made
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index 15b7db9929..debe1da067 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -32,7 +32,7 @@ static const PlainGameDescriptor madeGames[] = {
 	{"rtz", "Return to Zork"},
 	{"lgop2", "Leather Goddesses of Phobos 2"},
 	{"rodney", "Rodney's Funscreen"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #include "made/detection_tables.h"
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index e9af8225cf..d5ac2a1827 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -47,7 +47,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
 	_eventKey = 0;
 	_autoStopSound = false;
 	_soundEnergyIndex = 0;
-	_soundEnergyArray = 0;
+	_soundEnergyArray = nullptr;
 	_musicBeatStart = 0;
 	_cdTimeStart = 0;
 	_introMusicDigital = true;
diff --git a/engines/made/music.cpp b/engines/made/music.cpp
index 166008a040..4fff069a09 100644
--- a/engines/made/music.cpp
+++ b/engines/made/music.cpp
@@ -38,7 +38,7 @@ namespace Made {
 
 const uint8 MusicPlayer::MT32_GOODBYE_MSG[] = { 0x52, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x20, 0x54, 0x6F, 0x20, 0x5A, 0x6F, 0x72, 0x6B, 0x20, 0x53, 0x6F, 0x6F, 0x6E, 0x21 };
 
-MusicPlayer::MusicPlayer(MadeEngine *vm, bool milesAudio) : _vm(vm), _parser(0) {
+MusicPlayer::MusicPlayer(MadeEngine *vm, bool milesAudio) : _vm(vm), _parser(nullptr) {
 	MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32);
 	_driverType = MidiDriver::getMusicType(dev);
 	if (_driverType == MT_GM && ConfMan.getBool("native_mt32"))
@@ -90,7 +90,7 @@ MusicPlayer::~MusicPlayer() {
 		delete _parser;
 	}
 	if (_driver) {
-		_driver->setTimerCallback(0, 0);
+		_driver->setTimerCallback(nullptr, nullptr);
 		_driver->close();
 		delete _driver;
 	}
@@ -112,7 +112,7 @@ void MusicPlayer::playXMIDI(GenericResource *midiResource) {
 	if (_parser) {
 		_parser->unloadMusic();
 	} else {
-		_parser = MidiParser::createParser_XMIDI(0, 0, 0);
+		_parser = MidiParser::createParser_XMIDI(nullptr, nullptr, 0);
 
 		_parser->setMidiDriver(_driver);
 		_parser->setTimerRate(_driver->getBaseTempo());
diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp
index 8cc87a10a6..620b6473ab 100644
--- a/engines/made/pmvplayer.cpp
+++ b/engines/made/pmvplayer.cpp
@@ -105,7 +105,7 @@ bool PmvPlayer::play(const char *filename) {
 	uint32 soundSize = 0;
 	uint32 soundChunkOfs = 0, palChunkOfs = 0;
 	uint32 palSize = 0;
-	byte *frameData = 0, *audioData, *soundData, *palData, *imageData;
+	byte *frameData = nullptr, *audioData, *soundData, *palData, *imageData;
 	bool firstTime = true;
 
 	uint32 skipFrames = 0;
@@ -155,7 +155,7 @@ bool PmvPlayer::play(const char *filename) {
 
 			soundSize = chunkCount * chunkSize;
 			soundData = (byte *)malloc(soundSize);
-			decompressSound(audioData + 8, soundData, chunkSize, chunkCount, NULL, soundDecoderData);
+			decompressSound(audioData + 8, soundData, chunkSize, chunkCount, nullptr, soundDecoderData);
 			_audioStream->queueBuffer(soundData, soundSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
 		}
 
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp
index 08642d6ee4..836bb1ea46 100644
--- a/engines/made/resource.cpp
+++ b/engines/made/resource.cpp
@@ -41,7 +41,7 @@ Resource::~Resource() {
 
 /* PictureResource */
 
-PictureResource::PictureResource() : _picture(NULL), _picturePalette(NULL) {
+PictureResource::PictureResource() : _picture(nullptr), _picturePalette(nullptr) {
 	_hasPalette = false;
 	_paletteColorCount = 0;
 }
@@ -50,11 +50,11 @@ PictureResource::~PictureResource() {
 	if (_picture) {
 		_picture->free();
 		delete _picture;
-		_picture = 0;
+		_picture = nullptr;
 	}
 
 	delete[] _picturePalette;
-	_picturePalette = 0;
+	_picturePalette = nullptr;
 }
 
 void PictureResource::load(byte *source, int size) {
@@ -244,7 +244,7 @@ void AnimationResource::load(byte *source, int size) {
 
 /* SoundResource */
 
-SoundResource::SoundResource() : _soundSize(0), _soundData(NULL) {
+SoundResource::SoundResource() : _soundSize(0), _soundData(nullptr) {
 	_soundEnergyArray = nullptr;
 }
 
@@ -308,12 +308,12 @@ const char *MenuResource::getString(uint index) const {
 	if (index < _strings.size())
 		return _strings[index].c_str();
 	else
-		return NULL;
+		return nullptr;
 }
 
 /* FontResource */
 
-FontResource::FontResource() : _data(NULL), _size(0) {
+FontResource::FontResource() : _data(nullptr), _size(0) {
 }
 
 FontResource::~FontResource() {
@@ -343,7 +343,7 @@ byte *FontResource::getChar(uint c) const {
 	if (charData)
 		return charData + 1;
 	else
-		return NULL;
+		return nullptr;
 }
 
 int FontResource::getTextWidth(const char *text) {
@@ -358,13 +358,13 @@ int FontResource::getTextWidth(const char *text) {
 
 byte *FontResource::getCharData(uint c) const {
 	if (c < 28 || c > 255)
-		return NULL;
+		return nullptr;
 	return _data + 1 + (c - 28) * (getHeight() + 1);
 }
 
 /* GenericResource */
 
-GenericResource::GenericResource() : _data(NULL), _size(0) {
+GenericResource::GenericResource() : _data(nullptr), _size(0) {
 }
 
 GenericResource::~GenericResource() {
@@ -542,12 +542,12 @@ ResourceSlot *ResourceReader::getResourceSlot(uint32 resType, uint index) {
 	ResourceSlots *slots = _resSlots[resType];
 
 	if (!slots)
-		return NULL;
+		return nullptr;
 
 	if (index >= 1 && index < slots->size()) {
 		return &(*slots)[index];
 	} else {
-		return NULL;
+		return nullptr;
 	}
 }
 
@@ -583,7 +583,7 @@ void ResourceReader::purgeCache() {
 			if (slot->refCount <= 0 && slot->res) {
 				_cacheDataSize -= slot->size;
 				delete slot->res;
-				slot->res = NULL;
+				slot->res = nullptr;
 				slot->refCount = 0;
 				_cacheCount--;
 			}
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index 33edb3834c..c83db92889 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -87,7 +87,7 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) {
 	_textRect.top = 0;
 	_textRect.right = 320;
 	_textRect.bottom = 200;
-	_font = NULL;
+	_font = nullptr;
 	_currentFontNum = 0;
 	_fontDrawCtx.clipRect = Common::Rect(320, 200);
 	_fontDrawCtx.destSurface = _backgroundScreen;
@@ -155,7 +155,7 @@ void Screen::setExcludeArea(uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
 
 void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 flipX, int16 flipY, int16 mask, const ClipInfo &clipInfo) {
 
-	byte *source, *dest, *maskp = 0;
+	byte *source, *dest, *maskp = nullptr;
 	int startX = 0;
 	int startY = 0;
 	int clipWidth = sourceSurface->w;
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index 3cde7fe2fe..d5cbb8b8e8 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -300,7 +300,7 @@ int16 ScriptFunctions::sfStopMusic(int16 argc, int16 *argv) {
 	if (_vm->_music->isPlaying() && _musicRes) {
 		_vm->_music->stop();
 		_vm->_res->freeResource(_musicRes);
-		_musicRes = NULL;
+		_musicRes = nullptr;
 	}
 	return 0;
 }
@@ -498,7 +498,7 @@ int16 ScriptFunctions::sfSetFont(int16 argc, int16 *argv) {
 
 int16 ScriptFunctions::sfDrawText(int16 argc, int16 *argv) {
 
-	const char *text = NULL;
+	const char *text = nullptr;
 
 	if (_vm->getGameID() == GID_RTZ) {
 		text = _vm->_dat->getObjectString(argv[argc - 1]);


Commit: b55edb580a86b59f8805f9cb63a846f446769d20
    https://github.com/scummvm/scummvm/commit/b55edb580a86b59f8805f9cb63a846f446769d20
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
MADS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/mads/detection.cpp
    engines/mads/palette.cpp


diff --git a/engines/mads/detection.cpp b/engines/mads/detection.cpp
index c76eb88807..ae2a44e5f2 100644
--- a/engines/mads/detection.cpp
+++ b/engines/mads/detection.cpp
@@ -34,7 +34,7 @@ static const PlainGameDescriptor MADSGames[] = {
 	{"dragonsphere", "Dragonsphere"},
 	{"nebular", "Rex Nebular and the Cosmic Gender Bender"},
 	{"phantom", "Return of the Phantom"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp
index de870295a5..1112c5feac 100644
--- a/engines/mads/palette.cpp
+++ b/engines/mads/palette.cpp
@@ -724,7 +724,7 @@ uint8 Palette::palIndexFromRgb(byte r, byte g, byte b, byte *paletteData) {
 	int32 minDist = 0x7fffffff;
 	byte palData[PALETTE_SIZE];
 
-	if (paletteData == NULL) {
+	if (paletteData == nullptr) {
 		g_system->getPaletteManager()->grabPalette(palData, 0, PALETTE_COUNT);
 		paletteData = &palData[0];
 	}


Commit: e8087376625ff41ab7b679c11ee5b3607c9a8f09
    https://github.com/scummvm/scummvm/commit/e8087376625ff41ab7b679c11ee5b3607c9a8f09
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
MOHAWK: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/mohawk/cstime_game.cpp
    engines/mohawk/cstime_ui.cpp
    engines/mohawk/cstime_view.cpp
    engines/mohawk/livingbooks.cpp
    engines/mohawk/livingbooks_code.cpp
    engines/mohawk/livingbooks_lbx.cpp


diff --git a/engines/mohawk/cstime_game.cpp b/engines/mohawk/cstime_game.cpp
index 4f9e3982b0..16b6b50328 100644
--- a/engines/mohawk/cstime_game.cpp
+++ b/engines/mohawk/cstime_game.cpp
@@ -83,13 +83,13 @@ CSTimeChar::CSTimeChar(MohawkEngine_CSTime *vm, CSTimeScene *scene, uint id) : _
 	_flappingState = 0xffff;
 	_surfingState = 0;
 
-	_NIS = NULL;
-	_restFeature = NULL;
-	_talkFeature = NULL;
+	_NIS = nullptr;
+	_restFeature = nullptr;
+	_talkFeature = nullptr;
 
-	_talkFeature1 = NULL;
-	_talkFeature2 = NULL;
-	_talkFeature3 = NULL;
+	_talkFeature1 = nullptr;
+	_talkFeature2 = nullptr;
+	_talkFeature3 = nullptr;
 	_lastTime1 = 0;
 	_lastTime2 = 0;
 	_lastTime3 = 0;
@@ -163,7 +163,7 @@ void CSTimeChar::stopAmbients(bool restpos) {
 		if (!_ambients[i].feature)
 			continue;
 		_vm->getView()->removeFeature(_ambients[i].feature, true);
-		_ambients[i].feature = NULL;
+		_ambients[i].feature = nullptr;
 	}
 
 	if (restpos)
@@ -177,7 +177,7 @@ void CSTimeChar::setupRestPos() {
 	if (!_restFeature) {
 		uint id = _enabled ? 0 : 13;
 		uint32 flags = kFeatureSortStatic | kFeatureNewNoLoop | kFeatureNewDisableOnReset;
-		Feature *feature = _vm->getView()->installViewFeature(getChrBaseId() + id, flags, NULL);
+		Feature *feature = _vm->getView()->installViewFeature(getChrBaseId() + id, flags, nullptr);
 		// FIXME: fix priorities
 		_restFeature = feature;
 	} else {
@@ -203,12 +203,12 @@ void CSTimeChar::removeChr() {
 	if (_restFeature)
 		_vm->getView()->removeFeature(_restFeature, true);
 
-	_talkFeature1 = NULL;
-	_talkFeature2 = NULL;
-	_talkFeature3 = NULL;
+	_talkFeature1 = nullptr;
+	_talkFeature2 = nullptr;
+	_talkFeature3 = nullptr;
 
-	_talkFeature = NULL;
-	_restFeature = NULL;
+	_talkFeature = nullptr;
+	_restFeature = nullptr;
 }
 
 uint16 CSTimeChar::getChrBaseId() {
@@ -227,7 +227,7 @@ void CSTimeChar::playNIS(uint16 id) {
 	stopAmbients(false);
 	removeChr();
 	uint32 flags = kFeatureSortStatic | kFeatureNewNoLoop;
-	_NIS = _vm->getView()->installViewFeature(getChrTypeScriptBase() + id + _ambients.size(), flags, NULL);
+	_NIS = _vm->getView()->installViewFeature(getChrTypeScriptBase() + id + _ambients.size(), flags, nullptr);
 	// FIXME: fix priorities
 }
 
@@ -239,7 +239,7 @@ void CSTimeChar::removeNIS() {
 	if (!_NIS)
 		return;
 	_vm->getView()->removeFeature(_NIS, true);
-	_NIS = NULL;
+	_NIS = nullptr;
 }
 
 void CSTimeChar::startFlapping(uint16 id) {
@@ -249,7 +249,7 @@ void CSTimeChar::startFlapping(uint16 id) {
 	_scene->_activeChar = this;
 	if (_restFeature) {
 		_vm->getView()->removeFeature(_restFeature, true);
-		_restFeature = NULL;
+		_restFeature = nullptr;
 	}
 	stopAmbients(false);
 	setupTalk();
@@ -265,7 +265,7 @@ void CSTimeChar::interruptFlapping() {
 }
 
 void CSTimeChar::installAmbientAnim(uint id, uint32 flags) {
-	Feature *feature = _vm->getView()->installViewFeature(getChrTypeScriptBase() + id, flags, NULL);
+	Feature *feature = _vm->getView()->installViewFeature(getChrTypeScriptBase() + id, flags, nullptr);
 	// FIXME: fix priorities
 
 	_ambients[id].feature = feature;
@@ -312,13 +312,13 @@ void CSTimeChar::setupTalk() {
 		return;
 
 	uint32 flags = kFeatureSortStatic | kFeatureNewNoLoop | kFeatureNewDisableOnReset;
-	_talkFeature = _vm->getView()->installViewFeature(getChrBaseId() + (_enabled ? 1 : 14), flags, NULL);
+	_talkFeature = _vm->getView()->installViewFeature(getChrBaseId() + (_enabled ? 1 : 14), flags, nullptr);
 
-	_talkFeature3 = _vm->getView()->installViewFeature(getChrBaseId() + (_enabled ? 4 : 15), flags, NULL);
+	_talkFeature3 = _vm->getView()->installViewFeature(getChrBaseId() + (_enabled ? 4 : 15), flags, nullptr);
 	if (_enabled) {
-		_talkFeature1 = _vm->getView()->installViewFeature(getChrBaseId() + 2, flags, NULL);
+		_talkFeature1 = _vm->getView()->installViewFeature(getChrBaseId() + 2, flags, nullptr);
 		if (_unknown1 > 1) {
-			_talkFeature2 = _vm->getView()->installViewFeature(getChrBaseId() + 10, flags, NULL);
+			_talkFeature2 = _vm->getView()->installViewFeature(getChrBaseId() + 10, flags, nullptr);
 		}
 	}
 	// FIXME: fix priorities
@@ -699,7 +699,7 @@ void CSTimeCase::loadRolloverText() {
 
 CSTimeInventoryObject *CSTimeCase::loadInventoryObject(uint id) {
 	CSTimeInventoryObject *invObj = new CSTimeInventoryObject;
-	invObj->feature = NULL;
+	invObj->feature = nullptr;
 	invObj->id = id;
 
 	Common::SeekableReadStream *invObjStream = _vm->getResource(ID_INVO, id + 1);
@@ -755,7 +755,7 @@ CSTimeScene *CSTimeCase::getCurrScene() {
 
 CSTimeScene::CSTimeScene(MohawkEngine_CSTime *vm, CSTimeCase *case_, uint id) : _vm(vm), _case(case_), _id(id) {
 	_visitCount = 0;
-	_activeChar = NULL;
+	_activeChar = nullptr;
 	_currHotspot = 0xffff;
 	_hoverHotspot = 0xffff;
 	load();
@@ -804,7 +804,7 @@ void CSTimeScene::load() {
 		for (uint j = 0; j < numAmbients; j++) {
 			CSTimeAmbient ambient;
 			ambient.delay = sceneStream->readUint16BE();
-			ambient.feature = NULL;
+			ambient.feature = nullptr;
 			chr->_ambients.push_back(ambient);
 		}
 		_chars.push_back(chr);
@@ -863,7 +863,7 @@ void CSTimeScene::buildScene() {
 		// FIXME: deal with NULL
 		uint32 flags = kFeatureSortStatic | kFeatureNewNoLoop | kFeatureNewDisableOnReset;
 		assert(flags == 0x4C00000);
-		Feature *feature = _vm->getView()->installViewFeature(resourceId + i, flags, NULL);
+		Feature *feature = _vm->getView()->installViewFeature(resourceId + i, flags, nullptr);
 		_objectFeatures.push_back(feature);
 	}
 }
diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp
index d173b78ac5..a58767efad 100644
--- a/engines/mohawk/cstime_ui.cpp
+++ b/engines/mohawk/cstime_ui.cpp
@@ -74,10 +74,10 @@ CSTimeInterface::CSTimeInterface(MohawkEngine_CSTime *vm) : _vm(vm) {
 			error("failed to load rollover font");
 	}
 
-	_uiFeature = NULL;
-	_dialogTextFeature = NULL;
-	_rolloverTextFeature = NULL;
-	_bubbleTextFeature = NULL;
+	_uiFeature = nullptr;
+	_dialogTextFeature = nullptr;
+	_rolloverTextFeature = nullptr;
+	_bubbleTextFeature = nullptr;
 
 	_draggedItem = 0;
 
@@ -194,21 +194,21 @@ void CSTimeInterface::install() {
 
 	// TODO: store/reset these
 
-	_dialogTextFeature = _vm->getView()->installViewFeature(0, 0, NULL);
+	_dialogTextFeature = _vm->getView()->installViewFeature(0, 0, nullptr);
 	_dialogTextFeature->_data.bounds = _dialogTextRect;
 	_dialogTextFeature->_data.bitmapIds[0] = 0;
 	// We don't set a port.
 	_dialogTextFeature->_moveProc = (Module::FeatureProc)&CSTimeModule::dialogTextMoveProc;
 	_dialogTextFeature->_drawProc = (Module::FeatureProc)&CSTimeModule::dialogTextDrawProc;
-	_dialogTextFeature->_timeProc = NULL;
+	_dialogTextFeature->_timeProc = nullptr;
 	_dialogTextFeature->_flags = kFeatureOldSortForeground; // FIXME: not in original
 
-	_rolloverTextFeature = _vm->getView()->installViewFeature(0, 0, NULL);
+	_rolloverTextFeature = _vm->getView()->installViewFeature(0, 0, nullptr);
 	_rolloverTextFeature->_data.bounds = Common::Rect(0 + 100, 340 + 5, 640 - 100, 480 - 25);
 	_rolloverTextFeature->_data.bitmapIds[0] = 0;
 	_rolloverTextFeature->_moveProc = (Module::FeatureProc)&CSTimeModule::rolloverTextMoveProc;
 	_rolloverTextFeature->_drawProc = (Module::FeatureProc)&CSTimeModule::rolloverTextDrawProc;
-	_rolloverTextFeature->_timeProc = NULL;
+	_rolloverTextFeature->_timeProc = nullptr;
 	_rolloverTextFeature->_flags = kFeatureOldSortForeground; // FIXME: not in original
 }
 
@@ -218,7 +218,7 @@ void CSTimeInterface::draw() {
 		uint32 flags = kFeatureSortStatic | kFeatureNewNoLoop;
 		assert(flags == 0x4800000);
 		uint16 resourceId = 100; // TODO
-		_uiFeature = _vm->getView()->installViewFeature(resourceId, flags, NULL);
+		_uiFeature = _vm->getView()->installViewFeature(resourceId, flags, nullptr);
 		// TODO: special-case for case 20
 	} else {
 		_uiFeature->resetFeatureScript(1, 0);
@@ -617,19 +617,19 @@ void CSTimeInterface::drawTextToBubble(Common::String *text) {
 		error("unknown bubble type %d in drawTextToBubble", bubbleId);
 	}
 
-	_bubbleTextFeature = _vm->getView()->installViewFeature(0, 0, NULL);
+	_bubbleTextFeature = _vm->getView()->installViewFeature(0, 0, nullptr);
 	_bubbleTextFeature->_data.bounds = bounds;
 	_bubbleTextFeature->_data.bitmapIds[0] = 0;
 	_bubbleTextFeature->_moveProc = (Module::FeatureProc)&CSTimeModule::bubbleTextMoveProc;
 	_bubbleTextFeature->_drawProc = (Module::FeatureProc)&CSTimeModule::bubbleTextDrawProc;
-	_bubbleTextFeature->_timeProc = NULL;
+	_bubbleTextFeature->_timeProc = nullptr;
 	_bubbleTextFeature->_flags = kFeatureOldSortForeground; // FIXME: not in original
 }
 
 void CSTimeInterface::closeBubble() {
 	if (_bubbleTextFeature)
 		_vm->getView()->removeFeature(_bubbleTextFeature, true);
-	_bubbleTextFeature = NULL;
+	_bubbleTextFeature = nullptr;
 }
 
 void CSTimeInterface::startDragging(uint16 id) {
@@ -646,7 +646,7 @@ void CSTimeInterface::startDragging(uint16 id) {
 	}
 
 	uint32 dragFlags = (grabbedFromInventory() ? 0x800 : 0x600);
-	_vm->getView()->dragFeature((NewFeature *)invObj->feature, _grabPoint, 4, dragFlags, NULL);
+	_vm->getView()->dragFeature((NewFeature *)invObj->feature, _grabPoint, 4, dragFlags, nullptr);
 
 	if (_vm->getCase()->getId() == 1 && id == 2) {
 		// Hardcoded behavior for the torch in the first case.
@@ -735,24 +735,24 @@ void CSTimeInterface::stopDragging() {
 	// Deal with the actual drop.
 	if (grabbedFromInventory()) {
 		if (!consumeObj) {
-			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x800, NULL);
+			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x800, nullptr);
 			// TODO: playSound(151);
 		} else if (_draggedItem != TIME_CUFFS_ID) {
-			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x600, NULL);
+			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x600, nullptr);
 			_vm->_haveInvItem[_draggedItem] = 0;
-			invObj->feature = NULL;
+			invObj->feature = nullptr;
 			invObj->featureDisabled = true;
 			_inventoryDisplay->removeItem(_draggedItem);
 		} else if (!_inventoryDisplay->getCuffsState()) {
 			// Inactive cuffs.
 			// TODO: We never actually get here? Which would explain why it makes no sense.
-			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x800, NULL);
-			invObj->feature = NULL;
+			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x800, nullptr);
+			invObj->feature = nullptr;
 		} else {
 			// Active cuffs.
-			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x600, NULL);
+			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x600, nullptr);
 			_vm->_haveInvItem[_draggedItem] = 0;
-			invObj->feature = NULL;
+			invObj->feature = nullptr;
 			invObj->featureDisabled = true;
 		}
 
@@ -763,11 +763,11 @@ void CSTimeInterface::stopDragging() {
 		_inventoryDisplay->draw();
 	} else {
 		uint32 dragFlags = 0x600;
-		_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, dragFlags, NULL);
+		_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, dragFlags, nullptr);
 
 		if (_inventoryDisplay->_invRect.contains(mousePos)) {
 			// Dropped into the inventory.
-			invObj->feature = NULL;
+			invObj->feature = nullptr;
 			if (invObj->canTake) {
 				dropItemInInventory(_draggedItem);
 				if (invObj->hotspotId)
@@ -790,12 +790,12 @@ void CSTimeInterface::stopDragging() {
 			CSTimeEvent event;
 			event.param1 = 0xffff;
 			if (consumeObj) {
-				invObj->feature = NULL;
+				invObj->feature = nullptr;
 				invObj->featureDisabled = true;
 				event.type = kCSTimeEventDisableHotspot;
 				event.param2 = invObj->hotspotId;
 			} else {
-				invObj->feature = NULL;
+				invObj->feature = nullptr;
 				event.type = kCSTimeEventAddFeature;
 				event.param2 = invObj->featureId;
 			}
@@ -843,7 +843,7 @@ void CSTimeInterface::dropItemInInventory(uint16 id) {
 		return;
 
 	_vm->_haveInvItem[id] = 1;
-	_vm->getCase()->_inventoryObjs[id]->feature = NULL;
+	_vm->getCase()->_inventoryObjs[id]->feature = nullptr;
 
 	_inventoryDisplay->insertItemInDisplay(id);
 
@@ -1087,7 +1087,7 @@ void CSTimeInventoryDisplay::draw() {
 				id = 100 + 12;
 				flags &= ~kFeatureNewNoLoop;
 			}
-			invObj->feature = _vm->getView()->installViewFeature(id, flags, NULL);
+			invObj->feature = _vm->getView()->installViewFeature(id, flags, nullptr);
 		} else {
 			Common::Point pos((_itemRect[i].left + _itemRect[i].right) / 2, (_itemRect[i].top + _itemRect[i].bottom) / 2);
 			uint16 id = 9000 + (invObj->id - 1);
@@ -1166,7 +1166,7 @@ void CSTimeInventoryDisplay::removeItem(uint16 id) {
 	CSTimeInventoryObject *invObj = _vm->getCase()->_inventoryObjs[id];
 	if (invObj->feature) {
 		_vm->getView()->removeFeature(invObj->feature, true);
-		invObj->feature = NULL;
+		invObj->feature = nullptr;
 	}
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++)
 		if (_displayedItems[i] == id)
@@ -1261,7 +1261,7 @@ void CSTimeInventoryDisplay::activateCuffs(bool active) {
 	if (invObj->feature)
 		_vm->getView()->removeFeature(invObj->feature, true);
 	uint32 flags = kFeatureSortStatic | kFeatureNewNoLoop;
-	invObj->feature = _vm->getView()->installViewFeature(100 + _cuffsShape, flags, NULL);
+	invObj->feature = _vm->getView()->installViewFeature(100 + _cuffsShape, flags, nullptr);
 	invObj->featureDisabled = false;
 }
 
@@ -1271,7 +1271,7 @@ void CSTimeInventoryDisplay::setCuffsFlashing() {
 	if (invObj->feature)
 		_vm->getView()->removeFeature(invObj->feature, true);
 	uint32 flags = kFeatureSortStatic | 0x2000;
-	invObj->feature = _vm->getView()->installViewFeature(100 + _cuffsShape, flags, NULL);
+	invObj->feature = _vm->getView()->installViewFeature(100 + _cuffsShape, flags, nullptr);
 	invObj->featureDisabled = false;
 }
 
@@ -1286,7 +1286,7 @@ bool CSTimeInventoryDisplay::isItemDisplayed(uint16 id) {
 
 CSTimeBook::CSTimeBook(MohawkEngine_CSTime *vm) : _vm(vm) {
 	_state = 0;
-	_smallBookFeature = NULL;
+	_smallBookFeature = nullptr;
 }
 
 CSTimeBook::~CSTimeBook() {
@@ -1294,15 +1294,15 @@ CSTimeBook::~CSTimeBook() {
 
 void CSTimeBook::drawSmallBook() {
 	if (!_smallBookFeature) {
-		_smallBookFeature = _vm->getView()->installViewFeature(101, kFeatureSortStatic | kFeatureNewNoLoop, NULL);
+		_smallBookFeature = _vm->getView()->installViewFeature(101, kFeatureSortStatic | kFeatureNewNoLoop, nullptr);
 	} else {
-		_smallBookFeature->resetFeature(false, NULL, 0);
+		_smallBookFeature->resetFeature(false, nullptr, 0);
 	}
 }
 
 CSTimeCarmenNote::CSTimeCarmenNote(MohawkEngine_CSTime *vm) : _vm(vm) {
 	_state = 0;
-	_feature = NULL;
+	_feature = nullptr;
 	clearPieces();
 }
 
@@ -1377,7 +1377,7 @@ void CSTimeCarmenNote::drawSmallNote() {
 
 	if (_feature)
 		_vm->getView()->removeFeature(_feature, true);
-	_feature = _vm->getView()->installViewFeature(id, kFeatureSortStatic | kFeatureNewNoLoop, NULL);
+	_feature = _vm->getView()->installViewFeature(id, kFeatureSortStatic | kFeatureNewNoLoop, nullptr);
 }
 
 void CSTimeCarmenNote::drawBigNote() {
@@ -1398,7 +1398,7 @@ void CSTimeCarmenNote::drawBigNote() {
 
 	if (_feature)
 		_vm->getView()->removeFeature(_feature, true);
-	_feature = _vm->getView()->installViewFeature(id, kFeatureSortStatic | kFeatureNewNoLoop, NULL);
+	_feature = _vm->getView()->installViewFeature(id, kFeatureSortStatic | kFeatureNewNoLoop, nullptr);
 	// FIXME: attach note drawing proc
 	_state = 2;
 }
diff --git a/engines/mohawk/cstime_view.cpp b/engines/mohawk/cstime_view.cpp
index 310da16a23..4d9355afce 100644
--- a/engines/mohawk/cstime_view.cpp
+++ b/engines/mohawk/cstime_view.cpp
@@ -45,20 +45,20 @@ uint32 CSTimeView::getTime() {
 void CSTimeView::setupView() {
 	_rootNode = new NewFeature(this);
 	_cursorNode = new NewFeature(this);
-	_rootNode->setNodeDefaults(NULL, _cursorNode);
+	_rootNode->setNodeDefaults(nullptr, _cursorNode);
 	_rootNode->_id = 1; // TODO: 10 in new?
 	_rootNode->_data.enabled = 0;
 	_rootNode->_flags = kFeatureSortBackground;
-	_rootNode->_moveProc = NULL;
-	_rootNode->_drawProc = NULL;
-	_rootNode->_timeProc = NULL;
-	_cursorNode->setNodeDefaults(_rootNode, NULL);
+	_rootNode->_moveProc = nullptr;
+	_rootNode->_drawProc = nullptr;
+	_rootNode->_timeProc = nullptr;
+	_cursorNode->setNodeDefaults(_rootNode, nullptr);
 	_cursorNode->_id = 0xffff; // TODO: 1 in new?
 	_cursorNode->_data.enabled = 0;
 	_cursorNode->_flags = kFeatureOldSortForeground; // TODO: 0x4000 in new..
 	_cursorNode->_moveProc = (Module::FeatureProc)&CSTimeModule::cursorMoveProc;
 	_cursorNode->_drawProc = (Module::FeatureProc)&CSTimeModule::cursorDrawProc;
-	_cursorNode->_timeProc = NULL;
+	_cursorNode->_timeProc = nullptr;
 }
 
 Feature *CSTimeView::installViewFeature(uint16 scrbId, uint32 flags, Common::Point *pos) {
@@ -81,7 +81,7 @@ Feature *CSTimeView::installViewFeature(uint16 scrbId, uint32 flags, Common::Poi
 	feature->_pickupProc = (Module::PickupProc)&CSTimeModule::defaultPickupProc;
 	feature->_dropProc = (Module::FeatureProc)&CSTimeModule::defaultDropProc;
 	feature->_dragMoveProc = (Module::FeatureProc)&CSTimeModule::defaultDragMoveProc;
-	feature->_oldMoveProc = NULL;
+	feature->_oldMoveProc = nullptr;
 	feature->_dragFlags = 0x8000;
 
 	feature->_id = getNewFeatureId();
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index c9284ce93b..a73962d919 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -77,8 +77,8 @@ Common::Rect MohawkEngine_LivingBooks::readRect(Common::ReadStreamEndian *stream
 }
 
 LBPage::LBPage(MohawkEngine_LivingBooks *vm) : _vm(vm) {
-	_code = NULL;
-	_mhk = NULL;
+	_code = nullptr;
+	_mhk = nullptr;
 
 	_baseId = 0;
 	_cascade = false;
@@ -144,9 +144,9 @@ MohawkEngine_LivingBooks::MohawkEngine_LivingBooks(OSystem *syst, const MohawkGa
 
 	_rnd = new Common::RandomSource("livingbooks");
 
-	_sound = NULL;
-	_video = NULL;
-	_page = NULL;
+	_sound = nullptr;
+	_video = nullptr;
+	_page = nullptr;
 
 	const Common::FSNode gameDataDir(ConfMan.get("path"));
 	// Rugrats
@@ -208,7 +208,7 @@ Common::Error MohawkEngine_LivingBooks::run() {
 	Common::Event event;
 	while (!shouldQuit()) {
 		while (_eventMan->pollEvent(event)) {
-			LBItem *found = NULL;
+			LBItem *found = nullptr;
 
 			switch (event.type) {
 			case Common::EVENT_MOUSEMOVE:
@@ -330,7 +330,7 @@ void MohawkEngine_LivingBooks::loadBookInfo(const Common::String &filename) {
 			Common::String command = Common::String::format("%s = %s", i->key.c_str(), i->value.c_str());
 			LBCode tempCode(this, 0);
 			uint offset = tempCode.parseCode(command);
-			tempCode.runCode(NULL, offset);
+			tempCode.runCode(nullptr, offset);
 		}
 	}
 }
@@ -370,11 +370,11 @@ void MohawkEngine_LivingBooks::destroyPage() {
 	delete _page;
 	assert(_items.empty());
 	assert(_orderedItems.empty());
-	_page = NULL;
+	_page = nullptr;
 
 	_notifyEvents.clear();
 
-	_focus = NULL;
+	_focus = nullptr;
 }
 
 // Replace any colons (originally a slash) with another character
@@ -644,7 +644,7 @@ void MohawkEngine_LivingBooks::updatePage() {
 				_page->itemDestroyed(delayedEvent.item);
 				delete delayedEvent.item;
 				if (_focus == delayedEvent.item)
-					_focus = NULL;
+					_focus = nullptr;
 				break;
 			case kLBDelayedEventSetNotVisible:
 				_items[i]->setVisible(false);
@@ -713,7 +713,7 @@ LBItem *MohawkEngine_LivingBooks::getItemById(uint16 id) {
 		if (_items[i]->getId() == id)
 			return _items[i];
 
-	return NULL;
+	return nullptr;
 }
 
 LBItem *MohawkEngine_LivingBooks::getItemByName(Common::String name) {
@@ -721,7 +721,7 @@ LBItem *MohawkEngine_LivingBooks::getItemByName(Common::String name) {
 		if (_items[i]->getName() == name)
 			return _items[i];
 
-	return NULL;
+	return nullptr;
 }
 
 void MohawkEngine_LivingBooks::setFocus(LBItem *focus) {
@@ -1483,7 +1483,7 @@ void LBAnimationNode::loadScript(uint16 resourceId) {
 		entry.size = size;
 
 		if (!size) {
-			entry.data = NULL;
+			entry.data = nullptr;
 		} else {
 			entry.data = new byte[entry.size];
 			scriptStream->read(entry.data, entry.size);
@@ -2020,9 +2020,9 @@ uint16 LBAnimation::getParentId() {
 
 LBScriptEntry::LBScriptEntry() {
 	state = 0;
-	data = NULL;
-	argvParam = NULL;
-	argvTarget = NULL;
+	data = nullptr;
+	argvParam = nullptr;
+	argvTarget = nullptr;
 }
 
 LBScriptEntry::~LBScriptEntry() {
@@ -2558,7 +2558,7 @@ void LBItem::handleMouseMove(Common::Point pos) {
 }
 
 void LBItem::handleMouseUp(Common::Point pos) {
-	_vm->setFocus(NULL);
+	_vm->setFocus(nullptr);
 	runScript(kLBEventMouseUp);
 	runScript(kLBEventMouseUpIn);
 }
@@ -3341,7 +3341,7 @@ LBPaletteItem::LBPaletteItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common:
 	debug(3, "new LBPaletteItem");
 
 	_fadeInStart = 0;
-	_palette = NULL;
+	_palette = nullptr;
 }
 
 LBPaletteItem::~LBPaletteItem() {
@@ -3732,7 +3732,7 @@ LBItem *LBPictureItem::createClone() {
 }
 
 LBAnimationItem::LBAnimationItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common::Rect rect) : LBItem(vm, page, rect) {
-	_anim = NULL;
+	_anim = nullptr;
 	_running = false;
 	debug(3, "new LBAnimationItem");
 }
@@ -3939,7 +3939,7 @@ LBItem *LBMiniGameItem::createClone() {
 LBProxyItem::LBProxyItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common::Rect rect) : LBItem(vm, page, rect) {
 	debug(3, "new LBProxyItem");
 
-	_page = NULL;
+	_page = nullptr;
 }
 
 LBProxyItem::~LBProxyItem() {
@@ -3974,7 +3974,7 @@ void LBProxyItem::load() {
 
 void LBProxyItem::unload() {
 	delete _page;
-	_page = NULL;
+	_page = nullptr;
 
 	LBItem::unload();
 }
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index f5feba92a3..69cc7b6e32 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -176,7 +176,7 @@ Common::Rect LBValue::toRect() const {
 
 LBCode::LBCode(MohawkEngine_LivingBooks *vm, uint16 baseId) : _vm(vm) {
 	if (!baseId) {
-		_data = NULL;
+		_data = nullptr;
 		_size = 0;
 		return;
 	}
@@ -796,7 +796,7 @@ LBValue *LBCode::getIndexedVar(Common::String varname, const Common::Array<LBVal
 		if (index[i].type != kLBValueInteger)
 			error("index %d wasn't an integer", i);
 		if (index[i].integer < 1 || index[i].integer > (int)var->list->array.size())
-			return NULL;
+			return nullptr;
 		var = &var->list->array[index[i].integer - 1];
 	}
 	return var;
@@ -809,7 +809,7 @@ LBItem *LBCode::resolveItem(const LBValue &value) {
 		return _vm->getItemByName(value.string);
 	if (value.type == kLBValueInteger)
 		return _vm->getItemById(value.integer);
-	return NULL;
+	return nullptr;
 }
 
 Common::Array<LBValue> LBCode::readParams() {
@@ -898,123 +898,123 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = {
 	{ "right", &LBCode::cmdRight },
 	{ "xpos", &LBCode::cmdXPos },
 	{ "ypos", &LBCode::cmdYPos },
-	{ "playFrom", 0 },
+	{ "playFrom", nullptr },
 	{ "move", &LBCode::cmdMove },
-	{ 0, 0 },
-	{ 0, 0 },
+	{ nullptr, nullptr },
+	{ nullptr, nullptr },
 	{ "setDragParams", &LBCode::cmdSetDragParams },
-	{ "resetDragParams", 0 },
+	{ "resetDragParams", nullptr },
 	{ "enableRollover", &LBCode::cmdUnimplemented /* FIXME */ },
-	{ "setCursor", 0 },
+	{ "setCursor", nullptr },
 	{ "width", &LBCode::cmdWidth },
 	{ "height", &LBCode::cmdHeight },
-	{ "getFrameBounds", 0 }, // also "getFrameRect"
-	{ "traceRect", 0 },
-	{ "sqrt", 0 },
+	{ "getFrameBounds", nullptr }, // also "getFrameRect"
+	{ "traceRect", nullptr },
+	{ "sqrt", nullptr },
 	// 0x20
 	{ "deleteVar", &LBCode::cmdDeleteVar },
-	{ "saveVars", 0 },
-	{ "scriptLink", 0 },
+	{ "saveVars", nullptr },
+	{ "scriptLink", nullptr },
 	{ "setViewOrigin", &LBCode::cmdUnimplemented },
-	{ "rectSect", 0 },
-	{ "getViewOrigin", 0 },
-	{ "getViewRect", 0 },
-	{ "getPage", 0 },
-	{ "getWorldRect", 0 },
-	{ "isWorldWrap", 0 },
+	{ "rectSect", nullptr },
+	{ "getViewOrigin", nullptr },
+	{ "getViewRect", nullptr },
+	{ "getPage", nullptr },
+	{ "getWorldRect", nullptr },
+	{ "isWorldWrap", nullptr },
 	{ "newList", &LBCode::cmdNewList },
-	{ "deleteList", 0 },
+	{ "deleteList", nullptr },
 	{ "add", &LBCode::cmdAdd },
-	{ 0, 0 },
+	{ nullptr, nullptr },
 	{ "addAt", &LBCode::cmdAddAt },
-	{ "getAt", 0 },
+	{ "getAt", nullptr },
 	// 0x30
-	{ 0, 0 },
-	{ "getIndex", 0 },
+	{ nullptr, nullptr },
+	{ "getIndex", nullptr },
 	{ "setAt", &LBCode::cmdSetAt },
 	{ "listLen", &LBCode::cmdListLen },
 	{ "deleteAt", &LBCode::cmdDeleteAt },
 	{ "clearList", &LBCode::cmdUnimplemented },
-	{ "setWorld", 0 },
+	{ "setWorld", nullptr },
 	{ "setProperty", &LBCode::cmdSetProperty },
 	{ "getProperty", &LBCode::cmdGetProperty },
-	{ "copyList", 0 },
-	{ "invoke", 0 },
+	{ "copyList", nullptr },
+	{ "invoke", nullptr },
 	{ "exec", &LBCode::cmdExec },
 	{ "return", &LBCode::cmdReturn },
-	{ "sendSync", 0 },
-	{ "moveViewOrigin", 0 },
-	{ "addToGroup", 0 },
+	{ "sendSync", nullptr },
+	{ "moveViewOrigin", nullptr },
+	{ "addToGroup", nullptr },
 	// 0x40
-	{ "removeFromGroup", 0 },
-	{ "clearGroup", 0 },
+	{ "removeFromGroup", nullptr },
+	{ "clearGroup", nullptr },
 	{ "setPlayParams", &LBCode::cmdSetPlayParams },
-	{ "autoEvent", 0 },
-	{ 0, 0 },
-	{ 0, 0 },
-	{ "getID", 0 },
-	{ "setCursorPosition", 0 },
-	{ "getTime", 0 },
-	{ "logWriteLn", 0 },
-	{ "logWrite", 0 },
-	{ "getLanguage", 0 },
-	{ "setLanguage", 0 },
-	{ "getSequence", 0 },
-	{ "setSequence", 0 },
-	{ "getFileSpec", 0 },
+	{ "autoEvent", nullptr },
+	{ nullptr, nullptr },
+	{ nullptr, nullptr },
+	{ "getID", nullptr },
+	{ "setCursorPosition", nullptr },
+	{ "getTime", nullptr },
+	{ "logWriteLn", nullptr },
+	{ "logWrite", nullptr },
+	{ "getLanguage", nullptr },
+	{ "setLanguage", nullptr },
+	{ "getSequence", nullptr },
+	{ "setSequence", nullptr },
+	{ "getFileSpec", nullptr },
 	// 0x50
 	{ "setKeyEvent", &LBCode::cmdSetKeyEvent },
 	{ "setHitTest", &LBCode::cmdSetHitTest },
 	{ "key", &LBCode::cmdKey },
-	{ "deleteKeyEvent", 0 },
+	{ "deleteKeyEvent", nullptr },
 	{ "setDisplay", &LBCode::cmdUnimplemented },
-	{ "getDisplay", 0 },
-	{ 0, 0 },
+	{ "getDisplay", nullptr },
+	{ nullptr, nullptr },
 	{ "lbxCreate", &LBCode::cmdLBXCreate },
 	{ "lbxFunc", &LBCode::cmdLBXFunc },
-	{ "waitCursor", 0 },
-	{ "debugBreak", 0 },
-	{ "menuItemEnable", 0 },
-	{ "showChannel", 0 },
-	{ "hideChannel", 0 },
-	{ "setPageFade", 0 },
-	{ "normalize", 0 },
+	{ "waitCursor", nullptr },
+	{ "debugBreak", nullptr },
+	{ "menuItemEnable", nullptr },
+	{ "showChannel", nullptr },
+	{ "hideChannel", nullptr },
+	{ "setPageFade", nullptr },
+	{ "normalize", nullptr },
 	// 0x60 (v5+)
-	{ "addEvent", 0 },
-	{ "setCueEvent", 0 },
-	{ 0, 0 },
-	{ 0, 0 },
-	{ "getName", 0 },
-	{ "getProperties", 0 },
-	{ "createItem", 0 },
-	{ "setProperties", 0 },
-	{ "alert", 0 },
-	{ "getUniqueID", 0 },
-	{ "isNumeric", 0 },
-	{ "setKeyFocus", 0 },
-	{ "getKeyFocus", 0 },
-	{ "isItem", 0 },
-	{ "itemHit", 0 },
-	{ "getItem ", 0 },
+	{ "addEvent", nullptr },
+	{ "setCueEvent", nullptr },
+	{ nullptr, nullptr },
+	{ nullptr, nullptr },
+	{ "getName", nullptr },
+	{ "getProperties", nullptr },
+	{ "createItem", nullptr },
+	{ "setProperties", nullptr },
+	{ "alert", nullptr },
+	{ "getUniqueID", nullptr },
+	{ "isNumeric", nullptr },
+	{ "setKeyFocus", nullptr },
+	{ "getKeyFocus", nullptr },
+	{ "isItem", nullptr },
+	{ "itemHit", nullptr },
+	{ "getItem ", nullptr },
 	// 0x70
-	{ 0, 0 },
-	{ "setCascade", 0 },
-	{ "getCascade", 0 },
-	{ "getRes", 0 },
-	{ "setRes", 0 },
-	{ "getFilename", 0 },
-	{ "resEnumNames", 0 },
-	{ "isList", 0 },
-	{ "resetRect", 0 },
-	{ "setVolume", 0 },
-	{ "getVolume", 0 },
-	{ "pause", 0 },
-	{ "getTextWidth", 0 },
-	{ "setItemVolume", 0 },
-	{ "setSoundLoop", 0 },
+	{ nullptr, nullptr },
+	{ "setCascade", nullptr },
+	{ "getCascade", nullptr },
+	{ "getRes", nullptr },
+	{ "setRes", nullptr },
+	{ "getFilename", nullptr },
+	{ "resEnumNames", nullptr },
+	{ "isList", nullptr },
+	{ "resetRect", nullptr },
+	{ "setVolume", nullptr },
+	{ "getVolume", nullptr },
+	{ "pause", nullptr },
+	{ "getTextWidth", nullptr },
+	{ "setItemVolume", nullptr },
+	{ "setSoundLoop", nullptr },
 	// 0x80
-	{ "setClipboard", 0 },
-	{ "getResDuration", 0 }
+	{ "setClipboard", nullptr },
+	{ "getResDuration", nullptr }
 };
 
 void LBCode::runGeneralCommand() {
@@ -1472,41 +1472,41 @@ void LBCode::cmdKey(const Common::Array<LBValue> &params) {
 #define NUM_ITEM_COMMANDS 34
 CodeCommandInfo itemCommandInfo[NUM_ITEM_COMMANDS] = {
 	{ "clone", &LBCode::itemClone },
-	{ "destroy", 0 },
-	{ "dragBeginFrom", 0 },
-	{ "dragEnd", 0 },
-	{ "enableLocal", 0 },
-	{ "enable", 0 },
-	{ "showLocal", 0 },
-	{ "show", 0 },
-	{ "getFrame", 0 },
-	{ "getParent", 0 },
-	{ "getPosition" , 0 },
-	{ "getText", 0 },
-	{ "getZNext", 0 },
-	{ "getZPrev", 0 },
-	{ "hitTest", 0 },
+	{ "destroy", nullptr },
+	{ "dragBeginFrom", nullptr },
+	{ "dragEnd", nullptr },
+	{ "enableLocal", nullptr },
+	{ "enable", nullptr },
+	{ "showLocal", nullptr },
+	{ "show", nullptr },
+	{ "getFrame", nullptr },
+	{ "getParent", nullptr },
+	{ "getPosition" , nullptr },
+	{ "getText", nullptr },
+	{ "getZNext", nullptr },
+	{ "getZPrev", nullptr },
+	{ "hitTest", nullptr },
 	// 0x10
-	{ "isAmbient", 0 },
-	{ "isEnabled", 0 },
-	{ "isMuted", 0 },
+	{ "isAmbient", nullptr },
+	{ "isEnabled", nullptr },
+	{ "isMuted", nullptr },
 	{ "isPlaying", &LBCode::itemIsPlaying },
-	{ "isVisible", 0 },
+	{ "isVisible", nullptr },
 	{ "isLoaded", &LBCode::itemIsLoaded },
-	{ "isDragging", 0 },
-	{ "load", 0 },
+	{ "isDragging", nullptr },
+	{ "load", nullptr },
 	{ "moveTo", &LBCode::itemMoveTo },
-	{ "mute", 0 },
-	{ "play", 0 },
+	{ "mute", nullptr },
+	{ "play", nullptr },
 	{ "seek", &LBCode::itemSeek },
 	{ "seekToFrame", &LBCode::itemSeekToFrame },
 	{ "setParent", &LBCode::itemSetParent },
-	{ "setZOrder", 0 },
-	{ "setText", 0 },
+	{ "setZOrder", nullptr },
+	{ "setText", nullptr },
 	// 0x20
-	{ "stop", 0 },
-	{ "unload", 0 },
-	{ "unloadSync", 0}
+	{ "stop", nullptr },
+	{ "unload", nullptr },
+	{ "unloadSync", nullptr}
 };
 
 void LBCode::runItemCommand() {
@@ -1718,7 +1718,7 @@ bool LBCode::parseCodeSymbol(Common::String name, uint &pos, Common::Array<byte>
 	// first, check whether the name matches a known function
 	for (uint i = 0; i < 2; i++) {
 		byte cmdToken;
-		CodeCommandInfo *cmdInfo = NULL;
+		CodeCommandInfo *cmdInfo = nullptr;
 		uint cmdCount = 0;
 
 		switch (i) {
diff --git a/engines/mohawk/livingbooks_lbx.cpp b/engines/mohawk/livingbooks_lbx.cpp
index 631a5fe400..a56ff58234 100644
--- a/engines/mohawk/livingbooks_lbx.cpp
+++ b/engines/mohawk/livingbooks_lbx.cpp
@@ -108,7 +108,7 @@ bool LBXDataFile::call(uint callId, const Common::Array<LBValue> &params, LBValu
 			Common::String command = Common::String::format("%s = %s", i->key.c_str(), i->value.c_str());
 			LBCode tempCode(_vm, 0);
 			uint offset = tempCode.parseCode(command);
-			tempCode.runCode(NULL, offset);
+			tempCode.runCode(nullptr, offset);
 		}
 		}
 		return false;


Commit: bbbcd1c89907356218302186cba7849061a79c62
    https://github.com/scummvm/scummvm/commit/bbbcd1c89907356218302186cba7849061a79c62
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
MORTEVIELLE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/mortevielle/detection.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/saveload.cpp


diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index 9d40332dad..457c292284 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -28,7 +28,7 @@
 
 static const PlainGameDescriptor MortevielleGame[] = {
 	{"mortevielle", "Mortville Manor"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 3809a54652..fb538c0da8 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -125,7 +125,7 @@ void GfxSurface::decode(const byte *pSrc) {
 
 	byte *pDest = &outputBuffer[0];
 	const byte *pSrcStart = pSrc;
-	const byte *pLookup = NULL;
+	const byte *pLookup = nullptr;
 
 	byte *lookupTable = (byte *)malloc(sizeof(byte) * BUFFER_SIZE);
 	byte *srcBuffer   = (byte *)malloc(sizeof(byte) * BUFFER_SIZE);
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 528b6acaf3..3d9c5b0509 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -77,7 +77,7 @@ bool SavegameManager::loadSavegame(const Common::String &filename) {
 	Common::SeekableReadStream *stream = g_system->getSavefileManager()->openForLoading(filename);
 
 	Common::File f;
-	if (stream == NULL) {
+	if (stream == nullptr) {
 		if (!f.open(filename)) {
 			warning("Unable to open save file '%s'", filename.c_str());
 			return false;
@@ -101,7 +101,7 @@ bool SavegameManager::loadSavegame(const Common::String &filename) {
 	}
 
 	// Read the game contents
-	Common::Serializer sz(stream, NULL);
+	Common::Serializer sz(stream, nullptr);
 	sync_save(sz);
 
 	g_vm->_coreVar = g_vm->_saveStruct;
@@ -158,7 +158,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	writeSavegameHeader(f, saveName);
 
 	// Write out the savegame contents
-	Common::Serializer sz(NULL, f);
+	Common::Serializer sz(nullptr, f);
 	sync_save(sz);
 
 	// Close the save file


Commit: dda887aaba94b9cdaac022970ca66e900730999f
    https://github.com/scummvm/scummvm/commit/dda887aaba94b9cdaac022970ca66e900730999f
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
MYST3: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/myst3/detection.cpp
    engines/myst3/effects.cpp
    engines/myst3/gfx_opengl_shaders.cpp
    engines/myst3/gfx_opengl_texture.cpp
    engines/myst3/gfx_tinygl.cpp
    engines/myst3/gfx_tinygl_texture.cpp
    engines/myst3/inventory.cpp
    engines/myst3/menu.cpp
    engines/myst3/metaengine.cpp
    engines/myst3/movie.cpp
    engines/myst3/myst3.cpp
    engines/myst3/node.cpp
    engines/myst3/puzzles.cpp
    engines/myst3/sound.cpp
    engines/myst3/state.cpp
    engines/myst3/subtitles.cpp


diff --git a/engines/myst3/detection.cpp b/engines/myst3/detection.cpp
index 03a1d915d5..ef600f0358 100644
--- a/engines/myst3/detection.cpp
+++ b/engines/myst3/detection.cpp
@@ -31,7 +31,7 @@ namespace Myst3 {
 
 static const PlainGameDescriptor myst3Games[] = {
 	{ "myst3", "Myst III Exile" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const DebugChannelDef debugFlagList[] = {
@@ -47,7 +47,7 @@ static const char *directoryGlobs[] = {
 	"M3Data",
 	"MYST3BIN",
 	"TEXT",
-	0
+	nullptr
 };
 
 #define MYST3ENTRY(lang, langFile, md5lang, extra, flags)                       \
@@ -105,36 +105,36 @@ static const char *directoryGlobs[] = {
 
 static const Myst3GameDescription gameDescriptions[] = {
 	// Initial US release (English only) v1.0
-	MYST3ENTRY(Common::EN_ANY, "ENGLISH.m3t",  "19dcba1074f235ec2119313242d891de", 0, kLocMonolingual)
+	MYST3ENTRY(Common::EN_ANY, "ENGLISH.m3t",  "19dcba1074f235ec2119313242d891de", nullptr, kLocMonolingual)
 
 	// Initial US release (English only) v1.22
-	MYST3ENTRY(Common::EN_ANY, "ENGLISH.m3t",  "3ca92b097c4319a2ace7fd6e911d6b0f", 0, kLocMonolingual)
+	MYST3ENTRY(Common::EN_ANY, "ENGLISH.m3t",  "3ca92b097c4319a2ace7fd6e911d6b0f", nullptr, kLocMonolingual)
 
 	// European releases (Country language + English) (1.2)
-	MYST3ENTRY(Common::NL_NLD, "DUTCH.m3u",    "0e8019cfaeb58c2de00ac114cf122220", 0, kLocMulti2)
-	MYST3ENTRY(Common::FR_FRA, "FRENCH.m3u",   "3a7e270c686806dfc31c2091e09c03ec", 0, kLocMulti2)
-	MYST3ENTRY(Common::DE_DEU, "GERMAN.m3u",   "1b2fa162a951fa4ed65617dd3f0c8a53", 0, kLocMulti2) // #1323, andrews05
-	MYST3ENTRY(Common::IT_ITA, "ITALIAN.m3u",  "906645a87ac1cbbd2b88c277c2b4fda2", 0, kLocMulti2) // #1323, andrews05
-	MYST3ENTRY(Common::ES_ESP, "SPANISH.m3u",  "28003569d9536cbdf6020aee8e9bcd15", 0, kLocMulti2) // #1323, goodoldgeorge
-	MYST3ENTRY(Common::PL_POL, "POLISH.m3u",   "8075e4e822e100ec79a5842a530dbe24", 0, kLocMulti2)
+	MYST3ENTRY(Common::NL_NLD, "DUTCH.m3u",    "0e8019cfaeb58c2de00ac114cf122220", nullptr, kLocMulti2)
+	MYST3ENTRY(Common::FR_FRA, "FRENCH.m3u",   "3a7e270c686806dfc31c2091e09c03ec", nullptr, kLocMulti2)
+	MYST3ENTRY(Common::DE_DEU, "GERMAN.m3u",   "1b2fa162a951fa4ed65617dd3f0c8a53", nullptr, kLocMulti2) // #1323, andrews05
+	MYST3ENTRY(Common::IT_ITA, "ITALIAN.m3u",  "906645a87ac1cbbd2b88c277c2b4fda2", nullptr, kLocMulti2) // #1323, andrews05
+	MYST3ENTRY(Common::ES_ESP, "SPANISH.m3u",  "28003569d9536cbdf6020aee8e9bcd15", nullptr, kLocMulti2) // #1323, goodoldgeorge
+	MYST3ENTRY(Common::PL_POL, "POLISH.m3u",   "8075e4e822e100ec79a5842a530dbe24", nullptr, kLocMulti2)
 
 	// Russian release (Russian only) (1.2)
-	MYST3ENTRY(Common::RU_RUS, "ENGLISH.m3t",  "57d36d8610043fda554a0708d71d2681", 0, kLocMonolingual)
+	MYST3ENTRY(Common::RU_RUS, "ENGLISH.m3t",  "57d36d8610043fda554a0708d71d2681", nullptr, kLocMonolingual)
 
 	// Hebrew release (Hebrew only) (1.2 - Patched using the patch CD)
-	MYST3ENTRY(Common::HE_ISR, "HEBREW.m3u",   "16fbbe420fed366249a8d44a759f966c", 0, kLocMonolingual) // #1348, BLooperZ
+	MYST3ENTRY(Common::HE_ISR, "HEBREW.m3u",   "16fbbe420fed366249a8d44a759f966c", nullptr, kLocMonolingual) // #1348, BLooperZ
 
 	// Japanese release (1.2)
-	MYST3ENTRY(Common::JA_JPN, "JAPANESE.m3u", "21bbd040bcfadd13b9dc84360c3de01d", 0, kLocMulti2)
+	MYST3ENTRY(Common::JA_JPN, "JAPANESE.m3u", "21bbd040bcfadd13b9dc84360c3de01d", nullptr, kLocMulti2)
 	MYST3ENTRY(Common::JA_JPN, "JAPANESE.m3u", "1e7c3156417978a1187fa6bc0e2cfafc", "Subtitles only", kLocMulti2)
 
 	// Multilingual CD release (1.21)
-	MYST3ENTRY(Common::EN_ANY, "ENGLISH.m3u",  "b62ca55aa17724cddbbcc78cba988337", 0, kLocMulti6)
-	MYST3ENTRY(Common::FR_FRA, "FRENCH.m3u",   "73519070cba1c7bea599adbddeae304f", 0, kLocMulti6)
-	MYST3ENTRY(Common::NL_NLD, "DUTCH.m3u",    "c4a8d8fb0eb3fecb9c435a8517bc1f9a", 0, kLocMulti6)
-	MYST3ENTRY(Common::DE_DEU, "GERMAN.m3u",   "5b3be343dd20f03ebdf16381b873f035", 0, kLocMulti6)
-	MYST3ENTRY(Common::IT_ITA, "ITALIAN.m3u",  "73db43aac3fe8671e2c4e227977fbb61", 0, kLocMulti6)
-	MYST3ENTRY(Common::ES_ESP, "SPANISH.m3u",  "55ceb165dad02211ef2d25946c3aac8e", 0, kLocMulti6)
+	MYST3ENTRY(Common::EN_ANY, "ENGLISH.m3u",  "b62ca55aa17724cddbbcc78cba988337", nullptr, kLocMulti6)
+	MYST3ENTRY(Common::FR_FRA, "FRENCH.m3u",   "73519070cba1c7bea599adbddeae304f", nullptr, kLocMulti6)
+	MYST3ENTRY(Common::NL_NLD, "DUTCH.m3u",    "c4a8d8fb0eb3fecb9c435a8517bc1f9a", nullptr, kLocMulti6)
+	MYST3ENTRY(Common::DE_DEU, "GERMAN.m3u",   "5b3be343dd20f03ebdf16381b873f035", nullptr, kLocMulti6)
+	MYST3ENTRY(Common::IT_ITA, "ITALIAN.m3u",  "73db43aac3fe8671e2c4e227977fbb61", nullptr, kLocMulti6)
+	MYST3ENTRY(Common::ES_ESP, "SPANISH.m3u",  "55ceb165dad02211ef2d25946c3aac8e", nullptr, kLocMulti6)
 
 	{
 		// Chinese (Simplified) CD release (1.22LC)
diff --git a/engines/myst3/effects.cpp b/engines/myst3/effects.cpp
index 05cd3e6049..0cd538b3da 100644
--- a/engines/myst3/effects.cpp
+++ b/engines/myst3/effects.cpp
@@ -173,7 +173,7 @@ WaterEffect *WaterEffect::create(Myst3Engine *vm, uint32 id) {
 
 	if (!s->loadMasks("", id, Archive::kWaterEffectMask)) {
 		delete s;
-		return 0;
+		return nullptr;
 	}
 
 	return s;
@@ -349,7 +349,7 @@ LavaEffect *LavaEffect::create(Myst3Engine *vm, uint32 id) {
 
 	if (!s->loadMasks("", id, Archive::kLavaEffectMask)) {
 		delete s;
-		return 0;
+		return nullptr;
 	}
 
 	return s;
diff --git a/engines/myst3/gfx_opengl_shaders.cpp b/engines/myst3/gfx_opengl_shaders.cpp
index 76cc4db7db..dc26bdfae5 100644
--- a/engines/myst3/gfx_opengl_shaders.cpp
+++ b/engines/myst3/gfx_opengl_shaders.cpp
@@ -131,7 +131,7 @@ void ShaderRenderer::init() {
 
 	glEnable(GL_DEPTH_TEST);
 
-	static const char* attributes[] = { "position", "texcoord", NULL };
+	static const char* attributes[] = { "position", "texcoord", nullptr };
 	_boxShader = OpenGL::ShaderGL::fromFiles("myst3_box", attributes);
 	_boxVBO = OpenGL::ShaderGL::createBuffer(GL_ARRAY_BUFFER, sizeof(boxVertices), boxVertices);
 	_boxShader->enableVertexAttribute("position", _boxVBO, 2, GL_FLOAT, GL_TRUE, 2 * sizeof(float), 0);
@@ -143,12 +143,12 @@ void ShaderRenderer::init() {
 	_cubeShader->enableVertexAttribute("position", _cubeVBO, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(float), 2 * sizeof(float));
 
 	_rect3dShader = OpenGL::ShaderGL::fromFiles("myst3_cube", attributes);
-	_rect3dVBO = OpenGL::ShaderGL::createBuffer(GL_ARRAY_BUFFER, 20 * sizeof(float), NULL);
+	_rect3dVBO = OpenGL::ShaderGL::createBuffer(GL_ARRAY_BUFFER, 20 * sizeof(float), nullptr);
 	_rect3dShader->enableVertexAttribute("texcoord", _rect3dVBO, 2, GL_FLOAT, GL_TRUE, 5 * sizeof(float), 0);
 	_rect3dShader->enableVertexAttribute("position", _rect3dVBO, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(float), 2 * sizeof(float));
 
 	_textShader = OpenGL::ShaderGL::fromFiles("myst3_text", attributes);
-	_textVBO = OpenGL::ShaderGL::createBuffer(GL_ARRAY_BUFFER, 100 * 16 * sizeof(float), NULL, GL_DYNAMIC_DRAW);
+	_textVBO = OpenGL::ShaderGL::createBuffer(GL_ARRAY_BUFFER, 100 * 16 * sizeof(float), nullptr, GL_DYNAMIC_DRAW);
 	_textShader->enableVertexAttribute("texcoord", _textVBO, 2, GL_FLOAT, GL_TRUE, 4 * sizeof(float), 0);
 	_textShader->enableVertexAttribute("position", _textVBO, 2, GL_FLOAT, GL_TRUE, 4 * sizeof(float), 2 * sizeof(float));
 
@@ -305,7 +305,7 @@ void ShaderRenderer::draw2DText(const Common::String &text, const Common::Point
 	_textShader->use();
 	glBindTexture(GL_TEXTURE_2D, glFont->id);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _quadEBO);
-	glDrawElements(GL_TRIANGLES, 6 * textToDraw.size(), GL_UNSIGNED_SHORT, 0);
+	glDrawElements(GL_TRIANGLES, 6 * textToDraw.size(), GL_UNSIGNED_SHORT, nullptr);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
 
 	glDisable(GL_BLEND);
diff --git a/engines/myst3/gfx_opengl_texture.cpp b/engines/myst3/gfx_opengl_texture.cpp
index fc49424786..9654011f4d 100644
--- a/engines/myst3/gfx_opengl_texture.cpp
+++ b/engines/myst3/gfx_opengl_texture.cpp
@@ -79,7 +79,7 @@ OpenGLTexture::OpenGLTexture(const Graphics::Surface *surface) {
 
 	glGenTextures(1, &id);
 	glBindTexture(GL_TEXTURE_2D, id);
-	glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, internalWidth, internalHeight, 0, internalFormat, sourceFormat, 0);
+	glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, internalWidth, internalHeight, 0, internalFormat, sourceFormat, nullptr);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 
diff --git a/engines/myst3/gfx_tinygl.cpp b/engines/myst3/gfx_tinygl.cpp
index 79d88e341c..2b87cf95f8 100644
--- a/engines/myst3/gfx_tinygl.cpp
+++ b/engines/myst3/gfx_tinygl.cpp
@@ -42,7 +42,7 @@ Renderer *CreateGfxTinyGL(OSystem *system) {
 
 TinyGLRenderer::TinyGLRenderer(OSystem *system) :
 		Renderer(system),
-		_fb(NULL) {
+		_fb(nullptr) {
 }
 
 TinyGLRenderer::~TinyGLRenderer() {
diff --git a/engines/myst3/gfx_tinygl_texture.cpp b/engines/myst3/gfx_tinygl_texture.cpp
index 4a78730e9b..42e64bb5bd 100644
--- a/engines/myst3/gfx_tinygl_texture.cpp
+++ b/engines/myst3/gfx_tinygl_texture.cpp
@@ -41,7 +41,7 @@ TinyGLTexture::TinyGLTexture(const Graphics::Surface *surface) {
 
 	tglGenTextures(1, &id);
 	tglBindTexture(TGL_TEXTURE_2D, id);
-	tglTexImage2D(TGL_TEXTURE_2D, 0, 3, width, height, 0, internalFormat, sourceFormat, 0);
+	tglTexImage2D(TGL_TEXTURE_2D, 0, 3, width, height, 0, internalFormat, sourceFormat, nullptr);
 	tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MIN_FILTER, TGL_LINEAR);
 	tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MAG_FILTER, TGL_LINEAR);
 
diff --git a/engines/myst3/inventory.cpp b/engines/myst3/inventory.cpp
index dcee924d4a..586fabb0f2 100644
--- a/engines/myst3/inventory.cpp
+++ b/engines/myst3/inventory.cpp
@@ -43,7 +43,7 @@ const Inventory::ItemData Inventory::_availableItems[8] = {
 Inventory::Inventory(Myst3Engine *vm) :
 		Window(),
 		_vm(vm),
-		_texture(0) {
+		_texture(nullptr) {
 	_scaled = !_vm->isWideScreenModEnabled();
 	initializeTexture();
 }
@@ -327,7 +327,7 @@ void Inventory::updateCursor() {
 
 DragItem::DragItem(Myst3Engine *vm, uint id):
 		_vm(vm),
-		_texture(0),
+		_texture(nullptr),
 		_frame(1) {
 	// Draw on the whole screen
 	_isConstrainedToWindow = false;
diff --git a/engines/myst3/menu.cpp b/engines/myst3/menu.cpp
index 0f741875e6..894b1c0165 100644
--- a/engines/myst3/menu.cpp
+++ b/engines/myst3/menu.cpp
@@ -38,7 +38,7 @@ namespace Myst3 {
 
 Dialog::Dialog(Myst3Engine *vm, uint id):
 	_vm(vm),
-	_texture(0) {
+	_texture(nullptr) {
 	// Draw on the whole screen
 	_isConstrainedToWindow = false;
 	_scaled = !_vm->isWideScreenModEnabled();
@@ -218,7 +218,7 @@ int16 GamepadDialog::update() {
 
 Menu::Menu(Myst3Engine *vm) :
 		_vm(vm),
-		_saveLoadSpotItem(0) {
+		_saveLoadSpotItem(nullptr) {
 }
 
 Menu::~Menu() {
@@ -885,7 +885,7 @@ void AlbumMenu::loadSaves() {
 		}
 
 		// Read state data
-		Common::Serializer s = Common::Serializer(saveFile, 0);
+		Common::Serializer s = Common::Serializer(saveFile, nullptr);
 		GameState::StateData data;
 		data.syncWithSaveGame(s);
 
diff --git a/engines/myst3/metaengine.cpp b/engines/myst3/metaengine.cpp
index d8d97b5b18..79b05f1c60 100644
--- a/engines/myst3/metaengine.cpp
+++ b/engines/myst3/metaengine.cpp
@@ -90,7 +90,7 @@ public:
 		}
 
 		// Read state data
-		Common::Serializer s = Common::Serializer(saveFile, 0);
+		Common::Serializer s = Common::Serializer(saveFile, nullptr);
 		GameState::StateData data;
 		data.syncWithSaveGame(s);
 
diff --git a/engines/myst3/movie.cpp b/engines/myst3/movie.cpp
index bb163e82b8..7006dc3232 100644
--- a/engines/myst3/movie.cpp
+++ b/engines/myst3/movie.cpp
@@ -38,10 +38,10 @@ Movie::Movie(Myst3Engine *vm, uint16 id) :
 		_posV(0),
 		_startFrame(0),
 		_endFrame(0),
-		_texture(0),
+		_texture(nullptr),
 		_force2d(false),
 		_forceOpaque(false),
-		_subtitles(0),
+		_subtitles(nullptr),
 		_volume(0),
 		_additiveBlending(false),
 		_transparency(100) {
@@ -473,7 +473,7 @@ SimpleMovie::~SimpleMovie() {
 ProjectorMovie::ProjectorMovie(Myst3Engine *vm, uint16 id, Graphics::Surface *background) :
 		ScriptedMovie(vm, id),
 		_background(background),
-	_frame(0) {
+	_frame(nullptr) {
 	_enabled = true;
 
 	for (uint i = 0; i < kBlurIterations; i++) {
diff --git a/engines/myst3/myst3.cpp b/engines/myst3/myst3.cpp
index 843a53b890..ffdc601091 100644
--- a/engines/myst3/myst3.cpp
+++ b/engines/myst3/myst3.cpp
@@ -65,19 +65,19 @@ namespace Myst3 {
 
 Myst3Engine::Myst3Engine(OSystem *syst, const Myst3GameDescription *version) :
 		Engine(syst), _system(syst), _gameDescription(version),
-		_db(0), _scriptEngine(0),
-		_state(0), _node(0), _scene(0), _archiveNode(0),
-		_cursor(0), _inventory(0), _gfx(0), _menu(0),
-		_rnd(0), _sound(0), _ambient(0),
+		_db(nullptr), _scriptEngine(nullptr),
+		_state(nullptr), _node(nullptr), _scene(nullptr), _archiveNode(nullptr),
+		_cursor(nullptr), _inventory(nullptr), _gfx(nullptr), _menu(nullptr),
+		_rnd(nullptr), _sound(nullptr), _ambient(nullptr),
 		_inputSpacePressed(false), _inputEnterPressed(false),
 		_inputEscapePressed(false), _inputTildePressed(false),
 		_inputEscapePressedNotConsumed(false),
 		_interactive(false),
-		_menuAction(0), _projectorBackground(0),
-		_shakeEffect(0), _rotationEffect(0),
+		_menuAction(0), _projectorBackground(nullptr),
+		_shakeEffect(nullptr), _rotationEffect(nullptr),
 		_backgroundSoundScriptLastRoomId(0),
 		_backgroundSoundScriptLastAgeId(0),
-		_transition(0), _frameLimiter(0), _inventoryManualHide(false) {
+		_transition(nullptr), _frameLimiter(nullptr), _inventoryManualHide(false) {
 
 	// Add subdirectories to the search path to allow running from a full HDD install
 	const Common::FSNode gameDataDir(ConfMan.get("path"));
@@ -223,7 +223,7 @@ Common::Error Myst3Engine::run() {
 
 bool Myst3Engine::addArchive(const Common::String &file, bool mandatory) {
 	Archive *archive = new Archive();
-	bool opened = archive->open(file.c_str(), 0);
+	bool opened = archive->open(file.c_str(), nullptr);
 
 	if (opened) {
 		_archivesCommon.push_back(archive);
@@ -400,7 +400,7 @@ HotSpot *Myst3Engine::getHoveredHotspot(NodePtr nodeData, uint16 var) {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void Myst3Engine::updateCursor() {
@@ -1067,7 +1067,7 @@ void Myst3Engine::loadMovie(uint16 id, uint16 condition, bool resetCond, bool lo
 		movie = new ScriptedMovie(this, id);
 	} else {
 		movie = new ProjectorMovie(this, id, _projectorBackground);
-		_projectorBackground = 0;
+		_projectorBackground = nullptr;
 		_state->setMovieUseBackground(0);
 	}
 
diff --git a/engines/myst3/node.cpp b/engines/myst3/node.cpp
index 2b97aa56c4..9295f6112f 100644
--- a/engines/myst3/node.cpp
+++ b/engines/myst3/node.cpp
@@ -44,9 +44,9 @@ void Face::setTextureFromJPEG(const ResourceDescription *jpegDesc) {
 Face::Face(Myst3Engine *vm) :
 		_vm(vm),
 		_textureDirty(true),
-		_texture(0),
-		_bitmap(0),
-		_finalBitmap(0) {
+		_texture(nullptr),
+		_bitmap(nullptr),
+		_finalBitmap(nullptr) {
 }
 
 void Face::addTextureDirtyRect(const Common::Rect &rect) {
@@ -73,7 +73,7 @@ void Face::uploadTexture() {
 Face::~Face() {
 	_bitmap->free();
 	delete _bitmap;
-	_bitmap = 0;
+	_bitmap = nullptr;
 
 	if (_finalBitmap) {
 		_finalBitmap->free();
@@ -257,7 +257,7 @@ void Node::update() {
 	for (uint faceId = 0; faceId < 6; faceId++) {
 		Face *face = _faces[faceId];
 
-		if (face == 0)
+		if (face == nullptr)
 			continue; // No such face in this node
 
 		if (!isFaceVisible(faceId)) {
@@ -347,8 +347,8 @@ SpotItemFace::SpotItemFace(Face *face, uint16 posX, uint16 posY):
 		_posX(posX),
 		_posY(posY),
 		_drawn(false),
-		_bitmap(0),
-		_notDrawnBitmap(0),
+		_bitmap(nullptr),
+		_notDrawnBitmap(nullptr),
 		_fadeValue(0) {
 }
 
@@ -356,13 +356,13 @@ SpotItemFace::~SpotItemFace() {
 	if (_bitmap) {
 		_bitmap->free();
 		delete _bitmap;
-		_bitmap = 0;
+		_bitmap = nullptr;
 	}
 
 	if (_notDrawnBitmap) {
 		_notDrawnBitmap->free();
 		delete _notDrawnBitmap;
-		_notDrawnBitmap = 0;
+		_notDrawnBitmap = nullptr;
 	}
 }
 
diff --git a/engines/myst3/puzzles.cpp b/engines/myst3/puzzles.cpp
index 86be3beb6a..ca15c4f90a 100644
--- a/engines/myst3/puzzles.cpp
+++ b/engines/myst3/puzzles.cpp
@@ -440,7 +440,7 @@ void Puzzles::resonanceRingsLaunchBall() {
 
 		bool isOnLightButton = false;
 
-		const LightFrames *frames = 0;
+		const LightFrames *frames = nullptr;
 		int32 currentLightFrame = _vm->_state->getVar(33);
 
 		// Look is the mini ball is on a light button
@@ -788,7 +788,7 @@ void Puzzles::pinball(int16 var) {
 			int32 jumpPositionLeft = 50 * ((leftSideFrame + 25) / 50);
 			int32 jumpPositionRight = 50 * ((rightSideFrame + 25) / 50);
 
-			const BallJump *jump = 0;
+			const BallJump *jump = nullptr;
 
 			for (uint i = 0; i < ARRAYSIZE(jumps); i++) {
 				int32 filter = jumps[i].filter;
@@ -983,7 +983,7 @@ void Puzzles::pinball(int16 var) {
 }
 
 const Puzzles::PegCombination *Puzzles::_pinballFindCombination(uint16 var, const PegCombination pegs[], uint16 size) {
-	const PegCombination *combination = 0;
+	const PegCombination *combination = nullptr;
 
 	for (uint i = 0; i < size; i++) {
 		bool good = true;
@@ -1289,7 +1289,7 @@ void Puzzles::symbolCodesInit(uint16 var, uint16 posX, uint16 posY) {
 
 	uint16 node = _vm->_state->getLocationNode();
 
-	const CodeData *code = 0;
+	const CodeData *code = nullptr;
 	for (uint i = 0; i < ARRAYSIZE(codes); i++)
 		if (codes[i].node == node) {
 			code = &codes[i];
@@ -1519,7 +1519,7 @@ static void copySurfaceRect(Graphics::Surface *dest, const Common::Point &destPo
 }
 
 void Puzzles::projectorLoadBitmap(uint16 bitmap) {
-	assert(_vm->_projectorBackground == 0 && "Previous background not yet used.");
+	assert(_vm->_projectorBackground == nullptr && "Previous background not yet used.");
 
 	// This surface is freed by the destructor of the movie that uses it
 	_vm->_projectorBackground = new Graphics::Surface();
@@ -1546,7 +1546,7 @@ void Puzzles::projectorLoadBitmap(uint16 bitmap) {
 }
 
 void Puzzles::projectorAddSpotItem(uint16 bitmap, uint16 x, uint16 y) {
-	assert(_vm->_projectorBackground != 0 && "Projector background already used.");
+	assert(_vm->_projectorBackground != nullptr && "Projector background already used.");
 
 	// Nothing to do if the spotitem is not enabled
 	if (!_vm->_state->getVar(26))
diff --git a/engines/myst3/sound.cpp b/engines/myst3/sound.cpp
index b9ab8d47d2..2493e94f56 100644
--- a/engines/myst3/sound.cpp
+++ b/engines/myst3/sound.cpp
@@ -390,7 +390,7 @@ SoundChannel::SoundChannel(Myst3Engine *vm) :
 		_playing(false),
 		_fading(false),
 		_id(0),
-		_stream(0),
+		_stream(nullptr),
 		_age(0),
 		_ambientFadeOutDelay(0),
 		_volume(0),
@@ -555,7 +555,7 @@ void SoundChannel::stop() {
 	_stopWhenSilent = true;
 	_hasFadeArray = false;
 
-	_stream = 0;
+	_stream = nullptr;
 	_length = Audio::Timestamp();
 }
 
diff --git a/engines/myst3/state.cpp b/engines/myst3/state.cpp
index 93225d6f61..0704efaf67 100644
--- a/engines/myst3/state.cpp
+++ b/engines/myst3/state.cpp
@@ -537,7 +537,7 @@ void GameState::newGame() {
 }
 
 Common::Error GameState::load(Common::InSaveFile *saveFile) {
-	Common::Serializer s = Common::Serializer(saveFile, 0);
+	Common::Serializer s = Common::Serializer(saveFile, nullptr);
 	Common::Error loadError = _data.syncWithSaveGame(s);
 
 	_data.gameRunning = true;
@@ -550,7 +550,7 @@ Common::Error GameState::load(Common::InSaveFile *saveFile) {
 }
 
 Common::Error GameState::save(Common::OutSaveFile *saveFile, const Common::String &description, const Graphics::Surface *thumbnail, bool isAutosave) {
-	Common::Serializer s = Common::Serializer(0, saveFile);
+	Common::Serializer s = Common::Serializer(nullptr, saveFile);
 
 	// Update save creation info
 	TimeDate t;
diff --git a/engines/myst3/subtitles.cpp b/engines/myst3/subtitles.cpp
index b032b75a6c..f79f524e30 100644
--- a/engines/myst3/subtitles.cpp
+++ b/engines/myst3/subtitles.cpp
@@ -59,8 +59,8 @@ private:
 
 FontSubtitles::FontSubtitles(Myst3Engine *vm) :
 	Subtitles(vm),
-	_font(0),
-	_surface(0),
+	_font(nullptr),
+	_surface(nullptr),
 	_scale(1.0),
 	_charset(nullptr) {
 }
@@ -385,7 +385,7 @@ void MovieSubtitles::drawToTexture(const Phrase *phrase) {
 Subtitles::Subtitles(Myst3Engine *vm) :
 		Window(),
 		_vm(vm),
-		_texture(0),
+		_texture(nullptr),
 		_frame(-1) {
 	_scaled = !_vm->isWideScreenModEnabled();
 }
@@ -507,7 +507,7 @@ Subtitles *Subtitles::create(Myst3Engine *vm, uint32 id) {
 
 	if (!s->loadSubtitles(id)) {
 		delete s;
-		return 0;
+		return nullptr;
 	}
 
 	s->loadResources();


Commit: 3a51911db2d09f82aadba32844a2b767407efa58
    https://github.com/scummvm/scummvm/commit/3a51911db2d09f82aadba32844a2b767407efa58
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
NANCY: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/nancy/console.cpp
    engines/nancy/detection.cpp
    engines/nancy/resource.cpp
    engines/nancy/sound.cpp
    engines/nancy/video.cpp


diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index 8b8cffd593..e2c4daf386 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -256,7 +256,7 @@ bool NancyConsole::Cmd_showImage(int argc, const char **argv) {
 	}
 
 	_imageFile = argv[1];
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool NancyConsole::Cmd_loadCal(int argc, const char **argv) {
@@ -280,7 +280,7 @@ bool NancyConsole::Cmd_playVideo(int argc, const char **argv) {
 
 	_videoFile = argv[1];
 	_videoFile += ".avf";
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool NancyConsole::Cmd_playAudio(int argc, const char **argv) {
@@ -329,7 +329,7 @@ bool NancyConsole::Cmd_loadScene(int argc, const char **argv) {
 
 	NancySceneState.changeScene((uint16)atoi(argv[1]), 0, 0, false);
 	NancySceneState._state = State::Scene::kLoad;
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool NancyConsole::Cmd_sceneID(int argc, const char **argv) {
diff --git a/engines/nancy/detection.cpp b/engines/nancy/detection.cpp
index bd72f2dd09..d494fc736a 100644
--- a/engines/nancy/detection.cpp
+++ b/engines/nancy/detection.cpp
@@ -29,7 +29,7 @@ const char *const directoryGlobs[] = {
 	"game",
 	"iff",
 	"cifTree",
-	0
+	nullptr
 };
 
 static const DebugChannelDef debugFlagList[] = {
@@ -48,14 +48,14 @@ static const PlainGameDescriptor nancyGames[] = {
 	{"nancy4", "Nancy Drew: Treasure in the Royal Tower"},
 	{"nancy5", "Nancy Drew: The Final Scene"},
 	{"nancy6", "Nancy Drew: Secret of the Scarlet Hand"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const Nancy::NancyGameDescription gameDescriptions[] = {
 
 	{ // MD5 by fracturehill
 		{
-			"vampirediaries", 0,
+			"vampirediaries", nullptr,
 			AD_ENTRY1s("boot.iff", "66d3b6fe9a90d35de7a28950870719ec", 20340),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -66,7 +66,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by waltervn
 		{
-			"nancy1", 0,
+			"nancy1", nullptr,
 			AD_ENTRY1s("ciftree.dat", "9f89e0b53717515ae0eb82d14ffe0e88", 4317962),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -77,7 +77,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by fracturehill
 		{
-			"nancy1", 0,
+			"nancy1", nullptr,
 			AD_ENTRY1s("ciftree.dat", "e1cd21841ab1b83a0ea0755ce0254cbc", 4480956),
 			Common::RU_RUS,
 			Common::kPlatformWindows,
@@ -88,7 +88,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by fracturehill
 		{
-			"nancy1", 0,
+			"nancy1", nullptr,
 			{
 				{"data1.hdr", 0, "39b33ad649d3e7261508d3c6907f237f", 139814},
 				{"data1.cab", 0, "f900861c47b0cb88191f5c6189db6cb1", 1916153},
@@ -104,7 +104,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by waltervn
 		{
-			"nancy2", 0,
+			"nancy2", nullptr,
 			AD_ENTRY1s("ciftree.dat", "fa4293d728a1b31407961cd82e86a015", 7784516),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -115,7 +115,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by waltervn
 		{
-			"nancy3", 0,
+			"nancy3", nullptr,
 			AD_ENTRY1s("ciftree.dat", "ee5f8832226567c3610556497c451b09", 16256355),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -126,7 +126,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by waltervn
 		{
-			"nancy3", 0,
+			"nancy3", nullptr,
 			{
 				{"data1.hdr", 0, "44906f3d2242f73f16feb8eb6a5161cb", 207327},
 				{"data1.cab", 0, "e258cc871e5de5ae004d03c4e31431c7", 1555916},
@@ -142,7 +142,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by waltervn
 		{
-			"nancy4", 0,
+			"nancy4", nullptr,
 			AD_ENTRY1s("ciftree.dat", "e9d45f7db453b0d8f37d202fc979537c", 8742289),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -153,7 +153,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by waltervn
 		{
-			"nancy4", 0,
+			"nancy4", nullptr,
 			{
 				{"data1.hdr", 0, "fa4e7a1c411053557169a7731f287012", 263443},
 				{"data1.cab", 0, "8f689f92fcca443d6a03faa5de7e2f1c", 1568756},
@@ -169,7 +169,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by waltervn
 		{
-			"nancy5", 0,
+			"nancy5", nullptr,
 			AD_ENTRY1s("ciftree.dat", "21fa81f322595c3100d8d58d100852d5", 8187692),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -180,7 +180,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by waltervn
 		{
-			"nancy5", 0,
+			"nancy5", nullptr,
 			{
 				{"data1.hdr", 0, "261105fba2a1226eedb090c2ce79fd35", 284091},
 				{"data1.cab", 0, "7d27bb947ef7305831f1faaf1512a598", 1446301},
@@ -196,7 +196,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by clone2727
 		{
-			"nancy5", 0,
+			"nancy5", nullptr,
 			{
 				{"data1.hdr", 0, "258e27792fa7cc7a7125fd74d89f8487", 284091},
 				{"data1.cab", 0, "70433b30b6114031d54d0c991ad44577", 1446301},
@@ -212,7 +212,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
 	},
 	{ // MD5 by Strangerke
 		{
-			"nancy6", 0,
+			"nancy6", nullptr,
 			AD_ENTRY1s("ciftree.dat", "a97b848651fdcf38f5cad7092d98e4a1", 28888006),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
diff --git a/engines/nancy/resource.cpp b/engines/nancy/resource.cpp
index 7ee58dc6c7..a284d8e6ee 100644
--- a/engines/nancy/resource.cpp
+++ b/engines/nancy/resource.cpp
@@ -91,7 +91,7 @@ byte *CifFile::getCifData(ResourceManager::CifInfo &info, uint *size) const {
 	if (_f->read(buf, dataSize) < dataSize) {
 		warning("Failed to read CifFile '%s'", _name.c_str());
 		delete[] buf;
-		return 0;
+		return nullptr;
 	}
 
 	if (size)
@@ -133,7 +133,7 @@ const CifFile *CifFile::load(const Common::String &name) {
 
 	if (!f->open(name + ".cif")) {
 		delete f;
-		return 0;
+		return nullptr;
 	}
 
 	char id[20];
@@ -143,7 +143,7 @@ const CifFile *CifFile::load(const Common::String &name) {
 	if (f->eos() || Common::String(id) != "CIF FILE WayneSikes") {
 		warning("Invalid id string found in CifFile '%s'", name.c_str());
 		delete f;
-		return 0;
+		return nullptr;
 	}
 
 	// 4 bytes unused
@@ -169,7 +169,7 @@ const CifFile *CifFile::load(const Common::String &name) {
 		warning("Failed to read CifFile '%s'", name.c_str());
 		delete cifFile;
 		delete f;
-		return 0;
+		return nullptr;
 	}
 
 	return cifFile;
@@ -274,13 +274,13 @@ byte *CifTree::getCifData(const Common::String &name, ResourceManager::CifInfo &
 	uint32 dataOffset;
 
 	if (!getCifInfo(name, info, &dataOffset))
-		return 0;
+		return nullptr;
 
 	Common::File f;
 
 	if (!f.open(_filename)) {
 		warning("Failed to open CifTree '%s'", _name.c_str());
-		return 0;
+		return nullptr;
 	}
 
 	uint dataSize = (info.comp == 2 ? info.compressedSize : info.size);
@@ -290,7 +290,7 @@ byte *CifTree::getCifData(const Common::String &name, ResourceManager::CifInfo &
 		warning("Failed to read data for '%s' from CifTree '%s'", name.c_str(), _name.c_str());
 		delete[] buf;
 		f.close();
-		return 0;
+		return nullptr;
 	}
 
 	f.close();
@@ -309,7 +309,7 @@ byte *ResourceManager::getCifData(const Common::String &treeName, const Common::
 	} else {
 		const CifTree *cifTree = findCifTree(treeName);
 		if (!cifTree)
-			return 0;
+			return nullptr;
 
 		buf = cifTree->getCifData(name, info, size);
 	}
@@ -322,7 +322,7 @@ byte *ResourceManager::getCifData(const Common::String &treeName, const Common::
 			warning("Failed to decompress '%s'", name.c_str());
 			delete[] buf;
 			delete[] raw;
-			return 0;
+			return nullptr;
 		}
 		delete[] buf;
 		if (size)
@@ -418,7 +418,7 @@ void CifTree21::readCifInfo(Common::File &f, CifInfoChain &chain) {
 
 	f.skip(32); // TODO
 
-	readCifInfo20(f, info, (_hasOffsetFirst ? 0 : &chain.dataOffset));
+	readCifInfo20(f, info, (_hasOffsetFirst ? nullptr : &chain.dataOffset));
 
 	if (!_hasOffsetFirst)
 		chain.next = f.readUint16LE();
@@ -459,7 +459,7 @@ const CifTree *CifTree::load(const Common::String &name, const Common::String &e
 
 	if (!f.open(name + '.' + ext)) {
 		warning("Failed to open CifTree '%s'", name.c_str());
-		return 0;
+		return nullptr;
 	}
 
 	char id[20];
@@ -469,7 +469,7 @@ const CifTree *CifTree::load(const Common::String &name, const Common::String &e
 	if (f.eos() || Common::String(id) != "CIF TREE WayneSikes") {
 		warning("Invalid id string found in CifTree '%s'", name.c_str());
 		f.close();
-		return 0;
+		return nullptr;
 	}
 
 	// 4 bytes unused
@@ -590,7 +590,7 @@ const CifExporter *CifExporter::create(uint32 version) {
 		break;
 	default:
 		warning("Version %d.%d not supported by CifExporter", version >> 16, version & 0xffff);
-		return 0;
+		return nullptr;
 	}
 
 	return exp;
@@ -622,7 +622,7 @@ const CifTree *ResourceManager::findCifTree(const Common::String &name) const {
 			return _cifTrees[i];
 
 	warning("CifTree '%s' not loaded", name.c_str());
-	return 0;
+	return nullptr;
 }
 
 void ResourceManager::initialize() {
@@ -682,7 +682,7 @@ byte *ResourceManager::getCifData(const Common::String &name, CifInfo &info, uin
 			warning("Failed to decompress '%s'", name.c_str());
 			delete[] buf;
 			delete[] raw;
-			return 0;
+			return nullptr;
 		}
 		delete[] buf;
 		if (size)
diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index 02c91c3ac5..90dfa323e2 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -201,15 +201,15 @@ Audio::SeekableAudioStream *SoundManager::makeHISStream(Common::SeekableReadStre
 
 	if (headerID == "DiamondWare Digitized") {
 		if (!readDiamondwareHeader(stream, type, numChannels, samplesPerSec, bitsPerSample, size))
-			return 0;
+			return nullptr;
 	} else if (headerID == "Her Interactive Sound") {
 		// Early HIS file
 		if (!readWaveHeader(stream, type, numChannels, samplesPerSec, bitsPerSample, size))
-			return 0;
+			return nullptr;
 	} else if (headerID == "HIS") {
 		stream->seek(4);
 		if (!readHISHeader(stream, type, numChannels, samplesPerSec, bitsPerSample, size))
-			return 0;
+			return nullptr;
 	}
 
 	byte flags = 0;
@@ -220,14 +220,14 @@ Audio::SeekableAudioStream *SoundManager::makeHISStream(Common::SeekableReadStre
 			flags |= (Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN);
 		} else {
 			warning("Unsupported bitsPerSample %d found in HIS file", bitsPerSample);
-			return 0;
+			return nullptr;
 		}
 
 		if (numChannels == 2) {
 			flags |= Audio::FLAG_STEREO;
 		} else if (numChannels != 1) {
 			warning("Unsupported number of channels %d found in HIS file", numChannels);
-			return 0;
+			return nullptr;
 		}
 
 		// Raw PCM, make sure the last packet is complete
diff --git a/engines/nancy/video.cpp b/engines/nancy/video.cpp
index dea946a1fb..ce7baa2549 100644
--- a/engines/nancy/video.cpp
+++ b/engines/nancy/video.cpp
@@ -212,20 +212,20 @@ bool AVFDecoder::AVFVideoTrack::decode(byte *outBuf, uint32 frameSize, Common::R
 const Graphics::Surface *AVFDecoder::AVFVideoTrack::decodeFrame(uint frameNr) {
 	if (frameNr >= _chunkInfo.size()) {
 		warning("Frame %d doesn't exist", frameNr);
-		return 0;
+		return nullptr;
 	}
 
 	const ChunkInfo &info = _chunkInfo[frameNr];
 
 	if (info.type == 2 && (_refFrame == -1 || _refFrame != (int)frameNr - 1)) {
 		warning("Cannot decode frame %d, reference frame is invalid", frameNr);
-		return 0;
+		return nullptr;
 	}
 
 	if (!info.size && !info.compressedSize) {
 		if (info.type != 2) {
 			warning("Found empty frame %d of type %d", frameNr, info.type);
-			return 0;
+			return nullptr;
 		}
 		// Return previous frame
 		_refFrame = frameNr;
@@ -237,7 +237,7 @@ const Graphics::Surface *AVFDecoder::AVFVideoTrack::decodeFrame(uint frameNr) {
 		// For type 0 we decompress straight to the surface, make sure we don't go out of bounds
 		if (info.size > _frameSize) {
 			warning("Decompressed size %d exceeds frame size %d", info.size, _frameSize);
-			return 0;
+			return nullptr;
 		}
 	} else {
 		// For types 1 and 2, we decompress to a temp buffer for decoding
@@ -250,7 +250,7 @@ const Graphics::Surface *AVFDecoder::AVFVideoTrack::decodeFrame(uint frameNr) {
 	if (!_dec->decompress(input, output)) {
 		warning("Failed to decompress frame %d", frameNr);
 		delete[] decompBuf;
-		return 0;
+		return nullptr;
 	}
 
 	if (info.type != 0) {


Commit: 9dab8322140895375c990f5469121f97b10b8014
    https://github.com/scummvm/scummvm/commit/9dab8322140895375c990f5469121f97b10b8014
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
NEVERHOOD: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/neverhood/background.cpp
    engines/neverhood/blbarchive.cpp
    engines/neverhood/console.cpp
    engines/neverhood/detection.cpp
    engines/neverhood/diskplayerscene.cpp
    engines/neverhood/entity.cpp
    engines/neverhood/gamemodule.cpp
    engines/neverhood/graphics.cpp
    engines/neverhood/klaymen.cpp
    engines/neverhood/menumodule.cpp
    engines/neverhood/module_scene.cpp
    engines/neverhood/modules/module1000.cpp
    engines/neverhood/modules/module1000_sprites.cpp
    engines/neverhood/modules/module1200.cpp
    engines/neverhood/modules/module1200_sprites.cpp
    engines/neverhood/modules/module1300.cpp
    engines/neverhood/modules/module1300_sprites.cpp
    engines/neverhood/modules/module1400.cpp
    engines/neverhood/modules/module1400_sprites.cpp
    engines/neverhood/modules/module1600.cpp
    engines/neverhood/modules/module1600_sprites.cpp
    engines/neverhood/modules/module1700_sprites.cpp
    engines/neverhood/modules/module1900_sprites.cpp
    engines/neverhood/modules/module2200.cpp
    engines/neverhood/modules/module2200_sprites.cpp
    engines/neverhood/modules/module2400_sprites.cpp
    engines/neverhood/modules/module2500.cpp
    engines/neverhood/modules/module2700.cpp
    engines/neverhood/modules/module2800.cpp
    engines/neverhood/modules/module3000_sprites.cpp
    engines/neverhood/navigationscene.cpp
    engines/neverhood/resource.cpp
    engines/neverhood/resourceman.cpp
    engines/neverhood/scene.cpp
    engines/neverhood/screen.cpp
    engines/neverhood/smackerplayer.cpp
    engines/neverhood/smackerscene.cpp
    engines/neverhood/sound.cpp
    engines/neverhood/sprite.cpp


diff --git a/engines/neverhood/background.cpp b/engines/neverhood/background.cpp
index 77c1e057a6..7d04009bb8 100644
--- a/engines/neverhood/background.cpp
+++ b/engines/neverhood/background.cpp
@@ -27,12 +27,12 @@ namespace Neverhood {
 // Background
 
 Background::Background(NeverhoodEngine *vm, int objectPriority)
-	: Entity(vm, objectPriority), _surface(NULL), _spriteResource(vm) {
+	: Entity(vm, objectPriority), _surface(nullptr), _spriteResource(vm) {
 	// Empty
 }
 
 Background::Background(NeverhoodEngine *vm, uint32 fileHash, int objectPriority, int surfacePriority)
-	: Entity(vm, objectPriority), _surface(NULL), _spriteResource(vm) {
+	: Entity(vm, objectPriority), _surface(nullptr), _spriteResource(vm) {
 
 	_spriteResource.load(fileHash);
 	createSurface(surfacePriority, _spriteResource.getDimensions().width, _spriteResource.getDimensions().height);
diff --git a/engines/neverhood/blbarchive.cpp b/engines/neverhood/blbarchive.cpp
index 7bdacd6a6f..d5f2d12aec 100644
--- a/engines/neverhood/blbarchive.cpp
+++ b/engines/neverhood/blbarchive.cpp
@@ -48,7 +48,7 @@ uint32 SafeMutexedSeekableSubReadStream::read(void *dataPtr, uint32 dataSize) {
 	return Common::SafeSeekableSubReadStream::read(dataPtr, dataSize);
 }
 
-BlbArchive::BlbArchive() : _extData(NULL) {
+BlbArchive::BlbArchive() : _extData(nullptr) {
 }
 
 BlbArchive::~BlbArchive() {
@@ -91,7 +91,7 @@ void BlbArchive::open(const Common::String &filename) {
 		BlbArchiveEntry &entry = _entries[i];
 		entry.type = _fd.readByte();
 		entry.comprType = _fd.readByte();
-		entry.extData = NULL;
+		entry.extData = nullptr;
 		extDataOffsets[i] = _fd.readUint16LE();
 		entry.timeStamp = _fd.readUint32LE();
 		entry.offset = _fd.readUint32LE();
@@ -107,7 +107,7 @@ void BlbArchive::open(const Common::String &filename) {
 		_extData = new byte[header.extDataSize];
 		_fd.read(_extData, header.extDataSize);
 		for (uint i = 0; i < header.fileCount; i++)
-			_entries[i].extData = extDataOffsets[i] > 0 ? _extData + extDataOffsets[i] - 1 : NULL;
+			_entries[i].extData = extDataOffsets[i] > 0 ? _extData + extDataOffsets[i] - 1 : nullptr;
 	}
 
 	delete[] extDataOffsets;
diff --git a/engines/neverhood/console.cpp b/engines/neverhood/console.cpp
index 7ee6b30311..10dbd7b1b1 100644
--- a/engines/neverhood/console.cpp
+++ b/engines/neverhood/console.cpp
@@ -206,7 +206,7 @@ bool Console::Cmd_PlaySound(int argc, const char **argv) {
 	if (argc < 2) {
 		debugPrintf("Usage: %s <sound hash>\n", argv[0]);
 	} else {
-		uint32 soundHash = strtol(argv[1], NULL, 0);
+		uint32 soundHash = strtol(argv[1], nullptr, 0);
 		AudioResourceManSoundItem *soundItem = new AudioResourceManSoundItem(_vm, soundHash);
 		soundItem->setVolume(100);
 		soundItem->playSound(false);
@@ -226,7 +226,7 @@ bool Console::Cmd_CheckResource(int argc, const char **argv) {
 		debugPrintf("Gets information about a resource\n");
 		debugPrintf("Usage: %s <resource hash>\n", argv[0]);
 	} else {
-		uint32 resourceHash = strtol(argv[1], NULL, 0);
+		uint32 resourceHash = strtol(argv[1], nullptr, 0);
 		ResourceHandle handle;
 
 		_vm->_res->queryResource(resourceHash, handle);
@@ -245,7 +245,7 @@ bool Console::Cmd_DumpResource(int argc, const char **argv) {
 		debugPrintf("Dumps a resource to disk\n");
 		debugPrintf("Usage: %s <resource hash> <output file>\n", argv[0]);
 	} else {
-		uint32 resourceHash = strtol(argv[1], NULL, 0);
+		uint32 resourceHash = strtol(argv[1], nullptr, 0);
 		const char *outFileName = argv[2];
 		ResourceHandle handle;
 
diff --git a/engines/neverhood/detection.cpp b/engines/neverhood/detection.cpp
index 1c094c27f8..2020649a5e 100644
--- a/engines/neverhood/detection.cpp
+++ b/engines/neverhood/detection.cpp
@@ -30,7 +30,7 @@
 
 static const PlainGameDescriptor neverhoodGames[] = {
 	{"neverhood", "The Neverhood Chronicles"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 namespace Neverhood {
@@ -40,7 +40,7 @@ static const ADGameDescription gameDescriptions[] = {
 	// Neverhood English version
 	{
 		"neverhood",
-		0,
+		nullptr,
 		AD_ENTRY1s("hd.blb", "22958d968458c9ff221aee38577bb2b2", 4279716),
 		Common::EN_ANY,
 		Common::kPlatformWindows,
diff --git a/engines/neverhood/diskplayerscene.cpp b/engines/neverhood/diskplayerscene.cpp
index 7c1d53ff34..03a13e5b8e 100644
--- a/engines/neverhood/diskplayerscene.cpp
+++ b/engines/neverhood/diskplayerscene.cpp
@@ -247,7 +247,7 @@ void DiskplayerPlayButton::release() {
 
 DiskplayerSlot::DiskplayerSlot(NeverhoodEngine *vm, DiskplayerScene *diskplayerScene, int slotIndex, bool isAvailable)
 	: Entity(vm, 0), _diskplayerScene(diskplayerScene), _isLocked(false), _isBlinking(false),
-	_blinkCountdown(0), _initialBlinkCountdown(2), _inactiveSlot(NULL), _appearSlot(NULL), _activeSlot(NULL) {
+	_blinkCountdown(0), _initialBlinkCountdown(2), _inactiveSlot(nullptr), _appearSlot(nullptr), _activeSlot(nullptr) {
 
 	if (isAvailable && slotIndex < 20) {
 		_inactiveSlot = _diskplayerScene->addSprite(new StaticSprite(_vm, kDiskplayerSlotFileHashes1[slotIndex], 1100));
diff --git a/engines/neverhood/entity.cpp b/engines/neverhood/entity.cpp
index 68390051f5..186aec9960 100644
--- a/engines/neverhood/entity.cpp
+++ b/engines/neverhood/entity.cpp
@@ -47,7 +47,7 @@ Entity *MessageParam::asEntity() const {
 }
 
 Entity::Entity(NeverhoodEngine *vm, int priority)
-	: _vm(vm), _updateHandlerCb(NULL), _messageHandlerCb(nullptr), _priority(priority), _soundResources(NULL) {
+	: _vm(vm), _updateHandlerCb(nullptr), _messageHandlerCb(nullptr), _priority(priority), _soundResources(nullptr) {
 }
 
 Entity::~Entity() {
@@ -114,7 +114,7 @@ SoundResource *Entity::getSoundResource(uint index) {
 	if (!_soundResources) {
 		_soundResources = new SoundResource*[kMaxSoundResources];
 		for (uint i = 0; i < kMaxSoundResources; ++i)
-			_soundResources[i] = NULL;
+			_soundResources[i] = nullptr;
 	}
 	if (!_soundResources[index])
 		_soundResources[index] = new SoundResource(_vm);
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index b016e61002..a4a40009b1 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -74,7 +74,7 @@ enum {
 };
 
 GameModule::GameModule(NeverhoodEngine *vm)
-	: Module(vm, NULL), _moduleNum(-1), _prevChildObject(NULL), _prevModuleNum(-1),
+	: Module(vm, nullptr), _moduleNum(-1), _prevChildObject(nullptr), _prevModuleNum(-1),
 	_restoreGameRequested(false), _restartGameRequested(false), _canRequestMainMenu(true),
 	_mainMenuRequested(false) {
 
@@ -86,7 +86,7 @@ GameModule::GameModule(NeverhoodEngine *vm)
 GameModule::~GameModule() {
 	_vm->_soundMan->deleteSoundGroup(0x002D0031);
 	delete _childObject;
-	_childObject = NULL;
+	_childObject = nullptr;
 }
 
 void GameModule::handleMouseMove(int16 x, int16 y) {
@@ -435,8 +435,8 @@ void GameModule::checkRequests() {
 		_vm->_soundMan->playSoundThree(0x002D0031, 0x08861079);
 		delete _childObject;
 		delete _prevChildObject;
-		_childObject = NULL;
-		_prevChildObject = NULL;
+		_childObject = nullptr;
+		_prevChildObject = nullptr;
 		_prevModuleNum = 0;
 		createModuleByHash(getGlobalVar(V_MODULE_NAME));
 	}
@@ -831,7 +831,7 @@ void GameModule::updateMenuModule() {
 		_vm->_screen->restoreParams();
 		_childObject = _prevChildObject;
 		sendMessage(_childObject, NM_MOUSE_SHOW, 0);
-		_prevChildObject = NULL;
+		_prevChildObject = nullptr;
 		_moduleNum = _prevModuleNum;
 		SetUpdateHandler(&GameModule::updateModule);
 	}
diff --git a/engines/neverhood/graphics.cpp b/engines/neverhood/graphics.cpp
index 89792d2659..85caf7d7ad 100644
--- a/engines/neverhood/graphics.cpp
+++ b/engines/neverhood/graphics.cpp
@@ -28,7 +28,7 @@ namespace Neverhood {
 
 BaseSurface::BaseSurface(NeverhoodEngine *vm, int priority, int16 width, int16 height, Common::String name)
 	: _vm(vm), _priority(priority), _visible(true), _transparent(true),
-	_clipRects(NULL), _clipRectsCount(0), _version(0), _name(name) {
+	_clipRects(nullptr), _clipRectsCount(0), _version(0), _name(name) {
 
 	_drawRect.x = 0;
 	_drawRect.y = 0;
@@ -153,7 +153,7 @@ void ShadowSurface::draw() {
 
 FontSurface::FontSurface(NeverhoodEngine *vm, NPointArray *tracking, uint charsPerRow, uint16 numRows, byte firstChar, uint16 charWidth, uint16 charHeight)
 	: BaseSurface(vm, 0, charWidth * charsPerRow, charHeight * numRows, "font"), _charsPerRow(charsPerRow), _numRows(numRows),
-	_firstChar(firstChar), _charWidth(charWidth), _charHeight(charHeight), _tracking(NULL) {
+	_firstChar(firstChar), _charWidth(charWidth), _charHeight(charHeight), _tracking(nullptr) {
 
 	_tracking = new NPointArray();
 	*_tracking = *tracking;
@@ -162,7 +162,7 @@ FontSurface::FontSurface(NeverhoodEngine *vm, NPointArray *tracking, uint charsP
 
 FontSurface::FontSurface(NeverhoodEngine *vm, uint32 fileHash, uint charsPerRow, uint16 numRows, byte firstChar, uint16 charWidth, uint16 charHeight)
 	: BaseSurface(vm, 0, charWidth * charsPerRow, charHeight * numRows, "font"), _charsPerRow(charsPerRow), _numRows(numRows),
-	_firstChar(firstChar), _charWidth(charWidth), _charHeight(charHeight), _tracking(NULL) {
+	_firstChar(firstChar), _charWidth(charWidth), _charHeight(charHeight), _tracking(nullptr) {
 
 	SpriteResource fontSpriteResource(_vm);
 	fontSpriteResource.load(fileHash, true);
@@ -262,13 +262,13 @@ void parseBitmapResource(const byte *sprite, bool *rle, NDimensions *dimensions,
 			*palette = sprite;
 		sprite += 1024;
 	} else if (palette)
-		*palette = NULL;
+		*palette = nullptr;
 
 	if (flags & BF_HAS_IMAGE) {
 		if (pixels)
 			*pixels = sprite;
 	} else if (pixels)
-		*pixels = NULL;
+		*pixels = nullptr;
 
 }
 
diff --git a/engines/neverhood/klaymen.cpp b/engines/neverhood/klaymen.cpp
index dcfa26e7c3..ecc64f4550 100644
--- a/engines/neverhood/klaymen.cpp
+++ b/engines/neverhood/klaymen.cpp
@@ -52,9 +52,9 @@ static const KlaymenIdleTableItem klaymenIdleTable3[] = {
 Klaymen::Klaymen(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y, NRectArray *clipRects)
 	: AnimatedSprite(vm, 1000), _idleCounterMax(0), _idleCounter(0), _isMoveObjectRequested(false), _blinkCounterMax(0),
 	_isWalkingOpenDoorNotified(false), _spitOutCountdown(0), _tapesToInsert(0), _keysToInsert(0), _busyStatus(0), _acceptInput(true),
-	_attachedSprite(NULL), _isWalking(false), _actionStatus(1), _parentScene(parentScene), _isSneaking(false), _isLargeStep(false),
-	_doYHitIncr(false), _isLeverDown(false), _isSittingInTeleporter(false), _actionStatusChanged(false), _ladderStatus(0), _pathPoints(NULL), _soundFlag(false),
-	_idleTableNum(0), _otherSprite(NULL), _moveObjectCountdown(0), _walkResumeFrameIncr(0) {
+	_attachedSprite(nullptr), _isWalking(false), _actionStatus(1), _parentScene(parentScene), _isSneaking(false), _isLargeStep(false),
+	_doYHitIncr(false), _isLeverDown(false), _isSittingInTeleporter(false), _actionStatusChanged(false), _ladderStatus(0), _pathPoints(nullptr), _soundFlag(false),
+	_idleTableNum(0), _otherSprite(nullptr), _moveObjectCountdown(0), _walkResumeFrameIncr(0) {
 
 	createSurface(1000, 320, 200);
 	_x = x;
@@ -120,7 +120,7 @@ void Klaymen::stIdlePickEar() {
 	startAnimation(0x5B20C814, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmIdlePickEar);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stStandAround);
 	FinalizeState(&Klaymen::evIdlePickEarDone);
 }
@@ -149,7 +149,7 @@ void Klaymen::stIdleSpinHead() {
 	startAnimation(0xD122C137, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmIdleSpinHead);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stStandAround);
 }
 
@@ -173,7 +173,7 @@ void Klaymen::stIdleArms() {
 	startAnimation(0x543CD054, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmIdleArms);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stStandAround);
 	FinalizeState(&Klaymen::evIdleArmsDone);
 }
@@ -206,7 +206,7 @@ void Klaymen::stIdleChest() {
 	startAnimation(0x40A0C034, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmIdleChest);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stStandAround);
 }
 
@@ -230,7 +230,7 @@ void Klaymen::stIdleHeadOff() {
 	startAnimation(0x5120E137, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmIdleHeadOff);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stStandAround);
 }
 
@@ -260,7 +260,7 @@ void Klaymen::stIdleWonderAbout() {
 	startAnimation(0xD820A114, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stStandAround);
 }
 
@@ -270,7 +270,7 @@ void Klaymen::stSitIdleTeleporter() {
 	startAnimation(0x582EC138, 0, -1);
 	SetUpdateHandler(&Klaymen::upSitIdleTeleporter);
 	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	_idleCounter = 0;
 	_blinkCounter = 0;
 	_idleCounterMax = 8;
@@ -305,7 +305,7 @@ void Klaymen::stSitIdleTeleporterBlink() {
 	startAnimation(0x5C24C018, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stSitIdleTeleporterBlinkSecond);
 }
 
@@ -315,7 +315,7 @@ void Klaymen::stSitIdleTeleporterBlinkSecond() {
 	startAnimation(0x582EC138, 0, -1);
 	SetUpdateHandler(&Klaymen::upSitIdleTeleporter);
 	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stPickUpNeedle() {
@@ -326,7 +326,7 @@ void Klaymen::stPickUpNeedle() {
 		startAnimation(0x1449C169, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmPickUpObject);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -338,7 +338,7 @@ void Klaymen::stPickUpTube() {
 		startAnimation(0x0018C032, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmPickUpTube);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -371,7 +371,7 @@ void Klaymen::stTurnToUseInTeleporter() {
 	startAnimation(0xD229823D, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stReturnFromUseInTeleporter() {
@@ -380,7 +380,7 @@ void Klaymen::stReturnFromUseInTeleporter() {
 	startAnimation(0x9A2801E0, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stStepOver() {
@@ -433,7 +433,7 @@ void Klaymen::stGetUpFromTeleporter() {
 void Klaymen::stopWalking() {
 	_destX = _x;
 	if (!_isWalking && !_isSneaking && !_isLargeStep) {
-		gotoState(NULL);
+		gotoState(nullptr);
 		gotoNextStateExt();
 	}
 }
@@ -456,7 +456,7 @@ bool Klaymen::stStartActionFromIdle(AnimationCb callback) {
 		startAnimation(0x9A7020B8, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmStartAction);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 		NextState(callback);
 		return true;
 	}
@@ -466,12 +466,12 @@ bool Klaymen::stStartActionFromIdle(AnimationCb callback) {
 void Klaymen::gotoNextStateExt() {
 	if (_finalizeStateCb) {
 		AnimationCb cb = _finalizeStateCb;
-		_finalizeStateCb = NULL;
+		_finalizeStateCb = nullptr;
 		(this->*cb)();
 	}
 	if (_nextStateCb) {
 		AnimationCb cb = _nextStateCb;
-		_nextStateCb = NULL;
+		_nextStateCb = nullptr;
 		(this->*cb)();
 	} else {
 		// Inform the scene that the current Klaymen animation sequence has finished
@@ -496,7 +496,7 @@ void Klaymen::stTryStandIdle() {
 		startAnimation(0x5420E254, 0, -1);
 		SetUpdateHandler(&Klaymen::upStandIdle);
 		SetMessageHandler(&Klaymen::hmLowLevel);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 		_idleCounter = 0;
 		_blinkCounter = 0;
 		_blinkCounterMax = _vm->_rnd->getRandomNumber(64) + 24;
@@ -552,7 +552,7 @@ uint32 Klaymen::hmLowLevel(int messageNum, const MessageParam &param, Entity *se
 		if (param.asInteger() != 0) {
 			_pathPoints = _dataResource.getPointArray(param.asInteger());
 		} else {
-			_pathPoints = NULL;
+			_pathPoints = nullptr;
 		}
 		break;
 	default:
@@ -567,7 +567,7 @@ void Klaymen::stIdleBlink() {
 	startAnimation(0x5900C41E, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stStandAround);
 }
 
@@ -589,7 +589,7 @@ void Klaymen::stStandAround() {
 	startAnimation(0x5420E254, 0, -1);
 	SetUpdateHandler(&Klaymen::upStandIdle);
 	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 Klaymen::hmStartAction(int messageNum, const MessageParam &param, Entity *sender) {
@@ -614,12 +614,12 @@ void Klaymen::startWalkToX(int16 x, bool walkExt) {
 	if (x == _x) {
 		_destX = x;
 		if (!_isWalking && !_isSneaking && !_isLargeStep) {
-			gotoState(NULL);
+			gotoState(nullptr);
 			gotoNextStateExt();
 		}
 	} else if (xdiff <= 36 && !_isWalking && !_isSneaking && !_isLargeStep) {
 		_destX = x;
-		gotoState(NULL);
+		gotoState(nullptr);
 		gotoNextStateExt();
 	} else if (xdiff <= 42 && _actionStatus != 3) {
 		if (_isSneaking && ((!_doDeltaX && x - _x > 0) || (_doDeltaX && x - _x < 0)) && ABS(_destX - _x) > xdiff) {
@@ -942,7 +942,7 @@ void Klaymen::stPickUpGeneric() {
 		startAnimation(0x1C28C178, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmPickUpObject);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -979,7 +979,7 @@ void Klaymen::stPressButton() {
 		startAnimation(0x1C02B03D, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmPressButton);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -1008,7 +1008,7 @@ void Klaymen::stPressFloorButton() {
 		startAnimation(0x1C16B033, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmPressButton);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -1026,7 +1026,7 @@ void Klaymen::stPressButtonSide() {
 void Klaymen::startSpecialWalkRight(int16 x) {
 	if (_x == x) {
 		_destX = x;
-		gotoState(NULL);
+		gotoState(nullptr);
 		gotoNextStateExt();
 	} else if (_x < x) {
 		startWalkToX(x, false);
@@ -1040,7 +1040,7 @@ void Klaymen::startSpecialWalkRight(int16 x) {
 void Klaymen::startSpecialWalkLeft(int16 x) {
 	if (x == _x) {
 		_destX = x;
-		gotoState(NULL);
+		gotoState(nullptr);
 		gotoNextStateExt();
 	} else if (x < _x) {
 		startWalkToX(x, false);
@@ -1056,7 +1056,7 @@ void Klaymen::startWalkToXSmall(int16 x) {
 	if (_x == x) {
 		_destX = x;
 		if (_isWalking) {
-			GotoState(NULL);
+			GotoState(nullptr);
 			gotoNextStateExt();
 		}
 	} else if (_isWalking && ((!_doDeltaX && x - _x > 0) || (_doDeltaX && x - _x < 0))) {
@@ -1100,7 +1100,7 @@ void Klaymen::stStandIdleSmall() {
 	startAnimation(0x90D0D1D0, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stWonderAboutAfterSmall() {
@@ -1109,7 +1109,7 @@ void Klaymen::stWonderAboutAfterSmall() {
 	startAnimation(0x11C8D156, 30, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stWonderAboutHalfSmall() {
@@ -1118,7 +1118,7 @@ void Klaymen::stWonderAboutHalfSmall() {
 	startAnimation(0x11C8D156, 0, 10);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stWonderAboutSmall() {
@@ -1127,7 +1127,7 @@ void Klaymen::stWonderAboutSmall() {
 	startAnimation(0x11C8D156, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stWalkToFrontNoStepSmall() {
@@ -1210,7 +1210,7 @@ void Klaymen::stPullCord() {
 		startAnimation(0x3F28E094, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmPullReleaseCord);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 		NextState(&Klaymen::stReleaseCord);
 	}
 }
@@ -1220,7 +1220,7 @@ void Klaymen::stReleaseCord() {
 	startAnimation(0x3A28C094, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmPullReleaseCord);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 Klaymen::hmPullReleaseCord(int messageNum, const MessageParam &param, Entity *sender) {
@@ -1247,7 +1247,7 @@ void Klaymen::stUseTube() {
 		startAnimation(0x1A38A814, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmUseTube);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -1309,7 +1309,7 @@ void Klaymen::startWalkToXDistance(int16 destX, int16 distance) {
 	if (_x > destX) {
 		if (_x == destX + distance) {
 			_destX = destX + distance;
-			gotoState(NULL);
+			gotoState(nullptr);
 			gotoNextStateExt();
 		} else if (_x < destX + distance) {
 			startWalkToXExt(destX + distance);
@@ -1319,7 +1319,7 @@ void Klaymen::startWalkToXDistance(int16 destX, int16 distance) {
 	} else {
 		if (_x == destX - distance) {
 			_destX = destX - distance;
-			gotoState(NULL);
+			gotoState(nullptr);
 			gotoNextStateExt();
 		} else if (_x > destX - distance) {
 			startWalkToXExt(destX - distance);
@@ -1334,12 +1334,12 @@ void Klaymen::startWalkToXExt(int16 x) {
 	if (x == _x) {
 		_destX = x;
 		if (!_isWalking && !_isSneaking && !_isLargeStep) {
-			gotoState(NULL);
+			gotoState(nullptr);
 			gotoNextStateExt();
 		}
 	} else if (xdiff <= 36 && !_isWalking && !_isSneaking && !_isLargeStep) {
 		_destX = x;
-		gotoState(NULL);
+		gotoState(nullptr);
 		gotoNextStateExt();
 	} else if (xdiff <= 42 && _actionStatus != 3) {
 		if (_isSneaking && ((!_doDeltaX && x - _x > 0) || (_doDeltaX && x - _x < 0)) && ABS(_destX - _x) > xdiff) {
@@ -1435,7 +1435,7 @@ void Klaymen::stWonderAboutHalf() {
 	startAnimation(0xD820A114, 0, 10);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stWonderAboutAfter() {
@@ -1444,7 +1444,7 @@ void Klaymen::stWonderAboutAfter() {
 	startAnimation(0xD820A114, 30, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stTurnToUseHalf() {
@@ -1453,7 +1453,7 @@ void Klaymen::stTurnToUseHalf() {
 	startAnimation(0x9B250AD2, 0, 7);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmTurnToUse);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 Klaymen::hmTurnToUse(int messageNum, const MessageParam &param, Entity *sender) {
@@ -1478,7 +1478,7 @@ void Klaymen::stTurnAwayFromUse() {
 	startAnimation(0x98F88391, 4, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmTurnToUse);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stWonderAbout() {
@@ -1487,7 +1487,7 @@ void Klaymen::stWonderAbout() {
 	startAnimation(0xD820A114, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stPeekWall() {
@@ -1496,7 +1496,7 @@ void Klaymen::stPeekWall() {
 	startAnimation(0xAC20C012, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmPeekWall);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 Klaymen::hmPeekWall(int messageNum, const MessageParam &param, Entity *sender) {
@@ -1529,11 +1529,11 @@ void Klaymen::stReleaseRing() {
 	_busyStatus = 1;
 	_acceptInput = false;
 	sendMessage(_attachedSprite, NM_KLAYMEN_RAISE_LEVER, 0);
-	_attachedSprite = NULL;
+	_attachedSprite = nullptr;
 	startAnimation(0xB869A4B9, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::startWalkToAttachedSpriteXDistance(int16 distance) {
@@ -1548,7 +1548,7 @@ void Klaymen::stContinueClimbLadderUp() {
 	_newStickFrameHash = 0x01084280;
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	gotoNextStateExt();
 }
 
@@ -1748,7 +1748,7 @@ void Klaymen::stLandOnFeet() {
 	startAnimation(0x18118554, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLandOnFeet);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 Klaymen::hmLandOnFeet(int messageNum, const MessageParam &param, Entity *sender) {
@@ -1974,7 +1974,7 @@ void Klaymen::stInsertDisk() {
 			}
 		}
 		if (_tapesToInsert == 0) {
-			GotoState(NULL);
+			GotoState(nullptr);
 			gotoNextStateExt();
 		} else {
 			startAnimation(0xD8C8D100, 0, -1);
@@ -2120,7 +2120,7 @@ void Klaymen::stFinishGrow() {
 	_acceptInput = false;
 	startAnimation(0x38445000, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	SetMessageHandler(&Klaymen::hmFinishGrow);
 }
 
@@ -2166,7 +2166,7 @@ void Klaymen::stJumpToGrabRelease() {
 	startAnimationByHash(0x00AB8C10, 0x320AC306, 0);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmJumpToGrabRelease);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stReleaseRing);
 }
 
@@ -2189,7 +2189,7 @@ void Klaymen::stIdleTeleporterHands() {
 	startAnimation(0x90EF8D38, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stSitIdleTeleporterBlinkSecond);
 }
 
@@ -2199,7 +2199,7 @@ void Klaymen::stIdleTeleporterHands2() {
 	startAnimation(0x900F0930, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stSitIdleTeleporterBlinkSecond);
 }
 
@@ -2209,7 +2209,7 @@ void Klaymen::teleporterAppear(uint32 fileHash) {
 	startAnimation(fileHash, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmTeleporterAppearDisappear);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::teleporterDisappear(uint32 fileHash) {
@@ -2218,7 +2218,7 @@ void Klaymen::teleporterDisappear(uint32 fileHash) {
 	startAnimation(fileHash, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmTeleporterAppearDisappear);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 Klaymen::hmTeleporterAppearDisappear(int messageNum, const MessageParam &param, Entity *sender) {
@@ -2245,7 +2245,7 @@ void Klaymen::stStandWonderAbout() {
 	startAnimation(0xD820A114, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	_newStickFrameIndex = 10;
 }
 
@@ -2408,7 +2408,7 @@ void Klaymen::stInsertKey() {
 			}
 		}
 		if (_keysToInsert == 0) {
-			GotoState(NULL);
+			GotoState(nullptr);
 			gotoNextStateExt();
 		} else {
 			_acceptInput = false;
@@ -2454,7 +2454,7 @@ void Klaymen::stPeekWall1() {
 	startAnimation(0xAC20C012, 8, 37);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stPeekWallBlink);
 }
 
@@ -2463,7 +2463,7 @@ void Klaymen::stPeekWall2() {
 	_acceptInput = false;
 	startAnimation(0xAC20C012, 43, 49);
 	SetUpdateHandler(&Klaymen::update);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
 }
 
@@ -2474,7 +2474,7 @@ void Klaymen::stPeekWallBlink() {
 	_blinkCounterMax = _vm->_rnd->getRandomNumber(64) + 24;
 	startAnimation(0xAC20C012, 38, 42);
 	SetUpdateHandler(&Klaymen::upPeekWallBlink);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	SetMessageHandler(&Klaymen::hmLowLevel);
 	_newStickFrameIndex = 42;
 }
@@ -2485,7 +2485,7 @@ void Klaymen::stPeekWallReturn() {
 	startAnimation(0x2426932E, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmPeekWallReturn);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::upSpitOutFall() {
@@ -2541,7 +2541,7 @@ void Klaymen::stStandIdleSpecial() {
 	startAnimation(0x5420E254, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmStandIdleSpecial);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stSpitOutFall0() {
@@ -2576,11 +2576,11 @@ void Klaymen::stFalling() {
 	_isWalking = false;
 	startAnimationByHash(0x000BAB02, 0x88003000, 0);
 	SetUpdateHandler(&Klaymen::update);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
 	NextState(&Klaymen::stFallTouchdown);
 	sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
-	_attachedSprite = NULL;
+	_attachedSprite = nullptr;
 	sendMessage(_parentScene, 0x8001, 0);
 }
 
@@ -2742,7 +2742,7 @@ void Klaymen::stPeekInside() {
 	startAnimation(0xAC20C012, 8, 37);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&Klaymen::stPeekInsideBlink);
 }
 
@@ -2752,7 +2752,7 @@ void Klaymen::stPeekInsideReturn() {
 	startAnimation(0xAC20C012, 43, 49);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void Klaymen::stPeekInsideBlink() {
@@ -2762,7 +2762,7 @@ void Klaymen::stPeekInsideBlink() {
 	_newStickFrameIndex = 42;
 	SetUpdateHandler(&Klaymen::upPeekInsideBlink);
 	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	_blinkCounter = 0;
 	_blinkCounterMax = _vm->_rnd->getRandomNumber(64 - 1) + 24;
 }
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index a7752626d6..8dc28baeb5 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -74,7 +74,7 @@ static const uint32 kMakingOfSmackerFileHashList[] = {
 };
 
 MenuModule::MenuModule(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Module(vm, parentModule), _savegameList(NULL) {
+	: Module(vm, parentModule), _savegameList(nullptr) {
 
 	SetMessageHandler(&MenuModule::handleMessage);
 
@@ -231,7 +231,7 @@ void MenuModule::createDeleteGameMenu() {
 void MenuModule::refreshSaveGameList() {
 	_savegameSlot = -1;
 	delete _savegameList;
-	_savegameList = NULL;
+	_savegameList = nullptr;
 	_savegameList = new SavegameList();
 	loadSavegameList();
 }
@@ -243,7 +243,7 @@ void MenuModule::handleLoadGameMenuAction(bool doLoad) {
 		leaveModule(0);
 	}
 	delete _savegameList;
-	_savegameList = NULL;
+	_savegameList = nullptr;
 }
 
 void MenuModule::handleSaveGameMenuAction(bool doSave, bool doQuery) {
@@ -264,7 +264,7 @@ void MenuModule::handleSaveGameMenuAction(bool doSave, bool doQuery) {
 		createScene(MAIN_MENU, -1);
 	}
 	delete _savegameList;
-	_savegameList = NULL;
+	_savegameList = nullptr;
 }
 
 void MenuModule::handleDeleteGameMenuAction(bool doDelete) {
@@ -273,7 +273,7 @@ void MenuModule::handleDeleteGameMenuAction(bool doDelete) {
 		_vm->removeGameState(_savegameSlot);
 	}
 	delete _savegameList;
-	_savegameList = NULL;
+	_savegameList = nullptr;
 }
 
 void MenuModule::loadSavegameList() {
@@ -592,12 +592,12 @@ TextEditWidget::TextEditWidget(NeverhoodEngine *vm, int16 x, int16 y, GameStateM
 	int maxStringLength, FontSurface *fontSurface, uint32 fileHash, const NRect &rect)
 	: Widget(vm, x, y, parentScene,	1000, 1000),
 	_maxStringLength(maxStringLength), _fontSurface(fontSurface), _fileHash(fileHash), _rect(rect),
-	_cursorSurface(NULL), _cursorTicks(0), _cursorPos(0), _cursorFileHash(0), _cursorWidth(0), _cursorHeight(0),
+	_cursorSurface(nullptr), _cursorTicks(0), _cursorPos(0), _cursorFileHash(0), _cursorWidth(0), _cursorHeight(0),
 	_modified(false), _readOnly(false) {
 
 	_maxVisibleChars = (_rect.x2 - _rect.x1) / _fontSurface->getCharWidth();
 	_cursorPos = 0;
-	_textLabelWidget = NULL;
+	_textLabelWidget = nullptr;
 
 	SetUpdateHandler(&TextEditWidget::update);
 	SetMessageHandler(&TextEditWidget::handleMessage);
@@ -916,7 +916,7 @@ GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, Savegame
 	uint32 listBoxBackgroundFileHash, int16 listBoxX, int16 listBoxY, const NRect &listBoxRect,
 	uint32 textEditBackgroundFileHash, uint32 textEditCursorFileHash, int16 textEditX, int16 textEditY, const NRect &textEditRect,
 	uint32 textFileHash1, uint32 textFileHash2)
-	: Scene(vm, parentModule), _currWidget(NULL), _savegameList(savegameList) {
+	: Scene(vm, parentModule), _currWidget(nullptr), _savegameList(savegameList) {
 
 	bool isSave = (textEditCursorFileHash != 0);
 
@@ -1122,7 +1122,7 @@ static const NRect kLoadGameMenuMouseRect = { 263, 48, 583, 65 };
 LoadGameMenu::LoadGameMenu(NeverhoodEngine *vm, Module *parentModule, SavegameList *savegameList)
 	: GameStateMenu(vm, parentModule, savegameList, kLoadGameMenuButtonFileHashes, kLoadGameMenuButtonCollisionBounds,
 		0x98620234, 0x201C2474,
-		0x2023098E, NULL /* &kLoadGameMenuMouseRect */,
+		0x2023098E, nullptr /* &kLoadGameMenuMouseRect */,
 		0x04040409, 263, 142, kLoadGameMenuListBoxRect,
 		0x10924C03, 0, 263, 48, kLoadGameMenuTextEditRect,
 		0x0BC600A3, 0x0F960021) {
@@ -1157,7 +1157,7 @@ static const NRect kDeleteGameMenuTextEditRect = { 0, 0, 320, 17 };
 DeleteGameMenu::DeleteGameMenu(NeverhoodEngine *vm, Module *parentModule, SavegameList *savegameList)
 	: GameStateMenu(vm, parentModule, savegameList, kDeleteGameMenuButtonFileHashes, kDeleteGameMenuButtonCollisionBounds,
 		0x4080E01C, 0x728523ED,
-		0x0E018400, NULL,
+		0x0E018400, nullptr,
 		0xA5584211, 61, 64, kDeleteGameMenuListBoxRect,
 		0x250A3060, 0, 49, 414, kDeleteGameMenuTextEditRect,
 		0x80083C01, 0x84181E81) {
diff --git a/engines/neverhood/module_scene.cpp b/engines/neverhood/module_scene.cpp
index 0d6b70c9a2..55043b3ee6 100644
--- a/engines/neverhood/module_scene.cpp
+++ b/engines/neverhood/module_scene.cpp
@@ -29,7 +29,7 @@
 namespace Neverhood {
 
 Module::Module(NeverhoodEngine *vm, Module *parentModule)
-	: Entity(vm, 0), _parentModule(parentModule), _childObject(NULL),
+	: Entity(vm, 0), _parentModule(parentModule), _childObject(nullptr),
 	_done(false), _sceneType(kSceneTypeNormal) {
 
 	SetMessageHandler(&Module::handleMessage);
@@ -108,7 +108,7 @@ bool Module::updateChild() {
 			if (_sceneType == kSceneTypeNavigation)
 				_navigationAreaType = navigationScene()->getNavigationAreaType();
 			delete _childObject;
-			_childObject = NULL;
+			_childObject = nullptr;
 			_sceneType = kSceneTypeNormal;
 			return false;
 		}
diff --git a/engines/neverhood/modules/module1000.cpp b/engines/neverhood/modules/module1000.cpp
index 6102b16879..7664638fda 100644
--- a/engines/neverhood/modules/module1000.cpp
+++ b/engines/neverhood/modules/module1000.cpp
@@ -124,7 +124,7 @@ void Module1000::updateScene() {
 }
 
 Scene1001::Scene1001(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _asDoor(NULL), _asWindow(NULL) {
+	: Scene(vm, parentModule), _asDoor(nullptr), _asWindow(nullptr) {
 
 	Sprite *tempSprite;
 
@@ -402,7 +402,7 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam &param, Entit
 		}
 		break;
 	case NM_POSITION_CHANGE:
-		_messageList = NULL;
+		_messageList = nullptr;
 		break;
 	case NM_KLAYMEN_CLIMB_LADDER:
 		_isClimbingLadder = true;
diff --git a/engines/neverhood/modules/module1000_sprites.cpp b/engines/neverhood/modules/module1000_sprites.cpp
index 3714b82506..d03804adc6 100644
--- a/engines/neverhood/modules/module1000_sprites.cpp
+++ b/engines/neverhood/modules/module1000_sprites.cpp
@@ -160,7 +160,7 @@ uint32 AsScene1001Window::handleMessage(int messageNum, const MessageParam &para
 		startAnimation(0xC68C2299, 0, -1);
 		break;
 	case NM_ANIMATION_STOP:
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		setGlobalVar(V_WINDOW_OPEN, 1);
 		setVisible(false);
 		break;
@@ -400,7 +400,7 @@ AsScene1002Door::AsScene1002Door(NeverhoodEngine *vm, NRect &clipRect)
 	setClipRect(clipRect);
 	SetUpdateHandler(&AsScene1002Door::update);
 	SetMessageHandler(&AsScene1002Door::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void AsScene1002Door::update() {
@@ -429,7 +429,7 @@ void AsScene1002Door::suOpenDoor() {
 	if (_y > 49) {
 		_y -= 8;
 		if (_y < 49) {
-			SetSpriteUpdate(NULL);
+			SetSpriteUpdate(nullptr);
 			_y = 49;
 		}
 		_needRefresh = true;
@@ -440,7 +440,7 @@ void AsScene1002Door::suCloseDoor() {
 	if (_y < 239) {
 		_y += 8;
 		if (_y > 239) {
-			SetSpriteUpdate(NULL);
+			SetSpriteUpdate(nullptr);
 			_y = 239;
 		}
 		_needRefresh = true;
@@ -787,7 +787,7 @@ void AsScene1002VenusFlyTrap::stRingGrabbed() {
 void AsScene1002VenusFlyTrap::stKlaymenInside() {
 	startAnimation(0x31303094, 0, -1);
 	SetUpdateHandler(&AsScene1002VenusFlyTrap::update);
-	SetMessageHandler(NULL);
+	SetMessageHandler(nullptr);
 	NextState(&AsScene1002VenusFlyTrap::stKlaymenInsideMoving);
 	_countdown = 24;
 }
@@ -1106,7 +1106,7 @@ void KmScene1001::stWakeUp() {
 	startAnimation(0x527AC970, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void KmScene1001::stSleeping() {
@@ -1115,7 +1115,7 @@ void KmScene1001::stSleeping() {
 	startAnimation(0x5A38C110, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&KmScene1001::hmSleeping);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 KmScene1001::hmSleeping(int messageNum, const MessageParam &param, Entity *sender) {
@@ -1311,7 +1311,7 @@ void KmScene1002::stHangOnRing() {
 	startAnimation(0x4829E0B8, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&Klaymen::hmLowLevel);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void KmScene1002::stJumpToRing1() {
@@ -1369,7 +1369,7 @@ void KmScene1002::stHoldRing3() {
 	startAnimation(0x4A293FB0, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&KmScene1002::hmHoldRing3);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 KmScene1002::hmHoldRing3(int messageNum, const MessageParam &param, Entity *sender) {
@@ -1438,7 +1438,7 @@ void KmScene1002::stDropFromRing() {
 	if (_attachedSprite) {
 		_x = _attachedSprite->getX();
 		sendMessage(_attachedSprite, NM_KLAYMEN_RAISE_LEVER, 0);
-		_attachedSprite = NULL;
+		_attachedSprite = nullptr;
 	}
 	_busyStatus = 2;
 	_acceptInput = false;
diff --git a/engines/neverhood/modules/module1200.cpp b/engines/neverhood/modules/module1200.cpp
index cbfd6c8c95..ac18b6039d 100644
--- a/engines/neverhood/modules/module1200.cpp
+++ b/engines/neverhood/modules/module1200.cpp
@@ -102,8 +102,8 @@ static const uint32 kScene1201InitArray[] = {
 };
 
 Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _creatureExploded(false), _asMatch(NULL), _asTntMan(NULL),
-	_asCreature(NULL), _asTntManRope(NULL), _asLeftDoor(NULL), _asRightDoor(NULL), _asTape(NULL) {
+	: Scene(vm, parentModule), _creatureExploded(false), _asMatch(nullptr), _asTntMan(nullptr),
+	_asCreature(nullptr), _asTntManRope(nullptr), _asLeftDoor(nullptr), _asRightDoor(nullptr), _asTape(nullptr) {
 
 	int16 topY1, topY2, topY3, topY4;
 	int16 x1, x2;
@@ -188,7 +188,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
 	if (getGlobalVar(V_CREATURE_ANGRY) && !getGlobalVar(V_CREATURE_EXPLODED)) {
 		setBackground(0x4019A2C4);
 		setPalette(0x4019A2C4);
-		_asRightDoor = NULL;
+		_asRightDoor = nullptr;
 	} else {
 		setBackground(0x40206EC5);
 		setPalette(0x40206EC5);
@@ -271,7 +271,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
 	if (getGlobalVar(V_CREATURE_ANGRY) && getGlobalVar(V_MATCH_STATUS) == 0)
 		setGlobalVar(V_MATCH_STATUS, 1);
 
-	_asMatch = NULL;
+	_asMatch = nullptr;
 
 	if (getGlobalVar(V_MATCH_STATUS) < 3) {
 		_asMatch = insertSprite<AsScene1201Match>(this);
diff --git a/engines/neverhood/modules/module1200_sprites.cpp b/engines/neverhood/modules/module1200_sprites.cpp
index 88b486bef6..a17406eae9 100644
--- a/engines/neverhood/modules/module1200_sprites.cpp
+++ b/engines/neverhood/modules/module1200_sprites.cpp
@@ -61,7 +61,7 @@ AsScene1201Tape::AsScene1201Tape(NeverhoodEngine *vm, Scene *parentScene, uint32
 		SetMessageHandler(&AsScene1201Tape::handleMessage);
 	} else {
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 	}
 }
 
@@ -75,7 +75,7 @@ uint32 AsScene1201Tape::handleMessage(int messageNum, const MessageParam &param,
 	case NM_KLAYMEN_USE_OBJECT:
 		setSubVar(VA_HAS_TAPE, _nameHash, 1);
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		break;
 	default:
 		break;
@@ -273,7 +273,7 @@ void AsScene1201TntMan::suMoving() {
 void AsScene1201TntMan::stStanding() {
 	startAnimation(0x654913D0, 0, -1);
 	SetMessageHandler(&AsScene1201TntMan::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void AsScene1201TntMan::stComingDown() {
@@ -782,7 +782,7 @@ void KmScene1201::stCloseEyes() {
 		startAnimation(0x5420E254, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&Klaymen::hmLowLevel);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -816,7 +816,7 @@ void KmScene1201::stFetchMatch() {
 		startAnimation(0x9CAA0218, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&KmScene1201::hmMatch);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 		NextState(&KmScene1201::stLightMatch);
 	}
 }
@@ -828,7 +828,7 @@ void KmScene1201::stLightMatch() {
 	startAnimation(0x1222A513, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&KmScene1201::hmMatch);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 uint32 KmScene1201::hmTumbleHeadless(int messageNum, const MessageParam &param, Entity *sender) {
diff --git a/engines/neverhood/modules/module1300.cpp b/engines/neverhood/modules/module1300.cpp
index c782870f60..43bb508d10 100644
--- a/engines/neverhood/modules/module1300.cpp
+++ b/engines/neverhood/modules/module1300.cpp
@@ -481,7 +481,7 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam &param, Entit
 }
 
 Scene1303::Scene1303(NeverhoodEngine *vm, Module *parentModule)
-	: Scene(vm, parentModule), _asBalloon(NULL) {
+	: Scene(vm, parentModule), _asBalloon(nullptr) {
 
 	SetMessageHandler(&Scene1303::handleMessage);
 
@@ -522,7 +522,7 @@ uint32 Scene1303::handleMessage(int messageNum, const MessageParam &param, Entit
 }
 
 Scene1304::Scene1304(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _asNeedle(NULL) {
+	: Scene(vm, parentModule), _asNeedle(nullptr) {
 
 	SetMessageHandler(&Scene1304::handleMessage);
 
@@ -790,7 +790,7 @@ uint32 Scene1306::handleMessage416EB0(int messageNum, const MessageParam &param,
 }
 
 Scene1307::Scene1307(NeverhoodEngine *vm, Module *parentModule)
-	: Scene(vm, parentModule), _countdown(0), _asCurrKey(NULL),
+	: Scene(vm, parentModule), _countdown(0), _asCurrKey(nullptr),
 	_isInsertingKey(false), _doLeaveScene(false), _isPuzzleSolved(false) {
 
 	Sprite *tempSprite;
@@ -830,7 +830,7 @@ Scene1307::Scene1307(NeverhoodEngine *vm, Module *parentModule)
 			_asKeys[keyIndex] = insertSprite<AsScene1307Key>(this, keyIndex, _clipRects);
 			addCollisionSprite(_asKeys[keyIndex]);
 		} else {
-			_asKeys[keyIndex] = NULL;
+			_asKeys[keyIndex] = nullptr;
 		}
 	}
 
@@ -905,7 +905,7 @@ uint32 Scene1307::handleMessage(int messageNum, const MessageParam &param, Entit
 					sendMessage(_asKeys[keyIndex], 0x2000, 1);
 			sendMessage(_asCurrKey, 0x2004, 1);
 		}
-		_asCurrKey = NULL;
+		_asCurrKey = nullptr;
 		_isInsertingKey = false;
 		break;
 	case 0x4826:
@@ -930,7 +930,7 @@ static const uint32 kScene1308NumberFileHashes[] = {
 };
 
 Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _isProjecting(false), _asProjector(NULL) {
+	: Scene(vm, parentModule), _isProjecting(false), _asProjector(nullptr) {
 
 	_vm->gameModule()->initKeySlotsPuzzle();
 
@@ -956,7 +956,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
 	_ssNumber3 = insertSprite<SsScene1308Number>(kScene1308NumberFileHashes[getSubVar(VA_GOOD_KEY_SLOT_NUMBERS, 2)], 2);
 	_sprite2 = insertStaticSprite(0x40043120, 995);
 	_sprite3 = insertStaticSprite(0x43003100, 995);
-	_sprite4 = NULL;
+	_sprite4 = nullptr;
 	_sprite5 = nullptr;
 
 	if (which < 0) {
@@ -1014,7 +1014,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
 		_klaymen->setClipRect(_sprite1->getDrawRect().x, 0, 640, 480);
 
 	if (getGlobalVar(V_PROJECTOR_LOCATION) == 4) {
-		_asProjector = insertSprite<AsCommonProjector>(this, _klaymen, (Sprite*)NULL);
+		_asProjector = insertSprite<AsCommonProjector>(this, _klaymen, (Sprite*)nullptr);
 		addCollisionSprite(_asProjector);
 		_asProjector->setClipRect(0, 0, 640, _sprite2->getDrawRect().y2());
 		_asProjector->setRepl(64, 0);
diff --git a/engines/neverhood/modules/module1300_sprites.cpp b/engines/neverhood/modules/module1300_sprites.cpp
index 05f43e773d..b5a41f60d3 100644
--- a/engines/neverhood/modules/module1300_sprites.cpp
+++ b/engines/neverhood/modules/module1300_sprites.cpp
@@ -90,7 +90,7 @@ SsScene1302Fence::SsScene1302Fence(NeverhoodEngine *vm)
 	loadSound(1, 0x78184098);
 	SetUpdateHandler(&SsScene1302Fence::update);
 	SetMessageHandler(&SsScene1302Fence::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void SsScene1302Fence::update() {
@@ -103,12 +103,12 @@ uint32 SsScene1302Fence::handleMessage(int messageNum, const MessageParam &param
 	switch (messageNum) {
 	case NM_KLAYMEN_OPEN_DOOR:
 		playSound(0);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		SetSpriteUpdate(&SsScene1302Fence::suMoveDown);
 		break;
 	case NM_KLAYMEN_CLOSE_DOOR:
 		playSound(1);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		SetSpriteUpdate(&SsScene1302Fence::suMoveUp);
 		break;
 	default:
@@ -122,7 +122,7 @@ void SsScene1302Fence::suMoveDown() {
 		_y += 8;
 	else {
 		SetMessageHandler(&SsScene1302Fence::handleMessage);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -131,7 +131,7 @@ void SsScene1302Fence::suMoveUp() {
 		_y -= 8;
 	else {
 		SetMessageHandler(&SsScene1302Fence::handleMessage);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -174,7 +174,7 @@ uint32 AsScene1303Balloon::hmBalloonPopped(int messageNum, const MessageParam &p
 		playSound(0, 0x470007EE);
 		stopAnimation();
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		break;
 	default:
 		break;
@@ -204,7 +204,7 @@ uint32 AsScene1304Needle::handleMessage(int messageNum, const MessageParam &para
 	case NM_KLAYMEN_USE_OBJECT:
 		setGlobalVar(V_HAS_NEEDLE, 1);
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		break;
 	default:
 		break;
@@ -401,7 +401,7 @@ void AsScene1307Key::suRemoveKey() {
 		updateBounds();
 		_pointIndex++;
 	} else {
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -414,7 +414,7 @@ void AsScene1307Key::suInsertKey() {
 		if (_pointIndex == 7)
 			playSound(0);
 	} else {
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 		sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
 	}
 }
@@ -759,7 +759,7 @@ void KmScene1305::stCrashDown() {
 	_acceptInput = false;
 	startAnimationByHash(0x000BAB02, 0x88003000, 0);
 	SetUpdateHandler(&Klaymen::update);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	SetMessageHandler(&Klaymen::hmLowLevelAnimation);
 	NextState(&KmScene1305::stCrashDownFinished);
 }
diff --git a/engines/neverhood/modules/module1400.cpp b/engines/neverhood/modules/module1400.cpp
index 52e8d37623..eae3281640 100644
--- a/engines/neverhood/modules/module1400.cpp
+++ b/engines/neverhood/modules/module1400.cpp
@@ -142,9 +142,9 @@ void Module1400::updateScene() {
 }
 
 Scene1401::Scene1401(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _projectorBorderFlag(false), _ssFloorButton(NULL), _asProjector(NULL),
-	_asPipe(NULL), _asMouse(NULL), _asCheese(NULL), _asBackDoor(NULL),
-	_sprite1(NULL), _sprite2(NULL), _sprite3(NULL), _ssButton(NULL) {
+	: Scene(vm, parentModule), _projectorBorderFlag(false), _ssFloorButton(nullptr), _asProjector(nullptr),
+	_asPipe(nullptr), _asMouse(nullptr), _asCheese(nullptr), _asBackDoor(nullptr),
+	_sprite1(nullptr), _sprite2(nullptr), _sprite3(nullptr), _ssButton(nullptr) {
 
 	SetMessageHandler(&Scene1401::handleMessage);
 	SetUpdateHandler(&Scene1401::update);
@@ -286,7 +286,7 @@ uint32 Scene1401::handleMessage(int messageNum, const MessageParam &param, Entit
 }
 
 Scene1402::Scene1402(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _isShaking(false), _asPuzzleBox(NULL), _asProjector(NULL) {
+	: Scene(vm, parentModule), _isShaking(false), _asPuzzleBox(nullptr), _asProjector(nullptr) {
 
 	SetMessageHandler(&Scene1402::handleMessage);
 
@@ -343,7 +343,7 @@ Scene1402::Scene1402(NeverhoodEngine *vm, Module *parentModule, int which)
 		_asPuzzleBox->setClipRect(0, 0, 640, _ssBridgePart3->getDrawRect().y2());
 
 	if (getGlobalVar(V_PROJECTOR_LOCATION) == 1) {
-		_asProjector = insertSprite<AsCommonProjector>(this, _klaymen, (Sprite*)NULL);
+		_asProjector = insertSprite<AsCommonProjector>(this, _klaymen, (Sprite*)nullptr);
 		addCollisionSprite(_asProjector);
 		if (getGlobalVar(V_PROJECTOR_SLOT) == 4) {
 			sendEntityMessage(_klaymen, 0x1014, _asProjector);
@@ -495,7 +495,7 @@ uint32 Scene1407::handleMessage(int messageNum, const MessageParam &param, Entit
 }
 
 Scene1403::Scene1403(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _asProjector(NULL), _isProjecting(false) {
+	: Scene(vm, parentModule), _asProjector(nullptr), _isProjecting(false) {
 
 	SetMessageHandler(&Scene1403::handleMessage);
 
@@ -527,7 +527,7 @@ Scene1403::Scene1403(NeverhoodEngine *vm, Module *parentModule, int which)
 	_klaymen->setRepl(64, 0);
 
 	if (getGlobalVar(V_PROJECTOR_LOCATION) == 0) {
-		_asProjector = insertSprite<AsCommonProjector>(this, _klaymen, (Sprite*)NULL);
+		_asProjector = insertSprite<AsCommonProjector>(this, _klaymen, (Sprite*)nullptr);
 		addCollisionSprite(_asProjector);
 		if (getGlobalVar(V_PROJECTOR_SLOT) == 4) {
 			sendEntityMessage(_klaymen, 0x1014, _asProjector);
@@ -599,7 +599,7 @@ uint32 Scene1403::handleMessage(int messageNum, const MessageParam &param, Entit
 }
 
 Scene1404::Scene1404(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _asProjector(NULL), _asKey(NULL) {
+	: Scene(vm, parentModule), _asProjector(nullptr), _asKey(nullptr) {
 
 	if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0)
 		setGlobalVar(V_KEY3_LOCATION, 5);
@@ -645,7 +645,7 @@ Scene1404::Scene1404(NeverhoodEngine *vm, Module *parentModule, int which)
 	}
 
 	if (getGlobalVar(V_PROJECTOR_LOCATION) == 3) {
-		_asProjector = insertSprite<AsCommonProjector>(this, _klaymen, (Sprite*)NULL);
+		_asProjector = insertSprite<AsCommonProjector>(this, _klaymen, (Sprite*)nullptr);
 		addCollisionSprite(_asProjector);
 		if (getGlobalVar(V_PROJECTOR_SLOT) == 0) {
 			sendEntityMessage(_klaymen, 0x1014, _asProjector);
diff --git a/engines/neverhood/modules/module1400_sprites.cpp b/engines/neverhood/modules/module1400_sprites.cpp
index 67b30ca1c8..de6267aae4 100644
--- a/engines/neverhood/modules/module1400_sprites.cpp
+++ b/engines/neverhood/modules/module1400_sprites.cpp
@@ -148,8 +148,8 @@ void AsScene1401Mouse::suSuckedIn() {
 		playSound(0, 0x0E32247F);
 		stopAnimation();
 		setVisible(false);
-		SetMessageHandler(NULL);
-		SetSpriteUpdate(NULL);
+		SetMessageHandler(nullptr);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -187,8 +187,8 @@ void AsScene1401Cheese::suSuckedIn() {
 		playSound(0, 0x18020439);
 		stopAnimation();
 		setVisible(false);
-		SetMessageHandler(NULL);
-		SetSpriteUpdate(NULL);
+		SetMessageHandler(nullptr);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -454,14 +454,14 @@ void AsCommonProjector::stSuckedIn() {
 		stopAnimation();
 		setVisible(false);
 		SetMessageHandler(&Sprite::handleMessage);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
 void AsCommonProjector::stIdle() {
 	startAnimation(0x10E3042B, 0, -1);
 	SetMessageHandler(&AsCommonProjector::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void AsCommonProjector::stMoving() {
@@ -475,14 +475,14 @@ void AsCommonProjector::stMoving() {
 void AsCommonProjector::stStartLockedInSlot() {
 	startAnimation(0x80C32213, 0, -1);
 	SetMessageHandler(&AsCommonProjector::hmAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&AsCommonProjector::stStayLockedInSlot);
 }
 
 void AsCommonProjector::stStayLockedInSlot() {
 	startAnimation(0xD23B207F, 0, -1);
 	SetMessageHandler(&AsCommonProjector::hmLockedInSlot);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void AsCommonProjector::stStartProjecting() {
@@ -492,7 +492,7 @@ void AsCommonProjector::stStartProjecting() {
 	_vm->_soundMan->addSound(0x05331081, 0xCE428854);
 	_vm->_soundMan->playSoundLooping(0xCE428854);
 	SetMessageHandler(&AsCommonProjector::hmAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&AsCommonProjector::stLockedInSlot);
 }
 
@@ -500,7 +500,7 @@ void AsCommonProjector::stLockedInSlot() {
 	sendMessage(_parentScene, NM_KLAYMEN_LOWER_LEVER, 0);
 	startAnimation(0xD833207F, 0, -1);
 	SetMessageHandler(&AsCommonProjector::hmLockedInSlot);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void AsCommonProjector::stStopProjecting() {
@@ -509,7 +509,7 @@ void AsCommonProjector::stStopProjecting() {
 	playSound(0, 0xCC4A8456);
 	_vm->_soundMan->deleteSound(0xCE428854);
 	SetMessageHandler(&AsCommonProjector::hmAnimation);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&AsCommonProjector::stStayLockedInSlot);
 }
 
@@ -785,7 +785,7 @@ void AsScene1407Mouse::stIdleLookAtGoodHole() {
 	setDoDeltaX(kScene1407MouseHoles[kScene1407MouseSections[_currSectionIndex].goodHoleIndex].x < _x ? 1 : 0);
 	startAnimation(0x72215194, 0, -1);
 	SetMessageHandler(&AsScene1407Mouse::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void AsScene1407Mouse::stWalkToDest() {
@@ -811,8 +811,8 @@ void AsScene1407Mouse::stGoThroughHole() {
 	setVisible(false);
 	_countdown = 12;
 	SetUpdateHandler(&AsScene1407Mouse::upGoThroughHole);
-	SetMessageHandler(NULL);
-	SetSpriteUpdate(NULL);
+	SetMessageHandler(nullptr);
+	SetSpriteUpdate(nullptr);
 	NextState(&AsScene1407Mouse::stArriveAtHole);
 }
 
diff --git a/engines/neverhood/modules/module1600.cpp b/engines/neverhood/modules/module1600.cpp
index 9e07fb86c7..85f686b2d7 100644
--- a/engines/neverhood/modules/module1600.cpp
+++ b/engines/neverhood/modules/module1600.cpp
@@ -190,7 +190,7 @@ void Module1600::updateScene() {
 }
 
 Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Scene(vm, parentModule), _asCar(NULL), _countdown1(0) {
+	: Scene(vm, parentModule), _asCar(nullptr), _countdown1(0) {
 
 	setGlobalVar(V_CAR_DELTA_X, 1);
 
@@ -355,7 +355,7 @@ void Scene1608::upUpperFloor() {
 		_asCar->setVisible(true);
 		sendMessage(_asCar, NM_CAR_ENTER, 0);
 		_asCar->handleUpdate();
-		_klaymen = NULL;
+		_klaymen = nullptr;
 		_carStatus = 0;
 	}
 	updateKlaymenCliprect();
diff --git a/engines/neverhood/modules/module1600_sprites.cpp b/engines/neverhood/modules/module1600_sprites.cpp
index 58caec5cfe..a563282fc5 100644
--- a/engines/neverhood/modules/module1600_sprites.cpp
+++ b/engines/neverhood/modules/module1600_sprites.cpp
@@ -48,7 +48,7 @@ AsCommonCar::AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
 	_rectFlag = false;
 	_newDeltaXType = -1;
 	_soundCounter = 0;
-	_pathPoints = NULL;
+	_pathPoints = nullptr;
 	_currMoveDirection = 0;
 	_newMoveDirection = 0;
 
@@ -57,7 +57,7 @@ AsCommonCar::AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
 
 	SetUpdateHandler(&AsCommonCar::update);
 	SetMessageHandler(&AsCommonCar::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 AsCommonCar::~AsCommonCar() {
@@ -98,7 +98,7 @@ uint32 AsCommonCar::handleMessage(int messageNum, const MessageParam &param, Ent
 	uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
 	switch (messageNum) {
 	case NM_SCENE_LEAVE:
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 		break;
 	case NM_POSITION_CHANGE:
 		// Set the current position without moving
@@ -167,7 +167,7 @@ uint32 AsCommonCar::handleMessage(int messageNum, const MessageParam &param, Ent
 					if (_currPointIndex == 0)
 						moveToPrevPoint();
 					else
-						SetSpriteUpdate(NULL);
+						SetSpriteUpdate(nullptr);
 				} else {
 					if (minMatchIndex > _currPointIndex)
 						moveToNextPoint();
@@ -246,7 +246,7 @@ uint32 AsCommonCar::hmLeaveCar(int messageNum, const MessageParam &param, Entity
 
 void AsCommonCar::stCarAtHome() {
 	bool doDeltaX = _doDeltaX;
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	_hasAgainDestPoint = false;
 	_hasAgainDestPointIndex = false;
 	_isBraking = false;
@@ -427,7 +427,7 @@ void AsCommonCar::stTurnCarMoveToNextPoint() {
 
 void AsCommonCar::stTurnCarMoveToPrevPoint() {
 	// Turn to left/right #3
-	FinalizeState(NULL);
+	FinalizeState(nullptr);
 	_isBusy = true;
 	startAnimation(0xF46A0324, 0, -1);
 	SetUpdateHandler(&AsCommonCar::update);
@@ -480,7 +480,7 @@ void AsCommonCar::moveToPrevPoint() {
 }
 
 void AsCommonCar::stBrakeMoveToPrevPoint() {
-	FinalizeState(NULL);
+	FinalizeState(nullptr);
 	_isBusy = true;
 	_isBraking = true;
 	startAnimation(0x192ADD30, 0, -1);
diff --git a/engines/neverhood/modules/module1700_sprites.cpp b/engines/neverhood/modules/module1700_sprites.cpp
index 7a7145799e..f5a1e0ada3 100644
--- a/engines/neverhood/modules/module1700_sprites.cpp
+++ b/engines/neverhood/modules/module1700_sprites.cpp
@@ -39,7 +39,7 @@ SsScene1705Tape::SsScene1705Tape(NeverhoodEngine *vm, Scene *parentScene, uint32
 		SetMessageHandler(&SsScene1705Tape::handleMessage);
 	} else {
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 	}
 	_collisionBoundsOffset = _drawOffset;
 	_collisionBoundsOffset.x -= 4;
@@ -59,7 +59,7 @@ uint32 SsScene1705Tape::handleMessage(int messageNum, const MessageParam &param,
 	case NM_KLAYMEN_USE_OBJECT:
 		setSubVar(VA_HAS_TAPE, _tapeIndex, 1);
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		break;
 	default:
 		break;
diff --git a/engines/neverhood/modules/module1900_sprites.cpp b/engines/neverhood/modules/module1900_sprites.cpp
index 28e8164a36..34e0a15a71 100644
--- a/engines/neverhood/modules/module1900_sprites.cpp
+++ b/engines/neverhood/modules/module1900_sprites.cpp
@@ -140,7 +140,7 @@ void AsScene1907Symbol::suTryToPlugIn() {
 	if (_currStep == 16) {
 		_x -= _smallDeltaX;
 		_y -= _smallDeltaY;
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -191,7 +191,7 @@ void AsScene1907Symbol::suMoveDown() {
 	if (_y >= kAsScene1907SymbolPluggedInDownPositions[_elementIndex].y) {
 		_y = kAsScene1907SymbolPluggedInDownPositions[_elementIndex].y;
 		_isMoving = false;
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -211,7 +211,7 @@ void AsScene1907Symbol::suMoveUp() {
 	if (_y < kAsScene1907SymbolPluggedInPositions[_elementIndex].y) {
 		_y = kAsScene1907SymbolPluggedInPositions[_elementIndex].y;
 		_isMoving = false;
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -284,7 +284,7 @@ void AsScene1907Symbol::cbFallOffHitGroundEvent() {
 	_newStickFrameIndex = 0;
 	SetUpdateHandler(&AnimatedSprite::update);
 	SetMessageHandler(&AsScene1907Symbol::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	updateBounds();
 	playSound(2);
 }
@@ -294,7 +294,7 @@ void AsScene1907Symbol::stPlugIn() {
 	_currPositionIndex = _newPositionIndex;
 	stopAnimation();
 	SetMessageHandler(&AsScene1907Symbol::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	if (_elementIndex == 8)
 		sendMessage(_parentScene, 0x2001, 0);
 }
diff --git a/engines/neverhood/modules/module2200.cpp b/engines/neverhood/modules/module2200.cpp
index 16c5d15151..cc80968c9f 100644
--- a/engines/neverhood/modules/module2200.cpp
+++ b/engines/neverhood/modules/module2200.cpp
@@ -595,7 +595,7 @@ uint32 Scene2201::handleMessage(int messageNum, const MessageParam &param, Entit
 
 Scene2202::Scene2202(NeverhoodEngine *vm, Module *parentModule, int which)
 	: Scene(vm, parentModule), _isSolved(false), _leaveScene(false), _isCubeMoving(false),
-	_ssMovingCube(NULL), _ssDoneMovingCube(NULL) {
+	_ssMovingCube(nullptr), _ssDoneMovingCube(nullptr) {
 
 	_vm->gameModule()->initCubeSymbolsPuzzle();
 
@@ -648,14 +648,14 @@ void Scene2202::update() {
 		if (freeCubePosition != -1) {
 			setSurfacePriority(_ssMovingCube->getSurface(), 700);
 			sendMessage(_ssMovingCube, 0x2001, freeCubePosition);
-			_ssMovingCube = NULL;
+			_ssMovingCube = nullptr;
 			_isCubeMoving = true;
 		}
 	}
 
 	if (_ssDoneMovingCube) {
 		setSurfacePriority(_ssDoneMovingCube->getSurface(), _surfacePriority);
-		_ssDoneMovingCube = NULL;
+		_ssDoneMovingCube = nullptr;
 		if (testIsSolved()) {
 			playSound(0);
 			setGlobalVar(V_TILE_PUZZLE_SOLVED, 1);
@@ -1160,11 +1160,11 @@ Scene2207::Scene2207(NeverhoodEngine *vm, Module *parentModule)
 		insertSprite<SsScene2207Symbol>(kScene2207FileHashes[getSubVar(VA_GOOD_CANNON_SYMBOLS_1, 0)], 0);
 		insertSprite<SsScene2207Symbol>(kScene2207FileHashes[getSubVar(VA_GOOD_CANNON_SYMBOLS_1, 1)], 1);
 		insertSprite<SsScene2207Symbol>(kScene2207FileHashes[getSubVar(VA_GOOD_CANNON_SYMBOLS_1, 2)], 2);
-		_asTape = NULL;
-		_asLever = NULL;
-		_asWallRobotAnimation = NULL;
-		_asWallCannonAnimation = NULL;
-		_ssButton = NULL;
+		_asTape = nullptr;
+		_asLever = nullptr;
+		_asWallRobotAnimation = nullptr;
+		_asWallCannonAnimation = nullptr;
+		_ssButton = nullptr;
 		_klaymen->setClipRect(0, _ssMaskPart1->getDrawRect().y, 640, 480);
 		_asElevator->setClipRect(0, _ssMaskPart1->getDrawRect().y, 640, 480);
 	}
diff --git a/engines/neverhood/modules/module2200_sprites.cpp b/engines/neverhood/modules/module2200_sprites.cpp
index e04154063c..0d70a5f61a 100644
--- a/engines/neverhood/modules/module2200_sprites.cpp
+++ b/engines/neverhood/modules/module2200_sprites.cpp
@@ -319,7 +319,7 @@ void SsScene2202PuzzleCube::moveCube(int16 newCubePosition) {
 
 void SsScene2202PuzzleCube::stopMoving() {
 	loadSprite(kSsScene2202PuzzleCubeFileHashes2[_cubeSymbol], kSLFCenteredDrawOffset);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	_isMoving = false;
 	sendMessage(_parentScene, NM_POSITION_CHANGE, _cubePosition);
 }
@@ -336,7 +336,7 @@ AsCommonKey::AsCommonKey(NeverhoodEngine *vm, Scene *parentScene, int keyIndex,
 	} else {
 		// If Klaymen already has the key or it's already inserted then don't show it
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 	}
 }
 
@@ -350,7 +350,7 @@ uint32 AsCommonKey::handleMessage(int messageNum, const MessageParam &param, Ent
 	case NM_KLAYMEN_USE_OBJECT:
 		setSubVar(VA_HAS_KEY, _keyIndex, 1);
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		break;
 	default:
 		break;
@@ -458,7 +458,7 @@ AsScene2206DoorSpikes::AsScene2206DoorSpikes(NeverhoodEngine *vm, uint32 fileHas
 		_x -= 63;
 	SetUpdateHandler(&AsScene2206DoorSpikes::update);
 	SetMessageHandler(&AsScene2206DoorSpikes::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void AsScene2206DoorSpikes::update() {
@@ -472,13 +472,13 @@ uint32 AsScene2206DoorSpikes::handleMessage(int messageNum, const MessageParam &
 	case NM_KLAYMEN_OPEN_DOOR:
 		_deltaIndex = 0;
 		playSound(0, 0x032746E0);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		SetSpriteUpdate(&AsScene2206DoorSpikes::suOpen);
 		break;
 	case NM_KLAYMEN_CLOSE_DOOR:
 		_deltaIndex = 0;
 		playSound(0, 0x002642C0);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		SetSpriteUpdate(&AsScene2206DoorSpikes::suClose);
 		break;
 	default:
@@ -493,7 +493,7 @@ void AsScene2206DoorSpikes::suOpen() {
 		_deltaIndex++;
 	} else {
 		SetMessageHandler(&AsScene2206DoorSpikes::handleMessage);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -503,7 +503,7 @@ void AsScene2206DoorSpikes::suClose() {
 		_deltaIndex++;
 	} else {
 		SetMessageHandler(&AsScene2206DoorSpikes::handleMessage);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -512,7 +512,7 @@ AsScene2206Platform::AsScene2206Platform(NeverhoodEngine *vm, uint32 fileHash)
 
 	SetUpdateHandler(&AsScene2206Platform::update);
 	SetMessageHandler(&AsScene2206Platform::handleMessage);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 void AsScene2206Platform::update() {
@@ -525,7 +525,7 @@ uint32 AsScene2206Platform::handleMessage(int messageNum, const MessageParam &pa
 	switch (messageNum) {
 	case 0x4803:
 		_yDelta = 0;
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		SetSpriteUpdate(&AsScene2206Platform::suMoveDown);
 		break;
 	default:
@@ -544,7 +544,7 @@ SsScene2206TestTube::SsScene2206TestTube(NeverhoodEngine *vm, Scene *parentScene
 
 	if (getGlobalVar(V_HAS_TEST_TUBE)) {
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 	} else
 		SetMessageHandler(&SsScene2206TestTube::handleMessage);
 	_collisionBoundsOffset = _drawOffset;
@@ -561,7 +561,7 @@ uint32 SsScene2206TestTube::handleMessage(int messageNum, const MessageParam &pa
 	case NM_KLAYMEN_USE_OBJECT:
 		setGlobalVar(V_HAS_TEST_TUBE, 1);
 		setVisible(false);
-		SetMessageHandler(NULL);
+		SetMessageHandler(nullptr);
 		break;
 	default:
 		break;
@@ -807,7 +807,7 @@ uint32 AsScene2207WallRobotAnimation::handleMessage(int messageNum, const Messag
 
 void AsScene2207WallRobotAnimation::stStartAnimation() {
 	if (!_idle) {
-		NextState(NULL);
+		NextState(nullptr);
 	} else {
 		startAnimation(0xCCFD6090, 0, -1);
 		_idle = false;
@@ -862,7 +862,7 @@ uint32 AsScene2207WallCannonAnimation::handleMessage(int messageNum, const Messa
 
 void AsScene2207WallCannonAnimation::stStartAnimation() {
 	if (!_idle) {
-		NextState(NULL);
+		NextState(nullptr);
 	} else {
 		setVisible(true);
 		startAnimation(0x8CAA0099, 0, -1);
diff --git a/engines/neverhood/modules/module2400_sprites.cpp b/engines/neverhood/modules/module2400_sprites.cpp
index 4198287e27..51b4c12bdf 100644
--- a/engines/neverhood/modules/module2400_sprites.cpp
+++ b/engines/neverhood/modules/module2400_sprites.cpp
@@ -486,7 +486,7 @@ void KmScene2401::stTrySpitIntoPipe() {
 		startAnimation(0x1808B150, 0, -1);
 		SetUpdateHandler(&Klaymen::update);
 		SetMessageHandler(&KmScene2401::hmSpit);
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 	}
 }
 
@@ -498,7 +498,7 @@ void KmScene2401::spitIntoPipe() {
 	startAnimation(0x1B08B553, 0, -1);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&KmScene2401::hmSpit);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 	NextState(&KmScene2401::stContSpitIntoPipe);
 }
 
@@ -508,7 +508,7 @@ void KmScene2401::stContSpitIntoPipe() {
 	startAnimationByHash(0x1808B150, 0x16401CA6, 0);
 	SetUpdateHandler(&Klaymen::update);
 	SetMessageHandler(&KmScene2401::hmSpit);
-	SetSpriteUpdate(NULL);
+	SetSpriteUpdate(nullptr);
 }
 
 KmScene2402::KmScene2402(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y)
diff --git a/engines/neverhood/modules/module2500.cpp b/engines/neverhood/modules/module2500.cpp
index 90207a17cb..ce634b983c 100644
--- a/engines/neverhood/modules/module2500.cpp
+++ b/engines/neverhood/modules/module2500.cpp
@@ -337,7 +337,7 @@ void Scene2501::update() {
 		_asCar->setVisible(true);
 		sendMessage(_asCar, NM_CAR_ENTER, 0);
 		_asCar->handleUpdate();
-		_klaymen = NULL;
+		_klaymen = nullptr;
 		_carStatus = 0;
 	}
 	updateKlaymenClipRect();
diff --git a/engines/neverhood/modules/module2700.cpp b/engines/neverhood/modules/module2700.cpp
index 702552e2ea..76c122819e 100644
--- a/engines/neverhood/modules/module2700.cpp
+++ b/engines/neverhood/modules/module2700.cpp
@@ -572,7 +572,7 @@ Scene2701::Scene2701(NeverhoodEngine *vm, Module *parentModule, int which)
 		_asCarTrackShadow = insertSprite<AsCommonCarTrackShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
 		_asCarConnectorShadow = insertSprite<AsCommonCarConnectorShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
 	} else {
-		_ssTrackShadowBackground = NULL;
+		_ssTrackShadowBackground = nullptr;
 		_asCar = insertSprite<AsCommonCar>(this, 320, 240);
 	}
 
@@ -833,8 +833,8 @@ Scene2703::Scene2703(NeverhoodEngine *vm, Module *parentModule, int which, uint3
 		_asCarTrackShadow = insertSprite<AsCommonCarTrackShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
 		_asCarConnectorShadow = insertSprite<AsCommonCarConnectorShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
 	} else {
-		_ssTrackShadowBackground = NULL;
-		_asCarShadow = NULL;
+		_ssTrackShadowBackground = nullptr;
+		_asCarShadow = nullptr;
 		_asCar = insertSprite<AsCommonCar>(this, 320, 240);
 	}
 
@@ -954,8 +954,8 @@ Scene2704::Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint3
 		_asCarTrackShadow = insertSprite<AsCommonCarTrackShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
 		_asCarConnectorShadow = insertSprite<AsCommonCarConnectorShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
 	} else {
-		_ssTrackShadowBackground = NULL;
-		_asCarShadow = NULL;
+		_ssTrackShadowBackground = nullptr;
+		_asCarShadow = nullptr;
 		_asCar = insertSprite<AsCommonCar>(this, 320, 240);
 	}
 
diff --git a/engines/neverhood/modules/module2800.cpp b/engines/neverhood/modules/module2800.cpp
index ca5b481abd..a69dd7c938 100644
--- a/engines/neverhood/modules/module2800.cpp
+++ b/engines/neverhood/modules/module2800.cpp
@@ -34,7 +34,7 @@
 namespace Neverhood {
 
 Module2800::Module2800(NeverhoodEngine *vm, Module *parentModule, int which)
-	: Module(vm, parentModule), _musicResource(NULL) {
+	: Module(vm, parentModule), _musicResource(nullptr) {
 
 	_currentMusicFileHash = 0;
 	_vm->_soundMan->addMusic(0x64210814, 0xD2FA4D14);
@@ -199,7 +199,7 @@ void Module2800::updateScene() {
 				if (_musicResource) {
 					_musicResource->unload();
 					delete _musicResource;
-					_musicResource = NULL;
+					_musicResource = nullptr;
 				}
 				_currentMusicFileHash = 0;
 			}
@@ -1180,7 +1180,7 @@ Scene2804::Scene2804(NeverhoodEngine *vm, Module *parentModule, int which)
 	addCollisionSprite(_ssRedButton);
 
 	for (uint crystalIndex = 0; crystalIndex < 5; crystalIndex++) {
-		AsScene2804CrystalWaves *asCrystalWaves = NULL;
+		AsScene2804CrystalWaves *asCrystalWaves = nullptr;
 		if (crystalIndex < 4 && getGlobalVar(V_SHRINK_LIGHTS_ON) == 0)
 			asCrystalWaves = insertSprite<AsScene2804CrystalWaves>(crystalIndex);
 		_asCrystals[crystalIndex] = insertSprite<AsScene2804Crystal>(asCrystalWaves, crystalIndex);
@@ -2160,7 +2160,7 @@ uint32 Scene2822::handleMessage(int messageNum, const MessageParam &param, Entit
 			if (getGlobalVar(V_LADDER_DOWN) == 0) {
 				setGlobalVar(V_LADDER_DOWN, 1);
 				setGlobalVar(V_LADDER_DOWN_ACTION, 1);
-				SetMessageHandler(NULL);
+				SetMessageHandler(nullptr);
 				playSound(2);
 				_mouseCursor->setVisible(false);
 			}
diff --git a/engines/neverhood/modules/module3000_sprites.cpp b/engines/neverhood/modules/module3000_sprites.cpp
index 63f31cc5a3..0a51a781b8 100644
--- a/engines/neverhood/modules/module3000_sprites.cpp
+++ b/engines/neverhood/modules/module3000_sprites.cpp
@@ -307,7 +307,7 @@ uint32 AsScene3009HorizontalIndicator::handleMessage(int messageNum, const Messa
 void AsScene3009HorizontalIndicator::suMoveLeft() {
 	_x -= 6;
 	if (_x < 92) {
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 		_x = 92;
 	}
 }
@@ -315,7 +315,7 @@ void AsScene3009HorizontalIndicator::suMoveLeft() {
 void AsScene3009HorizontalIndicator::suMoveRight() {
 	_x += 6;
 	if (_x > 533) {
-		SetSpriteUpdate(NULL);
+		SetSpriteUpdate(nullptr);
 		_x = 533;
 	}
 }
diff --git a/engines/neverhood/navigationscene.cpp b/engines/neverhood/navigationscene.cpp
index 161fa3f158..1689e3beba 100644
--- a/engines/neverhood/navigationscene.cpp
+++ b/engines/neverhood/navigationscene.cpp
@@ -83,7 +83,7 @@ void NavigationScene::update() {
 		_smackerFileHash = 0;
 	} else if (_smackerDone) {
 		if (_leaveSceneAfter) {
-			_vm->_screen->setSmackerDecoder(NULL);
+			_vm->_screen->setSmackerDecoder(nullptr);
 			sendMessage(_parentModule, 0x1009, _navigationIndex);
 		} else {
 			const NavigationItem &navigationItem = (*_navigationList)[_navigationIndex];
@@ -170,7 +170,7 @@ void NavigationScene::handleNavigation(const NPoint &mousePos) {
 			} while (!(*_navigationList)[_navigationIndex].interactive);
 			setGlobalVar(V_NAVIGATION_INDEX, _navigationIndex);
 		} else {
-			_vm->_screen->setSmackerDecoder(NULL);
+			_vm->_screen->setSmackerDecoder(nullptr);
 			sendMessage(_parentModule, 0x1009, _navigationIndex);
 		}
 		break;
@@ -187,7 +187,7 @@ void NavigationScene::handleNavigation(const NPoint &mousePos) {
 			} while (!(*_navigationList)[_navigationIndex].interactive);
 			setGlobalVar(V_NAVIGATION_INDEX, _navigationIndex);
 		} else {
-			_vm->_screen->setSmackerDecoder(NULL);
+			_vm->_screen->setSmackerDecoder(nullptr);
 			sendMessage(_parentModule, 0x1009, _navigationIndex);
 		}
 		break;
@@ -195,7 +195,7 @@ void NavigationScene::handleNavigation(const NPoint &mousePos) {
 	case 3:
 	case 4:
 		if (navigationItem.middleFlag) {
-			_vm->_screen->setSmackerDecoder(NULL);
+			_vm->_screen->setSmackerDecoder(nullptr);
 			sendMessage(_parentModule, 0x1009, _navigationIndex);
 		} else if (navigationItem.middleSmackerFileHash != 0) {
 			_smackerFileHash = navigationItem.middleSmackerFileHash;
diff --git a/engines/neverhood/resource.cpp b/engines/neverhood/resource.cpp
index 6ddd241177..7093a18757 100644
--- a/engines/neverhood/resource.cpp
+++ b/engines/neverhood/resource.cpp
@@ -30,7 +30,7 @@ namespace Neverhood {
 // SpriteResource
 
 SpriteResource::SpriteResource(NeverhoodEngine *vm)
-	 : _vm(vm), _pixels(NULL) {
+	 : _vm(vm), _pixels(nullptr) {
 }
 
 SpriteResource::~SpriteResource() {
@@ -55,22 +55,22 @@ bool SpriteResource::load(uint32 fileHash, bool doLoadPosition) {
 	if (_resourceHandle.isValid() && _resourceHandle.type() == kResTypeBitmap) {
 		_vm->_res->loadResource(_resourceHandle, _vm->applyResourceFixes());
 		const byte *spriteData = _resourceHandle.data();
-		NPoint *position = doLoadPosition ? &_position : NULL;
-		parseBitmapResource(spriteData, &_rle, &_dimensions, position, NULL, &_pixels);
+		NPoint *position = doLoadPosition ? &_position : nullptr;
+		parseBitmapResource(spriteData, &_rle, &_dimensions, position, nullptr, &_pixels);
 	}
-	return _pixels != NULL;
+	return _pixels != nullptr;
 }
 
 void SpriteResource::unload() {
 	_vm->_res->unloadResource(_resourceHandle);
-	_pixels = NULL;
+	_pixels = nullptr;
 	_rle = false;
 }
 
 // PaletteResource
 
 PaletteResource::PaletteResource(NeverhoodEngine *vm)
-	: _vm(vm), _palette(NULL) {
+	: _vm(vm), _palette(nullptr) {
 }
 
 PaletteResource::~PaletteResource() {
@@ -87,15 +87,15 @@ bool PaletteResource::load(uint32 fileHash) {
 		_palette = _resourceHandle.data();
 		// Check if the palette is stored in a bitmap
 		if (_resourceHandle.type() == kResTypeBitmap)
-			parseBitmapResource(_palette, NULL, NULL, NULL, &_palette, NULL);
+			parseBitmapResource(_palette, nullptr, nullptr, nullptr, &_palette, nullptr);
 
 	}
-	return _palette != NULL;
+	return _palette != nullptr;
 }
 
 void PaletteResource::unload() {
 	_vm->_res->unloadResource(_resourceHandle);
-	_palette = NULL;
+	_palette = nullptr;
 }
 
 void PaletteResource::copyPalette(byte *destPalette) {
@@ -106,8 +106,8 @@ void PaletteResource::copyPalette(byte *destPalette) {
 // AnimResource
 
 AnimResource::AnimResource(NeverhoodEngine *vm)
-	: _vm(vm), _width(0), _height(0), _currSpriteData(NULL), _fileHash(0), _paletteData(NULL),
-	_spriteData(NULL), _replEnabled(false), _replOldColor(0), _replNewColor(0) {
+	: _vm(vm), _width(0), _height(0), _currSpriteData(nullptr), _fileHash(0), _paletteData(nullptr),
+	_spriteData(nullptr), _replEnabled(false), _replOldColor(0), _replNewColor(0) {
 }
 
 AnimResource::~AnimResource() {
@@ -212,10 +212,10 @@ bool AnimResource::load(uint32 fileHash) {
 
 void AnimResource::unload() {
 	_vm->_res->unloadResource(_resourceHandle);
-	_currSpriteData = NULL;
+	_currSpriteData = nullptr;
 	_fileHash = 0;
-	_paletteData = NULL;
-	_spriteData = NULL;
+	_paletteData = nullptr;
+	_spriteData = nullptr;
 	_replEnabled = true;
 	_replOldColor = 0;
 	_replNewColor = 0;
@@ -310,7 +310,7 @@ void MouseCursorResource::draw(int frameNum, Graphics::Surface *destSurface) {
 // TextResource
 
 TextResource::TextResource(NeverhoodEngine *vm)
-	: _vm(vm), _textData(NULL), _count(0) {
+	: _vm(vm), _textData(nullptr), _count(0) {
 
 }
 
@@ -331,7 +331,7 @@ void TextResource::load(uint32 fileHash) {
 
 void TextResource::unload() {
 	_vm->_res->unloadResource(_resourceHandle);
-	_textData = NULL;
+	_textData = nullptr;
 	_count = 0;
 }
 
@@ -354,7 +354,7 @@ DataResource::~DataResource() {
 void DataResource::load(uint32 fileHash) {
 	if (_resourceHandle.fileHash() == fileHash)
 		return;
-	const byte *data = NULL;
+	const byte *data = nullptr;
 	uint32 dataSize = 0;
 	unload();
 	_vm->_res->queryResource(fileHash, _resourceHandle);
@@ -554,14 +554,14 @@ MessageList *DataResource::getMessageListAtPos(int16 klaymenX, int16 klaymenY, i
 			}
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 DataResource::DRDirectoryItem *DataResource::findDRDirectoryItem(uint32 nameHash, uint16 type) {
 	for (Common::Array<DRDirectoryItem>::iterator it = _directory.begin(); it != _directory.end(); it++)
 		if ((*it).nameHash == nameHash && (*it).type == type)
 			return &(*it);
-	return NULL;
+	return nullptr;
 }
 
 uint32 calcHash(const char *value) {
diff --git a/engines/neverhood/resourceman.cpp b/engines/neverhood/resourceman.cpp
index 6ab3222a2d..79114a3e92 100644
--- a/engines/neverhood/resourceman.cpp
+++ b/engines/neverhood/resourceman.cpp
@@ -25,7 +25,7 @@
 namespace Neverhood {
 
 ResourceHandle::ResourceHandle()
-	: _resourceFileEntry(NULL), _data(NULL) {
+	: _resourceFileEntry(nullptr), _data(nullptr) {
 }
 
 ResourceHandle::~ResourceHandle() {
@@ -62,7 +62,7 @@ void ResourceMan::addArchive(const Common::String &filename) {
 
 ResourceFileEntry *ResourceMan::findEntrySimple(uint32 fileHash) {
 	EntriesMap::iterator p = _entries.find(fileHash);
-	return p != _entries.end() ? &(*p)._value : NULL;
+	return p != _entries.end() ? &(*p)._value : nullptr;
 }
 
 ResourceFileEntry *ResourceMan::findEntry(uint32 fileHash, ResourceFileEntry **firstEntry) {
@@ -76,13 +76,13 @@ ResourceFileEntry *ResourceMan::findEntry(uint32 fileHash, ResourceFileEntry **f
 
 Common::SeekableReadStream *ResourceMan::createStream(uint32 fileHash) {
 	ResourceFileEntry *entry = findEntry(fileHash);
-	return entry ? entry->archive->createStream(entry->archiveEntry) : NULL;
+	return entry ? entry->archive->createStream(entry->archiveEntry) : nullptr;
 }
 
 void ResourceMan::queryResource(uint32 fileHash, ResourceHandle &resourceHandle) {
 	ResourceFileEntry *firstEntry;
 	resourceHandle._resourceFileEntry = findEntry(fileHash, &firstEntry);
-	resourceHandle._extData = firstEntry ? firstEntry->archiveEntry->extData : NULL;
+	resourceHandle._extData = firstEntry ? firstEntry->archiveEntry->extData : nullptr;
 }
 
 struct EntrySizeFix {
@@ -127,7 +127,7 @@ static const EntrySizeFix entrySizeFixes[] = {
 };
 
 void ResourceMan::loadResource(ResourceHandle &resourceHandle, bool applyResourceFixes) {
-	resourceHandle._data = NULL;
+	resourceHandle._data = nullptr;
 	if (resourceHandle.isValid()) {
 		const uint32 fileHash = resourceHandle.fileHash();
 		ResourceData *resourceData = _data[fileHash];
@@ -135,7 +135,7 @@ void ResourceMan::loadResource(ResourceHandle &resourceHandle, bool applyResourc
 			resourceData = new ResourceData();
 			_data[fileHash] = resourceData;
 		}
-		if (resourceData->data != NULL) {
+		if (resourceData->data != nullptr) {
 			resourceData->dataRefCount++;
 		} else {
 			BlbArchiveEntry *entry = resourceHandle._resourceFileEntry->archiveEntry;
@@ -162,8 +162,8 @@ void ResourceMan::unloadResource(ResourceHandle &resourceHandle) {
 		ResourceData *resourceData = _data[resourceHandle.fileHash()];
 		if (resourceData && resourceData->dataRefCount > 0)
 			--resourceData->dataRefCount;
-		resourceHandle._resourceFileEntry = NULL;
-		resourceHandle._data = NULL;
+		resourceHandle._resourceFileEntry = nullptr;
+		resourceHandle._data = nullptr;
 	}
 }
 
@@ -172,7 +172,7 @@ void ResourceMan::purgeResources() {
 		ResourceData *resourceData = (*it)._value;
 		if (resourceData->dataRefCount == 0) {
 			delete[] resourceData->data;
-			resourceData->data = NULL;
+			resourceData->data = nullptr;
 		}
 	}
 }
diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp
index 38b878c0cb..a17ec835e1 100644
--- a/engines/neverhood/scene.cpp
+++ b/engines/neverhood/scene.cpp
@@ -27,28 +27,28 @@
 namespace Neverhood {
 
 Scene::Scene(NeverhoodEngine *vm, Module *parentModule)
-	: Entity(vm, 0), _parentModule(parentModule), _dataResource(vm), _hitRects(NULL),
+	: Entity(vm, 0), _parentModule(parentModule), _dataResource(vm), _hitRects(nullptr),
 	_mouseCursorWasVisible(true) {
 
 	_isKlaymenBusy = false;
 	_doConvertMessages = false;
-	_messageList = NULL;
+	_messageList = nullptr;
 	_rectType = 0;
 	_mouseClickPos.x = 0;
 	_mouseClickPos.y = 0;
 	_mouseClicked = false;
-	_rectList = NULL;
-	_klaymen = NULL;
-	_mouseCursor = NULL;
-	_palette = NULL;
-	_background = NULL;
+	_rectList = nullptr;
+	_klaymen = nullptr;
+	_mouseCursor = nullptr;
+	_palette = nullptr;
+	_background = nullptr;
 	clearHitRects();
 	clearCollisionSprites();
 	_vm->_screen->setFps(24);
-	_vm->_screen->setSmackerDecoder(NULL);
+	_vm->_screen->setSmackerDecoder(nullptr);
 	_canAcceptInput = true;
-	_messageList2 = NULL;
-	_smackerPlayer = NULL;
+	_messageList2 = nullptr;
+	_smackerPlayer = nullptr;
 	_isMessageListBusy = false;
 	_messageValue = -1;
 	_messageListStatus = 0;
@@ -65,7 +65,7 @@ Scene::Scene(NeverhoodEngine *vm, Module *parentModule)
 
 Scene::~Scene() {
 
-	_vm->_screen->setSmackerDecoder(NULL);
+	_vm->_screen->setSmackerDecoder(nullptr);
 
 	if (_palette) {
 		removeEntity(_palette);
@@ -183,7 +183,7 @@ void Scene::deleteSprite(Sprite **sprite) {
 	removeSurface((*sprite)->getSurface());
 	removeEntity(*sprite);
 	delete *sprite;
-	*sprite = NULL;
+	*sprite = nullptr;
 }
 
 Background *Scene::addBackground(Background *background) {
@@ -314,7 +314,7 @@ uint32 Scene::handleMessage(int messageNum, const MessageParam &param, Entity *s
 		// This cancels the current message list and sets Klaymen into the idle state.
 		if (_isKlaymenBusy) {
 			_isKlaymenBusy = false;
-			_messageList = NULL;
+			_messageList = nullptr;
 			sendMessage(_klaymen, NM_KLAYMEN_STAND_IDLE, 0);
 		}
 		break;
@@ -419,7 +419,7 @@ void Scene::processMessageList() {
 	_isMessageListBusy = true;
 
 	if (!_messageList) {
-		_messageList2 = NULL;
+		_messageList2 = nullptr;
 		_messageListStatus = 0;
 	}
 
@@ -473,7 +473,7 @@ void Scene::processMessageList() {
 			}
 			if (_messageListIndex == _messageListCount) {
 				_canAcceptInput = true;
-				_messageList = NULL;
+				_messageList = nullptr;
 			}
 		}
 	}
@@ -484,7 +484,7 @@ void Scene::processMessageList() {
 
 void Scene::cancelMessageList() {
 	_isKlaymenBusy = false;
-	_messageList = NULL;
+	_messageList = nullptr;
 	_canAcceptInput = true;
 	sendMessage(_klaymen, NM_KLAYMEN_STAND_IDLE, 0);
 }
@@ -499,7 +499,7 @@ void Scene::setRectList(RectList *rectList) {
 }
 
 void Scene::clearRectList() {
-	_rectList = NULL;
+	_rectList = nullptr;
 	_rectType = 0;
 }
 
@@ -549,7 +549,7 @@ uint16 Scene::convertMessageNum(uint32 messageNum) {
 }
 
 void Scene::clearHitRects() {
-	_hitRects = NULL;
+	_hitRects = nullptr;
 }
 
 HitRect *Scene::findHitRectAtPos(int16 x, int16 y) {
diff --git a/engines/neverhood/screen.cpp b/engines/neverhood/screen.cpp
index 5cc7998210..da754f7aec 100644
--- a/engines/neverhood/screen.cpp
+++ b/engines/neverhood/screen.cpp
@@ -27,8 +27,8 @@
 namespace Neverhood {
 
 Screen::Screen(NeverhoodEngine *vm)
-	: _vm(vm), _paletteData(NULL), _paletteChanged(false), _smackerDecoder(NULL),
-	_yOffset(0), _fullRefresh(false), _frameDelay(0), _savedSmackerDecoder(NULL),
+	: _vm(vm), _paletteData(nullptr), _paletteChanged(false), _smackerDecoder(nullptr),
+	_yOffset(0), _fullRefresh(false), _frameDelay(0), _savedSmackerDecoder(nullptr),
 	_savedFrameDelay(0), _savedYOffset(0) {
 
 	_ticks = _vm->_system->getMillis();
@@ -152,7 +152,7 @@ void Screen::setPaletteData(byte *paletteData) {
 void Screen::unsetPaletteData(byte *paletteData) {
 	if (_paletteData == paletteData) {
 		_paletteChanged = false;
-		_paletteData = NULL;
+		_paletteData = nullptr;
 	}
 }
 
diff --git a/engines/neverhood/smackerplayer.cpp b/engines/neverhood/smackerplayer.cpp
index e15e729f81..298fbcd520 100644
--- a/engines/neverhood/smackerplayer.cpp
+++ b/engines/neverhood/smackerplayer.cpp
@@ -32,7 +32,7 @@ namespace Neverhood {
 // SmackerSurface
 
 SmackerSurface::SmackerSurface(NeverhoodEngine *vm)
-	: BaseSurface(vm, 0, 0, 0, "smacker"), _smackerFrame(NULL) {
+	: BaseSurface(vm, 0, 0, 0, "smacker"), _smackerFrame(nullptr) {
 }
 
 void SmackerSurface::draw() {
@@ -61,7 +61,7 @@ void SmackerSurface::unsetSmackerFrame() {
 	_sysRect.y = 0;
 	_sysRect.width = 0;
 	_sysRect.height = 0;
-	_smackerFrame = NULL;
+	_smackerFrame = nullptr;
 }
 
 // SmackerDoubleSurface
@@ -103,7 +103,7 @@ void NeverhoodSmackerDecoder::forceSeekToFrame(uint frame) {
 
 SmackerPlayer::SmackerPlayer(NeverhoodEngine *vm, Scene *scene, uint32 fileHash, bool doubleSurface, bool flag, bool paused)
 	: Entity(vm, 0), _scene(scene), _doubleSurface(doubleSurface), _videoDone(false), _paused(paused),
-	_palette(NULL), _smackerDecoder(NULL), _smackerSurface(NULL), _stream(NULL), _smackerFirst(true),
+	_palette(nullptr), _smackerDecoder(nullptr), _smackerSurface(nullptr), _stream(nullptr), _smackerFirst(true),
 	_drawX(-1), _drawY(-1) {
 
 	SetUpdateHandler(&SmackerPlayer::update);
@@ -120,7 +120,7 @@ SmackerPlayer::SmackerPlayer(NeverhoodEngine *vm, Scene *scene, uint32 fileHash,
 SmackerPlayer::~SmackerPlayer() {
 	close();
 	delete _smackerSurface;
-	_smackerSurface = NULL;
+	_smackerSurface = nullptr;
 }
 
 void SmackerPlayer::open(uint32 fileHash, bool keepLastFrame) {
@@ -152,9 +152,9 @@ void SmackerPlayer::close() {
 	delete _smackerDecoder;
 	delete _palette;
 	// NOTE The SmackerDecoder deletes the _stream
-	_smackerDecoder = NULL;
-	_palette = NULL;
-	_stream = NULL;
+	_smackerDecoder = nullptr;
+	_palette = nullptr;
+	_stream = nullptr;
 	_smackerSurface->unsetSmackerFrame();
 }
 
diff --git a/engines/neverhood/smackerscene.cpp b/engines/neverhood/smackerscene.cpp
index ea9f4d3f7b..7ae7c24d58 100644
--- a/engines/neverhood/smackerscene.cpp
+++ b/engines/neverhood/smackerscene.cpp
@@ -27,7 +27,7 @@ namespace Neverhood {
 
 SmackerScene::SmackerScene(NeverhoodEngine *vm, Module *parentModule, bool doubleSurface, bool canSkip, bool canAbort)
 	: Scene(vm, parentModule), _doubleSurface(doubleSurface), _canSkip(canSkip), _canAbort(canAbort), _videoPlayedBefore(false),
-	_fileHashListIndex(-1), _fileHashList(NULL), _playNextVideoFlag(false) {
+	_fileHashListIndex(-1), _fileHashList(nullptr), _playNextVideoFlag(false) {
 
 	debug(0, "SmackerScene::SmackerScene(%d, %d, %d)", doubleSurface, canSkip, canAbort);
 
@@ -75,7 +75,7 @@ void SmackerScene::nextVideo() {
 		_vm->_res->queryResource(smackerFileHash, resourceHandle);
 		if (resourceHandle.type() != kResTypeVideo) {
 			// Not a Smacker file
-			_vm->_screen->setSmackerDecoder(NULL);
+			_vm->_screen->setSmackerDecoder(nullptr);
 			sendMessage(_parentModule, 0x1009, 0);
 			return;
 		}
@@ -88,7 +88,7 @@ void SmackerScene::nextVideo() {
 			_smackerPlayer->open(smackerFileHash, false);
 		_vm->_screen->setSmackerDecoder(_smackerPlayer->getSmackerDecoder());
 	} else {
-		_vm->_screen->setSmackerDecoder(NULL);
+		_vm->_screen->setSmackerDecoder(nullptr);
 		sendMessage(_parentModule, 0x1009, 0);
 	}
 
diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp
index eb55fde45c..781b43d95b 100644
--- a/engines/neverhood/sound.cpp
+++ b/engines/neverhood/sound.cpp
@@ -146,7 +146,7 @@ AudioResourceManMusicItem *MusicResource::getMusicItem() {
 }
 
 MusicItem::MusicItem(NeverhoodEngine *vm, uint32 groupNameHash, uint32 musicFileHash)
-	: _vm(vm), _musicResource(NULL) {
+	: _vm(vm), _musicResource(nullptr) {
 
 	_groupNameHash = groupNameHash;
 	_fileHash = musicFileHash;
@@ -196,7 +196,7 @@ void MusicItem::update() {
 SoundItem::SoundItem(NeverhoodEngine *vm, uint32 groupNameHash, uint32 soundFileHash,
 	bool playOnceAfterRandomCountdown, int16 minCountdown, int16 maxCountdown,
 	bool playOnceAfterCountdown, int16 initialCountdown, bool playLooping, int16 currCountdown)
-	: _vm(vm), _soundResource(NULL), _groupNameHash(groupNameHash), _fileHash(soundFileHash),
+	: _vm(vm), _soundResource(nullptr), _groupNameHash(groupNameHash), _fileHash(soundFileHash),
 	_playOnceAfterRandomCountdown(false), _minCountdown(0), _maxCountdown(0),
 	_playOnceAfterCountdown(playOnceAfterCountdown), _initialCountdown(initialCountdown),
 	_playLooping(false), _currCountdown(currCountdown) {
@@ -500,14 +500,14 @@ MusicItem *SoundMan::getMusicItemByHash(uint32 musicFileHash) {
 	for (uint i = 0; i < _musicItems.size(); ++i)
 		if (_musicItems[i] && _musicItems[i]->getFileHash() == musicFileHash)
 			return _musicItems[i];
-	return NULL;
+	return nullptr;
 }
 
 SoundItem *SoundMan::getSoundItemByHash(uint32 soundFileHash) {
 	for (uint i = 0; i < _soundItems.size(); ++i)
 		if (_soundItems[i] && _soundItems[i]->getFileHash() == soundFileHash)
 			return _soundItems[i];
-	return NULL;
+	return nullptr;
 }
 
 int16 SoundMan::addMusicItem(MusicItem *musicItem) {
@@ -540,7 +540,7 @@ void SoundMan::deleteSoundByIndex(int index) {
 // NeverhoodAudioStream
 
 NeverhoodAudioStream::NeverhoodAudioStream(int rate, byte shiftValue, bool isLooping, DisposeAfterUse::Flag disposeStream, Common::SeekableReadStream *stream)
-	: _rate(rate), _shiftValue(shiftValue), _isLooping(isLooping), _isStereo(false), _stream(stream, disposeStream), _endOfData(false), _buffer(0),
+	: _rate(rate), _shiftValue(shiftValue), _isLooping(isLooping), _isStereo(false), _stream(stream, disposeStream), _endOfData(false), _buffer(nullptr),
 	_isCompressed(_shiftValue != 0xFF), _prevValue(0) {
 	// Setup our buffer for readBuffer
 	_buffer = new byte[kSampleBufferLength * (_isCompressed ? 1 : 2)];
@@ -591,7 +591,7 @@ int NeverhoodAudioStream::readBuffer(int16 *buffer, const int numSamples) {
 }
 
 AudioResourceManSoundItem::AudioResourceManSoundItem(NeverhoodEngine *vm, uint32 fileHash)
-	: _vm(vm), _fileHash(fileHash), _data(NULL), _isLoaded(false), _isPlaying(false),
+	: _vm(vm), _fileHash(fileHash), _data(nullptr), _isLoaded(false), _isPlaying(false),
 	_volume(100), _panning(50) {
 
 	_vm->_res->queryResource(_fileHash, _resourceHandle);
@@ -614,7 +614,7 @@ void AudioResourceManSoundItem::unloadSound() {
 	if (_vm->_mixer->isSoundHandleActive(*_soundHandle))
 		_vm->_mixer->stopHandle(*_soundHandle);
 	_vm->_res->unloadResource(_resourceHandle);
-	_data = NULL;
+	_data = nullptr;
 }
 
 void AudioResourceManSoundItem::setVolume(int16 volume) {
diff --git a/engines/neverhood/sprite.cpp b/engines/neverhood/sprite.cpp
index 3611ce1ba2..8170bd68bf 100644
--- a/engines/neverhood/sprite.cpp
+++ b/engines/neverhood/sprite.cpp
@@ -28,8 +28,8 @@ namespace Neverhood {
 // Sprite
 
 Sprite::Sprite(NeverhoodEngine *vm, int objectPriority)
-	: Entity(vm, objectPriority), _x(0), _y(0), _spriteUpdateCb(NULL), _filterXCb(NULL), _filterYCb(NULL),
-	_dataResource(vm), _doDeltaX(false), _doDeltaY(false), _needRefresh(false), _flags(0), _surface(NULL) {
+	: Entity(vm, objectPriority), _x(0), _y(0), _spriteUpdateCb(nullptr), _filterXCb(nullptr), _filterYCb(nullptr),
+	_dataResource(vm), _doDeltaX(false), _doDeltaY(false), _needRefresh(false), _flags(0), _surface(nullptr) {
 
 	_drawOffset.x = 0;
 	_drawOffset.y = 0;
@@ -213,9 +213,9 @@ void AnimatedSprite::init() {
 	_plFirstFrameIndex = 0;
 	_currFrameIndex = 0;
 	_currStickFrameIndex = -1;
-	_finalizeStateCb = NULL;
-	_currStateCb = NULL;
-	_nextStateCb = NULL;
+	_finalizeStateCb = nullptr;
+	_currStateCb = nullptr;
+	_nextStateCb = nullptr;
 	_newStickFrameIndex = -1;
 	_newStickFrameHash = 0;
 	_frameChanged = false;
@@ -477,10 +477,10 @@ void AnimatedSprite::setFinalizeState(AnimationCb finalizeStateCb) {
 void AnimatedSprite::gotoState(AnimationCb currStateCb) {
 	if (_finalizeStateCb) {
 		AnimationCb cb = _finalizeStateCb;
-		_finalizeStateCb = NULL;
+		_finalizeStateCb = nullptr;
 		(this->*cb)();
 	}
-	_nextStateCb = NULL;
+	_nextStateCb = nullptr;
 	_currStateCb = currStateCb;
 	if (_currStateCb)
 		(this->*_currStateCb)();
@@ -489,15 +489,15 @@ void AnimatedSprite::gotoState(AnimationCb currStateCb) {
 void AnimatedSprite::gotoNextState() {
 	if (_finalizeStateCb) {
 		AnimationCb cb = _finalizeStateCb;
-		_finalizeStateCb = NULL;
+		_finalizeStateCb = nullptr;
 		(this->*cb)();
 	}
 	if (_nextStateCb) {
 		_currStateCb = _nextStateCb;
-		_nextStateCb = NULL;
+		_nextStateCb = nullptr;
 		(this->*_currStateCb)();
 	} else {
-		_currStateCb = NULL;
+		_currStateCb = nullptr;
 	}
 }
 


Commit: 1b73b90224464595c27e716602ad4153ffa569ed
    https://github.com/scummvm/scummvm/commit/1b73b90224464595c27e716602ad4153ffa569ed
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
NGI: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/ngi/anihandler.cpp
    engines/ngi/behavior.cpp
    engines/ngi/detection.cpp
    engines/ngi/floaters.cpp
    engines/ngi/fullpipe/scene04.cpp
    engines/ngi/fullpipe/scene05.cpp
    engines/ngi/fullpipe/scene06.cpp
    engines/ngi/fullpipe/scene07.cpp
    engines/ngi/fullpipe/scene08.cpp
    engines/ngi/fullpipe/scene09.cpp
    engines/ngi/fullpipe/scene11.cpp
    engines/ngi/fullpipe/scene13.cpp
    engines/ngi/fullpipe/scene14.cpp
    engines/ngi/fullpipe/scene16.cpp
    engines/ngi/fullpipe/scene17.cpp
    engines/ngi/fullpipe/scene18and19.cpp
    engines/ngi/fullpipe/scene22.cpp
    engines/ngi/fullpipe/scene23.cpp
    engines/ngi/fullpipe/scene25.cpp
    engines/ngi/fullpipe/scene26.cpp
    engines/ngi/fullpipe/scene27.cpp
    engines/ngi/fullpipe/scene28.cpp
    engines/ngi/fullpipe/scene29.cpp
    engines/ngi/fullpipe/scene32.cpp
    engines/ngi/fullpipe/scene33.cpp
    engines/ngi/fullpipe/scene34.cpp
    engines/ngi/fullpipe/scene37.cpp
    engines/ngi/fullpipe/scene38.cpp
    engines/ngi/fullpipe/sceneDbg.cpp
    engines/ngi/fullpipe/sceneFinal.cpp
    engines/ngi/gameloader.cpp
    engines/ngi/gfx.cpp
    engines/ngi/input.cpp
    engines/ngi/interaction.cpp
    engines/ngi/inventory.cpp
    engines/ngi/lift.cpp
    engines/ngi/messagehandlers.cpp
    engines/ngi/messages.cpp
    engines/ngi/modal.cpp
    engines/ngi/motion.cpp
    engines/ngi/ngi.cpp
    engines/ngi/ngiarchive.cpp
    engines/ngi/scene.cpp
    engines/ngi/scenes.cpp
    engines/ngi/sound.cpp
    engines/ngi/stateloader.cpp
    engines/ngi/statesaver.cpp
    engines/ngi/statics.cpp
    engines/ngi/utils.cpp


diff --git a/engines/ngi/anihandler.cpp b/engines/ngi/anihandler.cpp
index c11bacb9a7..2d1f3f596c 100644
--- a/engines/ngi/anihandler.cpp
+++ b/engines/ngi/anihandler.cpp
@@ -39,7 +39,7 @@ MessageQueue *AniHandler::makeQueue(StaticANIObject *ani, int staticsIndex, int,
 	int idx = getIndex(ani->_id);
 
 	if (idx == -1)
-		return 0;
+		return nullptr;
 
 #if 0
 	int stid = staticsId;
@@ -52,7 +52,7 @@ MessageQueue *AniHandler::makeQueue(StaticANIObject *ani, int staticsIndex, int,
 			stid = ani->_movement->_staticsObj2->_staticsId;
 		} else {
 			if (!ani->_statics)
-				return 0;
+				return nullptr;
 
 			stid = ani->_statics->_staticsId;
 		}
@@ -73,7 +73,7 @@ MessageQueue *AniHandler::makeQueue(StaticANIObject *ani, int staticsIndex, int,
 	}
 
 	if (!_items[idx].subItems[subidx].movement)
-		return 0;
+		return nullptr;
 
 	MessageQueue *mq = new MessageQueue(g_nmi->_globalMessageQueueList->compact());
 	Common::Point point;
@@ -135,7 +135,7 @@ MGMItem::MGMItem() {
 }
 
 MGMSubItem::MGMSubItem() {
-	movement = 0;
+	movement = nullptr;
 	staticsIndex = 0;
 	field_8 = 0;
 	field_C = 0;
@@ -199,12 +199,12 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
 	debugC(4, kDebugPathfinding, "AniHandler::makeRunQueue(*%d)", mkQueue->ani ? mkQueue->ani->_id : -1);
 
 	if (!mkQueue->ani)
-		return 0;
+		return nullptr;
 
 	Movement *mov = mkQueue->ani->_movement;
 
 	if (!mov && !mkQueue->ani->_statics)
-		return 0;
+		return nullptr;
 
 	if (!(mkQueue->flags & 1)) {
 		if (mov)
@@ -236,7 +236,7 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
 	mov = mkQueue->ani->getMovementById(mkQueue->movementId);
 
 	if (!mov)
-		return 0;
+		return nullptr;
 
 
 	int itemIdx = getIndex(mkQueue->ani->_id);
@@ -256,10 +256,10 @@ MessageQueue *AniHandler::makeRunQueue(MakeQueueStruct *mkQueue) {
 	const MGMSubItem &sub2 = _items[itemIdx].subItems[st1idx + subOffset * _items[itemIdx].statics.size()];
 
 	if (subIdx != st2idx && !sub1.movement)
-		return 0;
+		return nullptr;
 
 	if (st1idx != subOffset && !sub2.movement)
-		return 0;
+		return nullptr;
 
 	int n1x = mkQueue->x1 - mkQueue->x2 - sub1.x - sub2.x;
 	int n1y = mkQueue->y1 - mkQueue->y2 - sub1.y - sub2.y;
@@ -430,14 +430,14 @@ void AniHandler::putObjectToStatics(StaticANIObject *ani, int staticsId) {
 		return;
 
 	if (ani->_movement) {
-		ani->queueMessageQueue(0);
+		ani->queueMessageQueue(nullptr);
 		ani->_movement->gotoLastFrame();
 		ani->_statics = ani->_movement->_staticsObj2;
 
 		int x = ani->_movement->_ox;
 		int y = ani->_movement->_oy;
 
-		ani->_movement = 0;
+		ani->_movement = nullptr;
 
 		ani->setOXY(x, y);
 	}
diff --git a/engines/ngi/behavior.cpp b/engines/ngi/behavior.cpp
index c341b5842e..f9c59e697e 100644
--- a/engines/ngi/behavior.cpp
+++ b/engines/ngi/behavior.cpp
@@ -30,7 +30,7 @@
 namespace NGI {
 
 BehaviorManager::BehaviorManager() {
-	_scene = 0;
+	_scene = nullptr;
 	_isActive = 1;
 }
 
@@ -144,7 +144,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo &behaviorInfo, BehaviorAnim &e
 void BehaviorManager::updateStaticAniBehavior(StaticANIObject &ani, int delay, const BehaviorAnim &beh) {
 	debugC(6, kDebugBehavior, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic(ani._objectName));
 
-	MessageQueue *mq = 0;
+	MessageQueue *mq = nullptr;
 
 	if (beh._flags & 1) {
 		uint rnd = g_nmi->_rnd.getRandomNumber(32767);
@@ -220,7 +220,7 @@ BehaviorMove *BehaviorManager::getBehaviorMoveByMessageQueueDataId(StaticANIObje
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void BehaviorInfo::clear() {
@@ -328,7 +328,7 @@ BehaviorAnim::BehaviorAnim(GameVar *var, Scene *sc, StaticANIObject *ani, int *m
 }
 
 BehaviorMove::BehaviorMove(GameVar *subvar, Scene *sc, int *delay) {
-	_messageQueue = 0;
+	_messageQueue = nullptr;
 	_delay = 0;
 	_percent = 0;
 	_flags = 0;
diff --git a/engines/ngi/detection.cpp b/engines/ngi/detection.cpp
index 18fb0957d6..14abe0c20e 100644
--- a/engines/ngi/detection.cpp
+++ b/engines/ngi/detection.cpp
@@ -47,7 +47,7 @@ static const PlainGameDescriptor ngiGames[] = {
 	{"ngi", 		"Nikita Game Interface game"},
 	{"fullpipe",	"Full Pipe"},
 	{"mdream",		"Magic Dream"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 namespace NGI {
@@ -58,7 +58,7 @@ static const NGIGameDescription gameDescriptions[] = {
 	{
 		{
 			"mdream",
-			0,
+			nullptr,
 			AD_ENTRY1s("0001.nl", "079d02921a938ec9740598316450d526", 11848423),
 			Common::RU_RUS,
 			Common::kPlatformWindows,
@@ -72,7 +72,7 @@ static const NGIGameDescription gameDescriptions[] = {
 	{
 		{
 			"fullpipe",
-			0,
+			nullptr,
 			AD_ENTRY1s("4620.sc2", "a1a8f3ed731b0dfea43beaa3016fdc71", 554),
 			Common::RU_RUS,
 			Common::kPlatformWindows,
@@ -86,7 +86,7 @@ static const NGIGameDescription gameDescriptions[] = {
 	{
 		{
 			"fullpipe",
-			0,
+			nullptr,
 			AD_ENTRY1s("4620.sc2", "e4f24ffe4dc84cafc648b951e66c1fb3", 554),
 			Common::DE_DEU,
 			Common::kPlatformWindows,
@@ -100,7 +100,7 @@ static const NGIGameDescription gameDescriptions[] = {
 	{
 		{
 			"fullpipe",
-			0,
+			nullptr,
 			AD_ENTRY1s("4620.sc2", "571f6b4b68b02003e35bc12c1a1d3fe3", 466),
 			Common::ET_EST,
 			Common::kPlatformWindows,
@@ -114,7 +114,7 @@ static const NGIGameDescription gameDescriptions[] = {
 	{
 		{
 			"fullpipe",
-			0,
+			nullptr,
 			AD_ENTRY1s("4620.sc2", "bffea807345fece14089768fc141af83", 510),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
@@ -162,7 +162,7 @@ static const NGIGameDescription gameDescriptions[] = {
 			Common::RU_RUS,
 			Common::kPlatformWindows,
 			ADGF_DROPPLATFORM | ADGF_DEMO,
-			0
+			nullptr
 		},
 		GID_FULLPIPE
 	},
diff --git a/engines/ngi/floaters.cpp b/engines/ngi/floaters.cpp
index b32e008642..1095c03add 100644
--- a/engines/ngi/floaters.cpp
+++ b/engines/ngi/floaters.cpp
@@ -82,7 +82,7 @@ void Floaters::genFlies(Scene *sc, int x, int y, int priority, int flags) {
 	StaticANIObject *ani = new StaticANIObject(g_nmi->accessScene(SC_COMMON)->getStaticANIObject1ById(ANI_FLY, -1));
 
 	ani->_statics = ani->getStaticsById(ST_FLY_FLY);
-	ani->_movement = 0;
+	ani->_movement = nullptr;
 	ani->setOXY(x, y);
 	ani->_flags |= 4;
 	ani->_priority = priority;
diff --git a/engines/ngi/fullpipe/scene04.cpp b/engines/ngi/fullpipe/scene04.cpp
index 90e0d2e253..dcbe66a4d4 100644
--- a/engines/ngi/fullpipe/scene04.cpp
+++ b/engines/ngi/fullpipe/scene04.cpp
@@ -85,7 +85,7 @@ void scene04_initScene(Scene *sc) {
 	g_vars->scene04_spring = sc->getStaticANIObject1ById(ANI_SPRING, -1);
 	g_vars->scene04_mamasha = sc->getStaticANIObject1ById(ANI_MAMASHA_4, -1);
 	g_vars->scene04_boot = sc->getStaticANIObject1ById(ANI_SC4_BOOT, -1);
-	g_vars->scene04_ladder = 0;
+	g_vars->scene04_ladder = nullptr;
 
 	StaticANIObject *koz = sc->getStaticANIObject1ById(ANI_KOZAWKA, -1);
 
@@ -187,7 +187,7 @@ void scene04_initScene(Scene *sc) {
 	g_vars->scene04_bottleIsTaken = false;
 	g_vars->scene04_soundPlaying = false;
 	g_vars->scene04_kozyawkaOnLadder = false;
-	g_vars->scene04_walkingKozyawka = 0;
+	g_vars->scene04_walkingKozyawka = nullptr;
 	g_vars->scene04_bottleWeight = 2;
 	g_vars->scene04_dynamicPhaseIndex = 0;
 
@@ -228,7 +228,7 @@ bool sceneHandler04_friesAreWalking() {
 			Movement *koz;
 
 			if (!g_vars->scene04_walkingKozyawka
-				 || (koz = g_vars->scene04_walkingKozyawka->_movement) == 0
+				 || (koz = g_vars->scene04_walkingKozyawka->_movement) == nullptr
 				 || koz->_id != MV_KZW_WALKPLANK
 				 || koz->_currDynamicPhaseIndex < 10
 				 || koz->_currDynamicPhaseIndex > 41)
@@ -334,7 +334,7 @@ void sceneHandler04_walkClimbLadder(ExCommand *ex) {
 
 	mq->setFlags(mq->getFlags() | 1);
 
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_vars->scene04_dudeOnLadder = 1;
 
@@ -404,7 +404,7 @@ void sceneHandler04_clickLadder() {
 					postExCommand(g_nmi->_aniMan->_id, 2, 1095, 434, 0, -1);
 				}
 			} else {
-				sceneHandler04_walkClimbLadder(0);
+				sceneHandler04_walkClimbLadder(nullptr);
 			}
 		}
 	}
@@ -473,7 +473,7 @@ void sceneHandler04_dropBottle() {
 				break;
 			}
 
-		koz->queueMessageQueue(0);
+		koz->queueMessageQueue(nullptr);
 		koz->hide();
 
 		g_vars->scene04_kozyawkiObjList.push_back(koz);
@@ -557,7 +557,7 @@ void sceneHandler04_manFromBottle() {
 	if (g_vars->scene04_ladder)
 		delete g_vars->scene04_ladder;
 
-	g_vars->scene04_ladder = 0;
+	g_vars->scene04_ladder = nullptr;
 
 	getSc2MctlCompoundBySceneId(g_nmi->_currentScene->_sceneId)->activate();
 	getGameLoaderInteractionController()->enableFlag24();
@@ -663,7 +663,7 @@ MessageQueue *sceneHandler04_kozFly5(StaticANIObject *ani, double phase) {
 		mq1->addExCommandToEnd(mq2->getExCommandByIndex(0)->createClone());
 
 		delete mq2;
-		mq2 = 0;
+		mq2 = nullptr;
 
 		ExCommand *ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_STANDUP, 0, 0, 0, 1, 0, 0, 0);
 		ex->_excFlags |= 2;
@@ -871,8 +871,8 @@ void sceneHandler04_shootKozyawka() {
 						phase = kozTrajectory6[idx];
 				}
 
-				g_vars->scene04_walkingKozyawka->queueMessageQueue(0);
-				g_vars->scene04_walkingKozyawka->_movement = 0;
+				g_vars->scene04_walkingKozyawka->queueMessageQueue(nullptr);
+				g_vars->scene04_walkingKozyawka->_movement = nullptr;
 				g_vars->scene04_walkingKozyawka->_statics = g_vars->scene04_walkingKozyawka->getStaticsById(ST_KZW_RIGHT);
 
 				MessageQueue *mq;
@@ -934,7 +934,7 @@ void sceneHandler04_animOutOfBottle(ExCommand *ex) {
 	  }
 
 	mq->_flags |= 1;
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_vars->scene04_dudeInBottle = false;
 	g_nmi->_behaviorManager->setFlagByStaticAniObject(g_nmi->_aniMan, 1);
@@ -951,7 +951,7 @@ void sceneHandler04_walkKozyawka() {
 
 		MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_KOZAW_WALK), 0, 1);
 		mq->setParamInt(-1, g_vars->scene04_walkingKozyawka->_odelay);
-		mq->chain(0);
+		mq->chain(nullptr);
 	}
 }
 
@@ -1020,10 +1020,10 @@ void sceneHandler04_springWobble() {
 }
 
 void sceneHandler04_leaveScene() {
-	g_nmi->_aniMan2 = 0;
+	g_nmi->_aniMan2 = nullptr;
 
 	MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC4_MANTOBOTTLE), 0, 0);
-	ExCommand *ex = 0;
+	ExCommand *ex = nullptr;
 
 	for (uint i = 0; i < mq->getCount(); i++) {
 		if (mq->getExCommandByIndex(i)->_messageKind == 27) {
@@ -1038,7 +1038,7 @@ void sceneHandler04_leaveScene() {
 
 	ex->_y = g_vars->scene04_bottle->_oy - 304;
 
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_vars->scene04_var07 = false;
 	g_vars->scene04_dudeOnLadder = 0;
@@ -1187,7 +1187,7 @@ void sceneHandler04_leaveLadder(ExCommand *ex) {
 						if (g_vars->scene04_ladder)
 							delete g_vars->scene04_ladder;
 
-						g_vars->scene04_ladder = 0;
+						g_vars->scene04_ladder = nullptr;
 						g_vars->scene04_dudeOnLadder = 0;
 
 						ex->_messageKind = 0;
@@ -1232,8 +1232,8 @@ void sceneHandler04_putKozyawkaBack(StaticANIObject *ani) {
 	g_vars->scene04_kozyawkiAni.push_back(ani);
 
 	g_vars->scene04_bottleWeight += 2;
-	g_vars->scene04_walkingKozyawka = 0;
-	g_vars->scene04_lastKozyawka = 0;
+	g_vars->scene04_walkingKozyawka = nullptr;
+	g_vars->scene04_lastKozyawka = nullptr;
 
 	if (g_vars->scene04_kozyawkiAni.size() > 1 )
 		g_vars->scene04_objectIsTaken = false;
@@ -1284,7 +1284,7 @@ void sceneHandler04_takeKozyawka() {
 		g_vars->scene04_kozyawkiAni.pop_front();
 
 		if (koz) {
-			koz->queueMessageQueue(0);
+			koz->queueMessageQueue(nullptr);
 			koz->hide();
 
 			g_vars->scene04_kozyawkiObjList.push_back(koz);
@@ -1341,7 +1341,7 @@ void sceneHandler04_winArcade() {
 
 			g_vars->scene04_walkingKozyawka->changeStatics2(ST_KZW_EMPTY);
 			g_vars->scene04_walkingKozyawka->hide();
-			g_vars->scene04_walkingKozyawka = 0;
+			g_vars->scene04_walkingKozyawka = nullptr;
 		}
 
 		g_vars->scene04_objectIsTaken = false;
@@ -1382,7 +1382,7 @@ int sceneHandler04(ExCommand *ex) {
 		g_vars->scene04_coinPut = false;
 
 		if (g_vars->scene04_dudeInBottle)
-			sceneHandler04_animOutOfBottle(0);
+			sceneHandler04_animOutOfBottle(nullptr);
 
 		sceneHandler04_handTake();
 		sceneHandler04_stopSound();
@@ -1410,7 +1410,7 @@ int sceneHandler04(ExCommand *ex) {
 		if (g_vars->scene04_walkingKozyawka) {
 			g_vars->scene04_kozyawkiObjList.push_back(g_vars->scene04_walkingKozyawka);
 			g_vars->scene04_walkingKozyawka->hide();
-			g_vars->scene04_walkingKozyawka = 0;
+			g_vars->scene04_walkingKozyawka = nullptr;
 		}
 
 		if (g_vars->scene04_soundPlaying)
@@ -1451,7 +1451,7 @@ int sceneHandler04(ExCommand *ex) {
 				if (g_vars->scene04_soundPlaying) {
 					if (g_nmi->_aniMan->_movement) {
 						if (g_nmi->_aniMan->_movement->_id == MV_MAN_TOLADDER) {
-							g_nmi->_aniMan2 = 0;
+							g_nmi->_aniMan2 = nullptr;
 
 							if (g_nmi->_sceneRect.left > 380)
 								g_nmi->_currentScene->_x = 380 - g_nmi->_sceneRect.left;
@@ -1475,7 +1475,7 @@ int sceneHandler04(ExCommand *ex) {
 				sceneHandler04_clickLadder();
 
 			if (g_vars->scene04_dudeInBottle && g_vars->scene04_hand->_movement)
-				sceneHandler04_animOutOfBottle(0);
+				sceneHandler04_animOutOfBottle(nullptr);
 
 			if (g_vars->scene04_coinPut && g_vars->scene04_clockCanGo && !g_vars->scene04_handIsDown && !g_vars->scene04_soundPlaying)
 				sceneHandler04_goClock();
@@ -1530,7 +1530,7 @@ int sceneHandler04(ExCommand *ex) {
 					break;
 				}
 
-				sceneHandler04_gotoLadder(0);
+				sceneHandler04_gotoLadder(nullptr);
 
 				break;
 			}
@@ -1581,7 +1581,7 @@ int sceneHandler04(ExCommand *ex) {
 			g_vars->scene04_handIsDown = true;
 
 			if (g_vars->scene04_dudeInBottle)
-				sceneHandler04_animOutOfBottle(0);
+				sceneHandler04_animOutOfBottle(nullptr);
 
 			sceneHandler04_handTake();
 		}
@@ -1628,7 +1628,7 @@ int sceneHandler04(ExCommand *ex) {
 		break;
 
 	case MSG_GOTOLADDER:
-		sceneHandler04_gotoLadder(0);
+		sceneHandler04_gotoLadder(nullptr);
 		break;
 
 	case MSG_SC4_COINPUT:
diff --git a/engines/ngi/fullpipe/scene05.cpp b/engines/ngi/fullpipe/scene05.cpp
index 2334dc2cd2..0ea736851f 100644
--- a/engines/ngi/fullpipe/scene05.cpp
+++ b/engines/ngi/fullpipe/scene05.cpp
@@ -101,7 +101,7 @@ void sceneHandler05_makeManFlight() {
 
 	mq->setFlags(mq->getFlags() | 1);
 
-	mq->chain(0);
+	mq->chain(nullptr);
 }
 
 void sceneHandler05_makeWackoFeedback() {
diff --git a/engines/ngi/fullpipe/scene06.cpp b/engines/ngi/fullpipe/scene06.cpp
index d7867765b2..80aaeca87c 100644
--- a/engines/ngi/fullpipe/scene06.cpp
+++ b/engines/ngi/fullpipe/scene06.cpp
@@ -82,7 +82,7 @@ void sceneHandler06_winArcade() {
 		g_nmi->setObjectState(sO_ClockAxis, g_nmi->getObjectEnumState(sO_ClockAxis, sO_WithoutHandle));
 
 	if (g_vars->scene06_arcadeEnabled) {
-		g_nmi->_aniMan->_callback2 = 0; // Really NULL
+		g_nmi->_aniMan->_callback2 = nullptr; // Really NULL
 
 		g_nmi->_aniMan->changeStatics2(ST_MAN_RIGHT | 0x4000);
 
@@ -91,7 +91,7 @@ void sceneHandler06_winArcade() {
 
 			g_vars->scene06_balls.push_back(g_vars->scene06_someBall);
 
-			g_vars->scene06_someBall = 0;
+			g_vars->scene06_someBall = nullptr;
 		}
 
 		if (g_vars->scene06_flyingBall) {
@@ -99,7 +99,7 @@ void sceneHandler06_winArcade() {
 
 			g_vars->scene06_balls.push_back(g_vars->scene06_flyingBall);
 
-			g_vars->scene06_flyingBall = 0;
+			g_vars->scene06_flyingBall = nullptr;
 		}
 
 		if (g_vars->scene06_ballInHands) {
@@ -107,7 +107,7 @@ void sceneHandler06_winArcade() {
 
 			g_vars->scene06_balls.push_back(g_vars->scene06_ballInHands);
 
-			g_vars->scene06_ballInHands = 0;
+			g_vars->scene06_ballInHands = nullptr;
 		}
 
 		g_vars->scene06_arcadeEnabled = false;
@@ -225,12 +225,12 @@ void sceneHandler06_mumsyBallTake() {
 	}
 
 	mq->setFlags(mq->getFlags() | 1);
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_vars->scene06_mumsyNumBalls = 0;
 	g_vars->scene06_arcadeEnabled = false;
 
-	g_nmi->_aniMan2 = 0;
+	g_nmi->_aniMan2 = nullptr;
 }
 
 void sceneHandler06_spinHandle() {
@@ -268,7 +268,7 @@ void sceneHandler06_showNextBall() {
 		MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC6_SHOWNEXTBALL), 0, 1);
 
 		mq->setParamInt(-1, g_vars->scene06_currentBall->_odelay);
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		++g_vars->scene06_numBallsGiven;
 	}
@@ -284,7 +284,7 @@ int sceneHandler06_updateScreenCallback() {
 	res = g_nmi->drawArcadeOverlay(g_vars->scene06_arcadeEnabled);
 
 	if (!res)
-		g_nmi->_updateScreenCallback = 0;
+		g_nmi->_updateScreenCallback = nullptr;
 
 	return res;
 }
@@ -296,7 +296,7 @@ void sceneHandler06_startAiming() {
 		g_nmi->_aniMan->startAnim(MV_MAN6_TAKEBALL, 0, -1);
 
 		g_vars->scene06_ballInHands = g_vars->scene06_currentBall;
-		g_vars->scene06_currentBall = 0;
+		g_vars->scene06_currentBall = nullptr;
 
 		if (getCurrSceneSc2MotionController()->_isEnabled)
 			g_nmi->_updateScreenCallback = sceneHandler06_updateScreenCallback;
@@ -304,7 +304,7 @@ void sceneHandler06_startAiming() {
 		getCurrSceneSc2MotionController()->deactivate();
 		getGameLoaderInteractionController()->disableFlag24();
 
-		g_vars->scene06_ballDrop->queueMessageQueue(0);
+		g_vars->scene06_ballDrop->queueMessageQueue(nullptr);
 	}
 }
 
@@ -351,7 +351,7 @@ void sceneHandler06_aiming() {
 void sceneHandler06_ballStartFly() {
 	if (g_vars->scene06_ballInHands) {
 		g_vars->scene06_flyingBall = g_vars->scene06_ballInHands;
-		g_vars->scene06_ballInHands = 0;
+		g_vars->scene06_ballInHands = nullptr;
 		g_vars->scene06_flyingBall->show1(g_nmi->_aniMan->_ox - 60, g_nmi->_aniMan->_oy - 60, -1, 0);
 
 		g_vars->scene06_flyingBall->_priority = 27;
@@ -414,11 +414,11 @@ void sceneHandler06_fallBall() {
 	MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC6_FALLBALL), 0, 1);
 
 	mq->setParamInt(-1, g_vars->scene06_flyingBall->_odelay);
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_vars->scene06_balls.push_back(g_vars->scene06_flyingBall);
 
-	g_vars->scene06_flyingBall = 0;
+	g_vars->scene06_flyingBall = nullptr;
 
 	sceneHandler06_dropBall();
 	sceneHandler06_eggieWalk();
@@ -430,7 +430,7 @@ void sceneHandler06_catchBall() {
 
 		g_vars->scene06_balls.push_back(g_vars->scene06_flyingBall);
 
-		g_vars->scene06_flyingBall = 0;
+		g_vars->scene06_flyingBall = nullptr;
 
 		g_vars->scene06_mumsyNumBalls++;
 
@@ -489,15 +489,15 @@ void sceneHandler06_checkBallTarget(int par) {
 
 void scene06_initScene(Scene *sc) {
 	g_vars->scene06_mumsy = sc->getStaticANIObject1ById(ANI_MAMASHA, -1);
-	g_vars->scene06_someBall = 0;
+	g_vars->scene06_someBall = nullptr;
 	g_vars->scene06_invHandle = sc->getStaticANIObject1ById(ANI_INV_HANDLE, -1);
 	g_vars->scene06_liftButton = sc->getStaticANIObject1ById(ANI_BUTTON_6, -1);
 	g_vars->scene06_ballDrop = sc->getStaticANIObject1ById(ANI_BALLDROP, -1);
 	g_vars->scene06_arcadeEnabled = false;
 	g_vars->scene06_aimingBall = false;
-	g_vars->scene06_currentBall = 0;
-	g_vars->scene06_ballInHands = 0;
-	g_vars->scene06_flyingBall = 0;
+	g_vars->scene06_currentBall = nullptr;
+	g_vars->scene06_ballInHands = nullptr;
+	g_vars->scene06_flyingBall = nullptr;
 	g_vars->scene06_balls.clear();
 	g_vars->scene06_numBallsGiven = 0;
 	g_vars->scene06_mumsyNumBalls = 0;
diff --git a/engines/ngi/fullpipe/scene07.cpp b/engines/ngi/fullpipe/scene07.cpp
index 10a8675af6..7c7c1c4066 100644
--- a/engines/ngi/fullpipe/scene07.cpp
+++ b/engines/ngi/fullpipe/scene07.cpp
@@ -35,7 +35,7 @@
 namespace NGI {
 
 void scene07_initScene(Scene *sc) {
-	g_vars->scene07_lukeAnim = 0;
+	g_vars->scene07_lukeAnim = nullptr;
 	g_vars->scene07_lukePercent = 0;
 	g_vars->scene07_plusMinus = sc->getStaticANIObject1ById(ANI_PLUSMINUS, -1);
 
diff --git a/engines/ngi/fullpipe/scene08.cpp b/engines/ngi/fullpipe/scene08.cpp
index d018be2cdd..6adf062e10 100644
--- a/engines/ngi/fullpipe/scene08.cpp
+++ b/engines/ngi/fullpipe/scene08.cpp
@@ -215,7 +215,7 @@ int sceneHandler08_updateScreenCallback() {
 	res = g_nmi->drawArcadeOverlay(g_vars->scene08_inArcade);
 
 	if (!res)
-		g_nmi->_updateScreenCallback = 0;
+		g_nmi->_updateScreenCallback = nullptr;
 
 	return res;
 }
@@ -325,7 +325,7 @@ void sceneHandler08_badLuck() {
 	mq->addExCommandToEnd(ex);
 
 	mq->setFlags(mq->getFlags() | 1);
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_nmi->setObjectState(sO_StairsUp_8, g_nmi->getObjectEnumState(sO_StairsUp_8, sO_NotBroken));
 
diff --git a/engines/ngi/fullpipe/scene09.cpp b/engines/ngi/fullpipe/scene09.cpp
index 358d97e3f5..06f7c5e1a8 100644
--- a/engines/ngi/fullpipe/scene09.cpp
+++ b/engines/ngi/fullpipe/scene09.cpp
@@ -57,7 +57,7 @@ void scene09_setupGrit(Scene *sc) {
 }
 
 void scene09_initScene(Scene *sc) {
-	g_vars->scene09_flyingBall = 0;
+	g_vars->scene09_flyingBall = nullptr;
 	g_vars->scene09_numSwallenBalls = 0;
 	g_vars->scene09_gulper = sc->getStaticANIObject1ById(ANI_GLOTATEL, -1);
 	g_vars->scene09_spitter = sc->getStaticANIObject1ById(ANI_PLEVATEL, -1);
@@ -142,7 +142,7 @@ int sceneHandler09_updateScreenCallback() {
 	int res = g_nmi->drawArcadeOverlay(g_nmi->_objectIdAtCursor == ANI_VISUNCHIK || g_vars->scene09_interactingHanger >= 0);
 
 	if (!res)
-		g_nmi->_updateScreenCallback = 0;
+		g_nmi->_updateScreenCallback = nullptr;
 
 	return res;
 }
@@ -181,7 +181,7 @@ void sceneHandler09_startAuntie() {
 	MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_TTA9_GOL), 0, 1);
 
 	mq->getExCommandByIndex(0)->_x = g_nmi->_sceneRect.right + 30;
-	mq->chain(0);
+	mq->chain(nullptr);
 }
 
 void sceneHandler09_spitterClick() {
@@ -219,7 +219,7 @@ void sceneHandler09_spitterClick() {
 				g_nmi->stopAllSoundInstances(SND_9_006);
 			}
 
-			g_nmi->_aniMan2 = 0;
+			g_nmi->_aniMan2 = nullptr;
 
 			if (g_nmi->_sceneRect.left < 800)
 				g_nmi->_currentScene->_x = 800 - g_nmi->_sceneRect.left;
@@ -236,7 +236,7 @@ void sceneHandler09_eatBall() {
 		g_vars->scene09_flyingBalls.pop_back();
 		//g_vars->scene09_sceneBalls.pop_back();
 
-		g_vars->scene09_flyingBall = 0;
+		g_vars->scene09_flyingBall = nullptr;
 		g_vars->scene09_numSwallenBalls++;
 
 		if (g_vars->scene09_numSwallenBalls >= 3) {
@@ -510,7 +510,7 @@ int sceneHandler09(ExCommand *cmd) {
 	case 30:
 		if (g_vars->scene09_interactingHanger >= 0)  {
 			if (ABS(g_vars->scene09_hangers[g_vars->scene09_interactingHanger]->phase) < 15) {
-				g_vars->scene09_hangers[g_vars->scene09_interactingHanger]->ani->_callback2 = 0; // Really NULL
+				g_vars->scene09_hangers[g_vars->scene09_interactingHanger]->ani->_callback2 = nullptr; // Really NULL
 				g_vars->scene09_hangers[g_vars->scene09_interactingHanger]->ani->changeStatics2(ST_VSN_NORMAL);
 			}
 		}
diff --git a/engines/ngi/fullpipe/scene11.cpp b/engines/ngi/fullpipe/scene11.cpp
index a2a44d551e..a91bd5d258 100644
--- a/engines/ngi/fullpipe/scene11.cpp
+++ b/engines/ngi/fullpipe/scene11.cpp
@@ -152,7 +152,7 @@ void scene11_initScene(Scene *sc) {
 		g_vars->scene11_swingieStands = false;
 
 		if (swingie == g_nmi->getObjectEnumState(sO_Swingie, sO_IsSitting)) {
-			g_vars->scene11_swingie->_movement = 0;
+			g_vars->scene11_swingie->_movement = nullptr;
 			g_vars->scene11_swingie->_statics = g_vars->scene11_swingie->getStaticsById(ST_SWR_SIT);
 			g_vars->scene11_swingie->setOXY(144, 389);
 
@@ -160,7 +160,7 @@ void scene11_initScene(Scene *sc) {
 			getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing2, 0);
 			getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing3, 1);
 		} else {
-			g_vars->scene11_swingie->_movement = 0;
+			g_vars->scene11_swingie->_movement = nullptr;
 			g_vars->scene11_swingie->_statics = g_vars->scene11_swingie->getStaticsById(ST_SWR_SITBALD);
 			g_vars->scene11_swingie->setOXY(144, 415);
 
@@ -185,7 +185,7 @@ void scene11_initScene(Scene *sc) {
 }
 
 void sceneHandler11_restartMan() {
-	chainObjQueue(0, QU_SC11_RESTARTMAN, 1);
+	chainObjQueue(nullptr, QU_SC11_RESTARTMAN, 1);
 
 	getGameLoaderInteractionController()->enableFlag24();
 	getCurrSceneSc2MotionController()->activate();
@@ -223,7 +223,7 @@ int sceneHandler11_updateScreenCallback() {
 	int res = g_nmi->drawArcadeOverlay(g_vars->scene11_arcadeIsOn);
 
 	if (!res)
-		g_nmi->_updateScreenCallback = 0;
+		g_nmi->_updateScreenCallback = nullptr;
 
 	return res;
 }
@@ -244,7 +244,7 @@ void sceneHandler11_manToSwing() {
 	g_vars->scene11_dudeOnSwing->_flags &= 0xFFFB;
 	g_vars->scene11_dudeOnSwing = g_nmi->_currentScene->getStaticANIObject1ById(ANI_MAN11, -1);
 	g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_MAN11_EMPTY);
-	g_vars->scene11_dudeOnSwing->_movement = 0;
+	g_vars->scene11_dudeOnSwing->_movement = nullptr;
 	g_vars->scene11_dudeOnSwing->show1(690, 215, MV_MAN11_SWING_0, 0);
 	g_vars->scene11_dudeOnSwing->_priority = 20;
 	g_vars->scene11_dudeOnSwing->startAnim(MV_MAN11_SWING_0, 0, -1);
@@ -261,9 +261,9 @@ void sceneHandler11_manToSwing() {
 void sceneHandler11_putABoot() {
 	if (g_vars->scene11_boots->_flags & 4) {
 		if (g_vars->scene11_boots->_statics->_staticsId == ST_BTS11_ONE)
-			chainObjQueue(0, QU_SC11_PUTBOOT2, 1);
+			chainObjQueue(nullptr, QU_SC11_PUTBOOT2, 1);
 	} else {
-		chainObjQueue(0, QU_SC11_PUTBOOT1, 1);
+		chainObjQueue(nullptr, QU_SC11_PUTBOOT1, 1);
 	}
 }
 
@@ -288,7 +288,7 @@ void sceneHandler11_putBoot() {
 void sceneHandler11_showSwing() {
 	g_vars->scene11_dudeOnSwing = g_nmi->_currentScene->getStaticANIObject1ById(ANI_KACHELI, -1);
 	g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_KCH_0);
-	g_vars->scene11_dudeOnSwing->_movement = 0;
+	g_vars->scene11_dudeOnSwing->_movement = nullptr;
 	g_vars->scene11_dudeOnSwing->show1(691, 371, MV_KCH_START, 0);
 	g_vars->scene11_dudeOnSwing->_priority = 20;
 }
@@ -337,7 +337,7 @@ void sceneHandler11_swing0() {
 
 	int phase = g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex;
 	g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_MAN11_EMPTY);
-	g_vars->scene11_dudeOnSwing->_movement = 0;
+	g_vars->scene11_dudeOnSwing->_movement = nullptr;
 	g_vars->scene11_dudeOnSwing->show1(690, 215, MV_MAN11_SWING_0, 0);
 	g_vars->scene11_dudeOnSwing->startAnim(MV_MAN11_SWING_0, 0, -1);
 	g_vars->scene11_dudeOnSwing->_movement->setDynamicPhaseIndex(phase);
@@ -352,7 +352,7 @@ void sceneHandler11_swing1() {
 
 	int phase = g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex;
 	g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_MAN11_EMPTY);
-	g_vars->scene11_dudeOnSwing->_movement = 0;
+	g_vars->scene11_dudeOnSwing->_movement = nullptr;
 	g_vars->scene11_dudeOnSwing->show1(690, 215, MV_MAN11_SWING_1, 0);
 	g_vars->scene11_dudeOnSwing->startAnim(MV_MAN11_SWING_1, 0, -1);
 	g_vars->scene11_dudeOnSwing->_movement->setDynamicPhaseIndex(phase);
@@ -367,7 +367,7 @@ void sceneHandler11_swing2() {
 
 	int phase = g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex;
 	g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_MAN11_EMPTY);
-	g_vars->scene11_dudeOnSwing->_movement = 0;
+	g_vars->scene11_dudeOnSwing->_movement = nullptr;
 	g_vars->scene11_dudeOnSwing->show1(690, 215, MV_MAN11_SWING_2, 0);
 	g_vars->scene11_dudeOnSwing->startAnim(MV_MAN11_SWING_2, 0, -1);
 	g_vars->scene11_dudeOnSwing->_movement->setDynamicPhaseIndex(phase);
diff --git a/engines/ngi/fullpipe/scene13.cpp b/engines/ngi/fullpipe/scene13.cpp
index 73bb38084a..8ae9d9f734 100644
--- a/engines/ngi/fullpipe/scene13.cpp
+++ b/engines/ngi/fullpipe/scene13.cpp
@@ -60,7 +60,7 @@ void scene13_initScene(Scene *sc) {
 
 		g_nmi->playSound(SND_13_018, 1);
 
-		g_vars->scene13_whirlgig->_callback2 = 0; // Really NULL
+		g_vars->scene13_whirlgig->_callback2 = nullptr; // Really NULL
 	} else {
 		g_vars->scene13_bridge->changeStatics2(ST_BDG_OPEN2);
 
@@ -170,7 +170,7 @@ void sceneHandler13_stopWhirlgig() {
 }
 
 void sceneHandler13_startWhirlgig() {
-	g_vars->scene13_whirlgig->_callback2 = 0; // Really NULL
+	g_vars->scene13_whirlgig->_callback2 = nullptr; // Really NULL
 
 	g_nmi->playSound(SND_13_018, 1);
 	g_nmi->playSound(SND_13_034, 0);
diff --git a/engines/ngi/fullpipe/scene14.cpp b/engines/ngi/fullpipe/scene14.cpp
index a510547a53..f01d93b1a4 100644
--- a/engines/ngi/fullpipe/scene14.cpp
+++ b/engines/ngi/fullpipe/scene14.cpp
@@ -46,8 +46,8 @@ void scene14_initScene(Scene *sc) {
 	g_vars->scene14_dudeCanKick = false;
 	g_vars->scene14_sceneDiffX = 300;
 	g_vars->scene14_sceneDiffY = 300;
-	g_vars->scene14_pink = 0;
-	g_vars->scene14_flyingBall = 0;
+	g_vars->scene14_pink = nullptr;
+	g_vars->scene14_flyingBall = nullptr;
 	g_vars->scene14_balls.clear();
 
 	if (g_nmi->getObjectState(sO_Grandma) == g_nmi->getObjectEnumState(sO_Grandma, sO_In_14)) {
@@ -108,7 +108,7 @@ int sceneHandler14_updateScreenCallback() {
 
 	res = g_nmi->drawArcadeOverlay(g_vars->scene14_arcadeIsOn);
 	if (!res)
-		g_nmi->_updateScreenCallback = 0;
+		g_nmi->_updateScreenCallback = nullptr;
 
 	return res;
 }
@@ -120,7 +120,7 @@ void sceneHandler14_showBallGrandmaHit2() {
 
 		g_vars->scene14_pink = g_vars->scene14_flyingBall;
 
-		g_vars->scene14_flyingBall = 0;
+		g_vars->scene14_flyingBall = nullptr;
 	}
 }
 
@@ -129,7 +129,7 @@ void sceneHandler14_showBallGrandmaDive() {
 		g_vars->scene14_flyingBall->show1(g_vars->scene14_grandmaX + 506, g_vars->scene14_grandmaY - 29, -1, 0);
 
 		g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
-		g_vars->scene14_flyingBall = 0;
+		g_vars->scene14_flyingBall = nullptr;
 	}
 
 	g_nmi->_aniMan2 = g_nmi->_aniMan;
@@ -152,10 +152,10 @@ void sceneHandler14_showBallGrandmaHit() {
 		ex->_param = g_vars->scene14_flyingBall->_odelay;
 		ex->_excFlags |= 3;
 		mq->addExCommandToEnd(ex);
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
-		g_vars->scene14_flyingBall = 0;
+		g_vars->scene14_flyingBall = nullptr;
 	}
 }
 
@@ -194,12 +194,12 @@ void sceneHandler14_showBallMan() {
 		ex->_param = g_vars->scene14_flyingBall->_odelay;
 		ex->_excFlags |= 3;
 		mq->addExCommandToEnd(ex);
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		g_vars->scene14_flyingBall->startAnim(MV_BAL14_TOGMA, 0, -1);
 
 		g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
-		g_vars->scene14_flyingBall = 0;
+		g_vars->scene14_flyingBall = nullptr;
 
 		if (g_vars->scene14_dudeX >= 1300)
 			sceneHandler14_exitScene();
@@ -315,7 +315,7 @@ void sceneHandler14_winArcade() {
 			g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
 
 			g_vars->scene14_flyingBall->_flags &= 0xFFFB;
-			g_vars->scene14_flyingBall = 0;
+			g_vars->scene14_flyingBall = nullptr;
 		}
 
 		g_vars->scene14_ballIsFlying = false;
@@ -351,7 +351,7 @@ void sceneHandler14_hideBallLast() {
 	if (g_vars->scene14_pink) {
 		g_vars->scene14_pink->hide();
 		g_vars->scene14_balls.push_back(g_vars->scene14_pink);
-		g_vars->scene14_pink = 0;
+		g_vars->scene14_pink = nullptr;
 	}
 }
 
@@ -368,11 +368,11 @@ void sceneHandler14_startArcade() {
 	getCurrSceneSc2MotionController()->deactivate();
 	getGameLoaderInteractionController()->disableFlag24();
 
-	g_nmi->_aniMan2 = 0;
+	g_nmi->_aniMan2 = nullptr;
 	g_vars->scene14_sceneDeltaX = 50;
 	g_vars->scene14_sceneDiffX = 100;
 	g_vars->scene14_hitsLeft = 4;
-	g_vars->scene14_pink = 0;
+	g_vars->scene14_pink = nullptr;
 
 	chainQueue(QU_SC14_STARTARCADE, 0);
 
@@ -380,7 +380,7 @@ void sceneHandler14_startArcade() {
 }
 
 void sceneHandler14_clearCallback() {
-	g_nmi->_aniMan->_callback2 = 0; // Really NULL
+	g_nmi->_aniMan->_callback2 = nullptr; // Really NULL
 	g_vars->scene14_dudeIsKicking = false;
 }
 
@@ -491,7 +491,7 @@ void sceneHandler14_grandmaThrow() {
 	ex->_excFlags |= 2;
 	mq->addExCommandToEnd(ex);
 
-	mq->chain(0);
+	mq->chain(nullptr);
 }
 
 void sceneHandler14_passToGrandma() {
@@ -510,10 +510,10 @@ void sceneHandler14_passToGrandma() {
 	ex->_param = g_vars->scene14_flyingBall->_odelay;
 	ex->_excFlags |= 3;
 	mq->addExCommandToEnd(ex);
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
-	g_vars->scene14_flyingBall = 0;
+	g_vars->scene14_flyingBall = nullptr;
 
 	sceneHandler14_grandmaThrow();
 }
@@ -535,7 +535,7 @@ void sceneHandler14_grandmaJumpThrow() {
 	ex->_excFlags |= 2;
 	mq->addExCommandToEnd(ex);
 
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_vars->scene14_dude2X += 71;
 	g_nmi->_currentScene->_x = 71;
@@ -580,7 +580,7 @@ void sceneHandler14_arcadeLogic() {
 		sceneHandler14_clearCallback();
 
 		g_vars->scene14_dudeCanKick = false;
-		g_nmi->_aniMan2 = 0;
+		g_nmi->_aniMan2 = nullptr;
 
 		chainQueue(QU_SC14_WINARCADE, 1);
 
@@ -601,7 +601,7 @@ void sceneHandler14_arcadeLogic() {
 			ex->_excFlags |= 2;
 			mq->addExCommandToEnd(ex);
 
-			mq->chain(0);
+			mq->chain(nullptr);
 		} else {
 			MessageQueue *mq = new MessageQueue(g_nmi->_globalMessageQueueList->compact());
 
@@ -613,7 +613,7 @@ void sceneHandler14_arcadeLogic() {
 			ex->_excFlags |= 2;
 			mq->addExCommandToEnd(ex);
 
-			mq->chain(0);
+			mq->chain(nullptr);
 		}
 
 		sceneHandler14_grandmaStepForward();
@@ -715,7 +715,7 @@ int sceneHandler14(ExCommand *cmd) {
 		break;
 
 	case MSG_SC14_SCROLLLEFT:
-		g_nmi->_aniMan2 = 0;
+		g_nmi->_aniMan2 = nullptr;
 		g_nmi->_currentScene->_x = -g_nmi->_sceneRect.left;
 		g_nmi->_scrollSpeed = 24;
 		break;
diff --git a/engines/ngi/fullpipe/scene16.cpp b/engines/ngi/fullpipe/scene16.cpp
index 456b2712f1..2fe5d3ca03 100644
--- a/engines/ngi/fullpipe/scene16.cpp
+++ b/engines/ngi/fullpipe/scene16.cpp
@@ -38,8 +38,8 @@ namespace NGI {
 
 void scene16_initScene(Scene *sc) {
 	g_vars->scene16_figures.clear();
-	g_vars->scene16_walkingBoy = 0;
-	g_vars->scene16_walkingGirl = 0;
+	g_vars->scene16_walkingBoy = nullptr;
+	g_vars->scene16_walkingGirl = nullptr;
 	g_vars->scene16_walkingCount = 200;
 	g_vars->scene16_wire = sc->getStaticANIObject1ById(ANI_WIRE16, -1);
 	g_vars->scene16_mug = sc->getStaticANIObject1ById(ANI_MUG, -1);
@@ -85,7 +85,7 @@ void scene16_initScene(Scene *sc) {
 		g_vars->scene16_placeIsOccupied = false;
 
 		StaticANIObject *ani = new StaticANIObject(g_nmi->accessScene(SC_COMMON)->getStaticANIObject1ById(ANI_BEARDED_CMN, -1));
-		ani->_movement = 0;
+		ani->_movement = nullptr;
 		ani->_statics = ani->_staticsList[0];
 		sc->addStaticANIObject(ani, 1);
 	}
@@ -99,7 +99,7 @@ void scene16_initScene(Scene *sc) {
 
 	if (g_nmi->getObjectState(sO_Cup) == g_nmi->getObjectEnumState(sO_Cup, sO_In_16)) {
 		g_vars->scene16_mug->_statics = g_vars->scene16_mug->getStaticsById(ST_MUG_EMPTY);
-		g_vars->scene16_mug->_movement = 0;
+		g_vars->scene16_mug->_movement = nullptr;
 		g_vars->scene16_mug->setOXY(409, 459);
 		g_vars->scene16_mug->_priority = 5;
 		g_vars->scene16_mug->_flags |= 4;
@@ -235,7 +235,7 @@ void sceneHandler16_startLaugh() {
 
 	mq->setParamInt(-1, girl->_odelay);
 	mq->setFlags(mq->getFlags() | 1);
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_nmi->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->setSubVarAsInt(sO_DudeSwinged, 0);
 
@@ -255,7 +255,7 @@ void sceneHandler16_drink() {
 							g_nmi->_aniMan->_flags |= 0x180;
 
 							g_vars->scene16_walkingBoy->changeStatics2(ST_BOY_STAND);
-							g_vars->scene16_walkingBoy->queueMessageQueue(0);
+							g_vars->scene16_walkingBoy->queueMessageQueue(nullptr);
 
 							mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC16_BOYKICK), 0, 1);
 
@@ -268,7 +268,7 @@ void sceneHandler16_drink() {
 
 							mq->insertExCommandAt(2, ex);
 							mq->setFlags(mq->getFlags() | 1);
-							mq->chain(0);
+							mq->chain(nullptr);
 						} else {
 							g_nmi->_aniMan->_flags |= 0x100;
 
@@ -281,7 +281,7 @@ void sceneHandler16_drink() {
 
 							mq->addExCommandToEnd(ex);
 							mq->setFlags(mq->getFlags() | 1);
-							mq->chain(0);
+							mq->chain(nullptr);
 
 							g_nmi->_currentScene->getStaticANIObject1ById(ANI_GIRL, -1)->changeStatics2(ST_GRL_STAND);
 						}
@@ -363,18 +363,18 @@ void sceneHandler16_putOnWheel() {
 			mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC16_GOBOY), 0, 1);
 
 			mq->setParamInt(-1, ani->_odelay);
-			mq->chain(0);
+			mq->chain(nullptr);
 
 			g_vars->scene16_walkingBoy = ani;
-			g_vars->scene16_walkingGirl = 0;
+			g_vars->scene16_walkingGirl = nullptr;
 		} else if (ani->_id == ANI_GIRL) {
 			if (g_nmi->getObjectState(sO_Girl) == g_nmi->getObjectEnumState(sO_Girl, sO_IsSwinging)) {
 				mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC16_GOGIRL), 0, 1);
 
 				mq->setParamInt(-1, ani->_odelay);
-				mq->chain(0);
+				mq->chain(nullptr);
 
-				g_vars->scene16_walkingBoy = 0;
+				g_vars->scene16_walkingBoy = nullptr;
 				g_vars->scene16_walkingGirl = ani;
 			}
 		}
diff --git a/engines/ngi/fullpipe/scene17.cpp b/engines/ngi/fullpipe/scene17.cpp
index d91e6c2d3b..696a58139e 100644
--- a/engines/ngi/fullpipe/scene17.cpp
+++ b/engines/ngi/fullpipe/scene17.cpp
@@ -97,7 +97,7 @@ void sceneHandler17_drop() {
 		mug->changeStatics2(ST_MUG17_EMPTY);
 		chainQueue(QU_SC17_FILLMUG_DROP, 0);
 	} else if (jet) {
-		jet->queueMessageQueue(0);
+		jet->queueMessageQueue(nullptr);
 		chainQueue(QU_JET17_DROP, 0);
 	}
 }
diff --git a/engines/ngi/fullpipe/scene18and19.cpp b/engines/ngi/fullpipe/scene18and19.cpp
index f3d6ddeb6e..fc3b1b2ba8 100644
--- a/engines/ngi/fullpipe/scene18and19.cpp
+++ b/engines/ngi/fullpipe/scene18and19.cpp
@@ -51,12 +51,12 @@ struct Swinger {
 
 
 void scene18_preload() {
-	g_nmi->_scene3 = 0;
+	g_nmi->_scene3 = nullptr;
 
 	for (SceneTagList::iterator s = g_nmi->_gameProject->_sceneTagList->begin(); s != g_nmi->_gameProject->_sceneTagList->end(); ++s) {
 		if (s->_sceneId == SC_18) {
 			g_nmi->_scene3 = s->_scene;
-			s->_scene = 0;
+			s->_scene = nullptr;
 
 			g_nmi->_scene3->getStaticANIObject1ById(ANI_WHIRLIGIG_18, -1)->freeMovementsPixelData();
 
@@ -292,7 +292,7 @@ void scene18_initScene1(Scene *sc) {
 
 	if (g_vars->scene18_enteredTrubaRight) {
 		if (sc->_sceneId == SC_19)
-			g_nmi->_aniMan2 = 0;
+			g_nmi->_aniMan2 = nullptr;
 		else
 			g_nmi->_aniMan2 = g_vars->scene18_swingers[g_vars->scene18_manWheelPosTo]->ani;
 	} else {
@@ -345,7 +345,7 @@ void scene18_initScene2(Scene *sc) {
 }
 
 void scene19_initScene2() {
-	g_nmi->_aniMan2 = 0;
+	g_nmi->_aniMan2 = nullptr;
 }
 
 int scene18_updateCursor() {
@@ -439,7 +439,7 @@ void sceneHandler18and19_showManJump() {
 		g_vars->scene18_enteredTrubaRight = false;
 
 		mq->setFlags(mq->getFlags() | 1);
-		mq->chain(0);
+		mq->chain(nullptr);
 	}
 
 	g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->sflags = 1;
diff --git a/engines/ngi/fullpipe/scene22.cpp b/engines/ngi/fullpipe/scene22.cpp
index 5447219669..5c4e1790b1 100644
--- a/engines/ngi/fullpipe/scene22.cpp
+++ b/engines/ngi/fullpipe/scene22.cpp
@@ -155,7 +155,7 @@ void sceneHandler22_fromStool(ExCommand *cmd) {
 
 		mq->addExCommandToEnd(cmd->createClone());
 		mq->setFlags(mq->getFlags() | 1);
-		mq->chain(0);
+		mq->chain(nullptr);
 	}
 }
 
@@ -267,7 +267,7 @@ void sceneHandler22_stoolLogic(ExCommand *cmd) {
 
 				mq->insertExCommandAt(2, ex);
 				mq->setFlags(mq->getFlags() | 1);
-				mq->chain(0);
+				mq->chain(nullptr);
 
 				g_vars->scene22_interactionIsDisabled = true;
 			} else {
diff --git a/engines/ngi/fullpipe/scene23.cpp b/engines/ngi/fullpipe/scene23.cpp
index 506aa5c835..40114e344d 100644
--- a/engines/ngi/fullpipe/scene23.cpp
+++ b/engines/ngi/fullpipe/scene23.cpp
@@ -308,7 +308,7 @@ void sceneHandler23_pushButton(ExCommand *cmd) {
 
 					mq->addExCommandToEnd(cmd->createClone());
 					mq->setFlags(mq->getFlags() | 1);
-					mq->chain(0);
+					mq->chain(nullptr);
 				}
 
 				if (!g_vars->scene23_topReached)
@@ -397,7 +397,7 @@ void sceneHandler23_fromCalendar(ExCommand *cmd) {
 
 		mq->addExCommandToEnd(cmd->createClone());
 		mq->setFlags(mq->getFlags() | 1);
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		g_vars->scene23_topReached = false;
 		g_vars->scene23_someVar = 0;
@@ -410,7 +410,7 @@ void sceneHandler23_fromStool(ExCommand *cmd) {
 
 		mq->addExCommandToEnd(cmd->createClone());
 		mq->setFlags(mq->getFlags() | 1);
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		cmd->_messageKind = 0;
 	}
@@ -431,7 +431,7 @@ int sceneHandler23(ExCommand *cmd) {
 		break;
 
 	case MSG_SC23_HIDEGIRAFFEE:
-		g_vars->scene23_giraffee->queueMessageQueue(0);
+		g_vars->scene23_giraffee->queueMessageQueue(nullptr);
 		g_vars->scene23_giraffee->_flags &= 0xFFFB;
 		break;
 
diff --git a/engines/ngi/fullpipe/scene25.cpp b/engines/ngi/fullpipe/scene25.cpp
index fba4089e63..a90eb188a9 100644
--- a/engines/ngi/fullpipe/scene25.cpp
+++ b/engines/ngi/fullpipe/scene25.cpp
@@ -236,7 +236,7 @@ void sceneHandler25_animateBearders() {
 
 		mq->setParamInt(-1, g_vars->scene25_bearders[0]->_odelay);
 		mq->getExCommandByIndex(0)->_x = g_nmi->_rnd.getRandomNumber(650) + 100;
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		g_vars->scene25_beardersCounter = 0;
 
@@ -245,14 +245,14 @@ void sceneHandler25_animateBearders() {
 
 			mq->setParamInt(-1, g_vars->scene25_bearders[1]->_odelay);
 			mq->getExCommandByIndex(0)->_x = g_nmi->_rnd.getRandomNumber(650) + 100;
-			mq->chain(0);
+			mq->chain(nullptr);
 
 			if (g_nmi->_rnd.getRandomNumber(32767) < 8191) {
 				mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC25_BEARDED3), 0, 1);
 
 				mq->setParamInt(-1, g_vars->scene25_bearders[2]->_odelay);
 				mq->getExCommandByIndex(0)->_x = g_nmi->_rnd.getRandomNumber(650) + 100;
-				mq->chain(0);
+				mq->chain(nullptr);
 			}
 		}
 	}
@@ -451,7 +451,7 @@ void sceneHandler25_walkOnLadder(StaticANIObject *ani, Common::Point *pnt, Messa
 	int pnty = pnt->y;
 	int numObsolete = -1;
 	int minDistance = 20000;
-	ExCommand *lastEx = 0;
+	ExCommand *lastEx = nullptr;
 
 	for (uint i = 0; i < mq->getCount(); i++) {
 		int curDistance = abs(pnty - aniY);
diff --git a/engines/ngi/fullpipe/scene26.cpp b/engines/ngi/fullpipe/scene26.cpp
index aace588d1c..f3472f4871 100644
--- a/engines/ngi/fullpipe/scene26.cpp
+++ b/engines/ngi/fullpipe/scene26.cpp
@@ -249,7 +249,7 @@ void sceneHandler26_animateVents(StaticANIObject *ani) {
 		MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(qId), 0, 0);
 
 		mq->setFlags(mq->getFlags() | 1);
-		mq->chain(0);
+		mq->chain(nullptr);
 	}
 }
 
diff --git a/engines/ngi/fullpipe/scene27.cpp b/engines/ngi/fullpipe/scene27.cpp
index 4378e1306a..fd42e7eaea 100644
--- a/engines/ngi/fullpipe/scene27.cpp
+++ b/engines/ngi/fullpipe/scene27.cpp
@@ -124,7 +124,7 @@ void sceneHandler27_winArcade() {
 	if (g_nmi->getObjectState(sO_Driver) == g_nmi->getObjectEnumState(sO_Driver, sO_WithSteering)) {
 		g_vars->scene27_dudeIsAiming = false;
 
-		g_nmi->_aniMan->_callback2 = 0; // Really NULL
+		g_nmi->_aniMan->_callback2 = nullptr; // Really NULL
 		g_nmi->_aniMan->changeStatics2(ST_MAN_RIGHT);
 
 		sceneHandler27_driverGiveVent();
@@ -147,7 +147,7 @@ void sceneHandler27_showNextBat() {
 		MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC27_SHOWBET), 0, 1);
 
 		mq->setParamInt(-1, g_vars->scene27_bat->_odelay);
-		mq->chain(0);
+		mq->chain(nullptr);
 	}
 
 	g_vars->scene27_batHandler->_priority = 1045;
@@ -159,7 +159,7 @@ int sceneHandler27_updateScreenCallback() {
 	res = g_nmi->drawArcadeOverlay(getGameLoaderInteractionController()->_flag24 == 0);
 
 	if (!res)
-		g_nmi->_updateScreenCallback = 0;
+		g_nmi->_updateScreenCallback = nullptr;
 
 	return res;
 }
@@ -248,7 +248,7 @@ void sceneHandler27_startAiming() {
 	g_vars->scene27_dudeIsAiming = false;
 	g_vars->scene27_maxPhaseReached = false;
 
-	g_nmi->_aniMan->_callback2 = 0; // Really NULL
+	g_nmi->_aniMan->_callback2 = nullptr; // Really NULL
 
 	g_vars->scene27_launchPhase = g_nmi->_aniMan->_movement->_currDynamicPhaseIndex - 6;
 
@@ -498,9 +498,9 @@ void sceneHandler27_batLogic() {
 		ex->_excFlags |= 3;
 		mq->addExCommandToEnd(ex);
 
-		mq->chain(0);
+		mq->chain(nullptr);
 	} else {
-		g_vars->scene27_bat = 0;
+		g_vars->scene27_bat = nullptr;
 	}
 }
 
diff --git a/engines/ngi/fullpipe/scene28.cpp b/engines/ngi/fullpipe/scene28.cpp
index c6a93732da..9b685d92f0 100644
--- a/engines/ngi/fullpipe/scene28.cpp
+++ b/engines/ngi/fullpipe/scene28.cpp
@@ -39,8 +39,8 @@ namespace NGI {
 void scene28_initScene(Scene *sc) {
 	g_vars->scene28_fliesArePresent = true;
 	g_vars->scene28_beardedDirection = true;
-	g_vars->scene28_darkeningObject = 0;
-	g_vars->scene28_lighteningObject = 0;
+	g_vars->scene28_darkeningObject = nullptr;
+	g_vars->scene28_lighteningObject = nullptr;
 	g_vars->scene28_headDirection = false;
 	g_vars->scene28_headBeardedFlipper = false;
 	g_vars->scene28_lift6inside = false;
@@ -71,7 +71,7 @@ void sceneHandler28_lift1ShowAfter() {
 void sceneHandler28_makeFaces(ExCommand *cmd) {
 	g_nmi->_currentScene->getPictureObjectById(PIC_SC28_DARK4, 0)->_flags &= 0xFFFB;
 
-	g_vars->scene28_lighteningObject = 0;
+	g_vars->scene28_lighteningObject = nullptr;
 
 	MessageQueue *mq = g_nmi->_globalMessageQueueList->getMessageQueueById(cmd->_parId);
 	if (mq) {
@@ -107,7 +107,7 @@ void sceneHandler28_trySecondaryPers() {
 			mq->getExCommandByIndex(0)->_x = g_nmi->_sceneRect.left - 20;
 			mq->getExCommandByIndex(0)->_param = 1;
 			mq->setParamInt(-1, 1);
-			mq->chain(0);
+			mq->chain(nullptr);
 
 			mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_BRD28_GOR), 0, 1);
 
@@ -115,7 +115,7 @@ void sceneHandler28_trySecondaryPers() {
 			mq->getExCommandByIndex(0)->_y += 20;
 			mq->getExCommandByIndex(0)->_param = 2;
 			mq->setParamInt(-1, 2);
-			mq->chain(0);
+			mq->chain(nullptr);
 
 			mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_BRD28_GOR), 0, 1);
 
@@ -126,7 +126,7 @@ void sceneHandler28_trySecondaryPers() {
 			mq->getExCommandByIndex(0)->_x = g_nmi->_sceneRect.right + 20;
 			mq->getExCommandByIndex(0)->_param = 1;
 			mq->setParamInt(-1, 1);
-			mq->chain(0);
+			mq->chain(nullptr);
 
 			mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_BRD28_GOL), 0, 1);
 
@@ -134,7 +134,7 @@ void sceneHandler28_trySecondaryPers() {
 			mq->getExCommandByIndex(0)->_y += 20;
 			mq->getExCommandByIndex(0)->_param = 2;
 			mq->setParamInt(-1, 2);
-			mq->chain(0);
+			mq->chain(nullptr);
 
 			mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_BRD28_GOL), 0, 1);
 
@@ -145,7 +145,7 @@ void sceneHandler28_trySecondaryPers() {
 		mq->getExCommandByIndex(0)->_y += 40;
 		mq->getExCommandByIndex(0)->_param = 3;
 		mq->setParamInt(-1, 3);
-		mq->chain( 0);
+		mq->chain( nullptr);
 
 		g_vars->scene28_beardedDirection = !g_vars->scene28_beardedDirection;
 	} else {
@@ -160,7 +160,7 @@ void sceneHandler28_trySecondaryPers() {
 		}
 
 		mq->getExCommandByIndex(0)->_x = x;
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		g_vars->scene28_headDirection = !g_vars->scene28_headDirection;
 	}
@@ -451,7 +451,7 @@ int sceneHandler28(ExCommand *cmd) {
 			} else {
 				g_vars->scene28_darkeningObject->_flags &= 0xFFFB;
 
-				g_vars->scene28_darkeningObject = 0;
+				g_vars->scene28_darkeningObject = nullptr;
 			}
 		}
 
@@ -461,7 +461,7 @@ int sceneHandler28(ExCommand *cmd) {
 			} else {
 				g_vars->scene28_lighteningObject->_picture->setAlpha(0xff);
 
-				g_vars->scene28_lighteningObject = 0;
+				g_vars->scene28_lighteningObject = nullptr;
 			}
 		}
 
diff --git a/engines/ngi/fullpipe/scene29.cpp b/engines/ngi/fullpipe/scene29.cpp
index 6e85c10b79..4cf4450ce6 100644
--- a/engines/ngi/fullpipe/scene29.cpp
+++ b/engines/ngi/fullpipe/scene29.cpp
@@ -138,7 +138,7 @@ void sceneHandler29_winArcade() {
 			ani->hide();
 		}
 
-		g_vars->scene29_ass->queueMessageQueue(0);
+		g_vars->scene29_ass->queueMessageQueue(nullptr);
 		g_vars->scene29_ass->_flags &= 0xFFFB;
 
 		chainQueue(QU_SC29_ESCAPE, 1);
@@ -432,7 +432,7 @@ int sceneHandler29_updateScreenCallback() {
 	res = g_nmi->drawArcadeOverlay(g_vars->scene29_arcadeIsOn);
 
 	if (!res)
-		g_nmi->_updateScreenCallback = 0;
+		g_nmi->_updateScreenCallback = nullptr;
 
 	return res;
 }
@@ -549,7 +549,7 @@ void sceneHandler29_shootersEscape() {
 
 			chainQueue(QU_SC29_ESCAPE, 1);
 
-			g_vars->scene29_ass->queueMessageQueue(0);
+			g_vars->scene29_ass->queueMessageQueue(nullptr);
 			g_vars->scene29_ass->hide();
 
 			g_nmi->setObjectState(sO_LeftPipe_29, g_nmi->getObjectEnumState(sO_LeftPipe_29, sO_IsOpened));
@@ -602,7 +602,7 @@ void sceneHandler29_animBearded() {
 					mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC29_BRDOUT1), 0, 1);
 
 					mq->setParamInt(-1, ani->_odelay);
-					mq->chain(0);
+					mq->chain(nullptr);
 
 					g_vars->scene29_bearders[i]->wbflag = 0;
 					g_vars->scene29_bearders[i]->wbcounter = 0;
@@ -622,7 +622,7 @@ void sceneHandler29_animBearded() {
 						mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC29_BRDOUT2), 0, 1);
 
 						mq->setParamInt(-1, ani->_odelay);
-						mq->chain(0);
+						mq->chain(nullptr);
 
 						g_vars->scene29_bearders[i]->wbflag = 0;
 						g_vars->scene29_bearders[i]->wbcounter = 0;
@@ -663,7 +663,7 @@ void sceneHandler29_animBearded() {
 
 			mq->getExCommandByIndex(0)->_x = newx;
 			mq->setParamInt(-1, ani->_odelay);
-			mq->chain(0);
+			mq->chain(nullptr);
 
 			g_vars->scene29_bearders[i]->wbflag = 1;
 			g_vars->scene29_bearders[i]->wbcounter = 0;
diff --git a/engines/ngi/fullpipe/scene32.cpp b/engines/ngi/fullpipe/scene32.cpp
index 45b642ec0d..42111a4b0e 100644
--- a/engines/ngi/fullpipe/scene32.cpp
+++ b/engines/ngi/fullpipe/scene32.cpp
@@ -258,7 +258,7 @@ void sceneHandler32_potLogic(ExCommand *cmd) {
 			mq->addExCommandToEnd(cmd->createClone());
 
 		mq->setFlags(mq->getFlags() | 1);
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		getCurrSceneSc2MotionController()->activate();
 		getGameLoaderInteractionController()->enableFlag24();
diff --git a/engines/ngi/fullpipe/scene33.cpp b/engines/ngi/fullpipe/scene33.cpp
index 7b7fa05bd2..7c1f04444f 100644
--- a/engines/ngi/fullpipe/scene33.cpp
+++ b/engines/ngi/fullpipe/scene33.cpp
@@ -41,7 +41,7 @@ const int ventsInit[9] = { 0, 0, 1, 0, 0, 1, 0, 0, 1 };
 void scene33_initScene(Scene *sc) {
 	g_vars->scene33_mug = sc->getStaticANIObject1ById(ANI_MUG_33, -1);
 	g_vars->scene33_jettie = sc->getStaticANIObject1ById(ANI_JETTIE_FLOW, -1);
-	g_vars->scene33_cube = 0;
+	g_vars->scene33_cube = nullptr;
 	g_vars->scene33_cubeX = -1;
 	g_vars->scene33_handleIsDown = false;
 
@@ -166,8 +166,8 @@ void sceneHandler33_zoneClickProcess(StaticANIObject *ani) {
 	if (!ani->_movement) {
 		sceneHandler33_switchVent(ani);
 
-		StaticANIObject *vent1 = 0;
-		StaticANIObject *vent2 = 0;
+		StaticANIObject *vent1 = nullptr;
+		StaticANIObject *vent2 = nullptr;
 
 		switch (ani->_odelay) {
 		case 0:
@@ -207,7 +207,7 @@ void sceneHandler33_zoneClickProcess(StaticANIObject *ani) {
 }
 
 void sceneHandler33_clickZones(ExCommand *cmd) {
-	StaticANIObject *closest = 0;
+	StaticANIObject *closest = nullptr;
 	double mindist = 1e10;
 
 	for (uint i = 0; i < g_nmi->_currentScene->_staticANIObjectList1.size(); i++) {
diff --git a/engines/ngi/fullpipe/scene34.cpp b/engines/ngi/fullpipe/scene34.cpp
index 4232d831e1..bb979c564e 100644
--- a/engines/ngi/fullpipe/scene34.cpp
+++ b/engines/ngi/fullpipe/scene34.cpp
@@ -187,7 +187,7 @@ void sceneHandler34_fromCactus(ExCommand *cmd) {
 	mq->addExCommandToEnd(ex);
 
 	mq->setFlags(mq->getFlags() | 1);
-	mq->chain(0);
+	mq->chain(nullptr);
 
 	g_nmi->_aniMan->_flags |= 0x100;
 }
@@ -198,7 +198,7 @@ void sceneHandler34_animateLeaveBoard(ExCommand *cmd) {
 
 		mq->addExCommandToEnd(cmd->createClone());
 		mq->setFlags(mq->getFlags() | 1);
-		mq->chain(0);
+		mq->chain(nullptr);
 	}
 
 	cmd->_messageKind = 0;
@@ -228,7 +228,7 @@ void sceneHandler34_animateAction(ExCommand *cmd) {
 				MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(QU_SC34_FROMBOX), 0, 0);
 
 				mq->addExCommandToEnd(cmd->createClone());
-				mq->chain(0);
+				mq->chain(nullptr);
 
 				sceneHandler34_setExits();
 
@@ -245,7 +245,7 @@ void sceneHandler34_animateAction(ExCommand *cmd) {
 			MessageQueue *mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(qId), 0, 0);
 
 			mq->addExCommandToEnd(cmd->createClone());
-			mq->chain(0);
+			mq->chain(nullptr);
 		}
 
 		return;
diff --git a/engines/ngi/fullpipe/scene37.cpp b/engines/ngi/fullpipe/scene37.cpp
index a6e867c1d0..16b50c553b 100644
--- a/engines/ngi/fullpipe/scene37.cpp
+++ b/engines/ngi/fullpipe/scene37.cpp
@@ -37,7 +37,7 @@
 namespace NGI {
 
 Ring::Ring() {
-	ani = 0;
+	ani = nullptr;
 	x = 0;
 	y = 0;
 	numSubRings = 0;
diff --git a/engines/ngi/fullpipe/scene38.cpp b/engines/ngi/fullpipe/scene38.cpp
index af1b7113df..83ad48eefe 100644
--- a/engines/ngi/fullpipe/scene38.cpp
+++ b/engines/ngi/fullpipe/scene38.cpp
@@ -220,7 +220,7 @@ void sceneHandler38_animateAlcoholics() {
 				if (bossAnim > 0) {
 					mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(bossAnim), 0, 0);
 
-					mq->chain(0);
+					mq->chain(nullptr);
 
 					g_vars->scene38_bossCounter = 0;
 				}
@@ -268,7 +268,7 @@ void sceneHandler38_animateAlcoholics() {
 		if (tallyAnim > 0) {
 			mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(tallyAnim), 0, 0);
 
-			mq->chain(0);
+			mq->chain(nullptr);
 			g_vars->scene38_tallyCounter = 0;
 		}
 	}
@@ -312,7 +312,7 @@ void sceneHandler38_animateAlcoholics() {
 	if (shortyAnim > 0) {
 		mq = new MessageQueue(g_nmi->_currentScene->getMessageQueueById(shortyAnim), 0, 0);
 
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		g_vars->scene38_shortyCounter = 0;
 	}
diff --git a/engines/ngi/fullpipe/sceneDbg.cpp b/engines/ngi/fullpipe/sceneDbg.cpp
index 8bf0766944..6e9b4fb9b8 100644
--- a/engines/ngi/fullpipe/sceneDbg.cpp
+++ b/engines/ngi/fullpipe/sceneDbg.cpp
@@ -42,7 +42,7 @@ void sceneDbgMenu_initScene(Scene *sc) {
 
 GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) {
 	if (!g_nmi->_currentScene)
-		return 0;
+		return nullptr;
 
 	for (uint i = 1; i < g_nmi->_currentScene->_picObjList.size(); i++) {
 		PictureObject *pic = g_nmi->_currentScene->_picObjList[i];
@@ -54,7 +54,7 @@ GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 int sceneHandlerDbgMenu(ExCommand *ex) {
@@ -66,9 +66,9 @@ int sceneHandlerDbgMenu(ExCommand *ex) {
 
 	if (ex->_messageNum == 29) {
 		GameObject *obj = sceneHandlerDbgMenu_getObjectAtXY(mx, my);
-		if (obj && canInteractAny(0, obj, -3) ) {
+		if (obj && canInteractAny(nullptr, obj, -3) ) {
 			getGameLoaderInteractionController()->enableFlag24();
-			handleObjectInteraction(0, obj, 0);
+			handleObjectInteraction(nullptr, obj, 0);
 		}
 		return 0;
 	}
@@ -83,14 +83,14 @@ int sceneHandlerDbgMenu(ExCommand *ex) {
 	g_nmi->_cursorId = PIC_CSR_DEFAULT;
 	GameObject *obj = g_nmi->_currentScene->getStaticANIObjectAtPos(mx, my);
 	if (obj) {
-		if (canInteractAny(0, obj, -3)) {
+		if (canInteractAny(nullptr, obj, -3)) {
 			g_nmi->_cursorId = PIC_CSR_DEFAULT;
 			g_nmi->setCursor(PIC_CSR_DEFAULT);
 			return 0;
 		}
 	} else {
 		obj = sceneHandlerDbgMenu_getObjectAtXY(mx, my);
-		if (obj && canInteractAny(0, obj, -3) ) {
+		if (obj && canInteractAny(nullptr, obj, -3) ) {
 			g_vars->selector->_flags |= 4;
 			g_vars->selector->setOXY(obj->_ox, obj->_oy);
 			g_nmi->_cursorId = PIC_CSR_DEFAULT;
diff --git a/engines/ngi/fullpipe/sceneFinal.cpp b/engines/ngi/fullpipe/sceneFinal.cpp
index 64d3e02812..572154c3bd 100644
--- a/engines/ngi/fullpipe/sceneFinal.cpp
+++ b/engines/ngi/fullpipe/sceneFinal.cpp
@@ -103,7 +103,7 @@ void sceneHandlerFinal_startFinal() {
 	getCurrSceneSc2MotionController()->deactivate();
 	getGameLoaderInteractionController()->disableFlag24();
 
-	g_nmi->_aniMan2 = 0;
+	g_nmi->_aniMan2 = nullptr;
 
 	g_nmi->_aniMan->_flags &= 0xFFFB;
 
diff --git a/engines/ngi/gameloader.cpp b/engines/ngi/gameloader.cpp
index 57d63139cb..6b644a98c5 100644
--- a/engines/ngi/gameloader.cpp
+++ b/engines/ngi/gameloader.cpp
@@ -80,10 +80,10 @@ GameLoader::GameLoader() {
 
 	_field_FA = 0;
 	_field_F8 = 0;
-	_sceneSwitcher = 0;
-	_preloadCallback = 0;
-	_savegameCallback = 0;
-	_gameVar = 0;
+	_sceneSwitcher = nullptr;
+	_preloadCallback = nullptr;
+	_savegameCallback = nullptr;
+	_gameVar = nullptr;
 	_preloadSceneId = 0;
 	_preloadEntranceId = 0;
 	_updateCounter = 0;
@@ -205,7 +205,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
 
 	GameVar *sg = _gameVar->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
 
-	if (sg || (sg = _gameVar->getSubVarByName("OBJSTATES")->addSubVarAsInt("SAVEGAME", 0)) != 0)
+	if (sg || (sg = _gameVar->getSubVarByName("OBJSTATES")->addSubVarAsInt("SAVEGAME", 0)) != nullptr)
 		sg->setSubVarAsInt("Entrance", entranceId);
 
 	if (!g_nmi->sceneSwitcher(_sc2array[sc2idx]._entranceData[entranceIdx]))
@@ -236,7 +236,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
 
 		mq->setFlags(mq->getFlags() | 1);
 
-		if (!mq->chain(0)) {
+		if (!mq->chain(nullptr)) {
 			delete mq;
 
 			return false;
@@ -278,7 +278,7 @@ bool preloadCallback(PreloadItem &pre, int flag) {
 	} else {
 		if (g_nmi->_scene2) {
 			g_nmi->_aniMan = g_nmi->_scene2->getAniMan();
-			g_nmi->_scene2 = 0;
+			g_nmi->_scene2 = nullptr;
 			setInputDisabled(1);
 		}
 
@@ -296,7 +296,7 @@ bool preloadCallback(PreloadItem &pre, int flag) {
 				if (pre.preloadId1 != SC_18)
 					g_nmi->_gameLoader->unloadScene(SC_18);
 
-				g_nmi->_scene3 = 0;
+				g_nmi->_scene3 = nullptr;
 			}
 		} else {
 			scene19_setMovements(g_nmi->accessScene(pre.preloadId1), pre.param);
@@ -327,8 +327,8 @@ bool preloadCallback(PreloadItem &pre, int flag) {
 			pbar->startAnim(MV_PBAR_RUN, 0, -1);
 		}
 
-		g_nmi->_inventoryScene = 0;
-		g_nmi->_updateCursorCallback = 0;
+		g_nmi->_inventoryScene = nullptr;
+		g_nmi->_updateCursorCallback = nullptr;
 
 		g_nmi->_sceneRect.translate(-g_nmi->_sceneRect.left, -g_nmi->_sceneRect.top);
 
@@ -381,7 +381,7 @@ bool GameLoader::preloadScene(int sceneId, int entranceId) {
 	}
 
 	if (g_nmi->_currentScene && g_nmi->_currentScene->_sceneId == sceneId)
-		g_nmi->_currentScene = 0;
+		g_nmi->_currentScene = nullptr;
 
 	saveScenePicAniInfos(sceneId);
 	clearGlobalMessageQueueList1();
@@ -443,7 +443,7 @@ int GameLoader::getSceneTagBySceneId(int sceneId, SceneTag **st) {
 		}
 	}
 
-	*st = 0;
+	*st = nullptr;
 	return -1;
 }
 
@@ -665,14 +665,14 @@ GameVar *NGIEngine::getGameLoaderGameVar() {
 	if (_gameLoader)
 		return _gameLoader->_gameVar;
 	else
-		return 0;
+		return nullptr;
 }
 
 InputController *NGIEngine::getGameLoaderInputController() {
 	if (_gameLoader)
 		return _gameLoader->_inputController;
 	else
-		return 0;
+		return nullptr;
 }
 
 MctlCompound *getCurrSceneSc2MotionController() {
diff --git a/engines/ngi/gfx.cpp b/engines/ngi/gfx.cpp
index 82aeefead9..2552af96fb 100644
--- a/engines/ngi/gfx.cpp
+++ b/engines/ngi/gfx.cpp
@@ -378,7 +378,7 @@ bool GameObject::setPicAniInfo(const PicAniInfo &picAniInfo) {
 		if (picAniInfo.staticsId) {
 			ani->_statics = ani->getStaticsById(picAniInfo.staticsId);
 		} else {
-			ani->_statics = 0;
+			ani->_statics = nullptr;
 		}
 
 		if (picAniInfo.movementId) {
@@ -386,7 +386,7 @@ bool GameObject::setPicAniInfo(const PicAniInfo &picAniInfo) {
 			if (ani->_movement)
 				ani->_movement->setDynamicPhaseIndex(picAniInfo.dynamicPhaseIndex);
 		} else {
-			ani->_movement = 0;
+			ani->_movement = nullptr;
 		}
 
 		ani->setOXY(picAniInfo.ox, picAniInfo.oy);
@@ -682,7 +682,7 @@ int Picture::getPixelAtPosEx(int x, int y) {
 	// TODO: It looks like this doesn't really work.
 	if (x < (g_nmi->_pictureScale + _width - 1) / g_nmi->_pictureScale &&
 			y < (g_nmi->_pictureScale + _height - 1) / g_nmi->_pictureScale &&
-			_memoryObject2 != 0 && _memoryObject2->_rows != 0)
+			_memoryObject2 != nullptr && _memoryObject2->_rows != nullptr)
 		return _memoryObject2->_rows[x][2 * y];
 
 	return 0;
@@ -1129,8 +1129,8 @@ void Shadows::init() {
 	StaticANIObject *st;
 	Movement *mov;
 
-	if (scene && (st = scene->getStaticANIObject1ById(_staticAniObjectId, -1)) != 0
-		&& ((mov = st->getMovementById(_movementId)) != 0))
+	if (scene && (st = scene->getStaticANIObject1ById(_staticAniObjectId, -1)) != nullptr
+		&& ((mov = st->getMovementById(_movementId)) != nullptr))
 		initMovement(mov);
 }
 
@@ -1163,7 +1163,7 @@ DynamicPhase *Shadows::findSize(int width, int height) {
 	int min = 1000;
 
 	if (!_items.size())
-		return 0;
+		return nullptr;
 
 	for (uint i = 0; i < _items.size(); i++) {
 		int w = abs(width - _items[i].width);
diff --git a/engines/ngi/input.cpp b/engines/ngi/input.cpp
index 09bec8d389..01a87164f6 100644
--- a/engines/ngi/input.cpp
+++ b/engines/ngi/input.cpp
@@ -49,13 +49,13 @@ InputController::InputController() {
 	_cursorBounds.right = 0;
 	_cursorBounds.bottom = 0;
 
-	_cursorItemPicture = 0;
+	_cursorItemPicture = nullptr;
 }
 
 InputController::~InputController() {
 	removeMessageHandler(126, -1);
 
-	g_nmi->_inputController = 0;
+	g_nmi->_inputController = nullptr;
 
 	for (uint i = 0; i < _cursorsArray.size(); i++)
 		delete _cursorsArray[i];
diff --git a/engines/ngi/interaction.cpp b/engines/ngi/interaction.cpp
index 76903db4bb..05e04ea125 100644
--- a/engines/ngi/interaction.cpp
+++ b/engines/ngi/interaction.cpp
@@ -106,8 +106,8 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
 	if (!_interactions.size())
 		return false;
 
-	Interaction *inter = 0;
-	Interaction *previnter = 0;
+	Interaction *inter = nullptr;
+	Interaction *previnter = nullptr;
 	int dur = 0;
 	int mindur = 0xFFFF;
 
@@ -178,7 +178,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
 				if (ani->_flags & 0x100)
 					return false;
 			} else if (inter->_staticsId1 != 0) {
-				if (ani->_movement || ani->_statics == 0 || ani->_statics->_staticsId != inter->_staticsId1) {
+				if (ani->_movement || ani->_statics == nullptr || ani->_statics->_staticsId != inter->_staticsId1) {
 					mq = ani->changeStatics1(inter->_staticsId1);
 					if (!mq)
 						return false;
@@ -200,7 +200,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
 					return true;
 				} else {
 					if (ani->getMessageQueue())
-						ani->queueMessageQueue(0);
+						ani->queueMessageQueue(nullptr);
 				}
 			}
 		}
@@ -209,7 +209,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
 			mq = new MessageQueue(inter->_messageQueue, 0, 1);
 			mq->changeParam28ForObjectId(obj->_id, -1, obj->_odelay);
 
-			if (!mq->chain(0))
+			if (!mq->chain(nullptr))
 				return false;
 		}
 
@@ -240,7 +240,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
 		if (obj->_objtype == kObjTypeStaticANIObject) {
 			StaticANIObject *ani = static_cast<StaticANIObject *>(obj);
 
-			ani->queueMessageQueue(0);
+			ani->queueMessageQueue(nullptr);
 
 			if (inter->_staticsId1)
 				ani->changeStatics2(inter->_staticsId1);
@@ -313,7 +313,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
 		obj->setPicAniInfo(aniInfo);
 
 		if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1
-				|| (inter->_staticsId2 != 0 && (subj->_statics == 0 || subj->_statics->_staticsId != inter->_staticsId2))) {
+				|| (inter->_staticsId2 != 0 && (subj->_statics == nullptr || subj->_statics->_staticsId != inter->_staticsId2))) {
 			mq = getSc2MctlCompoundBySceneId(g_nmi->_currentScene->_sceneId)->startMove(subj, xpos, ypos, 1, inter->_staticsId2);
 
 			if (!mq)
@@ -352,7 +352,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
 			return false;
 
 		if (ani->getMessageQueue())
-			ani->queueMessageQueue(0);
+			ani->queueMessageQueue(nullptr);
 
 		if (!ani->_statics || ani->_statics->_staticsId != inter->_staticsId1 || ani->_movement) {
 			mq = ani->changeStatics1(inter->_staticsId1);
@@ -414,7 +414,7 @@ Interaction *InteractionController::getInteractionByObjectIds(int obId, int obId
 			return intr;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 Interaction::Interaction() {
@@ -424,7 +424,7 @@ Interaction::Interaction() {
 	_objectId3 = 0;
 	_objectState2 = 0;
 	_objectState1 = 0;
-	_messageQueue = 0;
+	_messageQueue = nullptr;
 	_flags = 0;
 	_yOffs = 0;
 	_xOffs = 0;
@@ -523,13 +523,13 @@ bool Interaction::canInteract(GameObject *obj1, GameObject *obj2, int invId) {
 bool Interaction::isOverlapping(StaticANIObject *subj, GameObject *obj) {
 	if (abs(_xOffs + obj->_ox - subj->_ox) <= 1
 		&& abs(obj->_oy + _yOffs - subj->_oy) <= 1) {
-		if (!_staticsId2 || (subj->_statics != 0 && subj->_statics->_staticsId == _staticsId2)) {
+		if (!_staticsId2 || (subj->_statics != nullptr && subj->_statics->_staticsId == _staticsId2)) {
 			if (!_staticsId1 || !(_flags & 1))
 				return true;
 
 			if (obj->_objtype == kObjTypeStaticANIObject) {
 				const StaticANIObject *ani = static_cast<StaticANIObject *>(obj);
-				if (ani->_statics != 0 && ani->_statics->_staticsId == _staticsId1)
+				if (ani->_statics != nullptr && ani->_statics->_staticsId == _staticsId1)
 					return true;
 			}
 		}
diff --git a/engines/ngi/inventory.cpp b/engines/ngi/inventory.cpp
index 02dc77d59b..5971cef0b7 100644
--- a/engines/ngi/inventory.cpp
+++ b/engines/ngi/inventory.cpp
@@ -78,8 +78,8 @@ bool Inventory::setItemFlags(int itemId, int flags) {
 Inventory2::Inventory2() {
 	_selectedId = -1;
 	_field_48 = -1;
-	_scene = 0;
-	_picture = 0;
+	_scene = nullptr;
+	_picture = nullptr;
 	_isInventoryOut = false;
 	_isLocked = 0;
 	_topOffset = -65;
@@ -443,7 +443,7 @@ bool Inventory2::unselectItem(bool flag) {
 			_inventoryIcons[i].isSelected = false;
 	}
 
-	g_nmi->getGameLoaderInputController()->setCursorItemPicture(0);
+	g_nmi->getGameLoaderInputController()->setCursorItemPicture(nullptr);
 
 	return true;
 }
diff --git a/engines/ngi/lift.cpp b/engines/ngi/lift.cpp
index 37f168d484..602bab5a7b 100644
--- a/engines/ngi/lift.cpp
+++ b/engines/ngi/lift.cpp
@@ -173,7 +173,7 @@ void NGIEngine::lift_setButton(const char *name, int state) {
 }
 
 void NGIEngine::lift_init(Scene *sc, int enterSeq, int exitSeq) {
-	_lastLiftButton = 0;
+	_lastLiftButton = nullptr;
 
 	_liftEnterMQ = sc->getMessageQueueById(enterSeq);
 	if (!_liftEnterMQ)
@@ -279,13 +279,13 @@ void NGIEngine::lift_exitSeq(ExCommand *cmd) {
 
 	mq->addExCommandToEnd(ex);
 
-	mq->chain(0);
+	mq->chain(nullptr);
 }
 
 void NGIEngine::lift_closedoorSeq() {
 	if (_lift->_movement) {
 		if (_lift->_movement->_id == MV_LFT_CLOSE) {
-			_lift->queueMessageQueue(0);
+			_lift->queueMessageQueue(nullptr);
 		} else if (_lift->_movement->_id == MV_LFT_OPEN) {
 			int ph = _lift->_movement->_currDynamicPhaseIndex;
 
@@ -356,7 +356,7 @@ void NGIEngine::lift_walkAndGo() {
 		ex->_excFlags |= 3;
 		mq->addExCommandToEnd(ex);
 
-		mq->chain(0);
+		mq->chain(nullptr);
 
 		_aniMan->_flags |= 0x100;
 	}
@@ -365,7 +365,7 @@ void NGIEngine::lift_walkAndGo() {
 void NGIEngine::lift_openLift() {
 	if (_lift->_movement) {
 		if (_lift->_movement->_id == MV_LFT_OPEN) {
-			_lift->queueMessageQueue(0);
+			_lift->queueMessageQueue(nullptr);
 		} else if (_lift->_movement->_id == MV_LFT_CLOSE) {
 			int idx = _lift->_movement->_currDynamicPhaseIndex;
 
@@ -435,11 +435,11 @@ void NGIEngine::lift_goAnimation() {
 		}
 	}
 
-	lift_exitSeq(0);
+	lift_exitSeq(nullptr);
 
 	if (_lastLiftButton) {
 		_lastLiftButton->_statics = _lastLiftButton->getStaticsById(lift_getButtonIdN(_lastLiftButton->_statics->_staticsId));
-		_lastLiftButton = 0;
+		_lastLiftButton = nullptr;
 	}
 }
 
@@ -456,7 +456,7 @@ void NGIEngine::lift_animateButton(StaticANIObject *button) {
 				if (id)
 					_lastLiftButton->_statics = _lastLiftButton->getStaticsById(id);
 
-				_lastLiftButton = 0;
+				_lastLiftButton = nullptr;
 			}
 
 			if (_aniMan->isIdle() && !(_aniMan->_flags & 0x100)) {
@@ -483,14 +483,14 @@ void NGIEngine::lift_animateButton(StaticANIObject *button) {
 void NGIEngine::lift_startExitQueue() {
 	MessageQueue *mq = new MessageQueue(_liftExitMQ, 0, 0);
 
-	mq->chain(0);
+	mq->chain(nullptr);
 }
 
 void NGIEngine::lift_hoverButton(ExCommand *cmd) {
 	if (_lastLiftButton) {
 		if (!(cmd->_param & 2) || _liftX != cmd->_x || _liftY != cmd->_y) {
 			_lastLiftButton->_statics = _lastLiftButton->getStaticsById(lift_getButtonIdN(_lastLiftButton->_statics->_staticsId));
-			_lastLiftButton = 0;
+			_lastLiftButton = nullptr;
 		}
 	}
 }
diff --git a/engines/ngi/messagehandlers.cpp b/engines/ngi/messagehandlers.cpp
index 16608fa911..4d23d93748 100644
--- a/engines/ngi/messagehandlers.cpp
+++ b/engines/ngi/messagehandlers.cpp
@@ -221,7 +221,7 @@ int global_messageHandler1(ExCommand *cmd) {
 				if (!g_nmi->_currSelectedInventoryItemId && !g_nmi->_aniMan->_movement &&
 					!(g_nmi->_aniMan->_flags & 0x100) && g_nmi->_aniMan->isIdle()) {
 					int st = g_nmi->_aniMan->_statics->_staticsId;
-					ExCommand *newex = 0;
+					ExCommand *newex = nullptr;
 
 					if (st == ST_MAN_RIGHT) {
 						newex = new ExCommand(g_nmi->_aniMan->_id, 1, rMV_MAN_LOOKUP, 0, 0, 0, 1, 0, 0, 0);
@@ -308,7 +308,7 @@ int global_messageHandler2(ExCommand *cmd) {
 				ani->_callback2 = staticANIObjectCallback;
 			} else {
 				ani->setFlags40(false);
-				ani->_callback2 = 0; // Really NULL
+				ani->_callback2 = nullptr; // Really NULL
 			}
 		}
 		break;
@@ -524,7 +524,7 @@ int global_messageHandler3(ExCommand *cmd) {
 }
 
 int global_messageHandler4(ExCommand *cmd) {
-	StaticANIObject *ani = 0;
+	StaticANIObject *ani = nullptr;
 
 	switch (cmd->_messageKind) {
 	case 18: {
@@ -610,7 +610,7 @@ int global_messageHandler4(ExCommand *cmd) {
 		if (!ani)
 			break;
 
-		ani->queueMessageQueue(0);
+		ani->queueMessageQueue(nullptr);
 		ani->playIdle();
 		break;
 	case 9:
@@ -665,7 +665,7 @@ int global_messageHandler4(ExCommand *cmd) {
 		break;
 
 	case 27:
-		if (!g_nmi->_currentScene || g_nmi->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_param) == 0) {
+		if (!g_nmi->_currentScene || g_nmi->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_param) == nullptr) {
 			ani = g_nmi->accessScene(cmd->_invId)->getStaticANIObject1ById(cmd->_parentId, -1);
 			if (ani) {
 				ani = new StaticANIObject(ani);
@@ -769,7 +769,7 @@ int MovGraph::messageHandler(ExCommand *cmd) {
 
 	MovGraph *gr = getSc2MovGraphBySceneId(g_nmi->_currentScene->_sceneId);
 
-	MovGraphLink *link = 0;
+	MovGraphLink *link = nullptr;
 	double mindistance = 1.0e10;
 	Common::Point point;
 
diff --git a/engines/ngi/messages.cpp b/engines/ngi/messages.cpp
index b0dfbdbb1b..a752e8cc86 100644
--- a/engines/ngi/messages.cpp
+++ b/engines/ngi/messages.cpp
@@ -250,7 +250,7 @@ ObjstateCommand *ObjstateCommand::createClone() {
 }
 
 MessageQueue::MessageQueue() {
-	_field_14 = 0;
+	_field_14 = nullptr;
 	_parId = 0;
 	_dataId = 0;
 	_id = 0;
@@ -262,7 +262,7 @@ MessageQueue::MessageQueue() {
 }
 
 MessageQueue::MessageQueue(int dataId) {
-	_field_14 = 0;
+	_field_14 = nullptr;
 	_parId = 0;
 	_dataId = dataId;
 	_id = g_nmi->_globalMessageQueueList->compact();
@@ -337,7 +337,7 @@ bool MessageQueue::load(MfcArchive &file) {
 	}
 
 	_id = -1;
-	_field_14 = 0;
+	_field_14 = nullptr;
 	_parId = 0;
 	_isFinished = 0;
 
@@ -405,7 +405,7 @@ void MessageQueue::insertExCommandAt(int pos, ExCommand *ex) {
 
 ExCommand *MessageQueue::getExCommandByIndex(uint idx) {
 	if (idx >= getCount())
-		return 0;
+		return nullptr;
 
 	Common::List<ExCommand *>::iterator it = _exCommands.begin();
 
@@ -581,7 +581,7 @@ int MessageQueue::calcDuration(StaticANIObject *obj) {
 		ex = getExCommandByIndex(i);
 		if (ex->_parentId == obj->_id) {
 			if (ex->_messageKind == 1 || ex->_messageKind == 20) {
-				if ((mov = obj->getMovementById(ex->_messageNum)) != 0) {
+				if ((mov = obj->getMovementById(ex->_messageNum)) != nullptr) {
 					if (ex->_z >= 1)
 						res += ex->_z;
 					else
@@ -629,7 +629,7 @@ MessageQueue *GlobalMessageQueueList::getMessageQueueById(int id) {
 			return *s;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void GlobalMessageQueueList::deleteQueueById(int id) {
@@ -727,7 +727,7 @@ void clearMessages() {
 bool removeMessageHandler(int16 id, int pos) {
 	if (g_nmi->_messageHandlers) {
 		MessageHandler *curItem = g_nmi->_messageHandlers;
-		MessageHandler *prevItem = 0;
+		MessageHandler *prevItem = nullptr;
 		int curPos = 0;
 
 		while (id != curItem->id) {
@@ -781,13 +781,13 @@ MessageHandler *getMessageHandlerById(int16 id) {
 	MessageHandler *curItem = g_nmi->_messageHandlers;
 
 	if (!curItem)
-		return 0;
+		return nullptr;
 
 	while (id != curItem->id) {
 		curItem = curItem->nextItem;
 
 		if (!curItem)
-			return 0;
+			return nullptr;
 	}
 
 	return curItem;
@@ -803,7 +803,7 @@ bool allocMessageHandler(MessageHandler *where, int16 id, int (*callback)(ExComm
 		msg->callback = callback;
 		msg->index = index;
 	} else {
-		msg->nextItem = 0;
+		msg->nextItem = nullptr;
 		msg->id = id;
 		msg->callback = callback;
 		msg->index = 0;
@@ -890,7 +890,7 @@ void clearMessageHandlers() {
 			curItem = nextItem;
 		} while (nextItem);
 
-		g_nmi->_messageHandlers = 0;
+		g_nmi->_messageHandlers = nullptr;
 	}
 }
 
diff --git a/engines/ngi/modal.cpp b/engines/ngi/modal.cpp
index 478bd888d3..3953a545bc 100644
--- a/engines/ngi/modal.cpp
+++ b/engines/ngi/modal.cpp
@@ -422,10 +422,10 @@ finish:
 }
 
 ModalMap::ModalMap() {
-	_mapScene = 0;
-	_pic = NULL;
-	_picI03 = NULL;
-	_highlightedPic = NULL;
+	_mapScene = nullptr;
+	_pic = nullptr;
+	_picI03 = nullptr;
+	_highlightedPic = nullptr;
 	_isRunning = false;
 	_rect1 = g_nmi->_sceneRect;
 	_x = g_nmi->_currentScene->_x;
@@ -879,7 +879,7 @@ PictureObject *ModalMap::getScenePicture(int sceneId) {
 
 PictureObject *ModalMap::getSceneHPicture(PictureObject *obj) {
 	if (!obj)
-		return NULL;
+		return nullptr;
 
 	switch (obj->_id) {
 	case PIC_MAP_S01:
@@ -960,7 +960,7 @@ PictureObject *ModalMap::getSceneHPicture(PictureObject *obj) {
 	case PIC_MAP_S38:
 		return _mapScene->getPictureObjectById(PIC_MAP_H38, 0);
 	default:
-		return NULL;
+		return nullptr;
 	}
 }
 
@@ -1241,7 +1241,7 @@ void ModalCredits::update() {
 }
 
 ModalMainMenu::ModalMainMenu() {
-	_lastArea = 0;
+	_lastArea = nullptr;
 	_hoverAreaId = 0;
 	_mfield_34 = 0;
 	_scene = g_nmi->accessScene(SC_MAINMENU);
@@ -1270,14 +1270,14 @@ ModalMainMenu::ModalMainMenu() {
 	_areas.push_back(MenuArea());
 	area = &_areas.back();
 	area->picIdL = PIC_MNU_EXIT_L;
-	area->picObjD = 0;
+	area->picObjD = nullptr;
 	area->picObjL = _scene->getPictureObjectById(area->picIdL, 0);
 	area->picObjL->_flags &= 0xFFFB;
 
 	_areas.push_back(MenuArea());
 	area = &_areas.back();
 	area->picIdL = PIC_MNU_CONTINUE_L;
-	area->picObjD = 0;
+	area->picObjD = nullptr;
 	area->picObjL = _scene->getPictureObjectById(area->picIdL, 0);
 	area->picObjL->_flags &= 0xFFFB;
 
@@ -1285,7 +1285,7 @@ ModalMainMenu::ModalMainMenu() {
 		_areas.push_back(MenuArea());
 		area = &_areas.back();
 		area->picIdL = PIC_MNU_SAVE_L;
-		area->picObjD = 0;
+		area->picObjD = nullptr;
 		area->picObjL = _scene->getPictureObjectById(area->picIdL, 0);
 		area->picObjL->_flags &= 0xFFFB;
 	}
@@ -1293,21 +1293,21 @@ ModalMainMenu::ModalMainMenu() {
 	_areas.push_back(MenuArea());
 	area = &_areas.back();
 	area->picIdL = PIC_MNU_LOAD_L;
-	area->picObjD = 0;
+	area->picObjD = nullptr;
 	area->picObjL = _scene->getPictureObjectById(area->picIdL, 0);
 	area->picObjL->_flags &= 0xFFFB;
 
 	_areas.push_back(MenuArea());
 	area = &_areas.back();
 	area->picIdL = PIC_MNU_RESTART_L;
-	area->picObjD = 0;
+	area->picObjD = nullptr;
 	area->picObjL = _scene->getPictureObjectById(area->picIdL, 0);
 	area->picObjL->_flags &= 0xFFFB;
 
 	_areas.push_back(MenuArea());
 	area = &_areas.back();
 	area->picIdL = PIC_MNU_AUTHORS_L;
-	area->picObjD = 0;
+	area->picObjD = nullptr;
 	area->picObjL = _scene->getPictureObjectById(area->picIdL, 0);
 	area->picObjL->_flags &= 0xFFFB;
 
@@ -1379,7 +1379,7 @@ bool ModalMainMenu::handleMessage(ExCommand *message) {
 
 	if (message->_messageNum == 30) {
 		if (_lastArea)
-			_lastArea = 0;
+			_lastArea = nullptr;
 
 		return false;
 	}
@@ -1717,7 +1717,7 @@ void ModalMainMenu::enableDebugMenuButton() {
 	_areas.push_back(MenuArea());
 	MenuArea *area = &_areas.back();
 	area->picIdL = PIC_MNU_DEBUG_L;
-	area->picObjD = 0;
+	area->picObjD = nullptr;
 	area->picObjL = _scene->getPictureObjectById(area->picIdL, 0);
 	area->picObjL->_flags &= 0xFFFB;
 
@@ -1753,8 +1753,8 @@ void ModalMainMenu::setSliderPos() {
 }
 
 ModalHelp::ModalHelp() {
-	_mainMenuScene = 0;
-	_bg = 0;
+	_mainMenuScene = nullptr;
+	_bg = nullptr;
 	_isRunning = false;
 	_rect = g_nmi->_sceneRect;
 	_hx = g_nmi->_currentScene->_x;
@@ -1817,10 +1817,10 @@ void ModalHelp::launch() {
 }
 
 ModalQuery::ModalQuery() {
-	_bgScene = 0;
-	_bg = 0;
-	_okBtn = 0;
-	_cancelBtn = 0;
+	_bgScene = nullptr;
+	_bg = nullptr;
+	_okBtn = nullptr;
+	_cancelBtn = nullptr;
 	_queryResult = -1;
 }
 
@@ -1976,19 +1976,19 @@ ModalSaveGame::ModalSaveGame() {
 	_oldBgX = 0;
 	_oldBgY = 0;
 
-	_bgr = 0;
-	_okD = 0;
-	_okL = 0;
-	_cancelD = 0;
-	_cancelL = 0;
-	_emptyD = 0;
-	_emptyL = 0;
-	_fullD = 0;
-	_fullL = 0;
-	_menuScene = 0;
+	_bgr = nullptr;
+	_okD = nullptr;
+	_okL = nullptr;
+	_cancelD = nullptr;
+	_cancelL = nullptr;
+	_emptyD = nullptr;
+	_emptyL = nullptr;
+	_fullD = nullptr;
+	_fullL = nullptr;
+	_menuScene = nullptr;
 	_queryRes = -1;
 	_rect = g_nmi->_sceneRect;
-	_queryDlg = 0;
+	_queryDlg = nullptr;
 	_mode = 1;
 
 	_objtype = kObjTypeModalSaveGame;
@@ -2015,7 +2015,7 @@ bool ModalSaveGame::init(int counterdiff) {
 				_queryRes = -1;
 
 			delete _queryDlg;
-			_queryDlg = 0;
+			_queryDlg = nullptr;
 		}
 
 		return true;
@@ -2136,7 +2136,7 @@ void ModalSaveGame::setup(Scene *sc, int mode) {
 
 char *ModalSaveGame::getSaveName() {
 	if (_queryRes < 0)
-		return 0;
+		return nullptr;
 
 	return _files[_queryRes - 1].filename;
 }
@@ -2267,7 +2267,7 @@ void ModalSaveGame::processMouse(int x, int y) {
 				if (!_files[i].empty) {
 					_queryDlg = new ModalQuery;
 
-					_queryDlg->create(_menuScene, 0, PIC_MOV_BGR);
+					_queryDlg->create(_menuScene, nullptr, PIC_MOV_BGR);
 				}
 			}
 
@@ -2300,7 +2300,7 @@ void ModalSaveGame::saveload() {
 			if (_parentObj) {
 				delete _parentObj;
 
-				_parentObj = 0;
+				_parentObj = nullptr;
 			}
 
 			g_nmi->stopAllSoundStreams();
@@ -2312,9 +2312,9 @@ void ModalSaveGame::saveload() {
 }
 
 ModalDemo::ModalDemo() {
-	_bg = 0;
-	_button = 0;
-	_text = 0;
+	_bg = nullptr;
+	_button = nullptr;
+	_text = nullptr;
 
 	if (g_nmi->getLanguage() == Common::RU_RUS) {
 		_clickedQuit = 0;
@@ -2323,7 +2323,7 @@ ModalDemo::ModalDemo() {
 		_clickedQuit = -1;
 		_countdown = 1000;
 	}
-	_scene = 0;
+	_scene = nullptr;
 }
 
 ModalDemo::~ModalDemo() {
@@ -2489,7 +2489,7 @@ void NGIEngine::openMainMenu() {
 
 		Scene *sc = accessScene(SC_MAINMENU);
 
-		q->create(sc, 0, 0);
+		q->create(sc, nullptr, 0);
 
 		g_nmi->_modalObject = q;
 
diff --git a/engines/ngi/motion.cpp b/engines/ngi/motion.cpp
index 432ef2cc2a..a2ab1a6f0e 100644
--- a/engines/ngi/motion.cpp
+++ b/engines/ngi/motion.cpp
@@ -102,7 +102,7 @@ MovGraphLink *MotionController::getLinkByName(const char *name) {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 MctlCompound::~MctlCompound() {
@@ -197,7 +197,7 @@ MessageQueue *MctlCompound::startMove(StaticANIObject *ani, int sourceX, int sou
 	debugC(4, kDebugPathfinding, "MctlCompound::startMove(*%d, %d, %d, %d, %d)", (ani ? ani->_id : -1), sourceX, sourceY, fuzzyMatch, staticsId);
 
 	if (!ani)
-		return 0;
+		return nullptr;
 
 	for (uint i = 0; i < _motionControllers.size(); i++) {
 		if (_motionControllers[i]->_movGraphReactObj) {
@@ -218,10 +218,10 @@ MessageQueue *MctlCompound::startMove(StaticANIObject *ani, int sourceX, int sou
 	}
 
 	if (idx == -1)
-		return 0;
+		return nullptr;
 
 	if (sourceIdx == -1)
-		return 0;
+		return nullptr;
 
 	debugC(1, kDebugPathfinding, "WWW 2");
 	if (idx == sourceIdx)
@@ -231,12 +231,12 @@ MessageQueue *MctlCompound::startMove(StaticANIObject *ani, int sourceX, int sou
 	MctlConnectionPoint *cp = findClosestConnectionPoint(ani->_ox, ani->_oy, idx, sourceX, sourceY, sourceIdx, &dist);
 
 	if (!cp)
-		return 0;
+		return nullptr;
 
 	MessageQueue *mq = _motionControllers[idx]->_motionControllerObj->makeQueue(ani, cp->_connectionX, cp->_connectionY, 1, cp->_mctlmirror);
 
 	if (!mq)
-		return 0;
+		return nullptr;
 
 	for (uint i = 0; i < cp->_messageQueueObj->getCount(); i++) {
 		ExCommand *ex = new ExCommand(cp->_messageQueueObj->getExCommandByIndex(i));
@@ -256,7 +256,7 @@ MessageQueue *MctlCompound::startMove(StaticANIObject *ani, int sourceX, int sou
 
 	if (!mq->chain(ani)) {
 		delete mq;
-		return 0;
+		return nullptr;
 	}
 
 	return mq;
@@ -269,7 +269,7 @@ MessageQueue *MctlCompound::makeQueue(StaticANIObject *subj, int xpos, int ypos,
 	debugC(1, kDebugPathfinding, "MctlCompound::makeQueue(*%d, %d, %d, %d, %d)", (subj ? subj->_id : -1), xpos, ypos, fuzzyMatch, staticsId);
 
 	if (!subj)
-		return 0;
+		return nullptr;
 
 	for (uint i = 0; i < _motionControllers.size(); i++) {
 		if (_motionControllers[i]->_movGraphReactObj) {
@@ -281,7 +281,7 @@ MessageQueue *MctlCompound::makeQueue(StaticANIObject *subj, int xpos, int ypos,
 	}
 
 	if (match1 == -1)
-		return 0;
+		return nullptr;
 
 	for (uint i = 0; i < _motionControllers.size(); i++) {
 		if (_motionControllers[i]->_movGraphReactObj) {
@@ -293,7 +293,7 @@ MessageQueue *MctlCompound::makeQueue(StaticANIObject *subj, int xpos, int ypos,
 	}
 
 	if (match2 == -1)
-		return 0;
+		return nullptr;
 
 	if (match1 == match2)
 		return _motionControllers[match1]->_motionControllerObj->makeQueue(subj, xpos, ypos, fuzzyMatch, staticsId);
@@ -302,7 +302,7 @@ MessageQueue *MctlCompound::makeQueue(StaticANIObject *subj, int xpos, int ypos,
 	MctlConnectionPoint *closestP = findClosestConnectionPoint(subj->_ox, subj->_oy, match1, xpos, ypos, match2, &dist);
 
 	if (!closestP)
-		return 0;
+		return nullptr;
 
 	MessageQueue *mq = _motionControllers[match1]->_motionControllerObj->makeQueue(subj, closestP->_connectionX, closestP->_connectionY, 1, closestP->_mctlmirror);
 
@@ -453,7 +453,7 @@ MessageQueue *MctlLadder::startMove(StaticANIObject *subj, int xpos, int ypos, i
 			return mq;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 MessageQueue *MctlLadder::makeQueue(StaticANIObject *ani, int xpos, int ypos, int fuzzyMatch, int staticsId) {
@@ -462,7 +462,7 @@ MessageQueue *MctlLadder::makeQueue(StaticANIObject *ani, int xpos, int ypos, in
 	int pos = findObjectPos(ani);
 
 	if (pos < 0)
-		return 0;
+		return nullptr;
 
 	double dh = _height;
 	double corr = (double)(ani->_oy - _ladderY) / dh;
@@ -475,7 +475,7 @@ MessageQueue *MctlLadder::makeQueue(StaticANIObject *ani, int xpos, int ypos, in
 	int normy = _ladderY + dl2 * _height;
 
 	if (dl == dl2 || dl2 < 0)
-		return 0;
+		return nullptr;
 
 	int direction = (normy - ani->_oy) < 0 ? 0 : 1;
 
@@ -493,7 +493,7 @@ MessageQueue *MctlLadder::makeQueue(StaticANIObject *ani, int xpos, int ypos, in
 
 		point = ani->_movement->calcSomeXY(1, ani->_someDynamicPhaseIndex);
 		ani->_statics = ani->_movement->_staticsObj2;
-		ani->_movement = 0;
+		ani->_movement = nullptr;
 		ani->setOXY(point.x + ox, point.y + oy);
 
 		mq = makeQueue(ani, normx, normy, fuzzyMatch, staticsId);
@@ -571,10 +571,10 @@ MessageQueue *MctlLadder::makeQueue(StaticANIObject *ani, int xpos, int ypos, in
 	}
 
 	if (ani->_statics->_staticsId != _ladmovements[pos]->staticIds[3]) {
-		mq = _aniHandler.makeQueue(ani, _ladmovements[pos]->staticIds[0], 0, 0, 0);
+		mq = _aniHandler.makeQueue(ani, _ladmovements[pos]->staticIds[0], 0, nullptr, nullptr);
 
 		if (!mq)
-			return 0;
+			return nullptr;
 
 		int nx = ani->_ox;
 		int ny = ani->_oy;
@@ -587,7 +587,7 @@ MessageQueue *MctlLadder::makeQueue(StaticANIObject *ani, int xpos, int ypos, in
 		ani->getPicAniInfo(picinfo);
 
 		ani->_statics = ani->getStaticsById(_ladmovements[pos]->staticIds[0]);
-		ani->_movement = 0;
+		ani->_movement = nullptr;
 		ani->setOXY(nx, ny);
 
 		MessageQueue *newmq = makeQueue(ani, normx, normy, fuzzyMatch, staticsId);
@@ -661,12 +661,12 @@ MctlConnectionPoint *MctlCompound::findClosestConnectionPoint(int ox, int oy, in
 	if (destIndex == sourceIdx) {
 		*minDistancePtr = sqrt((double)((oy - connectionY) * (oy - connectionY) + (ox - connectionX) * (ox - connectionX)));
 
-		return 0;
+		return nullptr;
 	}
 
 	double currDistance = 0.0;
 	double minDistance = 1.0e10;
-	MctlConnectionPoint *minConnectionPoint = 0;
+	MctlConnectionPoint *minConnectionPoint = nullptr;
 
 	for (uint i = 0; i < _motionControllers[sourceIdx]->_connectionPoints.size(); i++) {
 		for (uint j = 0; j < _motionControllers.size(); j++) {
@@ -736,9 +736,9 @@ MctlItem::~MctlItem() {
 }
 
 MovGraphItem::MovGraphItem() {
-	ani = 0;
+	ani = nullptr;
 	field_4 = 0;
-	mi_movitems = 0;
+	mi_movitems = nullptr;
 	count = 0;
 	field_30 = 0;
 	field_34 = 0;
@@ -757,7 +757,7 @@ void MovGraphItem::free() {
 
 	delete mi_movitems;
 
-	mi_movitems = 0;
+	mi_movitems = nullptr;
 }
 
 MovArr *movGraphCallback(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter) {
@@ -843,7 +843,7 @@ Common::Array<MovItem *> *MovGraph::getPaths(StaticANIObject *ani, int x, int y,
 	*rescount = 0;
 
 	if (_items.size() <= 0)
-		return 0;
+		return nullptr;
 
 	uint idx = 0;
 
@@ -851,7 +851,7 @@ Common::Array<MovItem *> *MovGraph::getPaths(StaticANIObject *ani, int x, int y,
 		idx++;
 
 		if (idx >= _items.size())
-			return 0;
+			return nullptr;
 	}
 	_items[idx].free();
 
@@ -870,7 +870,7 @@ Common::Array<MovItem *> *MovGraph::getPaths(StaticANIObject *ani, int x, int y,
 	_items[idx].count = 0;
 
 	delete _items[idx].mi_movitems;
-	_items[idx].mi_movitems = 0;
+	_items[idx].mi_movitems = nullptr;
 
 	int arrSize;
 	Common::Array<MovArr *> *movarr = getHitPoints(x, y, &arrSize, flag1, 0);
@@ -898,7 +898,7 @@ Common::Array<MovItem *> *MovGraph::getPaths(StaticANIObject *ani, int x, int y,
 		return _items[idx].mi_movitems;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 bool MovGraph::setPosImmediate(StaticANIObject *obj, int x, int y) {
@@ -911,25 +911,25 @@ MessageQueue *MovGraph::startMove(StaticANIObject *ani, int xpos, int ypos, int
 
 	if (!ani) {
 		if (!_items.size())
-			return 0;
+			return nullptr;
 
 		ani = _items[0].ani;
 	}
 
 	if (ABS(ani->_ox - xpos) < 50 && ABS(ani->_oy - ypos) < 50)
-		return 0;
+		return nullptr;
 
 	if (!ani->isIdle())
-		return 0;
+		return nullptr;
 
 	if (ani->_flags & 0x100)
-		return 0;
+		return nullptr;
 
 	int count;
 	Common::Array<MovItem *> *movitems = getPaths(ani, xpos, ypos, fuzzyMatch, &count);
 
 	if (!movitems)
-		return 0;
+		return nullptr;
 
 	if (ani->_movement) {
 		Common::Point point;
@@ -939,7 +939,7 @@ MessageQueue *MovGraph::startMove(StaticANIObject *ani, int xpos, int ypos, int
 		MessageQueue *mq = sub1(ani, ani->_ox - point.x, ani->_oy - point.y, ani->_movement->_staticsObj1->_staticsId, xpos, ypos, 0, fuzzyMatch);
 
 		if (!mq || !mq->getExCommandByIndex(0))
-			return 0;
+			return nullptr;
 
 		ExCommand *ex = mq->getExCommandByIndex(0);
 
@@ -960,12 +960,12 @@ MessageQueue *MovGraph::startMove(StaticANIObject *ani, int xpos, int ypos, int
 			ex->_invId = fuzzyMatch;
 			mq->addExCommandToEnd(ex);
 
-			if (mq->chain(0))
+			if (mq->chain(nullptr))
 				return mq;
 
 			delete mq;
 
-			return 0;
+			return nullptr;
 		}
 
 		int count2;
@@ -1073,7 +1073,7 @@ MessageQueue *MovGraph::makeQueue(StaticANIObject *subj, int xpos, int ypos, int
 					MessageQueue *mq = sub1(subj, subj->_ox - point.x, subj->_oy - point.y, subj->_movement->_staticsObj1->_staticsId, xpos, ypos, 0, fuzzyMatch);
 
 					if (!mq || !mq->getExCommandByIndex(0))
-						return 0;
+						return nullptr;
 
 					ExCommand *ex = mq->getExCommandByIndex(0);
 
@@ -1099,7 +1099,7 @@ MessageQueue *MovGraph::makeQueue(StaticANIObject *subj, int xpos, int ypos, int
 
 				if (arridx >= _items[idx].count) {
 					subj->setPicAniInfo(picAniInfo);
-					return 0;
+					return nullptr;
 				}
 			}
 
@@ -1107,7 +1107,7 @@ MessageQueue *MovGraph::makeQueue(StaticANIObject *subj, int xpos, int ypos, int
 			_items[idx].movarr = *(*_items[idx].mi_movitems)[arridx]->movarr;
 			_items[idx].movarr._movSteps = (*_items[idx].mi_movitems)[arridx]->movarr->_movSteps;
 			_items[idx].movarr._afield_8 = -1;
-			_items[idx].movarr._link = 0;
+			_items[idx].movarr._link = nullptr;
 
 			MessageQueue *mq = makeWholeQueue(_items[idx].ani, &_items[idx].movarr, staticsId);
 			if (mq) {
@@ -1126,7 +1126,7 @@ MessageQueue *MovGraph::makeQueue(StaticANIObject *subj, int xpos, int ypos, int
 
 	subj->setPicAniInfo(picAniInfo);
 
-	return 0;
+	return nullptr;
 }
 
 MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x1, int y1, int stid2, int flag1) {
@@ -1137,7 +1137,7 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x
 	ani->getPicAniInfo(picinfo);
 
 	ani->_statics = ani->getStaticsById(stid);
-	ani->_movement = 0;
+	ani->_movement = nullptr;
 	ani->setOXY(x, y);
 
 	int rescount;
@@ -1147,10 +1147,10 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x
 	if (!movitems) {
 		ani->setPicAniInfo(picinfo);
 
-		return 0;
+		return nullptr;
 	}
 
-	MessageQueue *res = 0;
+	MessageQueue *res = nullptr;
 
 	MovArr *goal = _callback1(ani, movitems, rescount);
 	int idx = getObjectIndex(ani);
@@ -1164,7 +1164,7 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x
 			_items[idx].movarr = *(*movgitem.mi_movitems)[nidx]->movarr;
 			_items[idx].movarr._movSteps = (*movgitem.mi_movitems)[nidx]->movarr->_movSteps;
 			_items[idx].movarr._afield_8 = -1;
-			_items[idx].movarr._link = 0;
+			_items[idx].movarr._link = nullptr;
 
 			res = makeWholeQueue(_items[idx].ani, &_items[idx].movarr, stid2);
 
@@ -1181,9 +1181,9 @@ MessageQueue *MovGraph::makeWholeQueue(StaticANIObject *ani, MovArr *movarr, int
 	debugC(4, kDebugPathfinding, "MovGraph::makeWholeQueue(*%d, *, %d)", (ani ? ani->_id : -1), staticsId);
 
 	if (!movarr->_movStepCount)
-		return 0;
+		return nullptr;
 
-	MessageQueue *mq = 0;
+	MessageQueue *mq = nullptr;
 	int ox = ani->_ox;
 	int oy = ani->_oy;
 	int id1 = 0;
@@ -1269,7 +1269,7 @@ MessageQueue *MovGraph::method50(StaticANIObject *ani, MovArr *movarr, int stati
 	debugC(4, kDebugPathfinding, "MovGraph::method50(*%d, *, %d)", (ani ? ani->_id : -1), staticsId);
 
 	if (_items.size() == 0)
-		return 0;
+		return nullptr;
 
 	uint idx;
 	int movidx = 0;
@@ -1277,14 +1277,14 @@ MessageQueue *MovGraph::method50(StaticANIObject *ani, MovArr *movarr, int stati
 
 	for (idx = 0; idx <= _items.size() && !done; idx++) {
 		if (idx == _items.size())
-			return 0;
+			return nullptr;
 
 		if (_items[idx].ani == ani) {
 			if (!_items[idx].mi_movitems)
-				return 0;
+				return nullptr;
 
 			if (_items[idx].count < 1)
-				return 0;
+				return nullptr;
 
 			for (movidx = 0; movidx < _items[idx].count; movidx++) {
 				if ((*_items[idx].mi_movitems)[movidx]->movarr == movarr) {
@@ -1300,12 +1300,12 @@ MessageQueue *MovGraph::method50(StaticANIObject *ani, MovArr *movarr, int stati
 	_items[idx].movarr = *(*_items[idx].mi_movitems)[movidx]->movarr;
 	_items[idx].movarr._movSteps = (*_items[idx].mi_movitems)[movidx]->movarr->_movSteps;
 	_items[idx].movarr._afield_8 = -1;
-	_items[idx].movarr._link = 0;
+	_items[idx].movarr._link = nullptr;
 
 	MessageQueue *mq = makeWholeQueue(_items[idx].ani, &_items[idx].movarr, 0);
 
 	if (!mq)
-		return 0;
+		return nullptr;
 
 	ExCommand *ex = new ExCommand();
 
@@ -1318,7 +1318,7 @@ MessageQueue *MovGraph::method50(StaticANIObject *ani, MovArr *movarr, int stati
 	if (!mq->chain(ani)) {
 		delete mq;
 
-		return 0;
+		return nullptr;
 	}
 
 	return mq;
@@ -1377,7 +1377,7 @@ void MovGraph::recalcLinkParams() {
 bool MovGraph::getNearestPoint(int unusedArg, Common::Point *p, MovArr *movarr) {
 	debugC(4, kDebugPathfinding, "MovGraph::getNearestPoint(...)");
 
-	MovGraphLink *link = 0;
+	MovGraphLink *link = nullptr;
 	double mindist = 1.0e20;
 	int resx = 0, resy = 0;
 
@@ -1445,7 +1445,7 @@ Common::Array<MovArr *> *MovGraph::getHitPoints(int x, int y, int *arrSize, int
 	if (!_links.size()) {
 		*arrSize = 0;
 
-		return 0;
+		return nullptr;
 	}
 
 	Common::Array<MovArr *> *arr = new Common::Array<MovArr *>;
@@ -1555,7 +1555,7 @@ Common::Array<MovItem *> *MovGraph::getPaths(MovArr *currPos, MovArr *destPos, i
 	*pathCount = 0;
 
 	if (!allPaths.size())
-		return 0;
+		return nullptr;
 
 	*pathCount = allPaths.size();
 
@@ -1598,7 +1598,7 @@ bool MovGraph::getHitPoint(int idx, int x, int y, MovArr *arr, int a6) {
 	Common::Array<MovArr *> *movarr = getHitPoints(x, y, &arrSize, 0, 1);
 
 	if (!movarr)
-		return getNearestPoint(idx, 0, arr);
+		return getNearestPoint(idx, nullptr, arr);
 
 	bool res = false;
 
@@ -1717,7 +1717,7 @@ bool MctlGraph::fillData(StaticANIObject *obj, MctlAni &item) {
 	if (!var)
 		return false;
 
-	GameVar *varD = 0;
+	GameVar *varD = nullptr;
 	Common::Point point;
 
 	for (int dir = 0; dir < 4; dir++) {
@@ -1886,7 +1886,7 @@ void MctlGraph::generateList(MctlMQ &movinfo, MovGraphLinkList *linkList, LinkIn
 			if (linkList->size() == 1)
 				idx1 = getDirBySize((*linkList)[0], movinfo.pt2.x - movinfo.pt1.x, movinfo.pt2.y - movinfo.pt1.y);
 			else
-				idx1 = getDirBySize(0, movinfo.pt2.x - movinfo.pt1.x, movinfo.pt2.y - movinfo.pt1.y);
+				idx1 = getDirBySize(nullptr, movinfo.pt2.x - movinfo.pt1.x, movinfo.pt2.y - movinfo.pt1.y);
 
 			point.y = -1;
 			rect.bottom = -1;
@@ -1912,7 +1912,7 @@ void MctlGraph::generateList(MctlMQ &movinfo, MovGraphLinkList *linkList, LinkIn
 		if (i != linkList->size() - 1) {
 			for (;;) {
 				i++;
-				if (getLinkDir(linkList, i, &rect, 0) != prevSubIndex) {
+				if (getLinkDir(linkList, i, &rect, nullptr) != prevSubIndex) {
 					i--;
 					getLinkDir(linkList, i, &rect, &point);
 
@@ -2072,7 +2072,7 @@ MessageQueue *MctlGraph::makeWholeQueue(MctlMQ &mctlMQ) {
 
 			if (!mq2) {
 				delete mq;
-				return 0;
+				return nullptr;
 			}
 
 			mq->mergeQueue(mq2);
@@ -2106,16 +2106,16 @@ MessageQueue *MctlGraph::startMove(StaticANIObject *ani, int xpos, int ypos, int
 	debugC(4, kDebugPathfinding, "MctlGraph::startMove(*%d, %d, %d, %d, %d)", ani->_id, xpos, ypos, fuzzyMatch, staticsId);
 
 	if (!ani->isIdle())
-		return 0;
+		return nullptr;
 
 	if (ani->_flags & 0x100)
-		return 0;
+		return nullptr;
 
 	debugC(1, kDebugPathfinding, "WWW 3");
 	MessageQueue *mq = makeQueue(ani, xpos, ypos, fuzzyMatch, staticsId);
 
 	if (!mq)
-		return 0;
+		return nullptr;
 
 	if (ani->_movement) {
 		if (mq->getCount() <= 1 || mq->getExCommandByIndex(0)->_messageKind != 22) {
@@ -2133,14 +2133,14 @@ MessageQueue *MctlGraph::startMove(StaticANIObject *ani, int xpos, int ypos, int
 				mq = mq1;
 			}
 		} else {
-			ani->_movement = 0;
+			ani->_movement = nullptr;
 		}
 	}
 
 	if (!mq->chain(ani)) {
 		delete mq;
 
-		return 0;
+		return nullptr;
 	}
 
 	return mq;
@@ -2158,13 +2158,13 @@ MessageQueue *MctlGraph::makeQueue(StaticANIObject *obj, int xpos, int ypos, int
 	int idx = getObjIndex(obj->_id);
 
 	if (idx < 0)
-		return 0;
+		return nullptr;
 
-	linkInfoSource.link = 0;
-	linkInfoSource.node = 0;
+	linkInfoSource.link = nullptr;
+	linkInfoSource.node = nullptr;
 
-	linkInfoDest.link = 0;
-	linkInfoDest.node = 0;
+	linkInfoDest.link = nullptr;
+	linkInfoDest.node = nullptr;
 
 	point.x = 0;
 
@@ -2185,7 +2185,7 @@ MessageQueue *MctlGraph::makeQueue(StaticANIObject *obj, int xpos, int ypos, int
 		subMgm = true;
 
 		if (idxsub == -1)
-			return 0;
+			return nullptr;
 	}
 
 	if (obj->_movement) {
@@ -2209,7 +2209,7 @@ MessageQueue *MctlGraph::makeQueue(StaticANIObject *obj, int xpos, int ypos, int
 			}
 		}
 
-		obj->_movement = 0;
+		obj->_movement = nullptr;
 		obj->setOXY(newx, newy);
 	}
 
@@ -2223,7 +2223,7 @@ MessageQueue *MctlGraph::makeQueue(StaticANIObject *obj, int xpos, int ypos, int
 
 				delete mq;
 
-				return 0;
+				return nullptr;
 			}
 
 			ExCommand *ex = new ExCommand(picAniInfo.objectId, 1, _items2[idx]._subItems[idxsub]._turnS[idxwalk]._movementId, 0, 0, 0, 1, 0, 0, 0);
@@ -2264,7 +2264,7 @@ MessageQueue *MctlGraph::makeQueue(StaticANIObject *obj, int xpos, int ypos, int
 			if (!linkInfoSource.link) {
 				obj->setPicAniInfo(picAniInfo);
 
-				return 0;
+				return nullptr;
 			}
 		}
 	}
@@ -2277,7 +2277,7 @@ MessageQueue *MctlGraph::makeQueue(StaticANIObject *obj, int xpos, int ypos, int
 		if (!linkInfoDest.link) {
 			obj->setPicAniInfo(picAniInfo);
 
-			return 0;
+			return nullptr;
 		}
 	}
 
@@ -2287,7 +2287,7 @@ MessageQueue *MctlGraph::makeQueue(StaticANIObject *obj, int xpos, int ypos, int
 	debugC(0, kDebugPathfinding, "MctlGraph::makeQueue(): path: %g  parts: %d", minPath, tempLinkList.size());
 
 	if (minPath < 0.0 || ((linkInfoSource.node != linkInfoDest.node || !linkInfoSource.node) && !tempLinkList.size()))
-		return 0;
+		return nullptr;
 
 	mctlMQ1.clear();
 
@@ -2336,9 +2336,9 @@ MessageQueue *MctlGraph::makeQueue(StaticANIObject *obj, int xpos, int ypos, int
 		if (tempLinkList.size() == 1)
 			mctlMQ1.item1Index = getDirBySize(tempLinkList[0], dx2 - dx1, dy2 - dy1);
 		else
-			mctlMQ1.item1Index = getDirBySize(0, dx2 - dx1, dy2 - dy1);
+			mctlMQ1.item1Index = getDirBySize(nullptr, dx2 - dx1, dy2 - dy1);
 	} else {
-		mctlMQ1.item1Index = getLinkDir(&tempLinkList, tempLinkList.size() - 1, 0, 0);
+		mctlMQ1.item1Index = getLinkDir(&tempLinkList, tempLinkList.size() - 1, nullptr, nullptr);
 	}
 
 	mctlMQ1.flags = fuzzyMatch != 0;
@@ -2402,7 +2402,7 @@ MovGraphNode *MctlGraph::getHitNode(int x, int y, int strictMatch) {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 int MctlGraph::getDirBySize(MovGraphLink *lnk, int x, int y) {
@@ -2675,7 +2675,7 @@ MovGraphLink *MctlGraph::getHitLink(int x, int y, int idx, int fuzzyMatch) {
 	debugC(4, kDebugPathfinding, "MctlGraph::getHitLink(...)");
 
 	Common::Point point;
-	MovGraphLink *res = 0;
+	MovGraphLink *res = nullptr;
 
 	for (LinkList::iterator i = _links.begin(); i != _links.end(); ++i) {
 		assert((*i)->_objtype == kObjTypeMovGraphLink);
@@ -2711,7 +2711,7 @@ MovGraphLink *MctlGraph::getNearestLink(int x, int y) {
 	debugC(4, kDebugPathfinding, "MctlGraph::getNearestLink(...)");
 
 	double mindist = 1.0e20;
-	MovGraphLink *res = 0;
+	MovGraphLink *res = nullptr;
 
 	for (LinkList::iterator i = _links.begin(); i != _links.end(); ++i) {
 		assert((*i)->_objtype == kObjTypeMovGraphLink);
@@ -2748,7 +2748,7 @@ MovGraphLink *MctlGraph::getNearestLink(int x, int y) {
 	if (mindist < 1.0e20)
 		return res;
 	else
-		return 0;
+		return nullptr;
 }
 
 double MctlGraph::iterate(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest, MovGraphLinkList *listObj) {
@@ -2764,7 +2764,7 @@ double MctlGraph::iterate(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest, MovG
 				MovGraphLink *lnk = static_cast<MovGraphLink *>(*i);
 
 				if ((lnk->_graphSrc == linkInfoSource->node || lnk->_graphDst == linkInfoSource->node) && !(lnk->_flags & 0xA0000000)) {
-					linkInfoWorkSource.node = 0;
+					linkInfoWorkSource.node = nullptr;
 					linkInfoWorkSource.link = lnk;
 
 					MovGraphLinkList tmpList;
@@ -2785,7 +2785,7 @@ double MctlGraph::iterate(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest, MovG
 			}
 		} else if (linkInfoSource->link) {
 			linkInfoWorkSource.node = linkInfoSource->link->_graphSrc;
-			linkInfoWorkSource.link = 0;
+			linkInfoWorkSource.link = nullptr;
 
 			MovGraphLinkList tmpList;
 
@@ -2800,7 +2800,7 @@ double MctlGraph::iterate(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest, MovG
 				minDistance = newDistance;
 			}
 
-			linkInfoWorkSource.link = 0;
+			linkInfoWorkSource.link = nullptr;
 			linkInfoWorkSource.node = linkInfoSource->link->_graphDst;
 
 			tmpList.clear();
@@ -2827,7 +2827,7 @@ double MctlGraph::iterate(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest, MovG
 }
 
 MovGraphNode *MovGraph::calcOffset(int ox, int oy) {
-	MovGraphNode *res = 0;
+	MovGraphNode *res = nullptr;
 	double mindist = 1.0e10;
 
 	for (NodeList::iterator i = _nodes.begin(); i != _nodes.end(); ++i) {
@@ -2849,11 +2849,11 @@ MovGraphLink::MovGraphLink() {
 	_length = 0;
 	_angle = 0;
 	_flags = 0x10000000;
-	_graphDst = 0;
-	_graphSrc = 0;
+	_graphDst = nullptr;
+	_graphSrc = nullptr;
 	_field_3C = 0;
 	_field_38 = 0;
-	_movGraphReact = 0;
+	_movGraphReact = nullptr;
 
 	_objtype = kObjTypeMovGraphLink;
 }
@@ -3084,7 +3084,7 @@ int startWalkTo(int objId, int objKey, int x, int y, int fuzzyMatch) {
 	MctlCompound *mc = getCurrSceneSc2MotionController();
 
 	if (mc)
-		return (mc->startMove(g_nmi->_currentScene->getStaticANIObject1ById(objId, objKey), x, y, fuzzyMatch, 0) != 0);
+		return (mc->startMove(g_nmi->_currentScene->getStaticANIObject1ById(objId, objKey), x, y, fuzzyMatch, 0) != nullptr);
 
 	return 0;
 }
diff --git a/engines/ngi/ngi.cpp b/engines/ngi/ngi.cpp
index 5613fc1dab..684e6b6328 100644
--- a/engines/ngi/ngi.cpp
+++ b/engines/ngi/ngi.cpp
@@ -78,12 +78,12 @@ NGIEngine::NGIEngine(OSystem *syst, const NGIGameDescription *gameDesc) :
 	_lastInputTicks = 0;
 	_lastButtonUpTicks = 0;
 
-	_currArchive = 0;
+	_currArchive = nullptr;
 
 	_soundEnabled = true;
 	_flgSoundList = true;
 
-	_inputController = 0;
+	_inputController = nullptr;
 	_inputDisabled = false;
 
 	_normalSpeed = true;
@@ -91,9 +91,9 @@ NGIEngine::NGIEngine(OSystem *syst, const NGIGameDescription *gameDesc) :
 	_currentCheat = -1;
 	_currentCheatPos = 0;
 
-	_liftEnterMQ = 0;
-	_liftExitMQ = 0;
-	_lift = 0;
+	_liftEnterMQ = nullptr;
+	_liftExitMQ = nullptr;
+	_lift = nullptr;
 	_lastLiftButton = nullptr;
 	_liftX = 0;
 	_liftY = 0;
@@ -111,7 +111,7 @@ NGIEngine::NGIEngine(OSystem *syst, const NGIGameDescription *gameDesc) :
 	_isProcessingMessages = false;
 
 	_musicAllowed = -1;
-	_musicGameVar = 0;
+	_musicGameVar = nullptr;
 	_musicMinDelay = 0;
 	_musicMaxDelay = 0;
 	_musicLocal = 0;
@@ -159,7 +159,7 @@ NGIEngine::NGIEngine(OSystem *syst, const NGIGameDescription *gameDesc) :
 
 	_minCursorId = 0xffff;
 	_maxCursorId = 0;
-	_objectAtCursor = 0;
+	_objectAtCursor = nullptr;
 	_objectIdAtCursor = 0;
 
 	_arcadeOverlay = nullptr;
@@ -455,9 +455,9 @@ void NGIEngine::freeGameLoader() {
 	setCursor(0);
 	_floaters->stopAll();
 	_gameLoader.reset();
-	_currentScene = 0;
-	_scene2 = 0;
-	_loaderScene = 0;
+	_currentScene = nullptr;
+	_scene2 = nullptr;
+	_loaderScene = nullptr;
 }
 
 void NGIEngine::cleanup() {
@@ -493,7 +493,7 @@ void NGIEngine::updateScreen() {
 	//if (inputArFlag)
 	//	updateGame_inputArFlag();
 
-	if (_modalObject || (_flgGameIsRunning && (_gameLoader->updateSystems(42), _modalObject != 0))) {
+	if (_modalObject || (_flgGameIsRunning && (_gameLoader->updateSystems(42), _modalObject != nullptr))) {
 		if (_flgGameIsRunning) {
 			if (_modalObject->init(42)) {
 				_modalObject->update();
diff --git a/engines/ngi/ngiarchive.cpp b/engines/ngi/ngiarchive.cpp
index c2866b4f9a..0e985b489f 100644
--- a/engines/ngi/ngiarchive.cpp
+++ b/engines/ngi/ngiarchive.cpp
@@ -128,7 +128,7 @@ const Common::ArchiveMemberPtr NGIArchive::getMember(const Common::Path &path) c
 Common::SeekableReadStream *NGIArchive::createReadStreamForMember(const Common::Path &path) const {
 	Common::String name = path.toString();
 	if (!_headers.contains(name)) {
-		return 0;
+		return nullptr;
 	}
 
 	NgiHeader *hdr = _headers[name].get();
diff --git a/engines/ngi/scene.cpp b/engines/ngi/scene.cpp
index 31945ae6ad..292416f669 100644
--- a/engines/ngi/scene.cpp
+++ b/engines/ngi/scene.cpp
@@ -36,7 +36,7 @@
 namespace NGI {
 
 Scene *NGIEngine::accessScene(int sceneId) {
-	SceneTag *t = 0;
+	SceneTag *t = nullptr;
 
 	for (SceneTagList::iterator s = _gameProject->_sceneTagList->begin(); s != _gameProject->_sceneTagList->end(); ++s) {
 		if (s->_sceneId == sceneId) {
@@ -46,7 +46,7 @@ Scene *NGIEngine::accessScene(int sceneId) {
 	}
 
 	if (!t)
-		return 0;
+		return nullptr;
 
 	if (!t->_scene) {
 		t->loadScene();
@@ -230,7 +230,7 @@ bool Scene::load(MfcArchive &file) {
 
 			_soundList->loadFile(slsname, nlname);
 		} else {
-			_soundList->loadFile(slsname, 0);
+			_soundList->loadFile(slsname, nullptr);
 		}
 	}
 
@@ -281,7 +281,7 @@ StaticANIObject *Scene::getStaticANIObject1ById(int obj, int a3) {
 			return _staticANIObjectList1[i];
 	}
 
-	return 0;
+	return nullptr;
 }
 
 StaticANIObject *Scene::getStaticANIObject1ByName(const Common::String &name, int a3) {
@@ -290,7 +290,7 @@ StaticANIObject *Scene::getStaticANIObject1ByName(const Common::String &name, in
 			return _staticANIObjectList1[i];
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void Scene::deleteStaticANIObject(StaticANIObject *obj) {
@@ -342,7 +342,7 @@ PictureObject *Scene::getPictureObjectById(int objId, int flags) {
 			return _picObjList[i];
 	}
 
-	return 0;
+	return nullptr;
 }
 
 PictureObject *Scene::getPictureObjectByName(const Common::String &objName, int flags) {
@@ -351,7 +351,7 @@ PictureObject *Scene::getPictureObjectByName(const Common::String &objName, int
 			return _picObjList[i];
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void Scene::deletePictureObject(PictureObject *obj) {
@@ -370,7 +370,7 @@ MessageQueue *Scene::getMessageQueueById(int messageId) {
 		if (_messageQueueList[i]->_dataId == messageId)
 			return _messageQueueList[i];
 
-	return 0;
+	return nullptr;
 }
 
 MessageQueue *Scene::getMessageQueueByName(const Common::String &name) {
@@ -378,7 +378,7 @@ MessageQueue *Scene::getMessageQueueByName(const Common::String &name) {
 		if (_messageQueueList[i]->_queueName == name)
 			return _messageQueueList[i];
 
-	return 0;
+	return nullptr;
 }
 
 void Scene::preloadMovements(GameVar *var) {
@@ -418,7 +418,7 @@ void Scene::initObjectCursors(const char *varname) {
 	for (GameVar *sub = cursorsVar->_subVars; sub; sub = sub->_nextVarObj) {
 		GameObject *obj = getPictureObjectByName(sub->_varName, -1);
 
-		if (obj || (obj = getStaticANIObject1ByName(sub->_varName, -1)) != 0) {
+		if (obj || (obj = getStaticANIObject1ByName(sub->_varName, -1)) != nullptr) {
 			if (obj->_id < minId)
 				minId = obj->_id;
 			if (obj->_id > maxId)
@@ -605,7 +605,7 @@ void Scene::updateScrolling2() {
 }
 
 StaticANIObject *Scene::getStaticANIObjectAtPos(int x, int y) {
-	StaticANIObject *res = 0;
+	StaticANIObject *res = nullptr;
 
 	for (uint i = 0; i < _staticANIObjectList1.size(); i++) {
 		StaticANIObject *p = _staticANIObjectList1[i];
@@ -620,7 +620,7 @@ StaticANIObject *Scene::getStaticANIObjectAtPos(int x, int y) {
 }
 
 PictureObject *Scene::getPictureObjectAtPos(int x, int y) {
-	PictureObject *res = 0;
+	PictureObject *res = nullptr;
 
 	for (uint i = 0; i < _picObjList.size(); i++) {
 		PictureObject *p = _picObjList[i];
@@ -634,7 +634,7 @@ PictureObject *Scene::getPictureObjectAtPos(int x, int y) {
 }
 
 int Scene::getPictureObjectIdAtPos(int x, int y) {
-	PictureObject *resp = 0;
+	PictureObject *resp = nullptr;
 	int res = 0;
 
 	for (uint i = 0; i < _picObjList.size(); i++) {
diff --git a/engines/ngi/scenes.cpp b/engines/ngi/scenes.cpp
index e3eeba8b76..0ec53b1bb3 100644
--- a/engines/ngi/scenes.cpp
+++ b/engines/ngi/scenes.cpp
@@ -38,39 +38,39 @@
 namespace NGI {
 
 Vars::Vars() {
-	sceneIntro_aniin1man = 0;
+	sceneIntro_aniin1man = nullptr;
 	sceneIntro_needSleep = true;
 	sceneIntro_needGetup = false;
 	sceneIntro_skipIntro = true;
 	sceneIntro_playing = false;
 	sceneIntro_needBlackout = false;
 
-	swallowedEgg1 = 0;
-	swallowedEgg2 = 0;
-	swallowedEgg3 = 0;
+	swallowedEgg1 = nullptr;
+	swallowedEgg2 = nullptr;
+	swallowedEgg3 = nullptr;
 
-	scene01_picSc01Osk = 0;
-	scene01_picSc01Osk2 = 0;
+	scene01_picSc01Osk = nullptr;
+	scene01_picSc01Osk2 = nullptr;
 
-	scene02_guvTheDrawer = 0;
+	scene02_guvTheDrawer = nullptr;
 	scene02_boxDelay = 0;
 	scene02_boxOpen = false;
 
-	scene03_eggeater = 0;
-	scene03_domino = 0;
-
-	scene04_bottle = 0;
-	scene04_hand = 0;
-	scene04_plank = 0;
-	scene04_clock = 0;
-	scene04_hand = 0;
-	scene04_spring = 0;
-	scene04_mamasha = 0;
-	scene04_boot = 0;
-	scene04_speaker = 0;
+	scene03_eggeater = nullptr;
+	scene03_domino = nullptr;
+
+	scene04_bottle = nullptr;
+	scene04_hand = nullptr;
+	scene04_plank = nullptr;
+	scene04_clock = nullptr;
+	scene04_hand = nullptr;
+	scene04_spring = nullptr;
+	scene04_mamasha = nullptr;
+	scene04_boot = nullptr;
+	scene04_speaker = nullptr;
 	scene04_musicStage = 0;
 
-	scene04_ladder = 0;
+	scene04_ladder = nullptr;
 	scene04_coinPut = false;
 	scene04_soundPlaying = false;
 	scene04_dynamicPhaseIndex = 0;
@@ -84,7 +84,7 @@ Vars::Vars() {
 
 	scene04_bottleIsTaken = false;
 	scene04_kozyawkaOnLadder = false;
-	scene04_walkingKozyawka = 0;
+	scene04_walkingKozyawka = nullptr;
 	scene04_bottleWeight = 0;
 	scene04_var07 = false;
 	scene04_ladderClickable = false;
@@ -100,14 +100,14 @@ Vars::Vars() {
 	scene04_clockCanGo = false;
 	scene04_objectIsTaken = false;
 	scene04_springOffset = 0;
-	scene04_lastKozyawka = 0;
+	scene04_lastKozyawka = nullptr;
 	scene04_springDelay = 0;
 	scene04_bottleY = 0;
 	scene04_ladderOffset = 0;
 
-	scene05_handle = 0;
-	scene05_wacko = 0;
-	scene05_bigHatch = 0;
+	scene05_handle = nullptr;
+	scene05_wacko = nullptr;
+	scene05_bigHatch = nullptr;
 	scene05_wackoTicker = 0;
 	scene05_handleFlipper = 0;
 	scene05_floatersTicker = 0;
@@ -116,16 +116,16 @@ Vars::Vars() {
 	scene06_manY = 0;
 	scene06_ballX = 0;
 	scene06_ballY = 0;
-	scene06_mumsy = 0;
-	scene06_someBall = 0;
-	scene06_invHandle = 0;
-	scene06_liftButton = 0;
-	scene06_ballDrop = 0;
+	scene06_mumsy = nullptr;
+	scene06_someBall = nullptr;
+	scene06_invHandle = nullptr;
+	scene06_liftButton = nullptr;
+	scene06_ballDrop = nullptr;
 	scene06_arcadeEnabled = false;
 	scene06_aimingBall = false;
-	scene06_currentBall = 0;
-	scene06_ballInHands = 0;
-	scene06_flyingBall = 0;
+	scene06_currentBall = nullptr;
+	scene06_ballInHands = nullptr;
+	scene06_flyingBall = nullptr;
 	scene06_numBallsGiven = 0;
 	scene06_mumsyNumBalls = 0;
 	scene06_eggieTimeout = 0;
@@ -136,18 +136,18 @@ Vars::Vars() {
 	scene06_sceneClickX = 0;
 	scene06_sceneClickY = 0;
 	scene06_mumsyPos = 0;
-	scene06_mumsyJumpBk = 0;
-	scene06_mumsyJumpFw = 0;
+	scene06_mumsyJumpBk = nullptr;
+	scene06_mumsyJumpFw = nullptr;
 	scene06_mumsyJumpBkPercent = 0;
 	scene06_mumsyJumpFwPercent = 0;
 
-	scene07_lukeAnim = 0;
+	scene07_lukeAnim = nullptr;
 	scene07_lukePercent = 0;
-	scene07_plusMinus = 0;
+	scene07_plusMinus = nullptr;
 
-	scene08_batuta = 0;
-	scene08_vmyats = 0;
-	scene08_clock = 0;
+	scene08_batuta = nullptr;
+	scene08_vmyats = nullptr;
+	scene08_clock = nullptr;
 	scene08_inAir = false;
 	scene08_flyingUp = false;
 	scene08_onBelly = false;
@@ -157,11 +157,11 @@ Vars::Vars() {
 	scene08_stairsVisible = true;
 	scene08_manOffsetY = 0;
 
-	scene09_flyingBall = 0;
+	scene09_flyingBall = nullptr;
 	scene09_numSwallenBalls = 0;
-	scene09_gulper = 0;
-	scene09_spitter = 0;
-	scene09_grit = 0;
+	scene09_gulper = nullptr;
+	scene09_spitter = nullptr;
+	scene09_grit = nullptr;
 	scene09_dudeY = 0;
 	scene09_gulperIsPresent = true;
 	scene09_dudeIsOnLadder = false;
@@ -179,17 +179,17 @@ Vars::Vars() {
 	scene09_hangerOffsets[3].x = 0;
 	scene09_hangerOffsets[3].y = 0;
 
-	scene10_gum = 0;
-	scene10_packet = 0;
-	scene10_packet2 = 0;
-	scene10_inflater = 0;
-	scene10_ladder = 0;
+	scene10_gum = nullptr;
+	scene10_packet = nullptr;
+	scene10_packet2 = nullptr;
+	scene10_inflater = nullptr;
+	scene10_ladder = nullptr;
 	scene10_hasGum = 0;
 
-	scene11_swingie = 0;
-	scene11_boots = 0;
-	scene11_dudeOnSwing = 0;
-	scene11_hint = 0;
+	scene11_swingie = nullptr;
+	scene11_boots = nullptr;
+	scene11_dudeOnSwing = nullptr;
+	scene11_hint = nullptr;
 	scene11_arcadeIsOn = false;
 	scene11_scrollIsEnabled = false;
 	scene11_scrollIsMaximized = false;
@@ -214,15 +214,15 @@ Vars::Vars() {
 	scene12_fly = 0;
 	scene12_flyCountdown = 0;
 
-	scene13_whirlgig = 0;
-	scene13_guard = 0;
-	scene13_handleR = 0;
-	scene13_handleL = 0;
-	scene13_bridge = 0;
+	scene13_whirlgig = nullptr;
+	scene13_guard = nullptr;
+	scene13_handleR = nullptr;
+	scene13_handleL = nullptr;
+	scene13_bridge = nullptr;
 	scene13_guardDirection = false;
 	scene13_dudeX = 0;
 
-	scene14_grandma = 0;
+	scene14_grandma = nullptr;
 	scene14_sceneDeltaX = 0;
 	scene14_sceneDeltaY = 0;
 	scene14_arcadeIsOn = false;
@@ -231,8 +231,8 @@ Vars::Vars() {
 	scene14_dudeCanKick = false;
 	scene14_sceneDiffX = 0;
 	scene14_sceneDiffY = 0;
-	scene14_pink = 0;
-	scene14_flyingBall = 0;
+	scene14_pink = nullptr;
+	scene14_flyingBall = nullptr;
 	scene14_balls.clear();
 	scene14_grandmaIsHere = false;
 	scene14_dudeX = 0;
@@ -247,18 +247,18 @@ Vars::Vars() {
 	scene14_hitsLeft = 0;
 
 	scene15_chantingCountdown = 0;
-	scene15_plusminus = 0;
-	scene15_ladder = 0;
-	scene15_boot = 0;
+	scene15_plusminus = nullptr;
+	scene15_ladder = nullptr;
+	scene15_boot = nullptr;
 
 	scene16_figures.clear();
-	scene16_walkingBoy = 0;
-	scene16_walkingGirl = 0;
+	scene16_walkingBoy = nullptr;
+	scene16_walkingGirl = nullptr;
 	scene16_walkingCount = 0;
-	scene16_wire = 0;
-	scene16_mug = 0;
-	scene16_jettie = 0;
-	scene16_boot = 0;
+	scene16_wire = nullptr;
+	scene16_mug = nullptr;
+	scene16_jettie = nullptr;
+	scene16_boot = nullptr;
 	scene16_girlIsLaughing = false;
 	scene16_sound = 0;
 	scene16_placeIsOccupied = false;
@@ -267,12 +267,12 @@ Vars::Vars() {
 	scene17_sugarIsShown = false;
 	scene17_sceneOldEdgeX = 0;
 	scene17_flyCountdown = 0;
-	scene17_hand = 0;
+	scene17_hand = nullptr;
 	scene17_handPhase = false;
 	scene17_sceneEdgeX = 0;
 
 	scene18_inScene18p1 = false;
-	scene18_whirlgig = 0;
+	scene18_whirlgig = nullptr;
 	scene18_wheelCenterX = 0;
 	scene18_wheelCenterY = 0;
 	scene18_bridgeIsConvoluted = false;
@@ -294,9 +294,9 @@ Vars::Vars() {
 	scene18_manWheelPosTo = -1;
 	scene18_kidWheelPos = 0;
 	scene18_kidWheelPosTo = 0;
-	scene18_boy = 0;
-	scene18_girl = 0;
-	scene18_domino = 0;
+	scene18_boy = nullptr;
+	scene18_girl = nullptr;
+	scene18_domino = nullptr;
 	scene18_boyJumpX = 290;
 	scene18_boyJumpY = -363;
 	scene18_girlJumpX = 283;
@@ -305,42 +305,42 @@ Vars::Vars() {
 	scene19_enteredTruba3 = false;
 
 	scene20_fliesCountdown = 0;
-	scene20_grandma = 0;
+	scene20_grandma = nullptr;
 
-	scene21_giraffeBottom = 0;
+	scene21_giraffeBottom = nullptr;
 	scene21_giraffeBottomX = 0;
 	scene21_giraffeBottomY = 0;
 	scene21_pipeIsOpen = false;
 	scene21_wigglePos = 0.0;
 	scene21_wiggleTrigger = 0;
 
-	scene22_bag = 0;
-	scene22_giraffeMiddle = 0;
+	scene22_bag = nullptr;
+	scene22_giraffeMiddle = nullptr;
 	scene22_dudeIsOnStool = false;
 	scene22_interactionIsDisabled = false;
 	scene22_craneIsOut = true;
 	scene22_numBagFalls = 1;
 
-	scene23_calend0 = 0;
-	scene23_calend1 = 0;
-	scene23_calend2 = 0;
-	scene23_calend3 = 0;
+	scene23_calend0 = nullptr;
+	scene23_calend1 = nullptr;
+	scene23_calend2 = nullptr;
+	scene23_calend3 = nullptr;
 	scene23_topReached = false;
 	scene23_isOnStool = false;
 	scene23_someVar = 0;
-	scene23_giraffeTop = 0;
-	scene23_giraffee = 0;
+	scene23_giraffeTop = nullptr;
+	scene23_giraffee = nullptr;
 
 	scene24_jetIsOn = false;
 	scene24_flowIsLow = false;
 	scene24_waterIsOn = false;
-	scene24_water = 0;
-	scene24_jet = 0;
-	scene24_drop = 0;
+	scene24_water = nullptr;
+	scene24_jet = nullptr;
+	scene24_drop = nullptr;
 
-	scene25_water = 0;
-	scene25_board = 0;
-	scene25_drop = 0;
+	scene25_water = nullptr;
+	scene25_board = nullptr;
+	scene25_drop = nullptr;
 	scene25_dudeIsOnBoard = false;
 	scene25_waterIsPresent = false;
 	scene25_boardIsSelectable = false;
@@ -349,18 +349,18 @@ Vars::Vars() {
 	scene25_bearders.clear();
 	scene25_sneezeFlipper = false;
 
-	scene26_chhi = 0;
-	scene26_drop = 0;
-	scene26_sockPic = 0;
-	scene26_sock = 0;
-	scene26_activeVent = 0;
+	scene26_chhi = nullptr;
+	scene26_drop = nullptr;
+	scene26_sockPic = nullptr;
+	scene26_sock = nullptr;
+	scene26_activeVent = nullptr;
 
-	scene27_hitZone = 0;
-	scene27_driver = 0;
-	scene27_maid = 0;
-	scene27_batHandler = 0;
+	scene27_hitZone = nullptr;
+	scene27_driver = nullptr;
+	scene27_maid = nullptr;
+	scene27_batHandler = nullptr;
 	scene27_driverHasVent = true;
-	scene27_bat = 0;
+	scene27_bat = nullptr;
 	scene27_dudeIsAiming = false;
 	scene27_maxPhaseReached = false;
 	scene27_wipeIsNeeded = false;
@@ -373,16 +373,16 @@ Vars::Vars() {
 
 	scene28_fliesArePresent = true;
 	scene28_beardedDirection = true;
-	scene28_darkeningObject = 0;
-	scene28_lighteningObject = 0;
+	scene28_darkeningObject = nullptr;
+	scene28_lighteningObject = nullptr;
 	scene28_headDirection = false;
 	scene28_headBeardedFlipper = false;
 	scene28_lift6inside = false;
 
-	scene29_porter = 0;
-	scene29_shooter1 = 0;
-	scene29_shooter2 = 0;
-	scene29_ass = 0;
+	scene29_porter = nullptr;
+	scene29_shooter1 = nullptr;
+	scene29_shooter2 = nullptr;
+	scene29_ass = nullptr;
 	scene29_manIsRiding = false;
 	scene29_arcadeIsOn = false;
 	scene29_reachedFarRight = false;
@@ -396,12 +396,12 @@ Vars::Vars() {
 	scene29_manX = 0;
 	scene29_manY = 0;
 
-	scene30_leg = 0;
+	scene30_leg = nullptr;
 	scene30_liftFlag = 1;
 
 	scene31_chantingCountdown = 0;
-	scene31_cactus = 0;
-	scene31_plusMinus = 0;
+	scene31_cactus = nullptr;
+	scene31_plusMinus = nullptr;
 
 	scene32_flagIsWaving = false;
 	scene32_flagNeedsStopping = false;
@@ -409,16 +409,16 @@ Vars::Vars() {
 	scene32_cactusCounter = -1;
 	scene32_dudeOnLadder = false;
 	scene32_cactusIsGrowing = false;
-	scene32_flag = 0;
-	scene32_cactus = 0;
-	scene32_massOrange = 0;
-	scene32_massBlue = 0;
-	scene32_massGreen = 0;
-	scene32_button = 0;
-
-	scene33_mug = 0;
-	scene33_jettie = 0;
-	scene33_cube = 0;
+	scene32_flag = nullptr;
+	scene32_cactus = nullptr;
+	scene32_massOrange = nullptr;
+	scene32_massBlue = nullptr;
+	scene32_massGreen = nullptr;
+	scene32_button = nullptr;
+
+	scene33_mug = nullptr;
+	scene33_jettie = nullptr;
+	scene33_cube = nullptr;
 	scene33_cubeX = -1;
 	scene33_handleIsDown = false;
 
@@ -427,39 +427,39 @@ Vars::Vars() {
 		scene33_ventsState[i] = 0;
 	}
 
-	scene34_cactus = 0;
-	scene34_vent = 0;
-	scene34_hatch = 0;
-	scene34_boot = 0;
+	scene34_cactus = nullptr;
+	scene34_vent = nullptr;
+	scene34_hatch = nullptr;
+	scene34_boot = nullptr;
 	scene34_dudeClimbed = false;
 	scene34_dudeOnBoard = false;
 	scene34_dudeOnCactus = false;
 	scene34_fliesCountdown = 0;
 
-	scene35_hose = 0;
-	scene35_bellyInflater = 0;
+	scene35_hose = nullptr;
+	scene35_bellyInflater = nullptr;
 	scene35_flowCounter = 0;
 	scene35_fliesCounter = 0;
 
-	scene36_rotohrust = 0;
-	scene36_scissors = 0;
+	scene36_rotohrust = nullptr;
+	scene36_scissors = nullptr;
 
 	scene37_rings.clear();
 	scene37_lastDudeX = -1;
 	scene37_pipeIsOpen = 0;
-	scene37_plusMinus1 = 0;
-	scene37_plusMinus2 = 0;
-	scene37_plusMinus3 = 0;
+	scene37_plusMinus1 = nullptr;
+	scene37_plusMinus2 = nullptr;
+	scene37_plusMinus3 = nullptr;
 	scene37_soundFlipper = 0;
 	scene37_dudeX = 0;
 
-	scene38_boss = 0;
-	scene38_tally = 0;
-	scene38_shorty = 0;
-	scene38_domino0 = 0;
-	scene38_dominos = 0;
-	scene38_domino1 = 0;
-	scene38_bottle = 0;
+	scene38_boss = nullptr;
+	scene38_tally = nullptr;
+	scene38_shorty = nullptr;
+	scene38_domino0 = nullptr;
+	scene38_dominos = nullptr;
+	scene38_domino1 = nullptr;
+	scene38_bottle = nullptr;
 	scene38_bossCounter = 0;
 	scene38_lastBossAnim = 0;
 	scene38_bossAnimCounter = 0;
@@ -475,7 +475,7 @@ Vars::Vars() {
 	sceneFinal_var03 = 0;
 	sceneFinal_trackHasStarted = false;
 
-	selector = 0;
+	selector = nullptr;
 }
 
 static int scenes[] = {
@@ -553,8 +553,8 @@ bool NGIEngine::sceneSwitcher(const EntranceInfo &entrance) {
 
 	_aniMan->setOXY(0, 0);
 	_aniMan->clearFlags();
-	_aniMan->_callback1 = 0; // Really NULL
-	_aniMan->_callback2 = 0; // Really NULL
+	_aniMan->_callback1 = nullptr; // Really NULL
+	_aniMan->_callback2 = nullptr; // Really NULL
 	_aniMan->_shadowsOn = 1;
 
 	_scrollSpeed = 8;
@@ -564,7 +564,7 @@ bool NGIEngine::sceneSwitcher(const EntranceInfo &entrance) {
 	_flgCanOpenMap = true;
 
 	if (entrance._sceneId == SC_DBGMENU) {
-		_inventoryScene = 0;
+		_inventoryScene = nullptr;
 	} else {
 		_gameLoader->loadScene(SC_INV);
 		getGameLoaderInventory()->rebuildItemRects();
@@ -589,7 +589,7 @@ bool NGIEngine::sceneSwitcher(const EntranceInfo &entrance) {
 	_currentScene = scene;
 	scene->addStaticANIObject(_aniMan, 1);
 	_scene2 = scene;
-	_aniMan->_movement = 0;
+	_aniMan->_movement = nullptr;
 	_aniMan->_statics = _aniMan->getStaticsById(ST_MAN_EMPTY);
 	_aniMan->setOXY(0, 0);
 
@@ -610,7 +610,7 @@ bool NGIEngine::sceneSwitcher(const EntranceInfo &entrance) {
 	p->setFlags(p->_flags & 0xFFFB);
 
 	removeMessageHandler(2, -1);
-	_updateScreenCallback = 0;
+	_updateScreenCallback = nullptr;
 
 	switch (entrance._sceneId) {
 	case SC_INTRO1:
diff --git a/engines/ngi/sound.cpp b/engines/ngi/sound.cpp
index f4c610badc..85c8e6b8e5 100644
--- a/engines/ngi/sound.cpp
+++ b/engines/ngi/sound.cpp
@@ -378,7 +378,7 @@ void NGIEngine::toggleMute() {
 }
 
 void NGIEngine::playSound(int id, int flag) {
-	Sound *sound = 0;
+	Sound *sound = nullptr;
 
 	for (int i = 0; i < _currSoundListCount; i++) {
 		sound = _currSoundList1[i]->getSoundItemById(id);
@@ -458,10 +458,10 @@ void global_messageHandler_handleSound(ExCommand *cmd) {
 	if (!g_nmi->_soundEnabled)
 		return;
 
-	Sound *snd = 0;
+	Sound *snd = nullptr;
 
 	for (int i = 0; i < g_nmi->_currSoundListCount; i++)
-		if ((snd = g_nmi->_currSoundList1[i]->getSoundItemById(cmd->_messageNum)) != NULL)
+		if ((snd = g_nmi->_currSoundList1[i]->getSoundItemById(cmd->_messageNum)) != nullptr)
 			break;
 
 	if (!snd)
diff --git a/engines/ngi/stateloader.cpp b/engines/ngi/stateloader.cpp
index ed556288ef..610abfa886 100644
--- a/engines/ngi/stateloader.cpp
+++ b/engines/ngi/stateloader.cpp
@@ -152,7 +152,7 @@ bool GameLoader::readSavegame(const char *fname) {
 		if (g_nmi->_currentScene)
 			unloadScene(g_nmi->_currentScene->_sceneId);
 
-		g_nmi->_currentScene = 0;
+		g_nmi->_currentScene = nullptr;
 
 		if (_preloadCallback)
 			_preloadCallback(preloadItem, 50);
@@ -307,7 +307,7 @@ bool NGIEngine::loadGam(const char *fname, int scene) {
 	_gameLoader->_savegameCallback = gameLoaderSavegameCallback;
 
 	_aniMan = accessScene(SC_COMMON)->getAniMan();
-	_scene2 = 0;
+	_scene2 = nullptr;
 
 	_movTable.reset(_aniMan->countMovements());
 
@@ -397,11 +397,11 @@ bool GameProject::load(MfcArchive &file) {
 }
 
 GameVar::GameVar() {
-	_subVars = 0;
-	_parentVarObj = 0;
-	_nextVarObj = 0;
-	_prevVarObj = 0;
-	_field_14 = 0;
+	_subVars = nullptr;
+	_parentVarObj = nullptr;
+	_nextVarObj = nullptr;
+	_prevVarObj = nullptr;
+	_field_14 = nullptr;
 	_varType = 0;
 	_value.floatValue = 0;
 
@@ -418,7 +418,7 @@ GameVar::~GameVar() {
 		} else if (_parentVarObj->_field_14 == this) {
 			_parentVarObj->_field_14 = _nextVarObj;
 		} else {
-			_parentVarObj = 0;
+			_parentVarObj = nullptr;
 		}
 	}
 
@@ -428,8 +428,8 @@ GameVar::~GameVar() {
 	if (_nextVarObj)
 		_nextVarObj->_prevVarObj = _prevVarObj;
 
-	_prevVarObj = 0;
-	_nextVarObj = 0;
+	_prevVarObj = nullptr;
+	_nextVarObj = nullptr;
 
 	GameVar *s = _subVars;
 
@@ -488,9 +488,9 @@ bool GameVar::load(MfcArchive &file) {
 }
 
 GameVar *GameVar::getSubVarByName(const Common::String &name) {
-	GameVar *sv = 0;
+	GameVar *sv = nullptr;
 
-	if (_subVars != 0) {
+	if (_subVars != nullptr) {
 		sv = _subVars;
 		for (;sv && scumm_stricmp(sv->_varName.c_str(), name.c_str()); sv = sv->_nextVarObj)
 			;
@@ -529,7 +529,7 @@ int GameVar::getSubVarAsInt(const Common::String &name) {
 
 GameVar *GameVar::addSubVarAsInt(const Common::String &name, int value) {
 	if (getSubVarByName(name)) {
-		return 0;
+		return nullptr;
 	} else {
 		GameVar *var = new GameVar();
 
@@ -538,7 +538,7 @@ GameVar *GameVar::addSubVarAsInt(const Common::String &name, int value) {
 
 		var->_varName = name;
 
-		return (addSubVar(var) != 0) ? var : 0;
+		return (addSubVar(var) != 0) ? var : nullptr;
 	}
 }
 
@@ -581,7 +581,7 @@ GameVar *GameVar::getSubVarByIndex(int idx) {
 		sub = sub->_nextVarObj;
 
 		if (!sub)
-			return 0;
+			return nullptr;
 	}
 
 	return sub;
diff --git a/engines/ngi/statesaver.cpp b/engines/ngi/statesaver.cpp
index 6c52bc1b3f..3def43f29d 100644
--- a/engines/ngi/statesaver.cpp
+++ b/engines/ngi/statesaver.cpp
@@ -61,16 +61,16 @@ bool GameLoader::writeSavegame(Scene *sc, const char *fname, const Common::Strin
 
 	v = _gameVar->getSubVarByName("OBJSTATES");
 
-	GameVar *nxt = 0;
-	GameVar *prv = 0;
-	GameVar *par = 0;
+	GameVar *nxt = nullptr;
+	GameVar *prv = nullptr;
+	GameVar *par = nullptr;
 	if (v) {
 		nxt = v->_nextVarObj;
 		prv = v->_prevVarObj;
 		par = v->_parentVarObj;
-		v->_parentVarObj = 0;
-		v->_nextVarObj = 0;
-		v->_prevVarObj = 0;
+		v->_parentVarObj = nullptr;
+		v->_nextVarObj = nullptr;
+		v->_prevVarObj = nullptr;
 	}
 
 	archive->writeObject(v);
diff --git a/engines/ngi/statics.cpp b/engines/ngi/statics.cpp
index ec64b7e26d..d2371bb9c6 100644
--- a/engines/ngi/statics.cpp
+++ b/engines/ngi/statics.cpp
@@ -97,11 +97,11 @@ StaticANIObject::StaticANIObject() {
 	_messageQueueId = 0;
 	_animExFlag = 0;
 	_counter = 0;
-	_movement = 0;
-	_statics = 0;
+	_movement = nullptr;
+	_statics = nullptr;
 	_flags = 0;
-	_callback1 = 0; // Really NULL
-	_callback2 = 0; // Really NULL
+	_callback1 = nullptr; // Really NULL
+	_callback2 = nullptr; // Really NULL
 	_sceneId = -1;
 	_someDynamicPhaseIndex = -1;
 
@@ -139,8 +139,8 @@ StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
 	for (uint i = 0; i < src->_staticsList.size(); i++)
 		_staticsList.push_back(new Statics(src->_staticsList[i], false));
 
-	_movement = 0;
-	_statics = 0;
+	_movement = nullptr;
+	_statics = nullptr;
 
 	for (uint i = 0; i < src->_movements.size(); i++) {
 		Movement *newmov;
@@ -151,7 +151,7 @@ StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
 			newmov = new Movement(getMovementById(src->getMovementIdById(src->_movements[i]->_id)), this);
 			newmov->_id = src->_movements[i]->_id;
 		} else {
-			newmov = new Movement(src->_movements[i], 0, -1, this);
+			newmov = new Movement(src->_movements[i], nullptr, -1, this);
 		}
 
 		_movements.push_back(newmov);
@@ -219,8 +219,8 @@ void StaticANIObject::clearFlags() {
 
 	deleteFromGlobalMessageQueue();
 	_messageQueueId = 0;
-	_movement = 0;
-	_statics = 0;
+	_movement = nullptr;
+	_statics = nullptr;
 	_animExFlag = 0;
 	_counter = 0;
 	_messageNum = 0;
@@ -300,7 +300,7 @@ void StaticANIObject::restartMessageQueue(MessageQueue *mq) {
 
 MessageQueue *StaticANIObject::getMessageQueue() {
 	if (this->_messageQueueId <= 0)
-		return 0;
+		return nullptr;
 
 	return g_nmi->_globalMessageQueueList->getMessageQueueById(_messageQueueId);
 }
@@ -369,7 +369,7 @@ Statics *StaticANIObject::getStaticsById(int itemId) {
 		if (_staticsList[i]->_staticsId == itemId)
 			return _staticsList[i];
 
-	return 0;
+	return nullptr;
 }
 
 Statics *StaticANIObject::getStaticsByName(const Common::String &name) {
@@ -377,7 +377,7 @@ Statics *StaticANIObject::getStaticsByName(const Common::String &name) {
 		if (_staticsList[i]->_staticsName == name)
 			return _staticsList[i];
 
-	return 0;
+	return nullptr;
 }
 
 Movement *StaticANIObject::getMovementById(int itemId) {
@@ -385,7 +385,7 @@ Movement *StaticANIObject::getMovementById(int itemId) {
 		if (_movements[i]->_id == itemId)
 			return _movements[i];
 
-	return 0;
+	return nullptr;
 }
 
 int StaticANIObject::getMovementIdById(int itemId) const {
@@ -409,11 +409,11 @@ Movement *StaticANIObject::getMovementByName(const Common::String &name) {
 		if (_movements[i]->_objectName == name)
 			return _movements[i];
 
-	return 0;
+	return nullptr;
 }
 
 bool StaticANIObject::isPixelHitAtPos(int x, int y) {
-	return getPixelAtPos(x, y, 0, true);
+	return getPixelAtPos(x, y, nullptr, true);
 }
 
 bool StaticANIObject::getPixelAtPos(int x, int y, uint32 *pixel, bool hitOnly) {
@@ -433,7 +433,7 @@ bool StaticANIObject::getPixelAtPos(int x, int y, uint32 *pixel, bool hitOnly) {
 	int oxani, oyani;
 
 	if (_movement)
-		ongoing = _movement->_currMovement != 0;
+		ongoing = _movement->_currMovement != nullptr;
 	else
 		ongoing = _statics->_staticsId & 0x4000;
 
@@ -849,7 +849,7 @@ void StaticANIObject::updateStepPos() {
 	y += point.y;
 
 	_statics = _movement->_staticsObj2;
-	_movement = 0;
+	_movement = nullptr;
 
 	setOXY(ox + x, oy + y);
 }
@@ -940,7 +940,7 @@ L12:
 		_statics->_x = _ox - point.x;
 		_statics->_y = _oy - point.y;
 		oid = _movement->_id;
-		_movement = 0;
+		_movement = nullptr;
 
 		ExCommand *ex = new ExCommand(_id, 17, 24, 0, 0, 0, 1, 0, 0, 0);
 		ex->_param = _odelay;
@@ -978,7 +978,7 @@ void StaticANIObject::adjustSomeXY() {
 			_oy += point.y;
 
 		_statics = _movement->_staticsObj2;
-		_movement = 0;
+		_movement = nullptr;
 		_someDynamicPhaseIndex = -1;
 	}
 }
@@ -986,10 +986,10 @@ void StaticANIObject::adjustSomeXY() {
 MessageQueue *StaticANIObject::changeStatics1(int msgNum) {
 	g_nmi->_aniHandler->attachObject(_id);
 
-	MessageQueue *mq = g_nmi->_aniHandler->makeQueue(this, msgNum, 0, 0, 0);
+	MessageQueue *mq = g_nmi->_aniHandler->makeQueue(this, msgNum, 0, nullptr, nullptr);
 
 	if (!mq)
-		return 0;
+		return nullptr;
 
 	if (mq->getCount() <= 0) {
 		g_nmi->_globalMessageQueueList->addMessageQueue(mq);
@@ -1000,7 +1000,7 @@ MessageQueue *StaticANIObject::changeStatics1(int msgNum) {
 		if (!queueMessageQueue(mq)) {
 			delete mq;
 
-			return 0;
+			return nullptr;
 		}
 
 		g_nmi->_globalMessageQueueList->addMessageQueue(mq);
@@ -1070,7 +1070,7 @@ void StaticANIObject::show1(int x, int y, int movId, int mqId) {
 	_flags |= 4;
 	_ox = x;
 	_oy = y;
-	_movement = 0;
+	_movement = nullptr;
 
 	if (mov->_currMovement)
 		_flags |= 8;
@@ -1131,7 +1131,7 @@ void StaticANIObject::playIdle() {
 }
 
 void StaticANIObject::startAnimSteps(int movementId, int messageQueueId, int x, int y, const PointList &points, int someDynamicPhaseIndex) {
-	Movement *mov = 0;
+	Movement *mov = nullptr;
 
 	if (!(_flags & 0x80)) {
 		if (!_messageQueueId)
@@ -1230,7 +1230,7 @@ bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhase
 		return false;
 	}
 
-	Movement *mov = 0;
+	Movement *mov = nullptr;
 
 	for (uint i = 0; i < _movements.size(); i++) {
 		if (_movements[i]->_id == movementId) {
@@ -1411,8 +1411,8 @@ Movement::Movement() {
 	_lastFrameSpecialFlag = 0;
 	_flipFlag = 0;
 	_updateFlag1 = 0;
-	_staticsObj1 = 0;
-	_staticsObj2 = 0;
+	_staticsObj1 = nullptr;
+	_staticsObj2 = nullptr;
 	_mx = 0;
 	_my = 0;
 	_m2x = 0;
@@ -1420,11 +1420,11 @@ Movement::Movement() {
 	_field_50 = 1;
 	_field_78 = 0;
 	_field_84 = 0;
-	_currDynamicPhase = 0;
+	_currDynamicPhase = nullptr;
 	_field_8C = 0;
 	_currDynamicPhaseIndex = 0;
 	_field_94 = 0;
-	_currMovement = 0;
+	_currMovement = nullptr;
 	_counter = 0;
 	_counterMax = 83;
 }
@@ -1451,8 +1451,8 @@ Movement::Movement(Movement *src, StaticANIObject *ani) {
 	_lastFrameSpecialFlag = 0;
 	_flipFlag = src->_flipFlag;
 	_updateFlag1 = src->_updateFlag1;
-	_staticsObj1 = 0;
-	_staticsObj2 = 0;
+	_staticsObj1 = nullptr;
+	_staticsObj2 = nullptr;
 	_mx = 0;
 	_my = 0;
 	_m2x = 0;
@@ -1460,7 +1460,7 @@ Movement::Movement(Movement *src, StaticANIObject *ani) {
 
 	_field_78 = 0;
 	_field_84 = 0;
-	_currDynamicPhase = 0;
+	_currDynamicPhase = nullptr;
 	_field_8C = 0;
 	_currDynamicPhaseIndex = src->_currDynamicPhaseIndex;
 	_field_94 = 0;
@@ -1484,8 +1484,8 @@ Movement::Movement(Movement *src, StaticANIObject *ani) {
 Movement::Movement(Movement *src, int *oldIdxs, int newSize, StaticANIObject *ani) : GameObject(src) {
 	_lastFrameSpecialFlag = 0;
 	_updateFlag1 = 1;
-	_staticsObj1 = 0;
-	_staticsObj2 = 0;
+	_staticsObj1 = nullptr;
+	_staticsObj2 = nullptr;
 	_mx = 0;
 	_my = 0;
 	_m2x = 0;
@@ -1496,7 +1496,7 @@ Movement::Movement(Movement *src, int *oldIdxs, int newSize, StaticANIObject *an
 
 	_field_78 = 0;
 	_field_84 = 0;
-	_currDynamicPhase = 0;
+	_currDynamicPhase = nullptr;
 	_field_8C = 0;
 	_currDynamicPhaseIndex = 0;
 	_field_94 = 0;
@@ -1506,7 +1506,7 @@ Movement::Movement(Movement *src, int *oldIdxs, int newSize, StaticANIObject *an
 
 	_field_50 = src->_field_50;
 	_flipFlag = src->_flipFlag;
-	_currMovement = 0;
+	_currMovement = nullptr;
 	_mx = src->_mx;
 	_my = src->_my;
 	_m2x = src->_m2x;
@@ -1634,8 +1634,8 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) {
 		int movid = file.readUint16LE();
 
 		_currMovement = ani->getMovementById(movid);
-		_staticsObj1 = 0;
-		_staticsObj2 = 0;
+		_staticsObj1 = nullptr;
+		_staticsObj2 = nullptr;
 
 		initStatics(ani);
 	}
@@ -1684,7 +1684,7 @@ Common::Point Movement::calcSomeXY(int idx, int dynidx) {
 
 	setOXY(x, y);
 
-	while (_currDynamicPhaseIndex != dynidx && gotoNextFrame(0, 0))
+	while (_currDynamicPhaseIndex != dynidx && gotoNextFrame(nullptr, nullptr))
 		;
 
 	Common::Point p(_ox, _oy);
@@ -1807,7 +1807,7 @@ int Movement::countPhasesWithFlag(int maxidx, int flag) {
 void Movement::setDynamicPhaseIndex(int index) {
 	debugC(7, kDebugAnimation, "Movement::setDynamicPhaseIndex(%d)", index);
 	while (_currDynamicPhaseIndex < index)
-		gotoNextFrame(0, 0);
+		gotoNextFrame(nullptr, nullptr);
 
 	while (_currDynamicPhaseIndex > index)
 		gotoPrevFrame();
@@ -1818,12 +1818,12 @@ DynamicPhase *Movement::getDynamicPhaseByIndex(int idx) {
 
 	if (_currMovement) {
 		if (_currMovement->_dynamicPhases.size() == 0 || (uint)idx >= _currMovement->_dynamicPhases.size())
-			return 0;
+			return nullptr;
 
 		return _currMovement->_dynamicPhases[idx];
 	} else {
 		if (_dynamicPhases.size() == 0 || (uint)idx >= _dynamicPhases.size())
-			return 0;
+			return nullptr;
 
 		return _dynamicPhases[idx];
 	}
@@ -1855,7 +1855,7 @@ void Movement::freePixelData() {
 void Movement::removeFirstPhase() {
 	if (_updateFlag1) {
 		if (!_currDynamicPhaseIndex)
-			gotoNextFrame(0, 0);
+			gotoNextFrame(nullptr, nullptr);
 
 		if (!_currMovement) {
 			delete _dynamicPhases.remove_at(0);
@@ -1913,7 +1913,7 @@ bool Movement::gotoNextFrame(void (*callback1)(int, Common::Point *point, int, i
 	if (_currMovement) {
 		if (_currMovement->_dynamicPhases.size() <= (uint)_currDynamicPhaseIndex) {
 			_currDynamicPhaseIndex = _currMovement->_dynamicPhases.size() - 1;
-			result = (callback2 == 0);
+			result = (callback2 == nullptr);
 		}
 		if (_currDynamicPhaseIndex < 0) {
 			_currDynamicPhaseIndex = 0;
@@ -1952,7 +1952,7 @@ bool Movement::gotoNextFrame(void (*callback1)(int, Common::Point *point, int, i
 	} else {
 		if (_dynamicPhases.size() <= (uint)_currDynamicPhaseIndex) {
 			_currDynamicPhaseIndex = _dynamicPhases.size() - 1;
-			result = (callback2 == 0);
+			result = (callback2 == nullptr);
 		}
 		if (_currDynamicPhaseIndex < 0) {
 			_currDynamicPhaseIndex = 0;
@@ -2045,13 +2045,13 @@ void Movement::gotoLastFrame() {
 	if (_currMovement) {
 		if ((uint)_currDynamicPhaseIndex != _currMovement->_dynamicPhases.size() - 1) {
 			do {
-				gotoNextFrame(0, 0);
+				gotoNextFrame(nullptr, nullptr);
 			} while ((uint)_currDynamicPhaseIndex != _currMovement->_dynamicPhases.size() - 1);
 		}
 	} else {
 		if ((uint)_currDynamicPhaseIndex != _dynamicPhases.size() - 1) {
 			do {
-				gotoNextFrame(0, 0);
+				gotoNextFrame(nullptr, nullptr);
 			} while ((uint)_currDynamicPhaseIndex != _dynamicPhases.size() - 1);
 		}
 	}
diff --git a/engines/ngi/utils.cpp b/engines/ngi/utils.cpp
index de81c2dc9a..eb63484c25 100644
--- a/engines/ngi/utils.cpp
+++ b/engines/ngi/utils.cpp
@@ -115,8 +115,8 @@ MemoryObject::MemoryObject() {
 	_mfield_14 = 1;
 	_dataSize = 0;
 	_mflags = 0;
-	_libHandle = 0;
-	_data = 0;
+	_libHandle = nullptr;
+	_data = nullptr;
 }
 
 MemoryObject::~MemoryObject() {
@@ -191,7 +191,7 @@ void MemoryObject::freeData() {
 	if (_data)
 		free(_data);
 
-	_data = 0;
+	_data = nullptr;
 }
 
 bool MemoryObject::testFlags() {
@@ -205,7 +205,7 @@ bool MemoryObject::testFlags() {
 }
 
 MemoryObject2::MemoryObject2() {
-	_rows = 0;
+	_rows = nullptr;
 }
 
 MemoryObject2::~MemoryObject2() {
@@ -277,7 +277,7 @@ const struct {
 	{ "CMovGraphNode",	kMovGraphNode },
 	{ "CReactParallel",	kReactParallel },
 	{ "CReactPolygonal", kReactPolygonal },
-	{ 0, 0 }
+	{ nullptr, 0 }
 };
 
 static const char *lookupObjectId(int id) {
@@ -292,7 +292,7 @@ static const char *lookupObjectId(int id) {
 static CObject *createObject(int objectId) {
 	switch (objectId) {
 	case kNullObject:
-		return 0;
+		return nullptr;
 	case kInteraction:
 		return new Interaction();
 	case kMessageQueue:
@@ -319,19 +319,19 @@ static CObject *createObject(int objectId) {
 		error("Unknown objectId: %d", objectId);
 	}
 
-	return 0;
+	return nullptr;
 }
 
 MfcArchive::MfcArchive(Common::SeekableReadStream *stream) {
 	_stream = stream;
-	_wstream = 0;
+	_wstream = nullptr;
 
 	init();
 }
 
 MfcArchive::MfcArchive(Common::WriteStream *stream) {
 	_wstream = stream;
-	_stream = 0;
+	_stream = nullptr;
 
 	init();
 }
@@ -361,14 +361,14 @@ CObject *MfcArchive::readBaseClass() {
 CObject *MfcArchive::parseClass(bool *isCopyReturned) {
 	Common::String name;
 	int objectId = 0;
-	CObject *res = 0;
+	CObject *res = nullptr;
 
 	uint obTag = readUint16LE();
 
 	debugC(7, kDebugLoading, "parseClass::obTag = %d (%04x)  at 0x%08x", obTag, obTag, (int)pos() - 2);
 
 	if (obTag == 0x0000) {
-		return NULL;
+		return nullptr;
 	} else if (obTag == 0xffff) {
 		int schema = readUint16LE();
 
@@ -425,7 +425,7 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
 }
 
 void MfcArchive::writeObject(CObject *obj) {
-	if (obj == NULL) {
+	if (obj == nullptr) {
 		writeUint16LE(0);
 	} else if (_objectHash.contains(obj)) {
 		int32 idx = _objectHash[obj];
@@ -557,7 +557,7 @@ void NGIEngine::loadGameObjH() {
 		}
 
 		Common::String val(&s.c_str()[8], cnt);
-		int key = strtol(ptr, NULL, 10);
+		int key = strtol(ptr, nullptr, 10);
 
 		_gameObjH[(uint16)key] = val;
 	}


Commit: b458ea47ddb8c2826c89405238c4db057a5e8a52
    https://github.com/scummvm/scummvm/commit/b458ea47ddb8c2826c89405238c4db057a5e8a52
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
PARALLACTION: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/parallaction/adlib.cpp
    engines/parallaction/balloons.cpp
    engines/parallaction/detection.cpp
    engines/parallaction/dialogue.cpp
    engines/parallaction/disk_br.cpp
    engines/parallaction/disk_ns.cpp
    engines/parallaction/exec.cpp
    engines/parallaction/exec_br.cpp
    engines/parallaction/exec_ns.cpp
    engines/parallaction/font.cpp
    engines/parallaction/graphics.cpp
    engines/parallaction/gui.cpp
    engines/parallaction/gui_br.cpp
    engines/parallaction/gui_ns.cpp
    engines/parallaction/input.cpp
    engines/parallaction/inventory.cpp
    engines/parallaction/objects.cpp
    engines/parallaction/parallaction.cpp
    engines/parallaction/parallaction_br.cpp
    engines/parallaction/parallaction_ns.cpp
    engines/parallaction/parser.cpp
    engines/parallaction/parser_br.cpp
    engines/parallaction/parser_ns.cpp
    engines/parallaction/saveload.cpp
    engines/parallaction/sound_br.cpp
    engines/parallaction/sound_ns.cpp


diff --git a/engines/parallaction/adlib.cpp b/engines/parallaction/adlib.cpp
index f0e798935a..9a217f2db7 100644
--- a/engines/parallaction/adlib.cpp
+++ b/engines/parallaction/adlib.cpp
@@ -278,14 +278,14 @@ public:
 
 		_isOpen = false;
 
-		_opl = NULL;
+		_opl = nullptr;
 		memset(_voices, 0, sizeof(_voices));
 
 		_lastVoice = 0;
 		_percussionMask = 0;
 
-		_adlibTimerProc = NULL;
-		_adlibTimerParam = NULL;
+		_adlibTimerProc = nullptr;
+		_adlibTimerParam = nullptr;
 	}
 
 	int open() override;
@@ -797,7 +797,7 @@ MidiChannel *AdLibDriver::allocateChannel() {
 			return &_channels[i];
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 void AdLibDriver::onTimer() {
diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp
index 0b18c36245..406324f771 100644
--- a/engines/parallaction/balloons.cpp
+++ b/engines/parallaction/balloons.cpp
@@ -189,7 +189,7 @@ protected:
 
 public:
 	StringWriter_NS(Parallaction_ns *vm, Font *font) : WrappedLineFormatter(font), _vm(vm),
-		_width(0), _height(0), _color(0), _surf(NULL) { }
+		_width(0), _height(0), _color(0), _surf(nullptr) { }
 
 	void write(const Common::String &text, uint maxWidth, byte color, Graphics::Surface *surf) {
 		StringExtent_NS	se(_font);
@@ -341,7 +341,7 @@ int BalloonManager_ns::setSingleBalloon(const Common::String &text, uint16 x, ui
 	_sw.write(text, MAX_BALLOON_WIDTH, _textColors[textColor], balloon->surface);
 
 	// TODO: extract some text to make a name for obj
-	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), 0);
+	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), nullptr);
 	balloon->obj->x = x;
 	balloon->obj->y = y;
 	balloon->obj->transparentKey = BALLOON_TRANSPARENT_COLOR_NS;
@@ -364,7 +364,7 @@ int BalloonManager_ns::setDialogueBalloon(const Common::String &text, uint16 win
 	_sw.write(text, MAX_BALLOON_WIDTH, _textColors[textColor], balloon->surface);
 
 	// TODO: extract some text to make a name for obj
-	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), 0);
+	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), nullptr);
 	balloon->obj->x = _dialogueBalloonX[id];
 	balloon->obj->y = 10;
 	balloon->obj->transparentKey = BALLOON_TRANSPARENT_COLOR_NS;
@@ -398,7 +398,7 @@ int BalloonManager_ns::setLocationBalloon(const Common::String &text, bool endGa
 	_sw.write(text, MAX_BALLOON_WIDTH, _textColors[kNormalColor], balloon->surface);
 
 	// TODO: extract some text to make a name for obj
-	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), 0);
+	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), nullptr);
 	balloon->obj->x = 5;
 	balloon->obj->y = 5;
 	balloon->obj->transparentKey = BALLOON_TRANSPARENT_COLOR_NS;
@@ -423,8 +423,8 @@ int BalloonManager_ns::hitTestDialogueBalloon(int x, int y) {
 
 void BalloonManager_ns::reset() {
 	for (uint i = 0; i < _numBalloons; i++) {
-		_intBalloons[i].obj = 0;
-		_intBalloons[i].surface = 0;	// no need to delete surface, since it is done by Gfx
+		_intBalloons[i].obj = nullptr;
+		_intBalloons[i].surface = nullptr;	// no need to delete surface, since it is done by Gfx
 	}
 	_numBalloons = 0;
 }
@@ -481,7 +481,7 @@ class StringWriter_BR : public WrappedLineFormatter {
 
 protected:
 	StringWriter_BR(Font *font, byte color) : WrappedLineFormatter(font), _width(0), _height(0),
-			_color(color), _x(0), _y(0), _surf(NULL) {
+			_color(color), _x(0), _y(0), _surf(nullptr) {
 
 	}
 
@@ -505,7 +505,7 @@ protected:
 
 public:
 	StringWriter_BR(Font *font) : WrappedLineFormatter(font), _width(0), _height(0),
-			_color(0), _x(0), _y(0), _surf(NULL) { }
+			_color(0), _x(0), _y(0), _surf(nullptr) { }
 
 	void write(const Common::String &text, uint maxWidth, byte color, Graphics::Surface *surf) {
 		StringExtent_BR	se(_font);
@@ -587,7 +587,7 @@ int BalloonManager_br::setSingleBalloon(const Common::String &text, uint16 x, ui
 	cacheAnims();
 
 	int id = _numBalloons;
-	Frames *src = 0;
+	Frames *src = nullptr;
 	int srcFrame = 0;
 
 	Balloon *balloon = &_intBalloons[id];
@@ -609,7 +609,7 @@ int BalloonManager_br::setSingleBalloon(const Common::String &text, uint16 x, ui
 	_sw.write(text, 216, _textColors[textColor], balloon->surface);
 
 	// TODO: extract some text to make a name for obj
-	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), 0);
+	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), nullptr);
 	balloon->obj->x = x + balloon->box.left;
 	balloon->obj->y = y + balloon->box.top;
 	balloon->obj->transparentKey = BALLOON_TRANSPARENT_COLOR_BR;
@@ -623,7 +623,7 @@ int BalloonManager_br::setDialogueBalloon(const Common::String &text, uint16 win
 	cacheAnims();
 
 	int id = _numBalloons;
-	Frames *src = 0;
+	Frames *src = nullptr;
 	int srcFrame = 0;
 
 	Balloon *balloon = &_intBalloons[id];
@@ -646,7 +646,7 @@ int BalloonManager_br::setDialogueBalloon(const Common::String &text, uint16 win
 	_sw.write(text, 216, _textColors[textColor], balloon->surface);
 
 	// TODO: extract some text to make a name for obj
-	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), 0);
+	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), nullptr);
 	balloon->obj->x = balloon->box.left;
 	balloon->obj->y = balloon->box.top;
 	balloon->obj->transparentKey = BALLOON_TRANSPARENT_COLOR_BR;
@@ -688,7 +688,7 @@ int BalloonManager_br::setLocationBalloon(const Common::String &text, bool endGa
 
 	_sw.write(text, 240, kNormalColor, balloon->surface);
 
-	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), 0);
+	balloon->obj = _vm->_gfx->registerBalloon(new SurfaceToFrames(balloon->surface), nullptr);
 	balloon->obj->x = 5;
 	balloon->obj->y = 5;
 	balloon->obj->transparentKey = BALLOON_TRANSPARENT_COLOR_BR;
@@ -709,8 +709,8 @@ int BalloonManager_br::hitTestDialogueBalloon(int x, int y) {
 
 void BalloonManager_br::reset() {
 	for (uint i = 0; i < _numBalloons; i++) {
-		_intBalloons[i].obj = 0;
-		_intBalloons[i].surface = 0;	// no need to delete surface, since it is done by Gfx
+		_intBalloons[i].obj = nullptr;
+		_intBalloons[i].surface = nullptr;	// no need to delete surface, since it is done by Gfx
 	}
 
 	_numBalloons = 0;
@@ -726,7 +726,7 @@ void BalloonManager_br::cacheAnims() {
 
 
 BalloonManager_br::BalloonManager_br(Parallaction_br *vm, Font *font) : _vm(vm), _numBalloons(0),
-	_leftBalloon(0), _rightBalloon(0), _sw(font), _se(font) {
+	_leftBalloon(nullptr), _rightBalloon(nullptr), _sw(font), _se(font) {
 
 	if (_vm->getPlatform() == Common::kPlatformDOS) {
 		_textColors[kSelectedColor] = 12;
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index 11e11634bc..3b5faad9ed 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -33,7 +33,7 @@
 static const PlainGameDescriptor parallactionGames[] = {
 	{"nippon", "Nippon Safes Inc."},
 	{"bra", "The Big Red Adventure"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 8164a91bc4..d9ce28b618 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -138,12 +138,12 @@ DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) {
 	_questioner = isNpc ? _vm->_disk->loadTalk(_z->u._filename.c_str()) : _vm->_char._talk;
 	_answerer = _vm->_char._talk;
 
-	_cmdList = 0;
+	_cmdList = nullptr;
 	_answerId = 0;
 
 	_faceId = 0;
 
-	_q = NULL;
+	_q = nullptr;
 	memset(_visAnswers, 0, sizeof(_visAnswers));
 	_numVisAnswers = 0;
 
@@ -295,7 +295,7 @@ void DialogueManager::runQuestion() {
 
 
 void DialogueManager::nextAnswer() {
-	if (_q->_answers[0] == NULL) {
+	if (_q->_answers[0] == nullptr) {
 		transitionToState(DIALOGUE_OVER);
 		return;
 	}
@@ -333,7 +333,7 @@ void DialogueManager::runAnswer() {
 
 void DialogueManager::nextQuestion() {
 	_q = _dialogue->findQuestion(_q->_answers[_answerId]->_followingName);
-	if (_q == 0) {
+	if (_q == nullptr) {
 		transitionToState(DIALOGUE_OVER);
 	} else {
 		transitionToState(displayQuestion() ? RUN_QUESTION : NEXT_ANSWER);
@@ -555,7 +555,7 @@ void Parallaction::exitDialogueMode() {
 void Parallaction::destroyDialogueManager() {
 	// destroy the _dialogueMan here
 	delete _dialogueMan;
-	_dialogueMan = 0;
+	_dialogueMan = nullptr;
 }
 
 void Parallaction::runDialogueFrame() {
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index dc0adf994d..6a2722d362 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -41,7 +41,7 @@ struct Sprite {
 
 	byte *packedData;
 
-	Sprite() : size(0), x(0), y(0), w(0), h(0), packedData(0) {
+	Sprite() : size(0), x(0), y(0), w(0), h(0), packedData(nullptr) {
 	}
 
 	~Sprite() {
@@ -53,7 +53,7 @@ struct Sprites : public Frames {
 	uint16		_num;
 	Sprite*		_sprites;
 
-	Sprites(uint num) : _num(0), _sprites(0) {
+	Sprites(uint num) : _num(0), _sprites(nullptr) {
 		_num = num;
 		_sprites = new Sprite[_num];
 	}
@@ -208,7 +208,7 @@ Script* DosDisk_br::loadScript(const char* name) {
 //	there are no Head resources in Big Red Adventure
 GfxObj* DosDisk_br::loadHead(const char* name) {
 	debugC(5, kDebugDisk, "DosDisk_br::loadHead");
-	return 0;
+	return nullptr;
 }
 
 void DosDisk_br::loadBitmap(Common::SeekableReadStream &stream, Graphics::Surface &surf, byte *palette) {
@@ -232,7 +232,7 @@ Frames* DosDisk_br::loadPointer(const char *name) {
 	debugC(5, kDebugDisk, "DosDisk_br::loadPointer");
 	Common::SeekableReadStream *stream = openFile(Common::String(name), ".ras");
 	Graphics::Surface *surf = new Graphics::Surface;
-	loadBitmap(*stream, *surf, 0);
+	loadBitmap(*stream, *surf, nullptr);
 	delete stream;
 	return new SurfaceToFrames(surf);
 }
@@ -263,7 +263,7 @@ GfxObj* DosDisk_br::loadStatic(const char* name) {
 	debugC(5, kDebugDisk, "DosDisk_br::loadStatic");
 	Common::SeekableReadStream *stream = openFile("ras/" + Common::String(name), ".ras");
 	Graphics::Surface *surf = new Graphics::Surface;
-	loadBitmap(*stream, *surf, 0);
+	loadBitmap(*stream, *surf, nullptr);
 	delete stream;
 	return new GfxObj(0, new SurfaceToFrames(surf), name);
 }
@@ -291,7 +291,7 @@ Sprites* DosDisk_br::createSprites(Common::ReadStream *stream) {
 }
 
 Frames* DosDisk_br::loadFrames(const char* name) {
-	Common::SeekableReadStream *stream = 0;
+	Common::SeekableReadStream *stream = nullptr;
 
 	debugC(5, kDebugDisk, "DosDisk_br::loadFrames");
 
@@ -330,7 +330,7 @@ void DosDisk_br::loadSlide(BackgroundInfo& info, const char *name) {
 
 MaskBuffer *DosDisk_br::loadMask(const char *name, uint32 w, uint32 h) {
 	if (!name) {
-		return 0;
+		return nullptr;
 	}
 
 	Common::SeekableReadStream *stream = openFile("msk/" + Common::String(name), ".msk");
@@ -348,7 +348,7 @@ MaskBuffer *DosDisk_br::loadMask(const char *name, uint32 w, uint32 h) {
 
 PathBuffer *DosDisk_br::loadPath(const char *name, uint32 w, uint32 h) {
 	if (!name) {
-		return 0;
+		return nullptr;
 	}
 
 	Common::SeekableReadStream *stream = openFile("pth/" + Common::String(name), ".pth");
@@ -535,13 +535,13 @@ void finalpass(byte *buffer, uint32 size) {
 
 MaskBuffer *AmigaDisk_br::loadMask(const char *name, uint32 w, uint32 h) {
 	if (!name) {
-		return 0;
+		return nullptr;
 	}
 	debugC(1, kDebugDisk, "AmigaDisk_br::loadMask '%s'", name);
 
 	Common::SeekableReadStream *stream = tryOpenFile("msk/" + Common::String(name), ".msk");
 	if (!stream) {
-		return 0;
+		return nullptr;
 	}
 
 	Image::IFFDecoder decoder;
@@ -650,7 +650,7 @@ Sprites* AmigaDisk_br::createSprites(Common::ReadStream *stream) {
 }
 
 Frames* AmigaDisk_br::loadFrames(const char* name) {
-	Common::SeekableReadStream *stream = 0;
+	Common::SeekableReadStream *stream = nullptr;
 
 	debugC(5, kDebugDisk, "AmigaDisk_br::loadFrames");
 
@@ -762,7 +762,7 @@ Common::String AmigaDisk_br::selectArchive(const Common::String& name) {
 }
 
 
-Disk_br::Disk_br(Parallaction *vm) : _vm(vm), _baseDir(0), _language(0) {
+Disk_br::Disk_br(Parallaction *vm) : _vm(vm), _baseDir(nullptr), _language(0) {
 }
 
 Disk_br::~Disk_br() {
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index 0a0ad96c2e..058e633a93 100644
--- a/engines/parallaction/disk_ns.cpp
+++ b/engines/parallaction/disk_ns.cpp
@@ -128,10 +128,10 @@ Common::SeekableReadStream *NSArchive::createReadStreamForMember(const Common::P
 	debugC(3, kDebugDisk, "NSArchive::createReadStreamForMember(%s)", name.c_str());
 
 	if (name.empty())
-		return 0;
+		return nullptr;
 
 	uint32 index = lookup(name.c_str());
-	if (index == _numFiles) return 0;
+	if (index == _numFiles) return nullptr;
 
 	debugC(9, kDebugDisk, "NSArchive::createReadStreamForMember: '%s' found in slot %i", name.c_str(), index);
 
@@ -158,7 +158,7 @@ const Common::ArchiveMemberPtr NSArchive::getMember(const Common::Path &path) co
 	Common::String name = path.toString();
 	uint32 index = lookup(name.c_str());
 
-	const char *item = 0;
+	const char *item = nullptr;
 	if (index < _numFiles) {
 		item = _archiveDir[index];
 	}
@@ -241,7 +241,7 @@ void Disk_ns::setLanguage(uint16 language) {
 #pragma mark -
 
 
-DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm), _gfx(NULL) {
+DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm), _gfx(nullptr) {
 
 }
 
@@ -503,7 +503,7 @@ void DosDisk_ns::loadScenery(BackgroundInfo& info, const char *name, const char
 	// load bitmap
 	loadBackground(info, filename);
 
-	if (mask == 0) {
+	if (mask == nullptr) {
 		return;
 	}
 
@@ -537,7 +537,7 @@ Common::SeekableReadStream* DosDisk_ns::loadMusic(const char* name) {
 
 
 Common::SeekableReadStream* DosDisk_ns::loadSound(const char* name) {
-	return 0;
+	return nullptr;
 }
 
 
@@ -805,7 +805,7 @@ void AmigaDisk_ns::patchFrame(byte *dst, byte *dlta, uint16 bytesPerPlane, uint1
 void AmigaDisk_ns::unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 bytesPerPlane, uint16 height) {
 
 	byte *baseFrame = src;
-	byte *tempBuffer = 0;
+	byte *tempBuffer = nullptr;
 
 	uint16 planeSize = bytesPerPlane * height;
 
@@ -814,7 +814,7 @@ void AmigaDisk_ns::unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 b
 
 			uint size = READ_BE_UINT32(src + 4);
 
-			if (tempBuffer == 0)
+			if (tempBuffer == nullptr)
 				tempBuffer = (byte *)malloc(planeSize * NUM_PLANES);
 
 			memcpy(tempBuffer, baseFrame, planeSize * NUM_PLANES);
@@ -885,7 +885,7 @@ Common::SeekableReadStream *AmigaDisk_ns::tryOpenFile(const char* name) {
 		return ret;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 
@@ -1012,7 +1012,7 @@ void AmigaDisk_ns::loadScenery(BackgroundInfo& info, const char* background, con
 
 	loadBackground(info, filename);
 
-	if (mask == 0) {
+	if (mask == nullptr) {
 		loadMask_internal(info, background);
 		loadPath_internal(info, background);
 	} else {
diff --git a/engines/parallaction/exec.cpp b/engines/parallaction/exec.cpp
index 3d4e9bd803..9441e280a2 100644
--- a/engines/parallaction/exec.cpp
+++ b/engines/parallaction/exec.cpp
@@ -81,7 +81,7 @@ void ProgramExec::runScripts(ProgramList::iterator first, ProgramList::iterator
 	return;
 }
 
-ProgramExec::ProgramExec() : _modCounter(0), _instructionNames(NULL) {
+ProgramExec::ProgramExec() : _modCounter(0), _instructionNames(nullptr) {
 }
 
 
@@ -102,7 +102,7 @@ void CommandExec::runList(CommandList::iterator first, CommandList::iterator las
 		if (cmd->_valid && !cmd->_zone && !cmd->_zoneName.empty()) {
 			// try binding the command to a zone
 			cmd->_zone = _vm->_location.findZone(cmd->_zoneName.c_str());
-			cmd->_valid = cmd->_zone != 0;
+			cmd->_valid = cmd->_zone != nullptr;
 		}
 
 		if (!cmd->_valid) {
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index f72738f745..1a504bd5cb 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -95,7 +95,7 @@ void Parallaction_br::setupSubtitles(const char *s, const char *s2, int y) {
 		_subtitle[1] = _gfx->createLabel(_labelFont, s2, color);
 		_gfx->showLabel(_subtitle[1], CENTER_LABEL_HORIZONTAL, _subtitleY + 5 + _labelFont->height());
 	} else {
-		_subtitle[1] = 0;
+		_subtitle[1] = nullptr;
 	}
 #if 0	// disabled because no references to lip sync has been found in the scripts
 	_subtitleLipSync = 0;
@@ -107,13 +107,13 @@ void Parallaction_br::clearSubtitles() {
 		_gfx->hideLabel(_subtitle[0]);
 	}
 	delete _subtitle[0];
-	_subtitle[0] = 0;
+	_subtitle[0] = nullptr;
 
 	if (_subtitle[1]) {
 		_gfx->hideLabel(_subtitle[1]);
 	}
 	delete _subtitle[1];
-	_subtitle[1] = 0;
+	_subtitle[1] = nullptr;
 }
 
 
@@ -585,7 +585,7 @@ DECLARE_INSTRUCTION_OPCODE(show) {
 }
 
 DECLARE_INSTRUCTION_OPCODE(call) {
-	_vm->callFunction(ctxt._inst->_immediate, 0);
+	_vm->callFunction(ctxt._inst->_immediate, nullptr);
 }
 
 
@@ -602,7 +602,7 @@ DECLARE_INSTRUCTION_OPCODE(endscript) {
 
 
 CommandExec_br::CommandExec_br(Parallaction_br* vm) : CommandExec(vm), _vm(vm) {
-	CommandOpcodeSet *table = 0;
+	CommandOpcodeSet *table = nullptr;
 
 	SetOpcodeTable(_opcodes);
 	COMMAND_OPCODE(invalid);
@@ -653,7 +653,7 @@ CommandExec_br::CommandExec_br(Parallaction_br* vm) : CommandExec(vm), _vm(vm) {
 ProgramExec_br::ProgramExec_br(Parallaction_br *vm) : _vm(vm) {
 	_instructionNames = _instructionNamesRes_br;
 
-	ProgramOpcodeSet *table = 0;
+	ProgramOpcodeSet *table = nullptr;
 
 	SetOpcodeTable(_opcodes);
 	INSTRUCTION_OPCODE(invalid);
diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp
index de1ca35243..f2bb7d319d 100644
--- a/engines/parallaction/exec_ns.cpp
+++ b/engines/parallaction/exec_ns.cpp
@@ -144,7 +144,7 @@ DECLARE_INSTRUCTION_OPCODE(invalid) {
 }
 
 DECLARE_INSTRUCTION_OPCODE(call) {
-	_vm->callFunction(ctxt._inst->_immediate, 0);
+	_vm->callFunction(ctxt._inst->_immediate, nullptr);
 }
 
 
@@ -292,7 +292,7 @@ DECLARE_COMMAND_OPCODE(stop) {
 }
 
 CommandExec_ns::CommandExec_ns(Parallaction_ns* vm) : CommandExec(vm), _vm(vm) {
-	CommandOpcodeSet *table = 0;
+	CommandOpcodeSet *table = nullptr;
 
 	SetOpcodeTable(_opcodes);
 	COMMAND_OPCODE(invalid);
@@ -317,7 +317,7 @@ CommandExec_ns::CommandExec_ns(Parallaction_ns* vm) : CommandExec(vm), _vm(vm) {
 ProgramExec_ns::ProgramExec_ns(Parallaction_ns *vm) : _vm(vm) {
 	_instructionNames = _instructionNamesRes_ns;
 
-	ProgramOpcodeSet *table = 0;
+	ProgramOpcodeSet *table = nullptr;
 
 	SetOpcodeTable(_opcodes);
 	INSTRUCTION_OPCODE(invalid);
diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp
index 2f30e2bc92..6cfed2c615 100644
--- a/engines/parallaction/font.cpp
+++ b/engines/parallaction/font.cpp
@@ -46,11 +46,11 @@ protected:
 	const byte	*_charMap;
 
 	byte mapChar(byte c) {
-		return (_charMap == 0) ? c : _charMap[c];
+		return (_charMap == nullptr) ? c : _charMap[c];
 	}
 
 public:
-	BraFont(Common::ReadStream &stream, const byte *charMap = 0) {
+	BraFont(Common::ReadStream &stream, const byte *charMap = nullptr) {
 		_charMap = charMap;
 
 		_numGlyphs = stream.readByte();
@@ -69,7 +69,7 @@ public:
 		_data = (byte *)malloc(size);
 		stream.read(_data, size);
 
-		_cp = 0;
+		_cp = nullptr;
 		_bufPitch = 0;
 	}
 
@@ -122,7 +122,7 @@ public:
 	}
 
 	void drawString(Graphics::Surface *src, int x, int y, const char *s) override {
-		if (src == NULL)
+		if (src == nullptr)
 			return;
 
 		_bufPitch = src->pitch;
@@ -303,7 +303,7 @@ protected:
 	}
 
 public:
-	DosFont(Cnv *cnv) : _data(cnv), _pitch(cnv->_width), _cp(NULL), _bufPitch(0) {
+	DosFont(Cnv *cnv) : _data(cnv), _pitch(cnv->_width), _cp(nullptr), _bufPitch(0) {
 	}
 
 	~DosFont() override {
@@ -327,7 +327,7 @@ public:
 	}
 
 	void drawString(Graphics::Surface *src, int x, int y, const char *s) override {
-		if (src == NULL)
+		if (src == nullptr)
 			return;
 
 		_bufPitch = src->pitch;
@@ -443,7 +443,7 @@ class AmigaFont : public Font {
 	Graphics::AmigaFont *_font;
 
 public:
-	AmigaFont(Common::SeekableReadStream *stream = NULL) {
+	AmigaFont(Common::SeekableReadStream *stream = nullptr) {
 		_font = new Graphics::AmigaFont(stream);
 	}
 	~AmigaFont() override {
@@ -464,7 +464,7 @@ protected:
 };
 
 Font *DosDisk_ns::createFont(const char *name, Cnv* cnv) {
-	Font *f = 0;
+	Font *f = nullptr;
 
 	if (!scumm_stricmp(name, "comic"))
 		f = new DosDialogueFont(cnv);
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index bc6822ace6..1599870b50 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -280,7 +280,7 @@ void Gfx::setProjectorPos(int x, int y) {
 }
 
 void Gfx::setProjectorProgram(int16 *data) {
-	if (_nextProjectorPos == 0) {
+	if (_nextProjectorPos == nullptr) {
 		_nextProjectorPos = data;
 	}
 }
@@ -419,7 +419,7 @@ void Gfx::updateScreen() {
 	// is needed
 	_overlayMode = false;
 
-	bool skipBackground = (_backgroundInfo->bg.getPixels() == 0);	// don't render frame if background is missing
+	bool skipBackground = (_backgroundInfo->bg.getPixels() == nullptr);	// don't render frame if background is missing
 
 	if (!skipBackground) {
 		// background may not cover the whole screen, so adjust bulk update size
@@ -569,15 +569,15 @@ void Gfx::showFloatingLabel(GfxObj *label) {
 }
 
 void Gfx::hideFloatingLabel() {
-	if (_floatingLabel != 0) {
+	if (_floatingLabel != nullptr) {
 		_floatingLabel->clearFlags(kGfxObjVisible);
 	}
-	_floatingLabel = 0;
+	_floatingLabel = nullptr;
 }
 
 
 void Gfx::updateFloatingLabel() {
-	if (_floatingLabel == 0) {
+	if (_floatingLabel == nullptr) {
 		return;
 	}
 
@@ -685,7 +685,7 @@ void Gfx::hideLabel(GfxObj *label) {
 
 void Gfx::freeLabels() {
 	_labels.clear();
-	_floatingLabel = 0;
+	_floatingLabel = nullptr;
 }
 
 void Gfx::unregisterLabel(GfxObj *label) {
@@ -719,7 +719,7 @@ void Gfx::grabBackground(const Common::Rect& r, Graphics::Surface &dst) {
 
 
 Gfx::Gfx(Parallaction* vm) :
-	_vm(vm), _disk(vm->_disk), _backgroundInfo(0),
+	_vm(vm), _disk(vm->_disk), _backgroundInfo(nullptr),
 	_scrollPosX(0), _scrollPosY(0),_minScrollX(0), _maxScrollX(0),
 	_minScrollY(0), _maxScrollY(0),
 	_requestedHScrollSteps(0), _requestedVScrollSteps(0),
@@ -732,12 +732,12 @@ Gfx::Gfx(Parallaction* vm) :
 
 	setPalette(_palette);
 
-	_floatingLabel = 0;
+	_floatingLabel = nullptr;
 
-	_backgroundInfo = 0;
+	_backgroundInfo = nullptr;
 
 	_halfbrite = false;
-	_nextProjectorPos = 0;
+	_nextProjectorPos = nullptr;
 	_hbCircleRadius = 0;
 
 	_overlayMode = false;
@@ -824,7 +824,7 @@ void Gfx::setBackground(uint type, BackgroundInfo *info) {
 	}
 
 	_hbCircleRadius = 0;
-	_nextProjectorPos = 0;
+	_nextProjectorPos = nullptr;
 
 	delete _backgroundInfo;
 	_backgroundInfo = info;
@@ -868,7 +868,7 @@ void Gfx::setBackground(uint type, BackgroundInfo *info) {
 }
 
 
-BackgroundInfo::BackgroundInfo() : _x(0), _y(0), width(0), height(0), _mask(0), _path(0) {
+BackgroundInfo::BackgroundInfo() : _x(0), _y(0), width(0), height(0), _mask(nullptr), _path(nullptr) {
 	layers[0] = layers[1] = layers[2] = layers[3] = 0;
 	memset(ranges, 0, sizeof(ranges));
 }
@@ -880,7 +880,7 @@ BackgroundInfo::~BackgroundInfo() {
 }
 
 bool BackgroundInfo::hasMask() {
-	return _mask != 0;
+	return _mask != nullptr;
 }
 
 void BackgroundInfo::clearMaskData() {
@@ -891,7 +891,7 @@ void BackgroundInfo::clearMaskData() {
 	}
 	_maskPatches.clear();
 	delete _mask;
-	_mask = 0;
+	_mask = nullptr;
 	_maskBackup.free();
 }
 
@@ -941,7 +941,7 @@ void BackgroundInfo::setPaletteRange(int index, const PaletteFxRange& range) {
 }
 
 bool BackgroundInfo::hasPath() {
-	return _path != 0;
+	return _path != nullptr;
 }
 
 void BackgroundInfo::clearPathData() {
@@ -952,7 +952,7 @@ void BackgroundInfo::clearPathData() {
 	}
 	_pathPatches.clear();
 	delete _path;
-	_path = 0;
+	_path = nullptr;
 	_pathBackup.free();
 }
 
@@ -989,7 +989,7 @@ void BackgroundInfo::togglePathPatch(uint id, int x, int y, bool apply) {
 	}
 }
 
-MaskBuffer::MaskBuffer() : w(0), internalWidth(0), h(0), size(0), data(0), bigEndian(true) {
+MaskBuffer::MaskBuffer() : w(0), internalWidth(0), h(0), size(0), data(nullptr), bigEndian(true) {
 }
 
 MaskBuffer::~MaskBuffer() {
@@ -1021,7 +1021,7 @@ void MaskBuffer::create(uint16 width, uint16 height) {
 
 void MaskBuffer::free() {
 	::free(data);
-	data = 0;
+	data = nullptr;
 	w = 0;
 	h = 0;
 	internalWidth = 0;
@@ -1072,7 +1072,7 @@ void MaskBuffer::bltCopy(uint16 dx, uint16 dy, const MaskBuffer &src, uint16 sx,
 
 
 
-PathBuffer::PathBuffer() : w(0), internalWidth(0), h(0), size(0), data(0), bigEndian(true) {
+PathBuffer::PathBuffer() : w(0), internalWidth(0), h(0), size(0), data(nullptr), bigEndian(true) {
 }
 
 PathBuffer::~PathBuffer() {
@@ -1100,7 +1100,7 @@ void PathBuffer::create(uint16 width, uint16 height) {
 
 void PathBuffer::free() {
 	::free(data);
-	data = 0;
+	data = nullptr;
 	w = 0;
 	h = 0;
 	internalWidth = 0;
diff --git a/engines/parallaction/gui.cpp b/engines/parallaction/gui.cpp
index a2d33f0256..7aa3aeaca5 100644
--- a/engines/parallaction/gui.cpp
+++ b/engines/parallaction/gui.cpp
@@ -27,7 +27,7 @@
 namespace Parallaction {
 
 bool MenuInputHelper::run() {
-	if (_newState == 0) {
+	if (_newState == nullptr) {
 		debugC(3, kDebugExec, "MenuInputHelper has set NULL state");
 		return false;
 	}
@@ -73,7 +73,7 @@ void Parallaction::runGuiFrame() {
 
 void Parallaction::cleanupGui() {
 	delete _menuHelper;
-	_menuHelper = 0;
+	_menuHelper = nullptr;
 }
 
 void Parallaction::setInternLanguage(uint id) {
diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp
index e0e85a263a..a5766fb915 100644
--- a/engines/parallaction/gui_br.cpp
+++ b/engines/parallaction/gui_br.cpp
@@ -171,7 +171,7 @@ class MainMenuInputState_BR : public MenuInputState {
 
 		for (int i = 0; i < _availItems; i++) {
 			delete _lines[i];
-			_lines[i] = 0;
+			_lines[i] = nullptr;
 		}
 	}
 
@@ -196,8 +196,8 @@ public:
 	MainMenuInputState_BR(Parallaction_br *vm, MenuInputHelper *helper) : MenuInputState("mainmenu", helper), _vm(vm)  {
 	    memset(_lines, 0, sizeof(_lines));
 
-		_menuStrings = 0;
-		_options = 0;
+		_menuStrings = nullptr;
+		_options = nullptr;
 		_availItems = 0;
 		_selection = 0;
 	}
@@ -236,7 +236,7 @@ public:
 		_vm->_system->showMouse(false);
 		cleanup();
 
-		return 0;
+		return nullptr;
 	}
 
 	void enter() override {
@@ -448,7 +448,7 @@ public:
 
 		if (close) {
 			_vm->_gfx->freeDialogueObjects();
-			return 0;
+			return nullptr;
 		}
 
 		_vm->_input->setArrowCursor();
@@ -520,7 +520,7 @@ public:
 
 		if (key == 'y' || key == 'Y') {
 			_vm->quitGame();
-			return 0;
+			return nullptr;
 		} else
 		if (key == 'n' || key == 'N') {
 			// NOTE: when the quit dialog is hidden, the in-game menu is
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index 2eefa7e0ea..084e803c15 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -117,8 +117,8 @@ public:
 	ChooseLanguageInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("chooselanguage", helper), _vm(vm) {
 		_allowChoice = false;
 		_nextState = "selectgame";
-		_label = 0;
-		_blocks = 0;
+		_label = nullptr;
+		_blocks = nullptr;
 
 		_dosLanguageSelectBlocks[0] = Common::Rect(  80, 110, 128, 180 );	// Italian
 		_dosLanguageSelectBlocks[1] = Common::Rect( 129,  85, 177, 155 );	// French
@@ -159,7 +159,7 @@ public:
 	void destroyLabels() {
 		_vm->_gfx->unregisterLabel(_label);
 		delete _label;
-		_label = 0;
+		_label = nullptr;
 	}
 
 	MenuInputState* run() override {
@@ -225,8 +225,8 @@ public:
 		_nextState[0] = "newgame";
 		_nextState[1] = "loadgame";
 
-		_labels[0] = 0;
-		_labels[1] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
 	}
 
 	~SelectGameInputState_NS() override {
@@ -238,8 +238,8 @@ public:
 		_vm->_gfx->unregisterLabel(_labels[1]);
 		delete _labels[0];
 		delete _labels[1];
-		_labels[0] = 0;
-		_labels[1] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
 	}
 
 
@@ -305,7 +305,7 @@ public:
 		if (!_result) {
 			_vm->scheduleLocationSwitch("fogne.dough");
 		}
-		return 0;
+		return nullptr;
 	}
 
 	void enter() override {
@@ -323,10 +323,10 @@ class NewGameInputState_NS : public MenuInputState {
 
 public:
 	NewGameInputState_NS(Parallaction_ns *vm, MenuInputHelper *helper) : MenuInputState("newgame", helper), _vm(vm) {
-		_labels[0] = 0;
-		_labels[1] = 0;
-		_labels[2] = 0;
-		_labels[3] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
+		_labels[2] = nullptr;
+		_labels[3] = nullptr;
 	}
 
 	~NewGameInputState_NS() override {
@@ -342,7 +342,7 @@ public:
 
 			if (event == kMouseLeftUp) {
 				_vm->scheduleLocationSwitch("fogne.dough");
-				return 0;
+				return nullptr;
 			}
 
 			return _helper->getState("selectcharacter");
@@ -360,10 +360,10 @@ public:
 		delete _labels[1];
 		delete _labels[2];
 		delete _labels[3];
-		_labels[0] = 0;
-		_labels[1] = 0;
-		_labels[2] = 0;
-		_labels[3] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
+		_labels[2] = nullptr;
+		_labels[3] = nullptr;
 	}
 
 	void enter() override {
@@ -400,7 +400,7 @@ public:
 	MenuInputState* run() override {
 		_vm->scheduleLocationSwitch("fognedemo.dough");
 		_vm->_input->setMouseState(MOUSE_ENABLED_SHOW);
-		return 0;
+		return nullptr;
 	}
 
 	void enter() override {
@@ -475,8 +475,8 @@ public:
 	SelectCharacterInputState_NS(Parallaction_ns *vm, MenuInputHelper *helper) : MenuInputState("selectcharacter", helper), _vm(vm) {
 		_keys = (_vm->getPlatform() == Common::kPlatformAmiga && (_vm->getFeatures() & GF_LANG_MULT)) ? _amigaKeys : _pcKeys;
 		_block.create(BLOCK_WIDTH, BLOCK_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
-		_labels[0] = 0;
-		_labels[1] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
 
 		_fail = false;
 		_len = 0;
@@ -516,8 +516,8 @@ public:
 		_vm->_gfx->unregisterLabel(_labels[1]);
 		delete _labels[0];
 		delete _labels[1];
-		_labels[0] = 0;
-		_labels[1] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
 	}
 
 	void cleanup() {
@@ -616,7 +616,7 @@ public:
 
 		case SUCCESS:
 			success();
-			nextState = 0;
+			nextState = nullptr;
 			break;
 
 		default:
@@ -693,8 +693,8 @@ class ShowCreditsInputState_NS : public MenuInputState {
 
 public:
 	ShowCreditsInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("showcredits", helper), _vm(vm) {
-		_labels[0] = 0;
-		_labels[1] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
 
 		_current = 0;
 		_startTime = 0;
@@ -709,8 +709,8 @@ public:
 		_vm->_gfx->unregisterLabel(_labels[1]);
 		delete _labels[0];
 		delete _labels[1];
-		_labels[0] = 0;
-		_labels[1] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
 	}
 
 	void drawCurrentLabel() {
@@ -771,7 +771,7 @@ class EndIntroInputState_NS : public MenuInputState {
 public:
 	EndIntroInputState_NS(Parallaction_ns *vm, MenuInputHelper *helper) : MenuInputState("endintro", helper), _vm(vm) {
 		_isDemo = (_vm->getFeatures() & GF_DEMO) != 0;
-		_label = 0;
+		_label = nullptr;
 	}
 
 	~EndIntroInputState_NS() override {
@@ -781,7 +781,7 @@ public:
 	void destroyLabels() {
 		_vm->_gfx->unregisterLabel(_label);
 		delete _label;
-		_label = 0;
+		_label = nullptr;
 	}
 
 	MenuInputState* run() override {
@@ -793,7 +793,7 @@ public:
 
 		if (_isDemo) {
 			_vm->quitGame();
-			return 0;
+			return nullptr;
 		}
 
 		destroyLabels();
@@ -832,10 +832,10 @@ class EndPartInputState_NS : public MenuInputState {
 
 public:
 	EndPartInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("endpart", helper), _vm(vm) {
-		_labels[0] = 0;
-		_labels[1] = 0;
-		_labels[2] = 0;
-		_labels[3] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
+		_labels[2] = nullptr;
+		_labels[3] = nullptr;
 
 		_allPartsComplete = false;
 	}
@@ -851,10 +851,10 @@ public:
 		delete _labels[2];
 		delete _labels[3];
 
-		_labels[0] = 0;
-		_labels[1] = 0;
-		_labels[2] = 0;
-		_labels[3] = 0;
+		_labels[0] = nullptr;
+		_labels[1] = nullptr;
+		_labels[2] = nullptr;
+		_labels[3] = nullptr;
 	}
 
 	MenuInputState* run() override {
@@ -867,7 +867,7 @@ public:
 
 		if (_allPartsComplete) {
 			_vm->scheduleLocationSwitch("estgrotta.drki");
-			return 0;
+			return nullptr;
 		}
 
 		return _helper->getState("selectcharacter");
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
index cf66f417a6..bcfa90a271 100644
--- a/engines/parallaction/input.cpp
+++ b/engines/parallaction/input.cpp
@@ -73,11 +73,11 @@ Input::Input(Parallaction *vm) : _vm(vm) {
 	_inputMode = 0;
 	_hasKeyPressEvent = false;
 
-	_dinoCursor = 0;
-	_dougCursor = 0;
-	_donnaCursor = 0;
-	_comboArrow = 0;
-	_mouseArrow = 0;
+	_dinoCursor = nullptr;
+	_dougCursor = nullptr;
+	_donnaCursor = nullptr;
+	_comboArrow = nullptr;
+	_mouseArrow = nullptr;
 
 	initCursors();
 }
@@ -472,7 +472,7 @@ void Input::getAbsoluteCursorPos(Common::Point& p) const {
 
 void Input::initCursors() {
 
-	_dinoCursor = _donnaCursor = _dougCursor = 0;
+	_dinoCursor = _donnaCursor = _dougCursor = nullptr;
 
 	switch (_gameType) {
 	case GType_Nippon:
diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp
index 1bb96a26be..fbf74286db 100644
--- a/engines/parallaction/inventory.cpp
+++ b/engines/parallaction/inventory.cpp
@@ -150,7 +150,7 @@ Inventory *Parallaction_br::findInventory(const char *name) {
 	if (!scumm_stricmp(name, "doug")) {
 		return _dougInventory;
 	}
-	return 0;
+	return nullptr;
 }
 
 InventoryRenderer::InventoryRenderer(Parallaction *vm, InventoryProperties *props) : _vm(vm), _props(props) {
@@ -375,21 +375,21 @@ void Parallaction_br::initInventory() {
 void Parallaction_ns::destroyInventory() {
 	delete _inventoryRenderer;
 	delete _inventory;
-	_inventory = 0;
-	_inventoryRenderer = 0;
+	_inventory = nullptr;
+	_inventoryRenderer = nullptr;
 }
 
 void Parallaction_br::destroyInventory() {
 	delete _inventoryRenderer;
-	_inventory = 0;
-	_inventoryRenderer = 0;
+	_inventory = nullptr;
+	_inventoryRenderer = nullptr;
 
 	delete _dinoInventory;
 	delete _donnaInventory;
 	delete _dougInventory;
-	_dinoInventory = 0;
-	_donnaInventory = 0;
-	_dougInventory = 0;
+	_dinoInventory = nullptr;
+	_donnaInventory = nullptr;
+	_dougInventory = nullptr;
 }
 
 
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index f51acfb0d6..478d22c627 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -47,7 +47,7 @@ Command::Command() {
 }
 
 Animation::Animation() {
-	gfxobj = NULL;
+	gfxobj = nullptr;
 	_frame = 0;
 	_z = 0;
 }
@@ -96,7 +96,7 @@ uint16 Animation::getFrameNum() const {
 }
 
 byte* Animation::getFrameData() const {
-	if (!gfxobj) return NULL;
+	if (!gfxobj) return nullptr;
 	return gfxobj->getData(_frame);
 }
 
@@ -188,7 +188,7 @@ Zone::Zone() {
 	_type = 0;
 
 	_flags = kFlagsNoName;
-	_label = 0;
+	_label = nullptr;
 
 	// BRA specific
 	_index = INVALID_ZONE_INDEX;
@@ -237,7 +237,7 @@ Question *Dialogue::findQuestion(const Common::String &name) const {
 			return _questions[i];
 		}
 	}
-	return 0;
+	return nullptr;
 }
 
 void Dialogue::addQuestion(Question *q) {
@@ -364,9 +364,9 @@ void ScriptVar::setRandom(int16 seed) {
 
 ScriptVar::ScriptVar() {
 	_flags = 0;
-	_local = 0;
+	_local = nullptr;
 	_value = 0;
-	_field = 0;
+	_field = nullptr;
 }
 
 ScriptVar::~ScriptVar() {
@@ -431,7 +431,7 @@ void FixedTable::clear() {
 	uint32 deleted = 0;
 	for (uint32 i = _numFixed; i < _used; i++) {
 		free(_data[i]);
-		_data[i] = 0;
+		_data[i] = nullptr;
 		deleted++;
 	}
 
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 18257c0752..d74e6331c0 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -33,7 +33,7 @@
 #include "parallaction/walk.h"
 
 namespace Parallaction {
-Parallaction *g_vm = NULL;
+Parallaction *g_vm = nullptr;
 // public stuff
 
 char		g_saveData1[30] = { '\0' };
@@ -44,7 +44,7 @@ uint32		g_globalFlags = 0;
 
 Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) :
 	Engine(syst), _gameDescription(gameDesc), _location(getGameType()),
-	_dialogueMan(0), _rnd("parallaction") {
+	_dialogueMan(nullptr), _rnd("parallaction") {
 	// Setup mixer
 	syncSoundSettings();
 
@@ -54,26 +54,26 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam
 	_screenHeight = 0;
 	_screenSize = 0;
 	_gameType = 0;
-	_gfx = 0;
-	_disk = 0;
-	_input = 0;
-	_saveLoad = 0;
-	_menuHelper = 0;
-	_soundMan = 0;
-	_labelFont = 0;
-	_menuFont = 0;
-	_introFont = 0;
-	_dialogueFont = 0;
-	_globalFlagsNames = 0;
-	_objectsNames = 0;
-	_objects = 0;
-	_callableNames = 0;
-	_localFlagNames = 0;
-	_cmdExec = 0;
-	_programExec = 0;
-	_balloonMan = 0;
-	_inventoryRenderer = 0;
-	_inventory = 0;
+	_gfx = nullptr;
+	_disk = nullptr;
+	_input = nullptr;
+	_saveLoad = nullptr;
+	_menuHelper = nullptr;
+	_soundMan = nullptr;
+	_labelFont = nullptr;
+	_menuFont = nullptr;
+	_introFont = nullptr;
+	_dialogueFont = nullptr;
+	_globalFlagsNames = nullptr;
+	_objectsNames = nullptr;
+	_objects = nullptr;
+	_callableNames = nullptr;
+	_localFlagNames = nullptr;
+	_cmdExec = nullptr;
+	_programExec = nullptr;
+	_balloonMan = nullptr;
+	_inventoryRenderer = nullptr;
+	_inventory = nullptr;
 	_currentLocationIndex = 0;
 	_numLocations = 0;
 	_language = 0;
@@ -92,7 +92,7 @@ Parallaction::~Parallaction() {
 	_gfx->freeCharacterObjects();
 	_gfx->freeLocationObjects();
 	delete _balloonMan;
-	_balloonMan = 0;
+	_balloonMan = nullptr;
 
 	delete _localFlagNames;
 	_char._ani.reset();
@@ -105,8 +105,8 @@ Parallaction::~Parallaction() {
 Common::Error Parallaction::init() {
 	_gameType = getGameType();
 	g_engineFlags = 0;
-	_objectsNames = NULL;
-	_globalFlagsNames = NULL;
+	_objectsNames = nullptr;
+	_globalFlagsNames = nullptr;
 	_location._hasSound = false;
 	_numLocations = 0;
 	_location._startPosition.x = -1000;
@@ -115,7 +115,7 @@ Common::Error Parallaction::init() {
 	_location._followerStartPosition.x = -1000;
 	_location._followerStartPosition.y = -1000;
 	_location._followerStartFrame = 0;
-	_objects = 0;
+	_objects = nullptr;
 
 	_screenSize = _screenWidth * _screenHeight;
 
@@ -131,7 +131,7 @@ Common::Error Parallaction::init() {
 
 	setDebugger(new Debugger(this));
 
-	_menuHelper = 0;
+	_menuHelper = nullptr;
 
 	return Common::kNoError;
 }
@@ -431,7 +431,7 @@ void Parallaction::drawZone(ZonePtr zone) {
 		return;
 	}
 
-	GfxObj *obj = 0;
+	GfxObj *obj = nullptr;
 	if (ACTIONTYPE(zone) == kZoneGet) {
 		obj = zone->u._gfxobj;
 	} else
@@ -508,7 +508,7 @@ void Parallaction::enterCommentMode(ZonePtr z) {
 	// TODO: move this balloons stuff into DialogueManager and BalloonManager
 	if (_gameType == GType_Nippon) {
 		if (!data->_filename.empty()) {
-			if (data->_gfxobj == 0) {
+			if (data->_gfxobj == nullptr) {
 				data->_gfxobj = _disk->loadStatic(data->_filename.c_str());
 			}
 
@@ -851,8 +851,8 @@ void Location::freeZones(bool removeAll) {
 }
 
 Character::Character() : _ani(new Animation) {
-	_talk = NULL;
-	_head = NULL;
+	_talk = nullptr;
+	_head = nullptr;
 
 	_ani->setX(150);
 	_ani->setY(100);
@@ -908,8 +908,8 @@ void CharacterName::dummify() {
 CharacterName::CharacterName() {
 	dummify();
 
-	_suffix = 0;
-	_prefix = 0;
+	_suffix = nullptr;
+	_prefix = nullptr;
 }
 
 CharacterName::CharacterName(const char *name) {
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index e3701f72e4..f028abb6c6 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -44,16 +44,16 @@ const char *Parallaction_br::_partNames[] = {
 };
 
 Parallaction_br::Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc),
-	_locationParser(0), _programParser(0), _soundManI(0) {
-	_audioCommandsNamesRes = 0;
+	_locationParser(nullptr), _programParser(nullptr), _soundManI(nullptr) {
+	_audioCommandsNamesRes = nullptr;
 	_part = 0;
 	_nextPart = 0;
 	_subtitleY = 0;
-	_subtitle[0] = 0;
-	_subtitle[1] = 0;
-	_countersNames = 0;
-	_callables = 0;
-	_walker = 0;
+	_subtitle[0] = nullptr;
+	_subtitle[1] = nullptr;
+	_countersNames = nullptr;
+	_callables = nullptr;
+	_walker = nullptr;
 }
 
 Common::Error Parallaction_br::init() {
@@ -93,12 +93,12 @@ Common::Error Parallaction_br::init() {
 	_part = -1;
 	_nextPart = -1;
 
-	_subtitle[0] = 0;
-	_subtitle[1] = 0;
+	_subtitle[0] = nullptr;
+	_subtitle[1] = nullptr;
 
 	memset(_zoneFlags, 0, sizeof(_zoneFlags));
 
-	_countersNames = 0;
+	_countersNames = nullptr;
 
 	_saveLoad = new SaveLoad_br(this, _saveFileMan);
 
@@ -187,13 +187,13 @@ Common::Error Parallaction_br::go() {
 
 void Parallaction_br::freeFonts() {
 	delete _menuFont;
-	_menuFont  = 0;
+	_menuFont  = nullptr;
 
 	delete _dialogueFont;
-	_dialogueFont = 0;
+	_dialogueFont = nullptr;
 
 	// no need to delete _labelFont, since it is using the same buffer as _menuFont
-	_labelFont = 0;
+	_labelFont = nullptr;
 }
 
 
@@ -229,8 +229,8 @@ void Parallaction_br::freeCharacter() {
 	delete _char._talk;
 	delete _char._ani->gfxobj;
 
-	_char._talk = 0;
-	_char._ani->gfxobj = 0;
+	_char._talk = nullptr;
+	_char._ani->gfxobj = nullptr;
 }
 
 void Parallaction_br::freeLocation(bool removeAll) {
@@ -266,9 +266,9 @@ void Parallaction_br::cleanupGame() {
 	delete _objectsNames;
 	delete _countersNames;
 
-	_globalFlagsNames = 0;
-	_objectsNames = 0;
-	_countersNames = 0;
+	_globalFlagsNames = nullptr;
+	_objectsNames = nullptr;
+	_countersNames = nullptr;
 
 	_numLocations = 0;
 	g_globalFlags = 0;
@@ -393,9 +393,9 @@ void Parallaction_br::parseLocation(const char *filename) {
 
 	// load background, mask and path
 	_disk->loadScenery(*out._info,
-		out._backgroundName.empty() ? 0 : out._backgroundName.c_str(),
-		out._maskName.empty()       ? 0 : out._maskName.c_str(),
-		out._pathName.empty()       ? 0 : out._pathName.c_str());
+		out._backgroundName.empty() ? nullptr : out._backgroundName.c_str(),
+		out._maskName.empty()       ? nullptr : out._maskName.c_str(),
+		out._pathName.empty()       ? nullptr : out._pathName.c_str());
 	// assign background
 	_gfx->setBackground(kBackgroundLocation, out._info);
 
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 25e5778393..2a8bfedc0e 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -109,7 +109,7 @@ void LocationName::bind(const char *s) {
 	char *tok = strtok(_buf.begin(), ".");
 	while (tok) {
 		list.push_back(tok);
-		tok = strtok(NULL, ".");
+		tok = strtok(nullptr, ".");
 	}
 
 	if (list.size() < 1 || list.size() > 4)
@@ -135,19 +135,19 @@ void LocationName::bind(const char *s) {
 }
 
 Parallaction_ns::Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc),
-	_locationParser(0), _programParser(0), _walker(0) {
-	_soundManI = 0;
+	_locationParser(nullptr), _programParser(nullptr), _walker(nullptr) {
+	_soundManI = nullptr;
 	_score = 0;
 	_inTestResult = 0;
-	_callables = 0;
+	_callables = nullptr;
 	num_foglie = 0;
 	_sarcophagusDeltaX = 0;
 	_movingSarcophagus = 0;
 	_freeSarcophagusSlotX = 0;
 	_intro = 0;
 
-	_testResultLabels[0] = 0;
-	_testResultLabels[1] = 0;
+	_testResultLabels[0] = nullptr;
+	_testResultLabels[1] = nullptr;
 }
 
 Common::Error Parallaction_ns::init() {
@@ -205,8 +205,8 @@ Common::Error Parallaction_ns::init() {
 
 	_score = 1;
 
-	_testResultLabels[0] = 0;
-	_testResultLabels[1] = 0;
+	_testResultLabels[0] = nullptr;
+	_testResultLabels[1] = nullptr;
 
 	Parallaction::init();
 
@@ -237,7 +237,7 @@ void Parallaction_ns::destroyTestResultLabels() {
 	for (int i = 0; i < 2; ++i) {
 		_gfx->unregisterLabel(_testResultLabels[i]);
 		delete _testResultLabels[i];
-		_testResultLabels[i] = 0;
+		_testResultLabels[i] = nullptr;
 	}
 }
 
@@ -248,10 +248,10 @@ void Parallaction_ns::freeFonts() {
 	delete _menuFont;
 	delete _introFont;
 
-	_menuFont  = 0;
-	_dialogueFont = 0;
-	_labelFont = 0;
-	_introFont = 0;
+	_menuFont  = nullptr;
+	_dialogueFont = nullptr;
+	_labelFont = nullptr;
+	_introFont = nullptr;
 }
 
 
@@ -319,7 +319,7 @@ void Parallaction_ns::changeBackground(const char* background, const char* mask,
 		return;
 	}
 
-	if (path == 0) {
+	if (path == nullptr) {
 		path = mask;
 	}
 
@@ -509,12 +509,12 @@ void Parallaction_ns::freeCharacter() {
 	delete _objects;
 	delete _objectsNames;
 
-	_char._talk = 0;
-	_char._head = 0;
-	_char._ani->gfxobj = 0;
+	_char._talk = nullptr;
+	_char._head = nullptr;
+	_char._ani->gfxobj = nullptr;
 
-	_objects = 0;
-	_objectsNames = 0;
+	_objects = nullptr;
+	_objectsNames = nullptr;
 }
 
 void Parallaction_ns::freeLocation(bool removeAll) {
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index 940bfa3659..146b6f19c0 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -71,7 +71,7 @@ char *Script::readLineIntern(char *buf, size_t bufSize) {
 		warning("overflow in readLineIntern (line %i)", _line);
 	}
 	if (i == 0 && _input->eos()) {
-		return 0;
+		return nullptr;
 	}
 	buf[i] = '\0';
 	return buf;
@@ -93,11 +93,11 @@ char *Script::readLine(char *buf, size_t bufSize) {
 	bool inBlockComment = false;
 	bool ignoreLine = true;
 
-	char *line = 0;
+	char *line = nullptr;
 	do {
 		line = readLineIntern(buf, bufSize);
-		if (line == 0) {
-			return 0;
+		if (line == nullptr) {
+			return nullptr;
 		}
 
 		if (line[0] == '\0')
@@ -227,8 +227,8 @@ uint16 Script::readLineToken(bool errorOnEOF) {
 
 
 void Parser::reset() {
-	_currentOpcodes = 0;
-	_currentStatements = 0;
+	_currentOpcodes = nullptr;
+	_currentStatements = nullptr;
 	_lookup = 0;
 
 	_statements.clear();
@@ -251,7 +251,7 @@ void Parser::popTables() {
 }
 
 void Parser::parseStatement() {
-	assert(_currentOpcodes != 0);
+	assert(_currentOpcodes != nullptr);
 
 	_lookup = _currentStatements->lookup(_tokens[0]);
 
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index 5da0d4b1e0..b58a84ade7 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -837,21 +837,21 @@ void LocationParser_br::parseNoneData(ZonePtr z) {
 
 typedef void (LocationParser_br::*ZoneTypeParser)(ZonePtr);
 static ZoneTypeParser parsers[] = {
-	0,	// no type
+	nullptr,	// no type
 	&LocationParser_br::parseExamineData,
 	&LocationParser_br::parseDoorData,
 	&LocationParser_br::parseGetData,
 	&LocationParser_br::parseMergeData,
-	0,	// taste
+	nullptr,	// taste
 	&LocationParser_br::parseHearData,
-	0,	// feel
+	nullptr,	// feel
 	&LocationParser_br::parseSpeakData,
 	&LocationParser_br::parseNoneData,
-	0,	// trap
-	0,	// you
-	0,	// command
+	nullptr,	// trap
+	nullptr,	// you
+	nullptr,	// command
 	&LocationParser_br::parsePathData,
-	0,	// box
+	nullptr,	// box
 };
 
 void LocationParser_br::parseZoneTypeBlock(ZonePtr z) {
@@ -1133,7 +1133,7 @@ void LocationParser_br::init() {
 	_locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_br), _locationZoneStmtRes_br);
 	_locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_br), _locationAnimStmtRes_br);
 
-	Common::Array<const Opcode *> *table = 0;
+	Common::Array<const Opcode *> *table = nullptr;
 
 	SetOpcodeTable(_commandParsers);
 	WARNING_PARSER(unexpected);
@@ -1236,7 +1236,7 @@ void ProgramParser_br::init() {
 
 	_instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_br), _instructionNamesRes_br);
 
-	Common::Array<const Opcode *> *table = 0;
+	Common::Array<const Opcode *> *table = nullptr;
 
 	SetOpcodeTable(_instructionParsers);
 	INSTRUCTION_PARSER(defLocal);	// invalid opcode -> local definition
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index d6717d0adb..979b6f6757 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -888,8 +888,8 @@ Answer *LocationParser_ns::parseAnswer() {
 Common::String LocationParser_ns::parseDialogueString() {
 	char buf[400];
 	char *line = _script->readLine(buf, 400);
-	if (line == 0) {
-		return 0;
+	if (line == nullptr) {
+		return nullptr;
 	}
 	return Common::String(line);
 }
@@ -1039,7 +1039,7 @@ void LocationParser_ns::parse(Script *script) {
 
 	ctxt.end = false;
 	_script = script;
-	ctxt.filename = 0;//filename;
+	ctxt.filename = nullptr;//filename;
 
 	_parser->reset();
 	_parser->pushTables(&_locationParsers, _locationStmt);
@@ -1107,7 +1107,7 @@ void LocationParser_ns::init() {
 	_locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_ns), _locationZoneStmtRes_ns);
 	_locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_ns), _locationAnimStmtRes_ns);
 
-	Common::Array<const Opcode *> *table = 0;
+	Common::Array<const Opcode *> *table = nullptr;
 
 	SetOpcodeTable(_commandParsers);
 	WARNING_PARSER(unexpected);
@@ -1177,7 +1177,7 @@ void ProgramParser_ns::init() {
 
 	_instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_ns), _instructionNamesRes_ns);
 
-	Common::Array<const Opcode *> *table = 0;
+	Common::Array<const Opcode *> *table = nullptr;
 	SetOpcodeTable(_instructionParsers);
 	INSTRUCTION_PARSER(defLocal);	// invalid opcode -> local definition
 	INSTRUCTION_PARSER(animation);	// on
@@ -1220,7 +1220,7 @@ Common::String LocationParser_ns::parseComment() {
 	} while (true);
 
 	if (comment.size() == 0) {
-		return 0;
+		return nullptr;
 	}
 
 	return comment;
@@ -1446,19 +1446,19 @@ void LocationParser_ns::parseNoneData(ZonePtr z) {
 
 typedef void (LocationParser_ns::*ZoneTypeParser)(ZonePtr);
 static ZoneTypeParser parsers[] = {
-	0,	// no type
+	nullptr,	// no type
 	&LocationParser_ns::parseExamineData,
 	&LocationParser_ns::parseDoorData,
 	&LocationParser_ns::parseGetData,
 	&LocationParser_ns::parseMergeData,
-	0,	// taste
+	nullptr,	// taste
 	&LocationParser_ns::parseHearData,
-	0,	// feel
+	nullptr,	// feel
 	&LocationParser_ns::parseSpeakData,
 	&LocationParser_ns::parseNoneData,
-	0,	// trap
-	0,	// you
-	0	// command
+	nullptr,	// trap
+	nullptr,	// you
+	nullptr	// command
 };
 
 void LocationParser_ns::parseZoneTypeBlock(ZonePtr z) {
diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp
index 5e2ea106f6..7bf7bbd6bc 100644
--- a/engines/parallaction/saveload.cpp
+++ b/engines/parallaction/saveload.cpp
@@ -126,7 +126,7 @@ void SaveLoad_ns::doLoadGame(uint16 slot) {
 
 void SaveLoad_ns::doSaveGame(uint16 slot, const char* name) {
 	Common::OutSaveFile *f = getOutSaveFile(slot);
-	if (f == 0) {
+	if (f == nullptr) {
 		Common::U32String buf = Common::U32String::format(_("Can't save game in slot %i\n\n"), slot);
 		GUI::MessageDialog dialog(buf);
 		dialog.runModal();
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index 5317be5549..30060ff2ee 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -86,7 +86,7 @@ protected:
 	byte *_trackEnd;
 
 public:
-	MidiParser_MSC() : byte_11C5A(false), _beats(0), _lastEvent(0), _trackEnd(NULL) {
+	MidiParser_MSC() : byte_11C5A(false), _beats(0), _lastEvent(0), _trackEnd(nullptr) {
 	}
 };
 
@@ -95,7 +95,7 @@ void MidiParser_MSC::parseMetaEvent(EventInfo &info) {
 	uint8 len = read1(_position._playPos);
 	info.ext.type = type;
 	info.length = len;
-	info.ext.data = 0;
+	info.ext.data = nullptr;
 
 	if (type == 0x51) {
 		info.ext.data = _position._playPos;
@@ -374,7 +374,7 @@ void DosSoundMan_br::pause(bool p) {
 }
 
 AmigaSoundMan_br::AmigaSoundMan_br(Parallaction_br *vm) : SoundMan_br(vm)  {
-	_musicStream = 0;
+	_musicStream = nullptr;
 }
 
 AmigaSoundMan_br::~AmigaSoundMan_br() {
@@ -383,7 +383,7 @@ AmigaSoundMan_br::~AmigaSoundMan_br() {
 
 Audio::AudioStream *AmigaSoundMan_br::loadChannelData(const char *filename, Channel *ch, bool looping) {
 	Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename);
-	Audio::AudioStream *input = 0;
+	Audio::AudioStream *input = nullptr;
 
 	if (_vm->getFeatures() & GF_DEMO) {
 		uint32 dataSize = stream->size();
@@ -456,7 +456,7 @@ void AmigaSoundMan_br::stopMusic() {
 	if (_mixer->isSoundHandleActive(_musicHandle)) {
 		_mixer->stopHandle(_musicHandle);
 		delete _musicStream;
-		_musicStream = 0;
+		_musicStream = nullptr;
 	}
 }
 
@@ -500,11 +500,11 @@ void SoundMan_br::stopSfx(uint channel) {
 
 	debugC(1, kDebugAudio, "SoundMan_br::stopSfx(%i)", channel);
 	_mixer->stopHandle(_channels[channel].handle);
-	_channels[channel].stream = 0;
+	_channels[channel].stream = nullptr;
 }
 
 void SoundMan_br::execute(int command, const char *parm) {
-	uint32 n = parm ? strtoul(parm, 0, 10) : 0;
+	uint32 n = parm ? strtoul(parm, nullptr, 10) : 0;
 	bool b = (n == 1) ? true : false;
 
 	switch (command) {
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index 8e88c4d201..208b5bd7cd 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -117,7 +117,7 @@ DosSoundMan_ns::~DosSoundMan_ns() {
 bool DosSoundMan_ns::isLocationSilent(const char *locationName) {
 
 	// these are the prefixes for location names with no background midi music
-	const char *noMusicPrefix[] = { "museo", "intgrottadopo", "caveau", "estgrotta", "plaza1", "endtgz", "common", 0 };
+	const char *noMusicPrefix[] = { "museo", "intgrottadopo", "caveau", "estgrotta", "plaza1", "endtgz", "common", nullptr };
 	Common::String s(locationName);
 
 	for (int i = 0; noMusicPrefix[i]; i++) {
@@ -167,7 +167,7 @@ void DosSoundMan_ns::playCharacterMusic(const char *character) {
 	}
 
 	char *name = const_cast<char *>(character);
-	const char *newMusicFile = 0;
+	const char *newMusicFile = nullptr;
 
 	if (!scumm_stricmp(name, g_dinoName)) {
 		newMusicFile = "dino";
@@ -218,7 +218,7 @@ static int8 res_amigaBeep[AMIGABEEP_SIZE] = {
 };
 
 AmigaSoundMan_ns::AmigaSoundMan_ns(Parallaction_ns *vm) : SoundMan_ns(vm) {
-	_musicStream = 0;
+	_musicStream = nullptr;
 
 	// initialize the waveform for the 'beep' sound
 	beepSoundBufferSize = AMIGABEEP_SIZE * NUM_REPEATS;
@@ -242,7 +242,7 @@ AmigaSoundMan_ns::~AmigaSoundMan_ns() {
 }
 
 Audio::AudioStream *AmigaSoundMan_ns::loadChannelData(const char *filename, Channel *ch, bool looping) {
-	Audio::AudioStream *input = 0;
+	Audio::AudioStream *input = nullptr;
 
 	if (!scumm_stricmp("beep", filename)) {
 		int rate = 11934;
@@ -287,7 +287,7 @@ void AmigaSoundMan_ns::stopSfx(uint channel) {
 
 	debugC(1, kDebugAudio, "AmigaSoundMan_ns::stopSfx(%i)", channel);
 	_mixer->stopHandle(_channels[channel].handle);
-	_channels[channel].stream = 0;
+	_channels[channel].stream = nullptr;
 }
 
 void AmigaSoundMan_ns::playMusic() {
@@ -310,7 +310,7 @@ void AmigaSoundMan_ns::stopMusic() {
 	if (_mixer->isSoundHandleActive(_musicHandle)) {
 		_mixer->stopHandle(_musicHandle);
 		delete _musicStream;
-		_musicStream = 0;
+		_musicStream = nullptr;
 	}
 }
 
@@ -338,8 +338,8 @@ void SoundMan_ns::setMusicFile(const char *filename) {
 	Common::strlcpy(_musicFile, filename, PATH_LEN);
 }
 
-void SoundMan_ns::execute(int command, const char *parm = 0) {
-	uint32 n = strtoul(parm, 0, 10);
+void SoundMan_ns::execute(int command, const char *parm = nullptr) {
+	uint32 n = strtoul(parm, nullptr, 10);
 	bool b = (n == 1) ? true : false;
 
 	switch (command) {


Commit: 3bc29bd60fb94456985bffd68a9ba9feadacaa35
    https://github.com/scummvm/scummvm/commit/3bc29bd60fb94456985bffd68a9ba9feadacaa35
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
PEGASUS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/pegasus/ai/ai_area.cpp
    engines/pegasus/ai/ai_condition.cpp
    engines/pegasus/chase.cpp
    engines/pegasus/compass.cpp
    engines/pegasus/cursor.cpp
    engines/pegasus/detection.cpp
    engines/pegasus/elements.cpp
    engines/pegasus/energymonitor.cpp
    engines/pegasus/fader.cpp
    engines/pegasus/graphics.cpp
    engines/pegasus/hotspot.cpp
    engines/pegasus/input.cpp
    engines/pegasus/interaction.cpp
    engines/pegasus/interface.cpp
    engines/pegasus/items/autodragger.cpp
    engines/pegasus/items/biochips/aichip.cpp
    engines/pegasus/items/biochips/arthurchip.cpp
    engines/pegasus/items/biochips/mapchip.cpp
    engines/pegasus/items/biochips/opticalchip.cpp
    engines/pegasus/items/biochips/shieldchip.cpp
    engines/pegasus/items/inventory.cpp
    engines/pegasus/items/inventory/airmask.cpp
    engines/pegasus/items/inventory/inventoryitem.cpp
    engines/pegasus/items/inventorypicture.cpp
    engines/pegasus/items/itemdragger.cpp
    engines/pegasus/items/itemlist.cpp
    engines/pegasus/menu.cpp
    engines/pegasus/movie.cpp
    engines/pegasus/neighborhood/caldoria/caldoria.cpp
    engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp
    engines/pegasus/neighborhood/mars/canyonchase.cpp
    engines/pegasus/neighborhood/mars/mars.cpp
    engines/pegasus/neighborhood/mars/planetmover.cpp
    engines/pegasus/neighborhood/mars/robotship.cpp
    engines/pegasus/neighborhood/mars/spacejunk.cpp
    engines/pegasus/neighborhood/mars/tunnelpod.cpp
    engines/pegasus/neighborhood/neighborhood.cpp
    engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
    engines/pegasus/neighborhood/norad/alpha/panorama.cpp
    engines/pegasus/neighborhood/norad/delta/globegame.cpp
    engines/pegasus/neighborhood/norad/delta/noraddelta.cpp
    engines/pegasus/neighborhood/norad/norad.cpp
    engines/pegasus/neighborhood/norad/pressuretracker.cpp
    engines/pegasus/neighborhood/wsc/wsc.cpp
    engines/pegasus/notification.cpp
    engines/pegasus/pegasus.cpp
    engines/pegasus/sound.cpp
    engines/pegasus/surface.cpp
    engines/pegasus/timers.cpp
    engines/pegasus/transition.cpp


diff --git a/engines/pegasus/ai/ai_area.cpp b/engines/pegasus/ai/ai_area.cpp
index 1becc00962..7cc808fea6 100644
--- a/engines/pegasus/ai/ai_area.cpp
+++ b/engines/pegasus/ai/ai_area.cpp
@@ -38,7 +38,7 @@
 
 namespace Pegasus {
 
-AIArea *g_AIArea = 0;
+AIArea *g_AIArea = nullptr;
 
 AIArea::AIArea(InputHandler *nextHandler) : InputHandler(nextHandler), _leftAreaMovie(kAILeftAreaID),
 		_middleAreaMovie(kAIMiddleAreaID), _rightAreaMovie(kAIRightAreaID), _AIMovie(kAIMovieID) {
@@ -71,7 +71,7 @@ AIArea::~AIArea() {
 	for (AIRuleList::iterator it = _AIRules.begin(); it != _AIRules.end(); it++)
 		delete *it;
 
-	g_AIArea = 0;
+	g_AIArea = nullptr;
 }
 
 // Save last state of AI rules...
diff --git a/engines/pegasus/ai/ai_condition.cpp b/engines/pegasus/ai/ai_condition.cpp
index 83b6a1567c..a7175eb984 100644
--- a/engines/pegasus/ai/ai_condition.cpp
+++ b/engines/pegasus/ai/ai_condition.cpp
@@ -234,9 +234,9 @@ bool AICurrentItemCondition::fireCondition() {
 	InventoryItem *item = ((PegasusEngine *)g_engine)->getCurrentInventoryItem();
 
 	if (_item == kNoItemID)
-		return item == 0;
+		return item == nullptr;
 
-	return item != 0 && item->getObjectID() == _item;
+	return item != nullptr && item->getObjectID() == _item;
 }
 
 AICurrentBiochipCondition::AICurrentBiochipCondition(const ItemID biochip)  {
@@ -247,9 +247,9 @@ bool AICurrentBiochipCondition::fireCondition() {
 	BiochipItem *biochip = ((PegasusEngine *)g_engine)->getCurrentBiochip();
 
 	if (_biochip == kNoItemID)
-		return biochip == 0;
+		return biochip == nullptr;
 
-	return biochip != 0 && biochip->getObjectID() == _biochip;
+	return biochip != nullptr && biochip->getObjectID() == _biochip;
 }
 
 AIItemStateCondition::AIItemStateCondition(const ItemID item, const ItemState state) {
@@ -259,7 +259,7 @@ AIItemStateCondition::AIItemStateCondition(const ItemID item, const ItemState st
 
 bool AIItemStateCondition::fireCondition() {
 	Item *item = g_allItems.findItemByID(_item);
-	return item != 0 && item->getItemState() == _state;
+	return item != nullptr && item->getItemState() == _state;
 }
 
 AIEnergyMonitorCondition::AIEnergyMonitorCondition(const int32 energyThreshold) {
@@ -267,7 +267,7 @@ AIEnergyMonitorCondition::AIEnergyMonitorCondition(const int32 energyThreshold)
 }
 
 bool AIEnergyMonitorCondition::fireCondition() {
-	return g_energyMonitor != 0 && g_energyMonitor->getCurrentEnergy() < _energyThreshold;
+	return g_energyMonitor != nullptr && g_energyMonitor->getCurrentEnergy() < _energyThreshold;
 }
 
 AILastExtraCondition::AILastExtraCondition(const ExtraID lastExtra) {
diff --git a/engines/pegasus/chase.cpp b/engines/pegasus/chase.cpp
index 43f88d3656..6550ce6997 100644
--- a/engines/pegasus/chase.cpp
+++ b/engines/pegasus/chase.cpp
@@ -42,7 +42,7 @@ ChaseInteraction::ChaseInteraction(const InteractionID interactionID, Neighborho
 	// TRIPLE SUPER ULTRA HACK
 	// This avoids a nasty optimization bug I have been unable to track down
 	// after days and days of searching. Let's just ship the game already.
-	setNextHandler(0);
+	setNextHandler(nullptr);
 
 	_neighborhoodNotification = handler->getNeighborhoodNotification();
 }
diff --git a/engines/pegasus/compass.cpp b/engines/pegasus/compass.cpp
index a918fe932d..e2b52f3b3c 100644
--- a/engines/pegasus/compass.cpp
+++ b/engines/pegasus/compass.cpp
@@ -27,7 +27,7 @@
 
 namespace Pegasus {
 
-Compass *g_compass = 0;
+Compass *g_compass = nullptr;
 
 Compass::Compass() : FaderAnimation(kCompassID) {
 	// Initialize it to east...
@@ -36,7 +36,7 @@ Compass::Compass() : FaderAnimation(kCompassID) {
 }
 
 Compass::~Compass() {
-	g_compass = 0;
+	g_compass = nullptr;
 }
 
 void Compass::initCompass() {
diff --git a/engines/pegasus/cursor.cpp b/engines/pegasus/cursor.cpp
index 0dadac207b..7d0e21f8bf 100644
--- a/engines/pegasus/cursor.cpp
+++ b/engines/pegasus/cursor.cpp
@@ -66,8 +66,8 @@ void Cursor::addCursorFrames(uint16 id) {
 		info.tag = cursStream->readUint16BE();
 		info.hotspot.x = cursStream->readUint16BE();
 		info.hotspot.y = cursStream->readUint16BE();
-		info.surface = 0;
-		info.palette = 0;
+		info.surface = nullptr;
+		info.palette = nullptr;
 		info.colorCount = 0;
 		_info.push_back(info);
 	}
diff --git a/engines/pegasus/detection.cpp b/engines/pegasus/detection.cpp
index a11a99fd67..5ef9e12d85 100644
--- a/engines/pegasus/detection.cpp
+++ b/engines/pegasus/detection.cpp
@@ -30,7 +30,7 @@
 
 static const PlainGameDescriptor pegasusGames[] = {
 	{"pegasus", "The Journeyman Project: Pegasus Prime"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 
diff --git a/engines/pegasus/elements.cpp b/engines/pegasus/elements.cpp
index 9b1e1fe6b8..bd56b75033 100644
--- a/engines/pegasus/elements.cpp
+++ b/engines/pegasus/elements.cpp
@@ -37,7 +37,7 @@ DisplayElement::DisplayElement(const DisplayElementID id) : IDObject(id) {
 	_elementIsVisible = false;
 	_elementOrder = 0;
 	_triggeredElement = this;
-	_nextElement = 0;
+	_nextElement = nullptr;
 }
 
 DisplayElement::~DisplayElement() {
@@ -315,7 +315,7 @@ bool FrameSequence::isSequenceOpen() const {
 Sprite::Sprite(const DisplayElementID id) : DisplayElement(id) {
 	_numFrames = 0;
 	_currentFrameNum = 0xffffffff;
-	_currentFrame = 0;
+	_currentFrame = nullptr;
 }
 
 Sprite::~Sprite() {
@@ -333,7 +333,7 @@ void Sprite::discardFrames() {
 
 		_frameArray.clear();
 		_numFrames = 0;
-		_currentFrame = 0;
+		_currentFrame = nullptr;
 		_currentFrameNum = 0xffffffff;
 		setBounds(0, 0, 0, 0);
 	}
@@ -401,7 +401,7 @@ void Sprite::setCurrentFrameIndex(const int32 frameNum) {
 	if (frameNum < 0) {
 		if (_currentFrameNum != 0xffffffff) {
 			_currentFrameNum = 0xffffffff;
-			_currentFrame = 0;
+			_currentFrame = nullptr;
 			triggerRedraw();
 		}
 	} else if (_numFrames > 0) {
@@ -416,7 +416,7 @@ void Sprite::setCurrentFrameIndex(const int32 frameNum) {
 
 SpriteFrame *Sprite::getFrame(const int32 index) {
 	if (index < 0 || (uint32)index >= _numFrames)
-		return 0;
+		return nullptr;
 
 	return _frameArray[index].frame;
 }
diff --git a/engines/pegasus/energymonitor.cpp b/engines/pegasus/energymonitor.cpp
index c4c27ad6d9..1d515a8ea8 100644
--- a/engines/pegasus/energymonitor.cpp
+++ b/engines/pegasus/energymonitor.cpp
@@ -30,7 +30,7 @@
 namespace Pegasus {
 
 Blinker::Blinker() {
-	_sprite = 0;
+	_sprite = nullptr;
 	_frame1 = -1;
 	_frame2 = -1;
 	_blinkDuration = 0;
@@ -51,7 +51,7 @@ void Blinker::startBlinking(Sprite *sprite, int32 frame1, int32 frame2, uint32 n
 void Blinker::stopBlinking() {
 	if (_sprite) {
 		_sprite->setCurrentFrameIndex(_frame2);
-		_sprite = 0;
+		_sprite = nullptr;
 		stop();
 	}
 }
@@ -72,7 +72,7 @@ enum {
 	kEnergyExpiredFlag = 1
 };
 
-EnergyMonitor *g_energyMonitor = 0;
+EnergyMonitor *g_energyMonitor = nullptr;
 
 EnergyMonitor::EnergyMonitor() : IdlerAnimation(kEnergyBarID), _energyLight(kWarningLightID) {
 	PegasusEngine *vm = (PegasusEngine *)g_engine;
@@ -116,7 +116,7 @@ EnergyMonitor::EnergyMonitor() : IdlerAnimation(kEnergyBarID), _energyLight(kWar
 }
 
 EnergyMonitor::~EnergyMonitor() {
-	g_energyMonitor = 0;
+	g_energyMonitor = nullptr;
 }
 
 void EnergyMonitor::setEnergyValue(const uint32 value) {
diff --git a/engines/pegasus/fader.cpp b/engines/pegasus/fader.cpp
index 5a213a2931..84601b840a 100644
--- a/engines/pegasus/fader.cpp
+++ b/engines/pegasus/fader.cpp
@@ -193,7 +193,7 @@ void FaderAnimation::setFaderValue(const int32 newValue) {
 }
 
 SoundFader::SoundFader() {
-	_sound = 0;
+	_sound = nullptr;
 	_masterVolume = 0xff;
 }
 
diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp
index d620fe3d4e..ecbca85a7d 100644
--- a/engines/pegasus/graphics.cpp
+++ b/engines/pegasus/graphics.cpp
@@ -42,7 +42,7 @@ GraphicsManager::GraphicsManager(PegasusEngine *vm) : _vm(vm) {
 
 	_backLayer = kMinAvailableOrder;
 	_frontLayer = kMaxAvailableOrder;
-	_firstDisplayElement = _lastDisplayElement = 0;
+	_firstDisplayElement = _lastDisplayElement = nullptr;
 	_workArea.create(640, 480, _vm->_system->getScreenFormat());
 	_curSurface = &_workArea;
 	_erase = false;
@@ -77,7 +77,7 @@ void GraphicsManager::addDisplayElement(DisplayElement *newElement) {
 
 	if (_firstDisplayElement) {
 		DisplayElement *runner = _firstDisplayElement;
-		DisplayElement *lastRunner = 0;
+		DisplayElement *lastRunner = nullptr;
 
 		// Search for first element whose display order is greater than
 		// the new element's and add the new element just before it.
@@ -116,8 +116,8 @@ void GraphicsManager::removeDisplayElement(DisplayElement *oldElement) {
 
 	if (oldElement == _firstDisplayElement) {
 		if (oldElement == _lastDisplayElement) {
-			_firstDisplayElement = 0;
-			_lastDisplayElement = 0;
+			_firstDisplayElement = nullptr;
+			_lastDisplayElement = nullptr;
 		} else {
 			_firstDisplayElement = oldElement->_nextElement;
 		}
@@ -146,7 +146,7 @@ void GraphicsManager::removeDisplayElement(DisplayElement *oldElement) {
 		}
 	}
 
-	oldElement->_nextElement = 0;
+	oldElement->_nextElement = nullptr;
 	oldElement->_elementIsDisplaying = false;
 }
 
@@ -156,7 +156,7 @@ void GraphicsManager::updateDisplay() {
 		if (_erase)
 			_workArea.fillRect(_dirtyRect, _workArea.format.RGBToColor(0, 0, 0));
 
-		for (DisplayElement *runner = _firstDisplayElement; runner != 0; runner = runner->_nextElement) {
+		for (DisplayElement *runner = _firstDisplayElement; runner != nullptr; runner = runner->_nextElement) {
 			Common::Rect bounds;
 			runner->getBounds(bounds);
 
@@ -187,7 +187,7 @@ DisplayElement *GraphicsManager::findDisplayElement(const DisplayElementID id) {
 		runner = runner->_nextElement;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void GraphicsManager::doFadeOutSync(const TimeValue time, const TimeScale scale, bool isBlack) {
diff --git a/engines/pegasus/hotspot.cpp b/engines/pegasus/hotspot.cpp
index 2ab204e81c..934203573b 100644
--- a/engines/pegasus/hotspot.cpp
+++ b/engines/pegasus/hotspot.cpp
@@ -229,7 +229,7 @@ Hotspot *HotspotList::findHotspot(const Common::Point where) {
 		if ((*it)->pointInSpot(where))
 			return *it;
 
-	return 0;
+	return nullptr;
 }
 
 HotSpotID HotspotList::findHotspotID(const Common::Point where) {
@@ -242,7 +242,7 @@ Hotspot *HotspotList::findHotspotByID(const HotSpotID id) {
 		if ((*it)->getObjectID() == id)
 			return *it;
 
-	return 0;
+	return nullptr;
 }
 
 Hotspot *HotspotList::findHotspotByMask(const HotSpotFlags flags) {
@@ -250,7 +250,7 @@ Hotspot *HotspotList::findHotspotByMask(const HotSpotFlags flags) {
 		if (((*it)->getHotspotFlags() & flags) == flags)
 			return *it;
 
-	return 0;
+	return nullptr;
 }
 
 void HotspotList::activateMaskedHotspots(const HotSpotFlags flags) {
diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp
index d7d99d1e65..242277d7e8 100644
--- a/engines/pegasus/input.cpp
+++ b/engines/pegasus/input.cpp
@@ -203,12 +203,12 @@ int operator!=(const Input &arg1, const Input &arg2) {
 	return !operator==(arg1, arg2);
 }
 
-InputHandler *InputHandler::_inputHandler = 0;
+InputHandler *InputHandler::_inputHandler = nullptr;
 bool InputHandler::_invalHotspots = false;
 InputBits InputHandler::_lastFilter = kFilterNoInput;
 
 InputHandler *InputHandler::setInputHandler(InputHandler *currentHandler) {
-	InputHandler *result = 0;
+	InputHandler *result = nullptr;
 
 	if (_inputHandler != currentHandler && (!_inputHandler || _inputHandler->releaseInputFocus())) {
 		result = _inputHandler;
@@ -223,7 +223,7 @@ InputHandler *InputHandler::setInputHandler(InputHandler *currentHandler) {
 void InputHandler::pollForInput() {
 	if (_inputHandler) {
 		Input input;
-		Hotspot *cursorSpot = 0;
+		Hotspot *cursorSpot = nullptr;
 
 		InputHandler::getInput(input, cursorSpot);
 		if (_inputHandler->isClickInput(input, cursorSpot))
@@ -332,7 +332,7 @@ bool InputHandler::wantsCursor() {
 	return false;
 }
 
-Tracker *Tracker::_currentTracker = 0;
+Tracker *Tracker::_currentTracker = nullptr;
 
 void Tracker::handleInput(const Input &input, const Hotspot *) {
 	if (stopTrackingInput(input))
@@ -350,7 +350,7 @@ void Tracker::startTracking(const Input &) {
 
 void Tracker::stopTracking(const Input &) {
 	if (isTracking()) {
-		_currentTracker = NULL;
+		_currentTracker = nullptr;
 		InputHandler::setInputHandler(_savedHandler);
 	}
 }
diff --git a/engines/pegasus/interaction.cpp b/engines/pegasus/interaction.cpp
index 452d7cdb0b..545d5bf242 100644
--- a/engines/pegasus/interaction.cpp
+++ b/engines/pegasus/interaction.cpp
@@ -30,7 +30,7 @@ namespace Pegasus {
 
 GameInteraction::GameInteraction(const InteractionID id, Neighborhood *nextHandler) : IDObject(id), InputHandler(nextHandler) {
 	_isInteracting = false;
-	_savedHandler = 0;
+	_savedHandler = nullptr;
 	_owner = nextHandler;
 }
 
diff --git a/engines/pegasus/interface.cpp b/engines/pegasus/interface.cpp
index b4d23c0228..26e601d5ec 100644
--- a/engines/pegasus/interface.cpp
+++ b/engines/pegasus/interface.cpp
@@ -33,9 +33,9 @@
 
 namespace Pegasus {
 
-Interface *g_interface = 0;
+Interface *g_interface = nullptr;
 
-Interface::Interface() : InputHandler(0), _interfaceNotification(kInterfaceNotificationID, (NotificationManager *)((PegasusEngine *)g_engine)),
+Interface::Interface() : InputHandler(nullptr), _interfaceNotification(kInterfaceNotificationID, (NotificationManager *)((PegasusEngine *)g_engine)),
 			_currentItemSpot(kCurrentItemSpotID), _currentBiochipSpot(kCurrentBiochipSpotID),
 			_background1(kInterface1ID), _background2(kInterface2ID), _background3(kInterface3ID),
 			_background4(kInterface4ID), _datePicture(kDateID), _inventoryPush(kInventoryPushID),
@@ -43,8 +43,8 @@ Interface::Interface() : InputHandler(0), _interfaceNotification(kInterfaceNotif
 			_inventoryPanel(kNoDisplayElement, (InputHandler *)((PegasusEngine *)g_engine), ((PegasusEngine *)g_engine)->getItemsInventory()),
 			_biochipPush(kBiochipPushID), _biochipLid(kBiochipLidID, kNoDisplayElement),
 			_biochipPanel(kNoDisplayElement, (InputHandler *)((PegasusEngine *)g_engine), ((PegasusEngine *)g_engine)->getBiochipsInventory()) {
-	g_energyMonitor = 0;
-	_previousHandler = 0;
+	g_energyMonitor = nullptr;
+	_previousHandler = nullptr;
 	_inventoryRaised = false;
 	_biochipRaised = false;
 	_playingEndMessage = false;
@@ -53,7 +53,7 @@ Interface::Interface() : InputHandler(0), _interfaceNotification(kInterfaceNotif
 
 Interface::~Interface() {
 	throwAwayInterface();
-	g_interface = 0;
+	g_interface = nullptr;
 }
 
 void Interface::throwAwayInterface() {
@@ -175,7 +175,7 @@ void Interface::validateInventoryPanel() {
 		_inventoryPanel.initInventoryImage(&_inventoryPush);
 		_inventoryPanel.moveElementTo(kInventoryPushLeft, kInventoryPushTop);
 		_inventoryPush.setSlideDirection(kSlideUpMask);
-		_inventoryPush.setInAndOutElements(&_inventoryPanel, 0);
+		_inventoryPush.setInAndOutElements(&_inventoryPanel, nullptr);
 		_inventoryPush.setDisplayOrder(kInventoryPushOrder);
 		_inventoryPush.startDisplaying();
 
@@ -225,7 +225,7 @@ void Interface::validateBiochipPanel() {
 		_biochipPanel.initInventoryImage(&_biochipPush);
 		_biochipPanel.moveElementTo(kBiochipPushLeft, kBiochipPushTop);
 		_biochipPush.setSlideDirection(kSlideUpMask);
-		_biochipPush.setInAndOutElements(&_biochipPanel, 0);
+		_biochipPush.setInAndOutElements(&_biochipPanel, nullptr);
 		_biochipPush.setDisplayOrder(kBiochipPushOrder);
 		_biochipPush.startDisplaying();
 
diff --git a/engines/pegasus/items/autodragger.cpp b/engines/pegasus/items/autodragger.cpp
index 5595a0a05e..8d8a9ffe58 100644
--- a/engines/pegasus/items/autodragger.cpp
+++ b/engines/pegasus/items/autodragger.cpp
@@ -29,7 +29,7 @@
 namespace Pegasus {
 
 AutoDragger::AutoDragger() {
-	_draggingElement = NULL;
+	_draggingElement = nullptr;
 	_lastTime = 0;
 	initCallBack(this, kCallBackAtExtremes);
 }
@@ -58,7 +58,7 @@ void AutoDragger::autoDrag(DisplayElement *dragElement, const Common::Point &sta
 void AutoDragger::stopDragging() {
 	cancelCallBack();
 	stopIdling();
-	_draggingElement = 0;
+	_draggingElement = nullptr;
 	_startLocation = Common::Point();
 	_stopLocation = Common::Point();
 	_lastTime = 0;
diff --git a/engines/pegasus/items/biochips/aichip.cpp b/engines/pegasus/items/biochips/aichip.cpp
index 654ab69626..d8696483ad 100644
--- a/engines/pegasus/items/biochips/aichip.cpp
+++ b/engines/pegasus/items/biochips/aichip.cpp
@@ -56,7 +56,7 @@ static const ItemState s_highlightState[4][3][7] = {
 	}
 };
 
-AIChip *g_AIChip = 0;
+AIChip *g_AIChip = nullptr;
 
 AIChip::AIChip(const ItemID id, const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction) :
 		BiochipItem(id, neighborhood, room, direction), _briefingSpot(kAIBriefingSpotID), _scanSpot(kAIScanSpotID),
@@ -92,7 +92,7 @@ AIChip::AIChip(const ItemID id, const NeighborhoodID neighborhood, const RoomID
 }
 
 AIChip::~AIChip() {
-	g_AIChip = NULL;
+	g_AIChip = nullptr;
 
 	g_allHotspots.removeOneHotspot(kAIBriefingSpotID);
 	g_allHotspots.removeOneHotspot(kAIScanSpotID);
diff --git a/engines/pegasus/items/biochips/arthurchip.cpp b/engines/pegasus/items/biochips/arthurchip.cpp
index 1ce093673e..64a930d437 100644
--- a/engines/pegasus/items/biochips/arthurchip.cpp
+++ b/engines/pegasus/items/biochips/arthurchip.cpp
@@ -88,7 +88,7 @@ static const char *kArthurWisdomMovies[] = {
 	"Images/AI/Globals/XGLOBA62"
 };
 
-ArthurChip *g_arthurChip = 0;
+ArthurChip *g_arthurChip = nullptr;
 
 ArthurChip::ArthurChip(const ItemID id, const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction) :
 		BiochipItem(id, neighborhood, room, direction), _arthurWisdomHotspot(kArthurWisdomSpotID),
@@ -118,7 +118,7 @@ ArthurChip::ArthurChip(const ItemID id, const NeighborhoodID neighborhood, const
 }
 
 ArthurChip::~ArthurChip() {
-	g_arthurChip = NULL;
+	g_arthurChip = nullptr;
 
 	g_allHotspots.removeOneHotspot(kArthurWisdomSpotID);
 	g_allHotspots.removeOneHotspot(kChattyArthurSpotID);
diff --git a/engines/pegasus/items/biochips/mapchip.cpp b/engines/pegasus/items/biochips/mapchip.cpp
index bdcc9f70e8..e8adbd69bf 100644
--- a/engines/pegasus/items/biochips/mapchip.cpp
+++ b/engines/pegasus/items/biochips/mapchip.cpp
@@ -30,7 +30,7 @@
 
 namespace Pegasus {
 
-MapChip *g_map = 0;
+MapChip *g_map = nullptr;
 
 MapChip::MapChip(const ItemID id, const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction) :
 		BiochipItem(id, neighborhood, room, direction) {
@@ -39,7 +39,7 @@ MapChip::MapChip(const ItemID id, const NeighborhoodID neighborhood, const RoomI
 }
 
 MapChip::~MapChip() {
-	g_map = 0;
+	g_map = nullptr;
 }
 
 void MapChip::writeToStream(Common::WriteStream *stream) {
diff --git a/engines/pegasus/items/biochips/opticalchip.cpp b/engines/pegasus/items/biochips/opticalchip.cpp
index ad781f19b9..81d1fdb6a1 100644
--- a/engines/pegasus/items/biochips/opticalchip.cpp
+++ b/engines/pegasus/items/biochips/opticalchip.cpp
@@ -29,7 +29,7 @@
 
 namespace Pegasus {
 
-OpticalChip *g_opticalChip = 0;
+OpticalChip *g_opticalChip = nullptr;
 
 OpticalChip::OpticalChip(const ItemID id, const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction) :
 		BiochipItem(id, neighborhood, room, direction), _ariesHotspot(kAriesSpotID), _mercuryHotspot(kMercurySpotID),
diff --git a/engines/pegasus/items/biochips/shieldchip.cpp b/engines/pegasus/items/biochips/shieldchip.cpp
index a8089a594d..931410246a 100644
--- a/engines/pegasus/items/biochips/shieldchip.cpp
+++ b/engines/pegasus/items/biochips/shieldchip.cpp
@@ -29,7 +29,7 @@
 
 namespace Pegasus {
 
-ShieldChip *g_shield = 0;
+ShieldChip *g_shield = nullptr;
 
 ShieldChip::ShieldChip(const ItemID id, const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction) :
 		BiochipItem(id, neighborhood, room, direction) {
diff --git a/engines/pegasus/items/inventory.cpp b/engines/pegasus/items/inventory.cpp
index 896a1c1c9f..44a8ddca6c 100644
--- a/engines/pegasus/items/inventory.cpp
+++ b/engines/pegasus/items/inventory.cpp
@@ -109,7 +109,7 @@ bool Inventory::itemInInventory(Item *item) {
 }
 
 bool Inventory::itemInInventory(ItemID id) {
-	return findItemByID(id) != NULL;
+	return findItemByID(id) != nullptr;
 }
 
 Item *Inventory::getItemAt(int32 index) {
@@ -118,7 +118,7 @@ Item *Inventory::getItemAt(int32 index) {
 		if (i == index)
 			return *it;
 
-	return 0;
+	return nullptr;
 }
 
 ItemID Inventory::getItemIDAt(int32 index) {
diff --git a/engines/pegasus/items/inventory/airmask.cpp b/engines/pegasus/items/inventory/airmask.cpp
index 3569fa1c0d..33848903e1 100644
--- a/engines/pegasus/items/inventory/airmask.cpp
+++ b/engines/pegasus/items/inventory/airmask.cpp
@@ -31,7 +31,7 @@
 
 namespace Pegasus {
 
-AirMask *g_airMask = 0;
+AirMask *g_airMask = nullptr;
 
 //	Based on full == 100, which is scale used by GetAirLeft().
 static const TimeValue kOxygenLowThreshold = 25;
@@ -54,7 +54,7 @@ AirMask::AirMask(const ItemID id, const NeighborhoodID neighborhood, const RoomI
 
 AirMask::~AirMask() {
 	g_allHotspots.removeOneHotspot(kAirMaskToggleSpotID);
-	g_airMask = 0;
+	g_airMask = nullptr;
 }
 
 void AirMask::writeToStream(Common::WriteStream *stream) {
diff --git a/engines/pegasus/items/inventory/inventoryitem.cpp b/engines/pegasus/items/inventory/inventoryitem.cpp
index 9d65f99e68..1a3307b284 100644
--- a/engines/pegasus/items/inventory/inventoryitem.cpp
+++ b/engines/pegasus/items/inventory/inventoryitem.cpp
@@ -42,7 +42,7 @@ InventoryItem::InventoryItem(const ItemID id, const NeighborhoodID neighborhood,
 		delete leftInfo;
 	} else {
 		_leftAreaInfo.numEntries = 0;
-		_leftAreaInfo.entries = 0;
+		_leftAreaInfo.entries = nullptr;
 	}
 
 	Common::SeekableReadStream *inventoryInfo = vm->_resFork->getResource(MKTAG('I', 'n', 'v', 'I'), kItemBaseResID + id);
diff --git a/engines/pegasus/items/inventorypicture.cpp b/engines/pegasus/items/inventorypicture.cpp
index ddb96a4ad1..d56e6c93b2 100644
--- a/engines/pegasus/items/inventorypicture.cpp
+++ b/engines/pegasus/items/inventorypicture.cpp
@@ -41,7 +41,7 @@ InventoryPicture::InventoryPicture(const DisplayElementID id, InputHandler *next
 		_currentItem = (Item *)_inventory->getItemAt(0);
 	} else {
 		_currentItemIndex = -1;
-		_currentItem = 0;
+		_currentItem = nullptr;
 	}
 
 	_active = false;
@@ -103,7 +103,7 @@ void InventoryPicture::setCurrentItemIndex(int32 index) {
 	if (index >= _inventory->getNumItems())
 		index = _inventory->getNumItems() - 1;
 
-	Item *currentItem = 0;
+	Item *currentItem = nullptr;
 	if (index >= 0)
 		currentItem = (Item *)_inventory->getItemAt(index);
 
diff --git a/engines/pegasus/items/itemdragger.cpp b/engines/pegasus/items/itemdragger.cpp
index 7736906f78..e91169952a 100644
--- a/engines/pegasus/items/itemdragger.cpp
+++ b/engines/pegasus/items/itemdragger.cpp
@@ -31,12 +31,12 @@
 namespace Pegasus {
 
 SpriteDragger::SpriteDragger() {
-	_draggingSprite = 0;
+	_draggingSprite = nullptr;
 	_limitRect = Common::Rect(-30000, -30000, 30000, 30000);
 	_slopRect = Common::Rect(-30000, -30000, 30000, 30000);
 	_dragOffset.x = 0;
 	_dragOffset.y = 0;
-	_lastHotspot = 0;
+	_lastHotspot = nullptr;
 }
 
 void SpriteDragger::setDragSprite(Sprite *newSprite) {
diff --git a/engines/pegasus/items/itemlist.cpp b/engines/pegasus/items/itemlist.cpp
index 2e4d859451..6352360a90 100644
--- a/engines/pegasus/items/itemlist.cpp
+++ b/engines/pegasus/items/itemlist.cpp
@@ -61,7 +61,7 @@ Item *ItemList::findItemByID(const ItemID id) {
 		if ((*it)->getObjectID() == id)
 			return *it;
 
-	return 0;
+	return nullptr;
 }
 
 void ItemList::resetAllItems() {
diff --git a/engines/pegasus/menu.cpp b/engines/pegasus/menu.cpp
index ff308f80dc..29ae0c4df3 100644
--- a/engines/pegasus/menu.cpp
+++ b/engines/pegasus/menu.cpp
@@ -31,7 +31,7 @@
 namespace Pegasus {
 
 GameMenu::GameMenu(const uint32 id) : IDObject(id), InputHandler((InputHandler *)((PegasusEngine *)g_engine)) {
-	_previousHandler = 0;
+	_previousHandler = nullptr;
 	_lastCommand = kMenuCmdNoCommand;
 }
 
diff --git a/engines/pegasus/movie.cpp b/engines/pegasus/movie.cpp
index eaf8e32c05..4a22380171 100644
--- a/engines/pegasus/movie.cpp
+++ b/engines/pegasus/movie.cpp
@@ -33,7 +33,7 @@
 namespace Pegasus {
 
 Movie::Movie(const DisplayElementID id) : Animation(id) {
-	_video = 0;
+	_video = nullptr;
 	setScale(600);
 }
 
@@ -46,7 +46,7 @@ Movie::~Movie() {
 void Movie::releaseMovie() {
 	if (_video) {
 		delete _video;
-		_video = 0;
+		_video = nullptr;
 		disposeAllCallBacks();
 		deallocateSurface();
 	}
@@ -92,7 +92,7 @@ void Movie::redrawMovieWorld() {
 			return;
 
 		// Make sure we have a surface in the current pixel format
-		Graphics::Surface *convertedFrame = 0;
+		Graphics::Surface *convertedFrame = nullptr;
 
 		if (frame->format != g_system->getScreenFormat()) {
 			convertedFrame = frame->convertTo(g_system->getScreenFormat());
diff --git a/engines/pegasus/neighborhood/caldoria/caldoria.cpp b/engines/pegasus/neighborhood/caldoria/caldoria.cpp
index 60a4a2fe08..170a1ea3fc 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoria.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoria.cpp
@@ -193,8 +193,8 @@ Caldoria::Caldoria(InputHandler* nextHandler, PegasusEngine *owner)
 	setIsItemTaken(kKeyCard);
 	setIsItemTaken(kOrangeJuiceGlassEmpty);
 	GameState.setTakenItemID(kOrangeJuiceGlassFull, GameState.isTakenItemID(kOrangeJuiceGlassEmpty));
-	_zoomOutSpot = 0;
-	_gunSprite = 0;
+	_zoomOutSpot = nullptr;
+	_gunSprite = nullptr;
 }
 
 Caldoria::~Caldoria() {
@@ -249,7 +249,7 @@ void Caldoria::start() {
 
 		_vm->_gfx->doFadeOutSync(kOneSecond * kFifteenTicksPerSecond, kFifteenTicksPerSecond);
 
-		Video::VideoDecoder *pullbackMovie = 0;
+		Video::VideoDecoder *pullbackMovie = nullptr;
 		uint16 pullbackX, pullbackY;
 
 #ifdef USE_THEORADEC
@@ -259,7 +259,7 @@ void Caldoria::start() {
 
 			if (!pullbackMovie->loadFile("Images/Caldoria/Pullback.ogg")) {
 				delete pullbackMovie;
-			pullbackMovie = 0;
+			pullbackMovie = nullptr;
 			}
 		}
 #endif
@@ -274,7 +274,7 @@ void Caldoria::start() {
 		pullbackMovie->setVolume(MIN<uint>(_vm->getSoundFXLevel(), 0xFF));
 
 		// Draw the first frame so we can fade to it
-		const Graphics::Surface *frame = 0;
+		const Graphics::Surface *frame = nullptr;
 
 		if (_vm->isDVD()) {
 			uint16 newHeight = (uint16)((640.0f / (float)pullbackMovie->getWidth()) * (float)pullbackMovie->getHeight());
@@ -332,12 +332,12 @@ void Caldoria::start() {
 
 		if (!skipped) {
 			if (_vm->isDVD()) {
-				Video::VideoDecoder* wakeModeMovie = 0;
+				Video::VideoDecoder* wakeModeMovie = nullptr;
 #ifdef USE_THEORADEC
 				wakeModeMovie = new Video::TheoraDecoder();
 				if (!wakeModeMovie->loadFile(wakeModeMoviePath + ".ogg")) {
 					delete wakeModeMovie;
-					wakeModeMovie = 0;
+					wakeModeMovie = nullptr;
 				}
 #endif
 				if (!wakeModeMovie) {
@@ -1056,7 +1056,7 @@ void Caldoria::doAIRecalibration() {
 	Input input;
 	InputDevice.getInput(input, kPullbackInterruptFilter);
 	if (_vm->isDVD() && JMPPPInput::isEasterEggModifierInput(input)) {
-		Video::VideoDecoder *video = 0;
+		Video::VideoDecoder *video = nullptr;
 
 		_vm->_cursor->hide();
 
@@ -1064,7 +1064,7 @@ void Caldoria::doAIRecalibration() {
 		video = new Video::TheoraDecoder();
 		if (!video->loadFile("Images/Caldoria/A00EA.ogg")) {
 			delete video;
-			video = 0;
+			video = nullptr;
 		}
 #endif
 
@@ -1633,7 +1633,7 @@ void Caldoria::receiveNotification(Notification *notification, const Notificatio
 		case kCa53EastZoomToSinclair:
 			if (GameState.getCaldoriaSinclairShot()) {
 				delete _gunSprite;
-				_gunSprite = 0;
+				_gunSprite = nullptr;
 				startExtraSequence(kCa53EastShootSinclair, kExtraCompletedFlag, false);
 			} else {
 				playDeathExtra(kCa53EastDeath2, kDeathSinclairShotDelegate);
@@ -2078,7 +2078,7 @@ GameInteraction *Caldoria::makeInteraction(const InteractionID interactionID) {
 		break;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void Caldoria::newInteraction(const InteractionID interactionID) {
@@ -2601,7 +2601,7 @@ Common::String Caldoria::getSoundSpotsName() {
 }
 
 void Caldoria::doArthurJoyride() {
-	Video::VideoDecoder *video = 0;
+	Video::VideoDecoder *video = nullptr;
 	BiochipItem *item;
 
 	setNextHandler(_vm);
@@ -2614,7 +2614,7 @@ void Caldoria::doArthurJoyride() {
 	video = new Video::TheoraDecoder();
 	if (!video->loadFile("Images/Caldoria/A12RD.ogg")) {
 		delete video;
-		video = 0;
+		video = nullptr;
 	}
 #endif
 
diff --git a/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp b/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp
index 97dbd9cb71..6c0d964db8 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp
@@ -930,8 +930,8 @@ bool setEdgeUsed(BombEdgeList edges, VertexType fromVertex, VertexType toVertex)
 	while (numEdges--) {
 		VertexType *p = anEdge;
 		VertexType numVerts = *++p;
-		VertexType *fromPtr = 0;
-		VertexType *toPtr = 0;
+		VertexType *fromPtr = nullptr;
+		VertexType *toPtr = nullptr;
 		VertexType i = numVerts;
 		p++;
 
diff --git a/engines/pegasus/neighborhood/mars/canyonchase.cpp b/engines/pegasus/neighborhood/mars/canyonchase.cpp
index 9149f12c92..556f0fffc0 100644
--- a/engines/pegasus/neighborhood/mars/canyonchase.cpp
+++ b/engines/pegasus/neighborhood/mars/canyonchase.cpp
@@ -87,8 +87,8 @@ void MusicTimerEvent::fire() {
 CanyonChase::CanyonChase(Neighborhood *handler) : ChaseInteraction(kMarsCanyonChaseInteractionID, handler,
 							kMarsCanyonChaseNotificationID, (PegasusEngine *)g_engine), _canyonMovie1(kNoDisplayElement),
 							_canyonMovie2(kNoDisplayElement), _deathMovie(kNoDisplayElement), _genoMovie(kNoDisplayElement) {
-	_currentMovie = NULL;
-	_currentCallBack = NULL;
+	_currentMovie = nullptr;
+	_currentCallBack = nullptr;
 }
 
 void CanyonChase::setSoundFXLevel(const uint16 fxLevel) {
@@ -468,7 +468,7 @@ void CanyonChase::hideControlsHint() {
 
 void CanyonChase::switchTo(Movie &movie, NotificationCallBack &callBack) {
 	if (_currentMovie != &movie) {
-		if (_currentMovie != NULL) {
+		if (_currentMovie != nullptr) {
 			_currentMovie->stop();
 			_currentMovie->hide();
 			_currentMovie->stopDisplaying();
diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp
index 1a7f613610..98a656b38c 100644
--- a/engines/pegasus/neighborhood/mars/mars.cpp
+++ b/engines/pegasus/neighborhood/mars/mars.cpp
@@ -143,7 +143,7 @@ void Mars::init() {
 
 	Hotspot *attackSpot = _vm->getAllHotspots().findHotspotByID(kAttackRobotHotSpotID);
 	attackSpot->setMaskedHotspotFlags(kDropItemSpotFlag, kDropItemSpotFlag);
-	_attackingItem = NULL;
+	_attackingItem = nullptr;
 
 	forceStridingStop(kMars08, kNorth, kAltMarsNormal);
 
@@ -164,7 +164,7 @@ GameInteraction *Mars::makeInteraction(const InteractionID interactionID) {
 	case kMarsCanyonChaseInteractionID:
 		return new CanyonChase(this);
 	default:
-		return NULL;
+		return nullptr;
 	}
 }
 
@@ -2853,7 +2853,7 @@ void Mars::receiveNotification(Notification *notification, const NotificationFla
 			break;
 		case kMars48RobotDefends:
 			_vm->addItemToInventory(_attackingItem);
-			_attackingItem = 0;
+			_attackingItem = nullptr;
 			if (_privateFlags.getFlag(kMarsPrivateRobotTiredOfWaitingFlag)) {
 				startExtraSequence(kMars48RobotKillsPlayer, kExtraCompletedFlag, kFilterNoInput);
 				loadLoopSound2("", 0x100, 0, 0);
@@ -3118,7 +3118,7 @@ void Mars::spotCompleted() {
 
 void Mars::startUpFromFinishedTunnelPod() {
 	arriveAt(kMars45, kSouth);
-	if (g_AIArea != NULL)
+	if (g_AIArea != nullptr)
 		g_AIArea->checkMiddleArea();
 }
 
@@ -3136,7 +3136,7 @@ void Mars::doCanyonChase() {
 	_spotSounds.initFromQuickTime(getSoundSpotsName());
 	_spotSounds.setVolume(_vm->getSoundFXLevel());
 
-	Video::VideoDecoder *video = 0;
+	Video::VideoDecoder *video = nullptr;
 
 #ifdef USE_THEORADEC
 	if (_vm->isDVD()) {
@@ -3144,7 +3144,7 @@ void Mars::doCanyonChase() {
 
 		if (!video->loadFile("Images/Mars/M44ESA_hq.ogg")) {
 			delete video;
-			video = 0;
+			video = nullptr;
 		}
 	}
 #endif
@@ -3881,7 +3881,7 @@ void Mars::playSpaceAmbient() {
 void Mars::transportOutFromSpaceChase(bool destroyedShip) {
 	throwAwayMarsShuttle();
 
-	Video::VideoDecoder *video = 0;
+	Video::VideoDecoder *video = nullptr;
 
 #ifdef USE_THEORADEC
 	if (_vm->isDVD()) {
@@ -3890,11 +3890,11 @@ void Mars::transportOutFromSpaceChase(bool destroyedShip) {
 		if (destroyedShip) {
 			if (!video->loadFile("Images/Mars/M98EAP_hq.ogg")) {
 				delete video;
-				video = 0;
+				video = nullptr;
 			}
 		} else if (!video->loadFile("Images/Mars/M98EAE_hq.ogg")) {
 			delete video;
-			video = 0;
+			video = nullptr;
 		}
 	}
 #endif
diff --git a/engines/pegasus/neighborhood/mars/planetmover.cpp b/engines/pegasus/neighborhood/mars/planetmover.cpp
index fa55e2bc35..504e52fc8a 100644
--- a/engines/pegasus/neighborhood/mars/planetmover.cpp
+++ b/engines/pegasus/neighborhood/mars/planetmover.cpp
@@ -41,7 +41,7 @@ static const CoordType kMaxVelocity = 20;
 PlanetMover::PlanetMover() {
 	setScale(kRovingScale);
 	_dropping = false;
-	_planetMovie = 0;
+	_planetMovie = nullptr;
 }
 
 void PlanetMover::startMoving(Movie *planetMovie) {
diff --git a/engines/pegasus/neighborhood/mars/robotship.cpp b/engines/pegasus/neighborhood/mars/robotship.cpp
index 3f672c0f0b..5926a2cdad 100644
--- a/engines/pegasus/neighborhood/mars/robotship.cpp
+++ b/engines/pegasus/neighborhood/mars/robotship.cpp
@@ -53,7 +53,7 @@ static const CoordType kRovingTop = kShuttleWindowTop + 20;
 static const CoordType kRovingWidth = kShuttleWindowMidH - kRovingLeft;
 static const CoordType kRovingHeight = kShuttleWindowMidV - kRovingTop;
 
-RobotShip *g_robotShip = 0;
+RobotShip *g_robotShip = nullptr;
 
 RobotShip::RobotShip() : _spritesMovie(kNoDisplayElement) {
 	g_robotShip = this;
@@ -68,7 +68,7 @@ RobotShip::RobotShip() : _spritesMovie(kNoDisplayElement) {
 }
 
 RobotShip::~RobotShip() {
-	g_robotShip = 0;
+	g_robotShip = nullptr;
 }
 
 void RobotShip::initRobotShip() {
diff --git a/engines/pegasus/neighborhood/mars/spacejunk.cpp b/engines/pegasus/neighborhood/mars/spacejunk.cpp
index 52753882b1..ed68428bf9 100644
--- a/engines/pegasus/neighborhood/mars/spacejunk.cpp
+++ b/engines/pegasus/neighborhood/mars/spacejunk.cpp
@@ -37,7 +37,7 @@ static const float kJunkXTarget = 0;
 static const float kJunkYTarget = 0;
 static const float kJunkZTarget = kJunkMinDistance;
 
-SpaceJunk *g_spaceJunk = 0;
+SpaceJunk *g_spaceJunk = nullptr;
 
 SpaceJunk::SpaceJunk(const DisplayElementID id) : ScalingMovie(id) {
 	_timer.setScale(kJunkTimeScale);
@@ -46,7 +46,7 @@ SpaceJunk::SpaceJunk(const DisplayElementID id) : ScalingMovie(id) {
 }
 
 SpaceJunk::~SpaceJunk() {
-	g_spaceJunk = 0;
+	g_spaceJunk = nullptr;
 }
 
 void SpaceJunk::launchJunk(int16 whichJunk, CoordType xOrigin, CoordType yOrigin) {
diff --git a/engines/pegasus/neighborhood/mars/tunnelpod.cpp b/engines/pegasus/neighborhood/mars/tunnelpod.cpp
index 61ba86cdd5..87df40df09 100644
--- a/engines/pegasus/neighborhood/mars/tunnelpod.cpp
+++ b/engines/pegasus/neighborhood/mars/tunnelpod.cpp
@@ -67,8 +67,8 @@ enum {
 TunnelPod::TunnelPod(Neighborhood *handler) : ChaseInteraction(kMarsTunnelPodInteractionID, handler,
 						kMarsTunnelPodNotificationID, (PegasusEngine *)g_engine), _tunnelMainMovie(kNoDisplayElement),
 						_tunnelAltMovie(kNoDisplayElement), _deathMovie(kNoDisplayElement) {
-	_currentMovie = NULL;
-	_currentCallBack = NULL;
+	_currentMovie = nullptr;
+	_currentCallBack = nullptr;
 }
 
 void TunnelPod::setSoundFXLevel(const uint16 fxLevel) {
@@ -218,8 +218,8 @@ void TunnelPod::branchLeft() {
 	branchStart = 0;
 	branchEnd = 0;
 	flag = 0;
-	movie = NULL;
-	callBack = NULL;
+	movie = nullptr;
+	callBack = nullptr;
 	switch (_tunnelState) {
 	case kTunnelLaunch:
 		branchStart = kBranch1MainStart;
@@ -277,8 +277,8 @@ void TunnelPod::branchRight() {
 	branchStart = 0;
 	branchEnd = 0;
 	flag = 0;
-	movie = NULL;
-	callBack = NULL;
+	movie = nullptr;
+	callBack = nullptr;
 	switch (_tunnelState) {
 	case kTunnelLaunch:
 		switchTo(_deathMovie, _deathCallBack);
@@ -352,7 +352,7 @@ void TunnelPod::dontBranch() {
 
 void TunnelPod::switchTo(Movie &movie, NotificationCallBack &callBack) {
 	if (_currentMovie != &movie) {
-		if (_currentMovie != NULL) {
+		if (_currentMovie != nullptr) {
 			_currentMovie->stop();
 			_currentMovie->hide();
 			_currentMovie->stopDisplaying();
diff --git a/engines/pegasus/neighborhood/neighborhood.cpp b/engines/pegasus/neighborhood/neighborhood.cpp
index a91431762f..a61986c156 100644
--- a/engines/pegasus/neighborhood/neighborhood.cpp
+++ b/engines/pegasus/neighborhood/neighborhood.cpp
@@ -54,7 +54,7 @@ void StriderCallBack::callBack() {
 
 static const TimeValue kStridingSlop = 39;
 
-Neighborhood *g_neighborhood = 0;
+Neighborhood *g_neighborhood = nullptr;
 
 Neighborhood::Neighborhood(InputHandler *nextHandler, PegasusEngine *vm, const Common::String &resName, NeighborhoodID id)
 		: InputHandler(nextHandler), IDObject(id), _vm(vm), _resName(resName), _navMovie(kNavMovieID), _stridingCallBack(this),
@@ -67,7 +67,7 @@ Neighborhood::Neighborhood(InputHandler *nextHandler, PegasusEngine *vm, const C
 	allowInput(true);
 	resetLastExtra();
 	g_neighborhood = this;
-	_currentInteraction = 0;
+	_currentInteraction = nullptr;
 	_doneWithInteraction = false;
 	_croppedMovie.setDisplayOrder(kCroppedMovieLayer);
 }
@@ -77,7 +77,7 @@ Neighborhood::~Neighborhood() {
 		_vm->getAllHotspots().remove(*it);
 
 	_neighborhoodHotspots.deleteHotspots();
-	g_neighborhood = 0;
+	g_neighborhood = nullptr;
 
 	loadLoopSound1("");
 	loadLoopSound2("");
@@ -991,7 +991,7 @@ HotspotInfoTable::Entry *Neighborhood::findHotspotEntry(const HotSpotID id) {
 		if (it->hotspot == id)
 			return &(*it);
 
-	return 0;
+	return nullptr;
 }
 
 void Neighborhood::hideNav() {
@@ -1256,7 +1256,7 @@ void Neighborhood::throwAwayInterface() {
 	_navMovie.releaseMovie();
 	_pushIn.deallocateSurface();
 	_turnPush.stopDisplaying();
-	_turnPush.setInAndOutElements(0, 0);
+	_turnPush.setInAndOutElements(nullptr, nullptr);
 	_turnPush.disposeAllCallBacks();
 
 	for (HotspotList::iterator it = _neighborhoodHotspots.begin(); it != _neighborhoodHotspots.end(); it++)
@@ -1416,7 +1416,7 @@ void Neighborhood::setUpAIRules() {
 
 GameInteraction *Neighborhood::makeInteraction(const InteractionID interactionID) {
 	if (interactionID == kNoInteractionID)
-		return 0;
+		return nullptr;
 
 	return new GameInteraction(interactionID, this);
 }
@@ -1444,7 +1444,7 @@ void Neighborhood::bumpIntoWall() {
 }
 
 void Neighborhood::zoomUpOrBump() {
-	Hotspot *zoomSpot = 0;
+	Hotspot *zoomSpot = nullptr;
 
 	for (HotspotList::iterator it = _vm->getAllHotspots().begin(); it != _vm->getAllHotspots().end(); it++) {
 		Hotspot *hotspot = *it;
@@ -1454,7 +1454,7 @@ void Neighborhood::zoomUpOrBump() {
 
 			if (entry && entry->hotspotRoom == GameState.getCurrentRoom() && entry->hotspotDirection == GameState.getCurrentDirection()) {
 				if (zoomSpot) {
-					zoomSpot = 0;
+					zoomSpot = nullptr;
 					break;
 				} else {
 					zoomSpot = hotspot;
diff --git a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
index d5e2dc4dc1..95a38da6cf 100644
--- a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
+++ b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
@@ -183,7 +183,7 @@ void NoradAlpha::start() {
 				if (itemNeighborhood == getObjectID())
 					_fillingStationItem = item;
 				else
-					_fillingStationItem = 0;
+					_fillingStationItem = nullptr;
 			}
 		}
 	}
@@ -773,10 +773,10 @@ void NoradAlpha::clickInHotspot(const Input &input, const Hotspot *cursorSpot) {
 void NoradAlpha::takeItemFromRoom(Item *item) {
 	if (GameState.getCurrentRoom() == kNorad01West) {
 		if (_fillingStationItem == item) {
-			_fillingStationItem = 0;
+			_fillingStationItem = nullptr;
 			GameState.setNoradGassed(false);
 			checkAirMask();
-			((NoradAlphaFillingStation *)_currentInteraction)->newFillingItem(0);
+			((NoradAlphaFillingStation *)_currentInteraction)->newFillingItem(nullptr);
 			forceStridingStop(kNorad03, kEast, kAltNoradAlphaNormal);
 		}
 	}
diff --git a/engines/pegasus/neighborhood/norad/alpha/panorama.cpp b/engines/pegasus/neighborhood/norad/alpha/panorama.cpp
index 4c979e1106..bb1b511ec7 100644
--- a/engines/pegasus/neighborhood/norad/alpha/panorama.cpp
+++ b/engines/pegasus/neighborhood/norad/alpha/panorama.cpp
@@ -40,7 +40,7 @@ Panorama::~Panorama() {
 void Panorama::blankFields() {
 	_viewBounds = Common::Rect();
 	_drawBounds = Common::Rect();
-	_mask = 0;
+	_mask = nullptr;
 	_panoramaWidth = 0;
 	_panoramaHeight = 0;
 	_stripWidth = 0;
diff --git a/engines/pegasus/neighborhood/norad/delta/globegame.cpp b/engines/pegasus/neighborhood/norad/delta/globegame.cpp
index ad60c987fd..78782c01fc 100644
--- a/engines/pegasus/neighborhood/norad/delta/globegame.cpp
+++ b/engines/pegasus/neighborhood/norad/delta/globegame.cpp
@@ -986,7 +986,7 @@ void GlobeGame::handleInput(const Input &input, const Hotspot *cursorSpot) {
 	input.getInputLocation(where);
 	Hotspot *spot = g_allHotspots.findHotspot(where);
 
-	if (((PegasusEngine *)g_engine)->_cursor->isVisible() && spot != 0 &&
+	if (((PegasusEngine *)g_engine)->_cursor->isVisible() && spot != nullptr &&
 			spot->getObjectID() == kNorad79SiloAreaSpotID && findClickedSilo(input) != -1) {
 		_targetHighlightUpperLeft.show();
 		_targetHighlightUpperRight.show();
diff --git a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp
index 4c9f307b88..8a5beb6017 100644
--- a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp
+++ b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp
@@ -424,7 +424,7 @@ void NoradDelta::arriveAtNorad68West() {
 
 	BiochipItem *retScan = _vm->getCurrentBiochip();
 
-	if (retScan != 0 && retScan->getObjectID() == kRetinalScanBiochip) {
+	if (retScan != nullptr && retScan->getObjectID() == kRetinalScanBiochip) {
 		((RetScanChip *)retScan)->searchForLaser();
 		succeedRetinalScan();
 	} else {
@@ -864,7 +864,7 @@ uint NoradDelta::getNumHints() {
 		case MakeRoomView(kNorad68, kWest):
 			if (_vm->playerHasItemID(kRetinalScanBiochip)) {
 				BiochipItem *retScan = _vm->getCurrentBiochip();
-				if (retScan == 0 || retScan->getObjectID() != kRetinalScanBiochip)
+				if (retScan == nullptr || retScan->getObjectID() != kRetinalScanBiochip)
 					numHints = 2;
 			} else if (!GameState.isCurrentDoorOpen()) {
 				numHints = 2;
@@ -943,7 +943,7 @@ bool NoradDelta::canSolve() {
 
 	if (GameState.getCurrentRoomAndView() == MakeRoomView(kNorad68, kWest)) {
 		BiochipItem *biochip = _vm->getCurrentBiochip();
-		if (biochip != 0 && biochip->getObjectID() != kRetinalScanBiochip)
+		if (biochip != nullptr && biochip->getObjectID() != kRetinalScanBiochip)
 			return true;
 	}
 
@@ -958,7 +958,7 @@ void NoradDelta::doSolve() {
 			_vm->addItemToBiochips((BiochipItem *)_vm->getAllItems().findItemByID(kRetinalScanBiochip));
 
 		BiochipItem *biochip = _vm->getCurrentBiochip();
-		if (biochip != 0 && biochip->getObjectID() != kRetinalScanBiochip && g_interface)
+		if (biochip != nullptr && biochip->getObjectID() != kRetinalScanBiochip && g_interface)
 			g_interface->setCurrentBiochipID(kRetinalScanBiochip);
 
 		Hotspot *spot = _vm->getAllHotspots().findHotspotByID(kNorad68WestSpotID);
diff --git a/engines/pegasus/neighborhood/norad/norad.cpp b/engines/pegasus/neighborhood/norad/norad.cpp
index 5b0d0b483a..22e31ea1db 100644
--- a/engines/pegasus/neighborhood/norad/norad.cpp
+++ b/engines/pegasus/neighborhood/norad/norad.cpp
@@ -111,7 +111,7 @@ GameInteraction *Norad::makeInteraction(const InteractionID interactionID) {
 	case kNoradSubPlatformInteractionID:
 		return new SubPlatform(this);
 	default:
-		return 0;
+		return nullptr;
 	}
 }
 
diff --git a/engines/pegasus/neighborhood/norad/pressuretracker.cpp b/engines/pegasus/neighborhood/norad/pressuretracker.cpp
index 17004a4d72..2503447a75 100644
--- a/engines/pegasus/neighborhood/norad/pressuretracker.cpp
+++ b/engines/pegasus/neighborhood/norad/pressuretracker.cpp
@@ -32,7 +32,7 @@ namespace Pegasus {
 
 PressureTracker::PressureTracker(PressureDoor *pressureDoor) {
 	_pressureDoor = pressureDoor;
-	_trackSpot = 0;
+	_trackSpot = nullptr;
 	_trackTime = 0;
 	_trackButton = nullptr;
 }
diff --git a/engines/pegasus/neighborhood/wsc/wsc.cpp b/engines/pegasus/neighborhood/wsc/wsc.cpp
index 2ce111ee38..2f3c35ec6a 100644
--- a/engines/pegasus/neighborhood/wsc/wsc.cpp
+++ b/engines/pegasus/neighborhood/wsc/wsc.cpp
@@ -526,8 +526,8 @@ void WSC::init() {
 
 	_extraMovieCallBack.setNotification(&_neighborhoodNotification);
 
-	_cachedZoomSpot = 0;
-	_argonSprite = 0;
+	_cachedZoomSpot = nullptr;
+	_argonSprite = nullptr;
 
 	// HACK: Fix the drag item for picking up the Sinclair Key Card
 	HotspotInfoTable::Entry *entry = findHotspotEntry(kWSC02SouthTakeArgonSpotID);
@@ -2003,7 +2003,7 @@ void WSC::receiveNotification(Notification *notification, const NotificationFlag
 			_privateFlags.setFlag(kWSCPrivateLabMessagesOpenFlag, false);
 			if (_cachedZoomSpot) {
 				zoomTo(_cachedZoomSpot);
-				_cachedZoomSpot = 0;
+				_cachedZoomSpot = nullptr;
 			}
 			break;
 		case kWSC02TurnOnMorphScreen:
@@ -2118,7 +2118,7 @@ void WSC::receiveNotification(Notification *notification, const NotificationFlag
 			setCurrentActivation(kActivationW61MessagesOff);
 			if (_cachedZoomSpot) {
 				zoomTo(_cachedZoomSpot);
-				_cachedZoomSpot = 0;
+				_cachedZoomSpot = nullptr;
 			}
 			break;
 		case kW61SouthScreenOnWithGun:
@@ -2134,7 +2134,7 @@ void WSC::receiveNotification(Notification *notification, const NotificationFlag
 			setCurrentActivation(kActivationW61SouthOff);
 			if (_cachedZoomSpot) {
 				zoomTo(_cachedZoomSpot);
-				_cachedZoomSpot = 0;
+				_cachedZoomSpot = nullptr;
 			}
 			break;
 		case kW62ZoomOutFromRobot:
@@ -2229,7 +2229,7 @@ void WSC::receiveNotification(Notification *notification, const NotificationFlag
 			break;
 		case kW98MorphsToRobot:
 			if (_argonSprite) {
-				delete _argonSprite; _argonSprite = 0;
+				delete _argonSprite; _argonSprite = nullptr;
 				startExtraSequence(kW98RobotGassed, kExtraCompletedFlag, kFilterNoInput);
 			} else if (_privateFlags.getFlag(kWSCPrivateClickedCatwalkCableFlag)) {
 				startExtraSequence(kW98RobotShocked, kExtraCompletedFlag, kFilterNoInput);
diff --git a/engines/pegasus/notification.cpp b/engines/pegasus/notification.cpp
index 66d6358bd7..87a691cf48 100644
--- a/engines/pegasus/notification.cpp
+++ b/engines/pegasus/notification.cpp
@@ -39,7 +39,7 @@ Notification::Notification(const NotificationID id, NotificationManager *owner)
 
 Notification::~Notification() {
 	for (uint i = 0; i < _receivers.size(); i++)
-		_receivers[i].receiver->newNotification(NULL);
+		_receivers[i].receiver->newNotification(nullptr);
 
 	if (_owner)
 		_owner->removeNotification(this);
@@ -98,7 +98,7 @@ int operator!=(const ReceiverEntry &entry1, const ReceiverEntry &entry2) {
 }
 
 NotificationReceiver::NotificationReceiver() {
-	_notification = NULL;
+	_notification = nullptr;
 }
 
 NotificationReceiver::~NotificationReceiver() {
@@ -137,7 +137,7 @@ void NotificationManager::removeNotification(Notification *notification) {
 
 void NotificationManager::detachNotifications() {
 	for (NotificationIterator it = _notifications.begin(); it != _notifications.end(); it++)
-		(*it)->_owner = 0;
+		(*it)->_owner = nullptr;
 }
 
 void NotificationManager::checkNotifications() {
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index d4eac61b4a..841b8605a6 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -79,28 +79,28 @@
 
 namespace Pegasus {
 
-PegasusEngine::PegasusEngine(OSystem *syst, const PegasusGameDescription *gamedesc) : Engine(syst), InputHandler(0), _gameDescription(gamedesc),
+PegasusEngine::PegasusEngine(OSystem *syst, const PegasusGameDescription *gamedesc) : Engine(syst), InputHandler(nullptr), _gameDescription(gamedesc),
 		_shellNotification(kJMPDCShellNotificationID, this), _returnHotspot(kInfoReturnSpotID), _itemDragger(this), _bigInfoMovie(kNoDisplayElement),
 		_smallInfoMovie(kNoDisplayElement) {
-	_continuePoint = 0;
+	_continuePoint = nullptr;
 	_saveAllowed = _loadAllowed = true;
 	_saveRequested = _loadRequested = false;
-	_gameMenu = 0;
+	_gameMenu = nullptr;
 	_deathReason = kDeathStranded;
-	_neighborhood = 0;
+	_neighborhood = nullptr;
 	_FXLevel = 0x80;
 	_ambientLevel = 0x80;
 	_gameMode = kNoMode;
 	_switchModesSync = false;
-	_draggingItem = 0;
+	_draggingItem = nullptr;
 	_dragType = kDragNoDrag;
-	_idlerHead = 0;
+	_idlerHead = nullptr;
 	_currentCD = 1;
-	_introTimer = 0;
+	_introTimer = nullptr;
 	_toggleRequested = false;
 	_chattyAI = true;
 	_chattyArthur = true;
-	_aiSaveStream = 0;
+	_aiSaveStream = nullptr;
 	_heardOverviewVoice = false;
 }
 
@@ -422,7 +422,7 @@ void PegasusEngine::addIdler(Idler *idler) {
 	idler->_nextIdler = _idlerHead;
 	if (_idlerHead)
 		_idlerHead->_prevIdler = idler;
-	idler->_prevIdler = 0;
+	idler->_prevIdler = nullptr;
 	_idlerHead = idler;
 }
 
@@ -433,12 +433,12 @@ void PegasusEngine::removeIdler(Idler *idler) {
 		idler->_nextIdler->_prevIdler = idler->_prevIdler;
 	if (idler == _idlerHead)
 		_idlerHead = idler->_nextIdler;
-	idler->_nextIdler = 0;
-	idler->_prevIdler = 0;
+	idler->_nextIdler = nullptr;
+	idler->_prevIdler = nullptr;
 }
 
 void PegasusEngine::giveIdleTime() {
-	for (Idler *idler = _idlerHead; idler != 0; idler = idler->_nextIdler)
+	for (Idler *idler = _idlerHead; idler != nullptr; idler = idler->_nextIdler)
 		idler->useIdleTime();
 }
 
@@ -454,8 +454,8 @@ bool PegasusEngine::loadFromStream(Common::SeekableReadStream *stream) {
 	// Dispose currently running stuff
 	lowerInventoryDrawerSync();
 	lowerBiochipDrawerSync();
-	useMenu(0);
-	useNeighborhood(0);
+	useMenu(nullptr);
+	useNeighborhood(nullptr);
 	removeAllItemsFromInventory();
 	removeAllItemsFromBiochips();
 	_currentItemID = kNoItemID;
@@ -769,7 +769,7 @@ void PegasusEngine::receiveNotification(Notification *notification, const Notifi
 				showTempScreen("Images/Demo/NGsplashScrn.pict");
 
 				if (shouldQuit()) {
-					useMenu(0);
+					useMenu(nullptr);
 					return;
 				}
 
@@ -824,7 +824,7 @@ void PegasusEngine::introTimerExpired() {
 
 		bool skipped = false;
 
-		Video::VideoDecoder *video = 0;
+		Video::VideoDecoder *video = nullptr;
 
 #ifdef USE_THEORADEC
 		if (isDVD()) {
@@ -832,7 +832,7 @@ void PegasusEngine::introTimerExpired() {
 
 			if (!video->loadFile(_introDirectory + "/LilMovie_hq.ogg")) {
 				delete video;
-				video = 0;
+				video = nullptr;
 			}
 		}
 #endif
@@ -994,18 +994,18 @@ void PegasusEngine::doGameMenuCommand(const GameMenuCommand command) {
 				}
 
 				_gfx->doFadeOutSync();
-				useMenu(0);
+				useMenu(nullptr);
 				_gfx->enableErase();
 				_gfx->updateDisplay();
 				_gfx->disableErase();
 
-				Video::VideoDecoder *video = 0;
+				Video::VideoDecoder *video = nullptr;
 				if (GameState.getEasterEgg()) {
 #ifdef USE_THEORADEC
 					video = new Video::TheoraDecoder();
 					if (!video->loadFile(_introDirectory + "/Closing_hq2.ogg")) {
 						delete video;
-						video = 0;
+						video = nullptr;
 					}
 #endif
 					if (!video) {
@@ -1018,7 +1018,7 @@ void PegasusEngine::doGameMenuCommand(const GameMenuCommand command) {
 					video = new Video::TheoraDecoder();
 					if (!video->loadFile(_introDirectory + "/Closing_hq1.ogg")) {
 						delete video;
-						video = 0;
+						video = nullptr;
 					}
 #endif
 					if (!video) {
@@ -1045,7 +1045,7 @@ void PegasusEngine::doGameMenuCommand(const GameMenuCommand command) {
 					video = new Video::TheoraDecoder();
 					if (!video->loadFile(_introDirectory + "/Closing_hq3.ogg")) {
 						delete video;
-						video = 0;
+						video = nullptr;
 					}
 #endif
 					if (!video) {
@@ -1214,7 +1214,7 @@ void PegasusEngine::doInterfaceOverview() {
 	static const Common::Rect hiddenSpot = Common::Rect(595, 417, 595 + 4, 417 + 5);
 
 	_gfx->doFadeOutSync();
-	useMenu(0);
+	useMenu(nullptr);
 
 	Picture leftBackground(kNoDisplayElement);
 	leftBackground.initFromPICTFile("Images/Interface/OVLeft.mac");
@@ -1486,7 +1486,7 @@ InventoryItem *PegasusEngine::getCurrentInventoryItem() {
 	if (g_interface)
 		return g_interface->getCurrentInventoryItem();
 
-	return 0;
+	return nullptr;
 }
 
 bool PegasusEngine::itemInInventory(InventoryItem *item) {
@@ -1501,7 +1501,7 @@ BiochipItem *PegasusEngine::getCurrentBiochip() {
 	if (g_interface)
 		return g_interface->getCurrentBiochip();
 
-	return 0;
+	return nullptr;
 }
 
 bool PegasusEngine::itemInBiochips(BiochipItem *item) {
@@ -1677,11 +1677,11 @@ void PegasusEngine::throwAwayEverything() {
 	else
 		_currentBiochipID = kNoItemID;
 
-	useMenu(0);
-	useNeighborhood(0);
+	useMenu(nullptr);
+	useNeighborhood(nullptr);
 
 	delete g_interface;
-	g_interface = 0;
+	g_interface = nullptr;
 }
 
 InputBits PegasusEngine::getInputFilter() {
@@ -1810,7 +1810,7 @@ void PegasusEngine::useNeighborhood(Neighborhood *neighborhood) {
 
 void PegasusEngine::performJump(NeighborhoodID neighborhoodID) {
 	if (_neighborhood)
-		useNeighborhood(0);
+		useNeighborhood(nullptr);
 
 	// Sub chase is special
 	if (neighborhoodID == kNoradSubChaseID) {
@@ -1861,7 +1861,7 @@ void PegasusEngine::startNewGame() {
 		Arthur.resetArthurState();
 
 	_gfx->doFadeOutSync();
-	useMenu(0);
+	useMenu(nullptr);
 
 	_gfx->enableErase();
 	_gfx->updateDisplay();
@@ -1965,7 +1965,7 @@ void PegasusEngine::makeNeighborhood(NeighborhoodID neighborhoodID, Neighborhood
 }
 
 bool PegasusEngine::wantsCursor() {
-	return _gameMenu == 0;
+	return _gameMenu == nullptr;
 }
 
 void PegasusEngine::updateCursor(const Common::Point, const Hotspot *cursorSpot) {
@@ -2359,7 +2359,7 @@ void PegasusEngine::pauseMenu(bool menuUp) {
 		_menuPauseToken.clear();
 		_screenDimmer.hide();
 		_screenDimmer.stopDisplaying();
-		useMenu(0);
+		useMenu(nullptr);
 		g_AIArea->checkMiddleArea();
 	}
 }
diff --git a/engines/pegasus/sound.cpp b/engines/pegasus/sound.cpp
index a86ebef67c..7af509eb23 100644
--- a/engines/pegasus/sound.cpp
+++ b/engines/pegasus/sound.cpp
@@ -35,9 +35,9 @@
 namespace Pegasus {
 
 Sound::Sound() {
-	_stream = 0;
+	_stream = nullptr;
 	_volume = 0xFF;
-	_fader = 0;
+	_fader = nullptr;
 }
 
 Sound::~Sound() {
@@ -46,7 +46,7 @@ Sound::~Sound() {
 
 void Sound::disposeSound() {
 	stopSound();
-	delete _stream; _stream = 0;
+	delete _stream; _stream = nullptr;
 }
 
 void Sound::initFromAIFFFile(const Common::String &fileName) {
@@ -81,7 +81,7 @@ void Sound::initFromQuickTime(const Common::String &fileName) {
 
 void Sound::attachFader(SoundFader *fader) {
 	if (_fader)
-		_fader->attachSound(0);
+		_fader->attachSound(nullptr);
 
 	_fader = fader;
 
@@ -148,7 +148,7 @@ bool Sound::isPlaying() {
 }
 
 bool Sound::isSoundLoaded() const {
-	return _stream != 0;
+	return _stream != nullptr;
 }
 
 SoundTimeBase::SoundTimeBase() {
diff --git a/engines/pegasus/surface.cpp b/engines/pegasus/surface.cpp
index 6a624397a7..d8eef2f6ba 100644
--- a/engines/pegasus/surface.cpp
+++ b/engines/pegasus/surface.cpp
@@ -38,7 +38,7 @@ namespace Pegasus {
 
 Surface::Surface() {
 	_ownsSurface = false;
-	_surface = 0;
+	_surface = nullptr;
 }
 
 Surface::~Surface() {
@@ -52,7 +52,7 @@ void Surface::deallocateSurface() {
 			delete _surface;
 		}
 
-		_surface = 0;
+		_surface = nullptr;
 		_bounds = Common::Rect();
 		_ownsSurface = false;
 	}
diff --git a/engines/pegasus/timers.cpp b/engines/pegasus/timers.cpp
index f97d30f53e..d81f4cbdf5 100644
--- a/engines/pegasus/timers.cpp
+++ b/engines/pegasus/timers.cpp
@@ -31,8 +31,8 @@ namespace Pegasus {
 
 Idler::Idler() {
 	_isIdling = false;
-	_nextIdler = 0;
-	_prevIdler = 0;
+	_nextIdler = nullptr;
+	_prevIdler = nullptr;
 }
 
 Idler::~Idler() {
@@ -55,7 +55,7 @@ void Idler::stopIdling() {
 
 TimeBase::TimeBase(const TimeScale preferredScale) {
 	_preferredScale = preferredScale;
-	_callBackList = 0;
+	_callBackList = nullptr;
 	_paused = false;
 	_flags = 0;
 	_lastMillis = 0;
@@ -65,7 +65,7 @@ TimeBase::TimeBase(const TimeScale preferredScale) {
 	_startScale = 1;
 	_stopTime = 0xffffffff;
 	_stopScale = 1;
-	_master = 0;
+	_master = nullptr;
 	_pausedRate = 0;
 	_pauseStart = 0;
 
@@ -231,7 +231,7 @@ void TimeBase::checkCallBacks() {
 	Common::Rational time = Common::Rational(getTime(), getScale());
 
 	// Check if we've triggered any callbacks
-	for (TimeBaseCallBack *runner = _callBackList; runner != 0; runner = runner->_nextCallBack) {
+	for (TimeBaseCallBack *runner = _callBackList; runner != nullptr; runner = runner->_nextCallBack) {
 		if (runner->_hasBeenTriggered)
 			continue;
 
@@ -287,24 +287,24 @@ void TimeBase::removeCallBack(TimeBaseCallBack *callBack) {
 		prevRunner->_nextCallBack = runner->_nextCallBack;
 	}
 
-	callBack->_nextCallBack = 0;
+	callBack->_nextCallBack = nullptr;
 }
 
 void TimeBase::disposeAllCallBacks() {
 	TimeBaseCallBack *nextRunner;
 
-	for (TimeBaseCallBack *runner = _callBackList; runner != 0; runner = nextRunner) {
+	for (TimeBaseCallBack *runner = _callBackList; runner != nullptr; runner = nextRunner) {
 		nextRunner = runner->_nextCallBack;
 		runner->disposeCallBack();
-		runner->_nextCallBack = 0;
+		runner->_nextCallBack = nullptr;
 	}
 
-	_callBackList = 0;
+	_callBackList = nullptr;
 }
 
 TimeBaseCallBack::TimeBaseCallBack() {
-	_timeBase = 0;
-	_nextCallBack = 0;
+	_timeBase = nullptr;
+	_nextCallBack = nullptr;
 	_trigger = kTriggerNone;
 	_type = kCallBackNone;
 	_hasBeenTriggered = false;
@@ -328,7 +328,7 @@ void TimeBaseCallBack::releaseCallBack() {
 }
 
 void TimeBaseCallBack::disposeCallBack() {
-	_timeBase = 0;
+	_timeBase = nullptr;
 	_trigger = kTriggerNone;
 	_hasBeenTriggered = false;
 }
@@ -361,7 +361,7 @@ void IdlerTimeBase::useIdleTime() {
 
 NotificationCallBack::NotificationCallBack() {
 	_callBackFlag = 0;
-	_notifier = 0;
+	_notifier = nullptr;
 }
 
 void NotificationCallBack::callBack() {
diff --git a/engines/pegasus/transition.cpp b/engines/pegasus/transition.cpp
index 4eda805ef6..3101906b1f 100644
--- a/engines/pegasus/transition.cpp
+++ b/engines/pegasus/transition.cpp
@@ -111,8 +111,8 @@ uint32 ScreenFader::fadePixel(uint32 color, int32 percent) const {
 }
 
 Transition::Transition(const DisplayElementID id) : FaderAnimation(id) {
-	_outPicture = 0;
-	_inPicture = 0;
+	_outPicture = nullptr;
+	_inPicture = nullptr;
 }
 
 void Transition::setBounds(const Common::Rect &r) {


Commit: 9394b5301ffece0802cfe595583eec0721252acb
    https://github.com/scummvm/scummvm/commit/9394b5301ffece0802cfe595583eec0721252acb
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
PETKA: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/petka/detection.cpp
    engines/petka/objects/heroes.cpp
    engines/petka/objects/object.cpp


diff --git a/engines/petka/detection.cpp b/engines/petka/detection.cpp
index 56ee08e518..312e77c32d 100644
--- a/engines/petka/detection.cpp
+++ b/engines/petka/detection.cpp
@@ -30,7 +30,7 @@ static const PlainGameDescriptor petkaGames[] = {
 	{"petka_demo", "Red Comrades Demo"},
 	{"petka1", "Red Comrades 1: Save the Galaxy"},
 	{"petka2", "Red Comrades 2: For the Great Justice"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/petka/objects/heroes.cpp b/engines/petka/objects/heroes.cpp
index 421c7102b6..3518f8bbc3 100644
--- a/engines/petka/objects/heroes.cpp
+++ b/engines/petka/objects/heroes.cpp
@@ -332,10 +332,10 @@ void QObjectPetka::update(int time) {
 			}
 			flc->setFrame(-1);
 			if (flc->getCurFrame() == (int32)flc->getFrameCount() - 1) {
-				g_vm->getQSystem()->addMessage(_id, kEnd, _resourceId, 0, 0, 0, 0);
+				g_vm->getQSystem()->addMessage(_id, kEnd, _resourceId, 0, 0, 0, nullptr);
 			}
 			if (flc->getCurFrame() + 1 == (int32)flc->getFrameCount() / 2) {
-				g_vm->getQSystem()->addMessage(_id, kHalf, _resourceId, 0, 0, 0, 0);
+				g_vm->getQSystem()->addMessage(_id, kHalf, _resourceId, 0, 0, 0, nullptr);
 			}
 
 			if (_field7C && flc->getCurFrame() == 0)
diff --git a/engines/petka/objects/object.cpp b/engines/petka/objects/object.cpp
index 8535e756ef..5ee45ee9b0 100644
--- a/engines/petka/objects/object.cpp
+++ b/engines/petka/objects/object.cpp
@@ -535,10 +535,10 @@ void QObject::update(int time) {
 			g_vm->videoSystem()->addDirtyRect(Common::Point(_x, _y), *flc);
 			flc->setFrame(-1);
 			if (flc->getCurFrame() == (int32)flc->getFrameCount() - 1) {
-				g_vm->getQSystem()->addMessage(_id, kEnd, _resourceId, 0, 0, 0, 0);
+				g_vm->getQSystem()->addMessage(_id, kEnd, _resourceId, 0, 0, 0, nullptr);
 			}
 			if (flc->getCurFrame() + 1 == (int32)flc->getFrameCount() / 2) {
-				g_vm->getQSystem()->addMessage(_id, kHalf, _resourceId, 0, 0, 0, 0);
+				g_vm->getQSystem()->addMessage(_id, kHalf, _resourceId, 0, 0, 0, nullptr);
 			}
 			g_vm->videoSystem()->addDirtyRect(Common::Point(_x, _y), *flc);
 			_time -= flc->getDelay();


Commit: 635377951e903199c580a45d38ea5dd9667d277e
    https://github.com/scummvm/scummvm/commit/635377951e903199c580a45d38ea5dd9667d277e
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
PINK: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/pink/cel_decoder.cpp
    engines/pink/detection.cpp
    engines/pink/director.cpp
    engines/pink/objects/pages/game_page.cpp
    engines/pink/objects/walk/walk_shortest_path.cpp


diff --git a/engines/pink/cel_decoder.cpp b/engines/pink/cel_decoder.cpp
index fafd6cc9a1..3757f35b47 100644
--- a/engines/pink/cel_decoder.cpp
+++ b/engines/pink/cel_decoder.cpp
@@ -64,7 +64,7 @@ uint16 CelDecoder::getTransparentColourIndex() const {
 const Graphics::Surface *CelDecoder::getCurrentFrame() const {
 	const CelVideoTrack *track = (const CelVideoTrack *)getTrack(0);
 	if (!track)
-		return 0;
+		return nullptr;
 	return track->getCurrentFrame();
 }
 
diff --git a/engines/pink/detection.cpp b/engines/pink/detection.cpp
index 412e0d1b29..9aeffa4f73 100644
--- a/engines/pink/detection.cpp
+++ b/engines/pink/detection.cpp
@@ -29,7 +29,7 @@
 static const PlainGameDescriptor pinkGames[] = {
 	{"peril", "The Pink Panther: Passport to Peril"},
 	{"pokus", "The Pink Panther: Hokus Pokus Pink"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #include "pink/detection_tables.h"
diff --git a/engines/pink/director.cpp b/engines/pink/director.cpp
index e16a8f52e1..d9c6ae67df 100644
--- a/engines/pink/director.cpp
+++ b/engines/pink/director.cpp
@@ -106,7 +106,7 @@ Director::Director(PinkEngine *vm)
 	_wm->setMenuDelay(250000);
 	_wm->setEngineRedrawCallback(this, redrawCallback);
 
-	_textFont = NULL;
+	_textFont = nullptr;
 
 #ifdef USE_FREETYPE2
 	_textFont = Graphics::loadTTFFontFromArchive("system.ttf", 16);
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index d4e82cd9a6..8456ec255e 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -51,7 +51,7 @@ void GamePage::toConsole() const {
 void GamePage::deserialize(Archive &archive) {
 	Page::deserialize(archive);
 	_module = static_cast<Module *>(archive.readObject());
-	assert(dynamic_cast<Module *>(_module) != 0);
+	assert(dynamic_cast<Module *>(_module) != nullptr);
 }
 
 void GamePage::load(Archive &archive) {
diff --git a/engines/pink/objects/walk/walk_shortest_path.cpp b/engines/pink/objects/walk/walk_shortest_path.cpp
index 619d13e40a..17c4b30cda 100644
--- a/engines/pink/objects/walk/walk_shortest_path.cpp
+++ b/engines/pink/objects/walk/walk_shortest_path.cpp
@@ -32,7 +32,7 @@ WalkShortestPath::WalkShortestPath(WalkMgr *manager)
 WalkLocation *WalkShortestPath::next(WalkLocation *start, WalkLocation *destination) {
 	if (start == destination)
 		return nullptr;
-	add(start, 0.0, 0);
+	add(start, 0.0, nullptr);
 	while (build() != destination) {}
 	return getNearestNeighbor(destination);
 }


Commit: 6c333554180575fa695912e749bb4e6d34a25525
    https://github.com/scummvm/scummvm/commit/6c333554180575fa695912e749bb4e6d34a25525
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
PLAYGROUND3D: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/playground3d/detection.cpp
    engines/playground3d/gfx_opengl_shaders.cpp
    engines/playground3d/gfx_tinygl.cpp
    engines/playground3d/playground3d.cpp


diff --git a/engines/playground3d/detection.cpp b/engines/playground3d/detection.cpp
index 32abc9656c..c0e60e09c7 100644
--- a/engines/playground3d/detection.cpp
+++ b/engines/playground3d/detection.cpp
@@ -27,14 +27,14 @@
 
 static const PlainGameDescriptor playground3d_setting[] = {
 	{ "playground3d", "Playground 3d: the testing and plaground environment for 3d renderers" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const ADGameDescription playground3dDescriptions[] = {
 	{
 		"playground3d",
 		"",
-		AD_ENTRY1("PLAYGROUND3D", 0),
+		AD_ENTRY1("PLAYGROUND3D", nullptr),
 		Common::EN_ANY,
 		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
diff --git a/engines/playground3d/gfx_opengl_shaders.cpp b/engines/playground3d/gfx_opengl_shaders.cpp
index ff920946a5..72aad7021d 100644
--- a/engines/playground3d/gfx_opengl_shaders.cpp
+++ b/engines/playground3d/gfx_opengl_shaders.cpp
@@ -75,7 +75,7 @@ void ShaderRenderer::init() {
 
 	glEnable(GL_DEPTH_TEST);
 
-	static const char *cubeAttributes[] = { "position", "normal", "color", "texcoord", NULL };
+	static const char *cubeAttributes[] = { "position", "normal", "color", "texcoord", nullptr };
 	_cubeShader = OpenGL::ShaderGL::fromFiles("playground3d_cube", cubeAttributes);
 	_cubeVBO = OpenGL::ShaderGL::createBuffer(GL_ARRAY_BUFFER, sizeof(cubeVertices), cubeVertices);
 	_cubeShader->enableVertexAttribute("texcoord", _cubeVBO, 2, GL_FLOAT, GL_FALSE, 11 * sizeof(float), 0);
diff --git a/engines/playground3d/gfx_tinygl.cpp b/engines/playground3d/gfx_tinygl.cpp
index 6b14821572..b1e6494ce2 100644
--- a/engines/playground3d/gfx_tinygl.cpp
+++ b/engines/playground3d/gfx_tinygl.cpp
@@ -61,7 +61,7 @@ Renderer *CreateGfxTinyGL(OSystem *system) {
 
 TinyGLRenderer::TinyGLRenderer(OSystem *system) :
 		Renderer(system),
-		_fb(NULL) {
+		_fb(nullptr) {
 }
 
 TinyGLRenderer::~TinyGLRenderer() {
diff --git a/engines/playground3d/playground3d.cpp b/engines/playground3d/playground3d.cpp
index b807a13495..73be2b207a 100644
--- a/engines/playground3d/playground3d.cpp
+++ b/engines/playground3d/playground3d.cpp
@@ -45,7 +45,7 @@ bool Playground3dEngine::hasFeature(EngineFeature f) const {
 }
 
 Playground3dEngine::Playground3dEngine(OSystem *syst)
-		: Engine(syst), _system(syst), _frameLimiter(0),
+		: Engine(syst), _system(syst), _frameLimiter(nullptr),
 		_rotateAngleX(0), _rotateAngleY(0), _rotateAngleZ(0),
 		_clearColor(0.0f, 0.0f, 0.0f, 1.0f), _fade(1.0f), _fadeIn(false) {
 }


Commit: b56293beaffb74e4e939c3884033dbf507e3f986
    https://github.com/scummvm/scummvm/commit/b56293beaffb74e4e939c3884033dbf507e3f986
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
PLUMBERS: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/plumbers/detection.cpp
    engines/plumbers/plumbers.cpp


diff --git a/engines/plumbers/detection.cpp b/engines/plumbers/detection.cpp
index fdc6c12acd..d7c8bf1c82 100644
--- a/engines/plumbers/detection.cpp
+++ b/engines/plumbers/detection.cpp
@@ -29,7 +29,7 @@
 
 static const PlainGameDescriptor plumbersGames[] = {
 	{"plumbers", "Plumbers Don't Wear Ties!"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
@@ -43,8 +43,8 @@ static const ADGameDescription gameDescriptions[] = {
 	// Plumbers PC version
 	{
 		"plumbers",
-		0,
-		AD_ENTRY1s("GAME.BIN", 0, 41622),
+		nullptr,
+		AD_ENTRY1s("GAME.BIN", nullptr, 41622),
 		Common::EN_ANY,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
@@ -54,8 +54,8 @@ static const ADGameDescription gameDescriptions[] = {
 	// Plumbers 3DO version
 	{
 		"plumbers",
-		0,
-		AD_ENTRY1s("launchme", 0, 143300),
+		nullptr,
+		AD_ENTRY1s("launchme", nullptr, 143300),
 		Common::EN_ANY,
 		Common::kPlatform3DO,
 		ADGF_UNSTABLE,
diff --git a/engines/plumbers/plumbers.cpp b/engines/plumbers/plumbers.cpp
index 9aa7bc19c6..4621160d8b 100644
--- a/engines/plumbers/plumbers.cpp
+++ b/engines/plumbers/plumbers.cpp
@@ -71,7 +71,7 @@ static const Common::JoystickButton cheatJoy[] = {
 };
 
 PlumbersGame::PlumbersGame(OSystem *syst, const ADGameDescription *gameDesc) :
-		Engine(syst), _gameDescription(gameDesc), _console(0), _image(0) {
+		Engine(syst), _gameDescription(gameDesc), _console(nullptr), _image(nullptr) {
 	_timerInstalled = false;
 	_showScoreFl = false;
 	_setDurationFl = false;


Commit: 5733e3de1cb575a68009898f897882e29c554b57
    https://github.com/scummvm/scummvm/commit/5733e3de1cb575a68009898f897882e29c554b57
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
PRINCE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/prince/archive.cpp
    engines/prince/detection.cpp
    engines/prince/graphics.cpp
    engines/prince/hero.cpp
    engines/prince/prince.cpp
    engines/prince/script.cpp


diff --git a/engines/prince/archive.cpp b/engines/prince/archive.cpp
index d974af721d..0945c037bd 100644
--- a/engines/prince/archive.cpp
+++ b/engines/prince/archive.cpp
@@ -158,7 +158,7 @@ const Common::ArchiveMemberPtr PtcArchive::getMember(const Common::Path &path) c
 Common::SeekableReadStream *PtcArchive::createReadStreamForMember(const Common::Path &path) const {
 	Common::String name = path.toString();
 	if (!_items.contains(name)) {
-		return 0;
+		return nullptr;
 	}
 
 	debug(8, "PtcArchive::createReadStreamForMember(%s)", name.c_str());
@@ -166,7 +166,7 @@ Common::SeekableReadStream *PtcArchive::createReadStreamForMember(const Common::
 	const FileEntry &entryHeader = _items[name];
 
 	if (entryHeader._size < 4)
-		return 0;
+		return nullptr;
 
 	uint32 size = entryHeader._size;
 
diff --git a/engines/prince/detection.cpp b/engines/prince/detection.cpp
index 23590f6855..fc3068ca66 100644
--- a/engines/prince/detection.cpp
+++ b/engines/prince/detection.cpp
@@ -27,7 +27,7 @@
 
 static const PlainGameDescriptor princeGames[] = {
 	{"prince", "The Prince and the Coward"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
@@ -103,7 +103,7 @@ static const PrinceGameDescription gameDescriptions[] = {
 			"prince",
 			"w/translation",
 			AD_ENTRY2s("databank.ptc", "5fa03833177331214ec1354761b1d2ee", 3565031,
-					   "prince_translation.dat", 0, -1),
+					   "prince_translation.dat", nullptr, -1),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			GF_TRANSLATED | ADGF_DROPPLATFORM,
@@ -116,7 +116,7 @@ static const PrinceGameDescription gameDescriptions[] = {
 			"prince",
 			"w/translation",
 			AD_ENTRY2s("databank.ptc", "48ec9806bda9d152acbea8ce31c93c49", 3435298,
-					   "prince_translation.dat", 0, -1),
+					   "prince_translation.dat", nullptr, -1),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			GF_TRANSLATED | ADGF_DROPPLATFORM,
@@ -131,7 +131,7 @@ static const PrinceGameDescription gameDescriptions[] = {
 
 const static char *directoryGlobs[] = {
 	"all",
-	0
+	nullptr
 };
 
 class PrinceMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp
index 5d7a0e88fb..7df7f96573 100644
--- a/engines/prince/graphics.cpp
+++ b/engines/prince/graphics.cpp
@@ -45,7 +45,7 @@ GraphicsMan::GraphicsMan(PrinceEngine *vm) : _vm(vm), _changed(false) {
 	_shadowTable70 = (byte *)malloc(256);
 	_shadowTable50 = (byte *)malloc(256);
 
-	_roomBackground = 0;
+	_roomBackground = nullptr;
 }
 
 GraphicsMan::~GraphicsMan() {
diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp
index f0424006bc..7b398d0a37 100644
--- a/engines/prince/hero.cpp
+++ b/engines/prince/hero.cpp
@@ -264,7 +264,7 @@ void Hero::showHeroShadow(Graphics::Surface *screen, DrawNode *drawNode) {
 		int shadWallDown = 0;
 		int shadWallBitAddr = 0;
 		int shadWallBitMask = 0;
-		byte *shadWallDestAddr = 0;
+		byte *shadWallDestAddr = nullptr;
 		int shadWallPosY = 0;
 		int shadWallSkipX = 0;
 		int shadWallModulo = 0;
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 81177a4516..f7ffa1b432 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -771,7 +771,7 @@ void PrinceEngine::leftMouseButton() {
 						if (!text._str) {
 							continue;
 						}
-						text._str = 0;
+						text._str = nullptr;
 						text._time = 0;
 					}
 				}
diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp
index de833a90e0..cc32d5e4ad 100644
--- a/engines/prince/script.cpp
+++ b/engines/prince/script.cpp
@@ -1537,8 +1537,8 @@ void Interpreter::O_INITDIALOG() {
 		_string = string + adressOfFirstSequence;
 
 		for (int i = 0; i < 32; i++) {
-			_vm->_dialogBoxAddr[i] = 0;
-			_vm->_dialogOptAddr[i] = 0;
+			_vm->_dialogBoxAddr[i] = nullptr;
+			_vm->_dialogOptAddr[i] = nullptr;
 		}
 
 		for (int i = 0; i < 4 * 32; i++) {
@@ -1574,7 +1574,7 @@ void Interpreter::O_INITDIALOG() {
 
 		int freeHSlot = 0;
 		for (int i = 31; i >= 0; i--) {
-			if (_vm->_dialogOptAddr[i] != 0) {
+			if (_vm->_dialogOptAddr[i] != nullptr) {
 				i++;
 				freeHSlot = i;
 				_flags->setFlagValue(Flags::VOICE_H_LINE, i);


Commit: 5a830a7baee09c63931e90ec1e6d2fd54047aff3
    https://github.com/scummvm/scummvm/commit/5a830a7baee09c63931e90ec1e6d2fd54047aff3
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
PRIVATE: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/private/detection.cpp
    engines/private/funcs.cpp
    engines/private/grammar.cpp
    engines/private/lexer.cpp
    engines/private/private.cpp
    engines/private/symbol.cpp


diff --git a/engines/private/detection.cpp b/engines/private/detection.cpp
index a2c1f528b8..0d23c52d16 100644
--- a/engines/private/detection.cpp
+++ b/engines/private/detection.cpp
@@ -35,13 +35,13 @@ static const DebugChannelDef debugFlagList[] = {
 namespace Private {
 static const PlainGameDescriptor privateGames[] = {
 	{ "private-eye", "Private Eye" },
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 static const ADGameDescription gameDescriptions[] = {
 	{
 		"private-eye",  // US release
-		0,
+		nullptr,
 		AD_ENTRY2s("pvteye.z", "b682118cda6a42fa89833cae2b8824bd", 271895,
 		   "intro.smk", "270a1d0a29df122fc3d1d38e655161a7", 7310984),
 		Common::EN_USA,
@@ -61,7 +61,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye",  // EU release (UK)
-		0,
+		nullptr,
 		AD_ENTRY2s("pvteye.z", "d9ce391395701615e8b5d04bc4bf7ec3", 284699,
 		   "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
 		Common::EN_GRB,
@@ -101,7 +101,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye", // EU release (ES)
-		0,
+		nullptr,
 		AD_ENTRY2s("pvteye.ex_", "f41770550ab717086b2d0c805fef4b8f", 498176,
 		   "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
 		Common::ES_ESP,
@@ -121,7 +121,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye", // EU release (FR)
-		0,
+		nullptr,
 		AD_ENTRY2s("pvteye.ex_", "ae0dec43b2f54d45c8a1c93e97092141", 600576,
 		   "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
 		Common::FR_FRA,
@@ -131,7 +131,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye", // EU release (DE)
-		0,
+		nullptr,
 		AD_ENTRY2s("pvteye.ex_", "5ca171c4e8d804c7277887277d049f03", 600576,
 		   "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
 		Common::DE_DEU,
@@ -161,7 +161,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye",  // RU release
-		0,
+		nullptr,
 		AD_ENTRY2s("pvteye.z", "b682118cda6a42fa89833cae2b8824bd", 271895,
 		   "intro.smk", "61cc13c9e4e2affd574087209df5c4a4", 7241368),
 		Common::RU_RUS,
@@ -171,7 +171,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye", // MacOS release (US)
-		0,
+		nullptr,
 		AD_ENTRY2s("game.mac", "33553cc04813d3f658bbe9d548377878", 81894,
 		   "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
 		Common::EN_USA,
@@ -190,7 +190,7 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye", // MacOS demo (US)
-		0,
+		nullptr,
 		AD_ENTRY2s("demogame.mac", "cfbceaa8b91f0f53c745db61d1bc9749", 6103,
 		    "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
 		Common::EN_USA,
@@ -214,7 +214,7 @@ static const ADGameDescription gameDescriptions[] = {
 static const char *const directoryGlobs[] = {
 	"support",
 	"intro",
-	0
+	nullptr
 };
 
 class PrivateMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/private/funcs.cpp b/engines/private/funcs.cpp
index 2e67f201ed..1c10248472 100644
--- a/engines/private/funcs.cpp
+++ b/engines/private/funcs.cpp
@@ -142,8 +142,8 @@ static void fLoadGame(ArgArray args) {
 	m.surf = g_private->loadMask(args[0].u.str, 0, 0, true);
 	m.cursor = *args[2].u.sym->name;
 	m.nextSetting = "";
-	m.flag1 = NULL;
-	m.flag2 = NULL;
+	m.flag1 = nullptr;
+	m.flag2 = nullptr;
 	if (g_private->_loadGameMask.surf)
 		g_private->_loadGameMask.surf->free();
 	delete g_private->_loadGameMask.surf;
@@ -158,8 +158,8 @@ static void fSaveGame(ArgArray args) {
 	m.surf = g_private->loadMask(args[0].u.str, 0, 0, true);
 	m.cursor = *args[1].u.sym->name;
 	m.nextSetting = "";
-	m.flag1 = NULL;
-	m.flag2 = NULL;
+	m.flag1 = nullptr;
+	m.flag2 = nullptr;
 	if (g_private->_saveGameMask.surf)
 		g_private->_saveGameMask.surf->free();
 	delete g_private->_saveGameMask.surf;
@@ -255,8 +255,8 @@ static void fDossierChgSheet(ArgArray args) {
 	m.surf = g_private->loadMask(s, x, y, true);
 	m.cursor = g_private->getExitCursor();
 	m.nextSetting = "";
-	m.flag1 = NULL;
-	m.flag2 = NULL;
+	m.flag1 = nullptr;
+	m.flag2 = nullptr;
 	if (p == 0)
 		g_private->_dossierPrevSheetMask = m;
 	else if (p == 1)
@@ -278,8 +278,8 @@ static void fDossierPrevSuspect(ArgArray args) {
 	m.surf = g_private->loadMask(s, x, y, true);
 	m.cursor = g_private->getExitCursor();
 	m.nextSetting = "";
-	m.flag1 = NULL;
-	m.flag2 = NULL;
+	m.flag1 = nullptr;
+	m.flag2 = nullptr;
 	g_private->_dossierPrevSuspectMask = m;
 	g_private->_masks.push_front(m);
 }
@@ -295,8 +295,8 @@ static void fDossierNextSuspect(ArgArray args) {
 	m.surf = g_private->loadMask(s, x, y, true);
 	m.cursor = g_private->getExitCursor();
 	m.nextSetting = "";
-	m.flag1 = NULL;
-	m.flag2 = NULL;
+	m.flag1 = nullptr;
+	m.flag2 = nullptr;
 	g_private->_dossierNextSuspectMask = m;
 	g_private->_masks.push_front(m);
 }
@@ -361,12 +361,12 @@ static void fInventory(ArgArray args) {
 		if (v1.type == NAME) {
 			m.flag1 = g_private->maps.lookupVariable(v1.u.sym->name);
 		} else
-			m.flag1 = NULL;
+			m.flag1 = nullptr;
 
 		if (v2.type == NAME) {
 			m.flag2 = g_private->maps.lookupVariable(v2.u.sym->name);
 		} else
-			m.flag2 = NULL;
+			m.flag2 = nullptr;
 
 		g_private->_masks.push_front(m);
 		g_private->_toTake = true;
@@ -591,8 +591,8 @@ static void _fMask(ArgArray args, bool drawn) {
 	m.surf = g_private->loadMask(s, x, y, drawn);
 	m.nextSetting = e;
 	m.cursor = *c;
-	m.flag1 = NULL;
-	m.flag2 = NULL;
+	m.flag1 = nullptr;
+	m.flag2 = nullptr;
 	m.point = Common::Point(x, y);
 	g_private->_masks.push_front(m);
 }
@@ -604,7 +604,7 @@ static void fMaskDrawn(ArgArray args) {
 	_fMask(args, true);
 }
 
-static void fAddSound(Common::String sound, const char *t, Symbol *flag = NULL, int val = 0) {
+static void fAddSound(Common::String sound, const char *t, Symbol *flag = nullptr, int val = 0) {
 	if (sound == "\"\"")
 		return;
 
@@ -685,8 +685,8 @@ static void fSoundArea(ArgArray args) {
 		m.surf = g_private->loadMask(s, 0, 0, true);
 		m.cursor = *args[2].u.sym->name;
 		m.nextSetting = "";
-		m.flag1 = NULL;
-		m.flag2 = NULL;
+		m.flag1 = nullptr;
+		m.flag2 = nullptr;
 		if (g_private->_AMRadioArea.surf)
 			g_private->_AMRadioArea.surf->free();
 		delete g_private->_AMRadioArea.surf;
@@ -696,8 +696,8 @@ static void fSoundArea(ArgArray args) {
 		m.surf = g_private->loadMask(s, 0, 0, true);
 		m.cursor = *args[2].u.sym->name;
 		m.nextSetting = "";
-		m.flag1 = NULL;
-		m.flag2 = NULL;
+		m.flag1 = nullptr;
+		m.flag2 = nullptr;
 		if (g_private->_policeRadioArea.surf)
 			g_private->_policeRadioArea.surf->free();
 		delete g_private->_policeRadioArea.surf;
@@ -707,8 +707,8 @@ static void fSoundArea(ArgArray args) {
 		m.surf = g_private->loadMask(s, 0, 0, true);
 		m.cursor = *args[2].u.sym->name;
 		m.nextSetting = "";
-		m.flag1 = NULL;
-		m.flag2 = NULL;
+		m.flag1 = nullptr;
+		m.flag2 = nullptr;
 		if (g_private->_phoneArea.surf)
 			g_private->_phoneArea.surf->free();
 		delete g_private->_phoneArea.surf;
@@ -821,7 +821,7 @@ const FuncTable funcTable[] = {
 	{fSafeDigit, "SafeDigit"},
 	{fCRect, "CRect"},
 
-	{0, 0}};
+	{nullptr, nullptr}};
 
 void call(const char *name, const ArgArray &args) {
 	Common::String n(name);
diff --git a/engines/private/grammar.cpp b/engines/private/grammar.cpp
index 8abef1f009..ff7b8d1832 100644
--- a/engines/private/grammar.cpp
+++ b/engines/private/grammar.cpp
@@ -1231,7 +1231,7 @@ yyreduce:
                             {
         (yyval.inst) = g_vm->_progp;
         code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-1].s)));
-        code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL));
+        code2(constpush, (Inst) g_private->maps.constant(NUM, 1, nullptr));
         code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
         code1(funcpush);
         }
@@ -1316,13 +1316,13 @@ yyreduce:
 
   case 23: /* define: NAME ',' define  */
 #line 158 "engines/private/grammar.y"
-                          { g_private->maps.defineSymbol((yyvsp[-2].s), NULL); }
+                          { g_private->maps.defineSymbol((yyvsp[-2].s), nullptr); }
 #line 1320 "engines/private/grammar.cpp"
     break;
 
   case 24: /* define: NAME  */
 #line 159 "engines/private/grammar.y"
-                          { g_private->maps.defineSymbol((yyvsp[0].s), NULL); }
+                          { g_private->maps.defineSymbol((yyvsp[0].s), nullptr); }
 #line 1326 "engines/private/grammar.cpp"
     break;
 
@@ -1331,7 +1331,7 @@ yyreduce:
                                {
                                (yyval.inst) = g_vm->_progp;
                                code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-1].s)));
-                               code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL));
+                               code2(constpush, (Inst) g_private->maps.constant(NUM, 1, nullptr));
                                code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
                                code1(funcpush);
                                }
@@ -1348,7 +1348,7 @@ yyreduce:
 #line 171 "engines/private/grammar.y"
                                       {
                                (yyval.inst) = (yyvsp[-2].inst);
-                               code2(constpush, (Inst) g_private->maps.constant(NUM, (yyvsp[-1].narg), NULL));
+                               code2(constpush, (Inst) g_private->maps.constant(NUM, (yyvsp[-1].narg), nullptr));
                                code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-4].s)));
                                code1(funcpush);
                                }
@@ -1393,19 +1393,19 @@ yyreduce:
 
   case 34: /* value: NULLTOK  */
 #line 189 "engines/private/grammar.y"
-                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, NULL)); }
+                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, nullptr)); }
 #line 1397 "engines/private/grammar.cpp"
     break;
 
   case 35: /* value: FALSETOK  */
 #line 190 "engines/private/grammar.y"
-                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, NULL)); }
+                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, nullptr)); }
 #line 1403 "engines/private/grammar.cpp"
     break;
 
   case 36: /* value: TRUETOK  */
 #line 191 "engines/private/grammar.y"
-                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL)); }
+                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 1, nullptr)); }
 #line 1409 "engines/private/grammar.cpp"
     break;
 
diff --git a/engines/private/lexer.cpp b/engines/private/lexer.cpp
index 6ae2887d26..181ca4cc9f 100644
--- a/engines/private/lexer.cpp
+++ b/engines/private/lexer.cpp
@@ -508,7 +508,7 @@ struct yy_buffer_state
 /* Stack of input buffers. */
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = nullptr; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
@@ -530,7 +530,7 @@ static int yy_n_chars;		/* number of characters read into yy_ch_buf */
 int yyleng;
 
 /* Points to current character in buffer. */
-static char *yy_c_buf_p = NULL;
+static char *yy_c_buf_p = nullptr;
 static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
@@ -587,7 +587,7 @@ void yyfree ( void *  );
 #define YY_SKIP_YYWRAP
 typedef flex_uint8_t YY_CHAR;
 
-FILE *yyin = NULL, *yyout = NULL;
+FILE *yyin = nullptr, *yyout = nullptr;
 
 typedef int yy_state_type;
 
@@ -1149,7 +1149,7 @@ PRIVATE_lval.s = scumm_strdup(PRIVATE_text); return NAME;
 case 18:
 YY_RULE_SETUP
 #line 61 "engines/private/lexer.l"
-PRIVATE_lval.sym = g_private->maps.constant(NUM, atoi(PRIVATE_text), NULL); return NUM;
+PRIVATE_lval.sym = g_private->maps.constant(NUM, atoi(PRIVATE_text), nullptr); return NUM;
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
@@ -1393,7 +1393,7 @@ static int yy_get_next_buffer (void)
 				}
 			else
 				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = NULL;
+				b->yy_ch_buf = nullptr;
 
 			if ( ! b->yy_ch_buf )
 				YY_FATAL_ERROR(
@@ -1729,7 +1729,7 @@ static void yy_load_buffer_state  (void)
 		return;
 
 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr;
 
 	if ( b->yy_is_our_buffer )
 		yyfree( (void *) b->yy_ch_buf  );
@@ -1800,7 +1800,7 @@ static void yy_load_buffer_state  (void)
  */
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-    	if (new_buffer == NULL)
+    	if (new_buffer == nullptr)
 		return;
 
 	yyensure_buffer_stack();
@@ -1834,7 +1834,7 @@ void yypop_buffer_state (void)
 		return;
 
 	yy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = NULL;
+	YY_CURRENT_BUFFER_LVALUE = nullptr;
 	if ((yy_buffer_stack_top) > 0)
 		--(yy_buffer_stack_top);
 
@@ -1904,7 +1904,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
 		/* They forgot to leave room for the EOB's. */
-		return NULL;
+		return nullptr;
 
 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
 	if ( ! b )
@@ -1913,7 +1913,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
 	b->yy_buf_pos = b->yy_ch_buf = base;
 	b->yy_is_our_buffer = 0;
-	b->yy_input_file = NULL;
+	b->yy_input_file = nullptr;
 	b->yy_n_chars = b->yy_buf_size;
 	b->yy_is_interactive = 0;
 	b->yy_at_bol = 1;
@@ -2089,10 +2089,10 @@ static int yy_init_globals (void)
      * This function is called from yylex_destroy(), so don't allocate here.
      */
 
-    (yy_buffer_stack) = NULL;
+    (yy_buffer_stack) = nullptr;
     (yy_buffer_stack_top) = 0;
     (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = NULL;
+    (yy_c_buf_p) = nullptr;
     (yy_init) = 0;
     (yy_start) = 0;
 
@@ -2101,8 +2101,8 @@ static int yy_init_globals (void)
     yyin = stdin;
     yyout = stdout;
 #else
-    yyin = NULL;
-    yyout = NULL;
+    yyin = nullptr;
+    yyout = nullptr;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
@@ -2118,13 +2118,13 @@ int yylex_destroy  (void)
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		yy_delete_buffer( YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
+		YY_CURRENT_BUFFER_LVALUE = nullptr;
 		yypop_buffer_state();
 	}
 
 	/* Destroy the stack itself. */
 	yyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = NULL;
+	(yy_buffer_stack) = nullptr;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
      * yylex() is called, initialization will occur. */
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 8ceb10cfa2..f91d713de6 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -43,7 +43,7 @@
 
 namespace Private {
 
-PrivateEngine *g_private = NULL;
+PrivateEngine *g_private = nullptr;
 extern int parse(const char *);
 
 PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
@@ -132,7 +132,7 @@ void PrivateEngine::initializePath(const Common::FSNode &gamePath) {
 Common::SeekableReadStream *PrivateEngine::loadAssets() {
 
 	Common::File *test = new Common::File();
-	Common::SeekableReadStream *file = NULL;
+	Common::SeekableReadStream *file = nullptr;
 
 	if (isDemo() && test->open("SUPPORT/ASSETS/DEMOGAME.WIN"))
 		file = test;
@@ -169,7 +169,7 @@ Common::SeekableReadStream *PrivateEngine::loadAssets() {
 			}
 		}
 	}
-	if (file == NULL)
+	if (file == nullptr)
 		error("Unknown version");
 	return file;
 }
@@ -488,7 +488,7 @@ bool PrivateEngine::cursorExit(Common::Point mousePos) {
 }
 
 bool PrivateEngine::inMask(Graphics::Surface *surf, Common::Point mousePos) {
-	if (surf == NULL)
+	if (surf == nullptr)
 		return false;
 
 	mousePos = mousePos - _origin;
@@ -686,7 +686,7 @@ void PrivateEngine::selectMask(Common::Point mousePos) {
 				ns = m.nextSetting;
 			}
 
-			if (m.flag1 != NULL) { // TODO: check this
+			if (m.flag1 != nullptr) { // TODO: check this
 				setSymbol(m.flag1, 1);
 				// an item was taken
 				if (_toTake) {
@@ -695,7 +695,7 @@ void PrivateEngine::selectMask(Common::Point mousePos) {
 				}
 			}
 
-			if (m.flag2 != NULL) {
+			if (m.flag2 != nullptr) {
 				setSymbol(m.flag2, 1);
 			}
 			break;
@@ -708,7 +708,7 @@ void PrivateEngine::selectMask(Common::Point mousePos) {
 }
 
 void PrivateEngine::selectAMRadioArea(Common::Point mousePos) {
-	if (_AMRadioArea.surf == NULL)
+	if (_AMRadioArea.surf == nullptr)
 		return;
 
 	if (_AMRadio.empty())
@@ -722,7 +722,7 @@ void PrivateEngine::selectAMRadioArea(Common::Point mousePos) {
 }
 
 void PrivateEngine::selectPoliceRadioArea(Common::Point mousePos) {
-	if (_policeRadioArea.surf == NULL)
+	if (_policeRadioArea.surf == nullptr)
 		return;
 
 	if (_policeRadio.empty())
@@ -736,7 +736,7 @@ void PrivateEngine::selectPoliceRadioArea(Common::Point mousePos) {
 }
 
 void PrivateEngine::checkPhoneCall() {
-	if (_phoneArea.surf == NULL)
+	if (_phoneArea.surf == nullptr)
 		return;
 
 	if (_phone.empty())
@@ -747,7 +747,7 @@ void PrivateEngine::checkPhoneCall() {
 }
 
 void PrivateEngine::selectPhoneArea(Common::Point mousePos) {
-	if (_phoneArea.surf == NULL)
+	if (_phoneArea.surf == nullptr)
 		return;
 
 	if (_phone.empty())
@@ -778,7 +778,7 @@ void PrivateEngine::loadDossier() {
 }
 
 bool PrivateEngine::selectDossierNextSuspect(Common::Point mousePos) {
-	if (_dossierNextSuspectMask.surf == NULL)
+	if (_dossierNextSuspectMask.surf == nullptr)
 		return false;
 
 	if (inMask(_dossierNextSuspectMask.surf, mousePos)) {
@@ -796,7 +796,7 @@ bool PrivateEngine::selectDossierNextSuspect(Common::Point mousePos) {
 }
 
 bool PrivateEngine::selectDossierPrevSheet(Common::Point mousePos) {
-	if (_dossierNextSheetMask.surf == NULL)
+	if (_dossierNextSheetMask.surf == nullptr)
 		return false;
 
 	if (inMask(_dossierPrevSheetMask.surf, mousePos)) {
@@ -813,7 +813,7 @@ bool PrivateEngine::selectDossierPrevSheet(Common::Point mousePos) {
 }
 
 bool PrivateEngine::selectDossierNextSheet(Common::Point mousePos) {
-	if (_dossierNextSheetMask.surf == NULL)
+	if (_dossierNextSheetMask.surf == nullptr)
 		return false;
 
 	if (inMask(_dossierNextSheetMask.surf, mousePos)) {
@@ -831,7 +831,7 @@ bool PrivateEngine::selectDossierNextSheet(Common::Point mousePos) {
 }
 
 bool PrivateEngine::selectDossierPrevSuspect(Common::Point mousePos) {
-	if (_dossierPrevSuspectMask.surf == NULL)
+	if (_dossierPrevSuspectMask.surf == nullptr)
 		return false;
 
 	if (inMask(_dossierPrevSuspectMask.surf, mousePos)) {
@@ -849,7 +849,7 @@ bool PrivateEngine::selectDossierPrevSuspect(Common::Point mousePos) {
 }
 
 bool PrivateEngine::selectSafeDigit(Common::Point mousePos) {
-	if (_safeDigitArea[0].surf == NULL)
+	if (_safeDigitArea[0].surf == nullptr)
 		return false;
 
 	mousePos = mousePos - _origin;
@@ -876,8 +876,8 @@ void PrivateEngine::addSafeDigit(uint32 d, Common::Rect *rect) {
 	m.surf = loadMask(Common::String::format(_safeNumberPath.c_str(), _safeDigit[d]), _safeDigitRect[d].left, _safeDigitRect[d].top, true);
 	m.cursor = g_private->getExitCursor();
 	m.nextSetting = "";
-	m.flag1 = NULL;
-	m.flag2 = NULL;
+	m.flag1 = nullptr;
+	m.flag2 = nullptr;
 	_safeDigitArea[d] = m;
 	drawScreen();
 }
@@ -885,7 +885,7 @@ void PrivateEngine::addSafeDigit(uint32 d, Common::Rect *rect) {
 
 void PrivateEngine::renderSafeDigit(uint32 d) {
 
-	if (_safeDigitArea[d].surf != NULL) {
+	if (_safeDigitArea[d].surf != nullptr) {
 		_safeDigitArea[d].surf->free();
 		delete _safeDigitArea[d].surf;
 		_safeDigitArea[d].clear();
@@ -895,14 +895,14 @@ void PrivateEngine::renderSafeDigit(uint32 d) {
 	m.surf = loadMask(Common::String::format(_safeNumberPath.c_str(), _safeDigit[d]), _safeDigitRect[d].left, _safeDigitRect[d].top, true);
 	m.cursor = g_private->getExitCursor();
 	m.nextSetting = "";
-	m.flag1 = NULL;
-	m.flag2 = NULL;
+	m.flag1 = nullptr;
+	m.flag2 = nullptr;
 	_safeDigitArea[d] = m;
 	drawScreen();
 }
 
 void PrivateEngine::selectLoadGame(Common::Point mousePos) {
-	if (_loadGameMask.surf == NULL)
+	if (_loadGameMask.surf == nullptr)
 		return;
 
 	if (inMask(_loadGameMask.surf, mousePos)) {
@@ -911,7 +911,7 @@ void PrivateEngine::selectLoadGame(Common::Point mousePos) {
 }
 
 void PrivateEngine::selectSaveGame(Common::Point mousePos) {
-	if (_saveGameMask.surf == NULL)
+	if (_saveGameMask.surf == nullptr)
 		return;
 
 	if (inMask(_saveGameMask.surf, mousePos)) {
@@ -1184,7 +1184,7 @@ void PrivateEngine::playSound(const Common::String &name, uint loops, bool stopO
 		stopSound(true);
 	}
 
-	Audio::SoundHandle *sh = NULL;
+	Audio::SoundHandle *sh = nullptr;
 	if (background) {
 		_mixer->stopHandle(_bgSoundHandle);
 		sh = &_bgSoundHandle;
diff --git a/engines/private/symbol.cpp b/engines/private/symbol.cpp
index 916b95d770..6521585706 100644
--- a/engines/private/symbol.cpp
+++ b/engines/private/symbol.cpp
@@ -141,22 +141,22 @@ void SymbolMaps::installAll(const char *n) {
 		//debug("name %s", s.c_str());
 		if (strcmp(n, "settings") == 0) {
 			//debug("new setting %s", n);
-			assert(r == NULL);
+			assert(r == nullptr);
 			install(s, NAME, 0, s.c_str(), r, &settings);
 		} else if (strcmp(n, "variables") == 0) {
-			assert(r == NULL);
-			install(s, NAME, 0, NULL, r, &variables);
+			assert(r == nullptr);
+			install(s, NAME, 0, nullptr, r, &variables);
 			variableList.push_front(s);
 		} else if (strcmp(n, "cursors") == 0) {
-			assert(r == NULL);
-			install(s, NAME, 0, NULL, r, &cursors);
+			assert(r == nullptr);
+			install(s, NAME, 0, nullptr, r, &cursors);
 		} else if (strcmp(n, "locations") == 0) {
-			assert(r == NULL);
-			install(s, NAME, 0, NULL, r, &locations);
+			assert(r == nullptr);
+			install(s, NAME, 0, nullptr, r, &locations);
 			locationList.push_front(s);
 		} else if (strcmp(n, "rects") == 0) {
-			assert(r != NULL);
-			install(s, RECT, 0, NULL, r, &rects);
+			assert(r != nullptr);
+			install(s, RECT, 0, nullptr, r, &rects);
 		} else
 			error("invalid symbol type");
 	}


Commit: 59a6446d8ca6c4ef16fa70ab263758445c510011
    https://github.com/scummvm/scummvm/commit/59a6446d8ca6c4ef16fa70ab263758445c510011
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
QUEEN: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/queen/bankman.cpp
    engines/queen/command.cpp
    engines/queen/cutaway.cpp
    engines/queen/detection.cpp
    engines/queen/display.cpp
    engines/queen/graphics.cpp
    engines/queen/logic.cpp
    engines/queen/music.cpp
    engines/queen/resource.cpp
    engines/queen/talk.cpp


diff --git a/engines/queen/bankman.cpp b/engines/queen/bankman.cpp
index 6d99874697..b4caa5a352 100644
--- a/engines/queen/bankman.cpp
+++ b/engines/queen/bankman.cpp
@@ -136,12 +136,12 @@ void BankManager::unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) {
 
 	assert(bankslot < MAX_BANKS_NUMBER);
 	PackedBank *bank = &_banks[bankslot];
-	assert(bank->data != NULL);
+	assert(bank->data != nullptr);
 
 	assert(dstframe < MAX_FRAMES_NUMBER);
 	BobFrame *bf = &_frames[dstframe];
 	delete[] bf->data;
-	bf->data = NULL;
+	bf->data = nullptr;
 
 	const uint8 *p = bank->data + bank->indexes[srcframe];
 
@@ -178,7 +178,7 @@ void BankManager::overpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) {
 
 	assert(bankslot < MAX_BANKS_NUMBER);
 	PackedBank *bank = &_banks[bankslot];
-	assert(bank->data != NULL);
+	assert(bank->data != nullptr);
 
 	assert(dstframe < MAX_FRAMES_NUMBER);
 	BobFrame *bf = &_frames[dstframe];
@@ -223,7 +223,7 @@ BobFrame *BankManager::fetchFrame(uint32 index) {
 	debug(9, "BankManager::fetchFrame(%d)", index);
 	assert(index < MAX_FRAMES_NUMBER);
 	BobFrame *bf = &_frames[index];
-	assert((bf->width == 0 && bf->height == 0) || bf->data != 0);
+	assert((bf->width == 0 && bf->height == 0) || bf->data != nullptr);
 	return bf;
 }
 
diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp
index e4aa44ded3..d7a47e8a1b 100644
--- a/engines/queen/command.cpp
+++ b/engines/queen/command.cpp
@@ -154,7 +154,7 @@ void CmdState::init() {
 }
 
 Command::Command(QueenEngine *vm)
-	: _cmdList(NULL), _cmdArea(NULL), _cmdObject(NULL), _cmdInventory(NULL), _cmdGameState(NULL), _vm(vm) {
+	: _cmdList(nullptr), _cmdArea(nullptr), _cmdObject(nullptr), _cmdInventory(nullptr), _cmdGameState(nullptr), _vm(vm) {
 	_cmdText = CmdText::makeCmdTextInstance(CmdText::COMMAND_Y_POS, vm);
 }
 
@@ -183,7 +183,7 @@ void Command::executeCurrentAction() {
 	if (_mouseKey == Input::MOUSE_RBUTTON && _state.subject[0] > 0) {
 
 		ObjectData *od = _vm->logic()->objectData(_state.subject[0]);
-		if (od == NULL || od->name <= 0) {
+		if (od == nullptr || od->name <= 0) {
 			cleanupCurrentAction();
 			return;
 		}
@@ -400,7 +400,7 @@ void Command::readCommandsFrom(byte *&ptr) {
 }
 
 ObjectData *Command::findObjectData(uint16 objRoomNum) const {
-	ObjectData *od = NULL;
+	ObjectData *od = nullptr;
 	if (objRoomNum != 0) {
 		objRoomNum += _vm->logic()->currentRoomData();
 		od = _vm->logic()->objectData(objRoomNum);
@@ -409,7 +409,7 @@ ObjectData *Command::findObjectData(uint16 objRoomNum) const {
 }
 
 ItemData *Command::findItemData(Verb invNum) const {
-	ItemData *id = NULL;
+	ItemData *id = nullptr;
 	uint16 itNum = _vm->logic()->findInventoryItem(invNum - VERB_INV_FIRST);
 	if (itNum != 0) {
 		id = _vm->logic()->itemData(itNum);
@@ -542,7 +542,7 @@ int16 Command::makeJoeWalkTo(int16 x, int16 y, int16 objNum, Verb v, bool mustWa
 			// because this is an exit object, see if there is
 			// a walk off point and set (x,y) accordingly
 			WalkOffData *wod = _vm->logic()->walkOffPointForObject(objNum);
-			if (wod != NULL) {
+			if (wod != nullptr) {
 				x = wod->x;
 				y = wod->y;
 			}
@@ -634,7 +634,7 @@ void Command::grabSelectedObject(int16 objNum, uint16 objState, uint16 objName)
 
 void Command::grabSelectedItem() {
 	ItemData *id = findItemData(_state.verb);
-	if (id == NULL || id->name <= 0) {
+	if (id == nullptr || id->name <= 0) {
 		return;
 	}
 
@@ -690,7 +690,7 @@ void Command::grabSelectedItem() {
 
 void Command::grabSelectedNoun() {
 	ObjectData *od = findObjectData(_state.noun);
-	if (od == NULL || od->name <= 0) {
+	if (od == nullptr || od->name <= 0) {
 		// selected a turned off object, so just walk
 		clear(true);
 		_state.noun = 0;
@@ -1274,7 +1274,7 @@ void Command::lookForCurrentObject(int16 cx, int16 cy) {
 	}
 
 	ObjectData *od = findObjectData(_state.noun);
-	if (od == NULL || od->name <= 0) {
+	if (od == nullptr || od->name <= 0) {
 		_state.oldNoun = _state.noun;
 		_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 		if (_state.action != VERB_NONE) {
@@ -1307,7 +1307,7 @@ void Command::lookForCurrentIcon(int16 cx, int16 cy) {
 
 		if (isVerbInv(_state.verb)) {
 			ItemData *id = findItemData(_state.verb);
-			if (id != NULL && id->name > 0) {
+			if (id != nullptr && id->name > 0) {
 				if (_state.action == VERB_NONE) {
 					Verb v = State::findDefaultVerb(id->state);
 					_cmdText->setVerb((v == VERB_NONE) ? VERB_LOOK_AT : v);
diff --git a/engines/queen/cutaway.cpp b/engines/queen/cutaway.cpp
index 1ef3797bce..9a53f493ac 100644
--- a/engines/queen/cutaway.cpp
+++ b/engines/queen/cutaway.cpp
@@ -580,7 +580,7 @@ const byte *Cutaway::handleAnimation(const byte *ptr, CutawayObject &object) {
 		frameCount++;
 
 		if (_vm->input()->cutawayQuit())
-			return NULL;
+			return nullptr;
 	}
 
 	if (object.animType == 1) {
@@ -682,7 +682,7 @@ const byte *Cutaway::handleAnimation(const byte *ptr, CutawayObject &object) {
 			}
 
 			if (_vm->input()->cutawayQuit())
-				return NULL;
+				return nullptr;
 
 			if (objAnim[i].song > 0)
 				_vm->sound()->playSong(objAnim[i].song);
@@ -705,7 +705,7 @@ const byte *Cutaway::handleAnimation(const byte *ptr, CutawayObject &object) {
 		}
 
 		if (_vm->input()->cutawayQuit())
-			return NULL;
+			return nullptr;
 	}
 
 	return ptr;
@@ -779,7 +779,7 @@ void Cutaway::handlePersonRecord(
 
 			char voiceFilePrefix[MAX_STRING_SIZE];
 			findCdCut(_basename, index, voiceFilePrefix);
-			_vm->logic()->makePersonSpeak(sentence, (object.objectNumber == OBJECT_JOE) ? NULL : &p, voiceFilePrefix);
+			_vm->logic()->makePersonSpeak(sentence, (object.objectNumber == OBJECT_JOE) ? nullptr : &p, voiceFilePrefix);
 		}
 
 	}
diff --git a/engines/queen/detection.cpp b/engines/queen/detection.cpp
index 5718362c9f..647f3eae46 100644
--- a/engines/queen/detection.cpp
+++ b/engines/queen/detection.cpp
@@ -33,7 +33,7 @@
 
 static const PlainGameDescriptor queenGames[] = {
 	{"queen", "Flight of the Amazon Queen"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #define GAMEOPTION_ALT_INTRO  GUIO_GAMEOPTIONS1
diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp
index 4f13091008..6f47190649 100644
--- a/engines/queen/display.cpp
+++ b/engines/queen/display.cpp
@@ -95,9 +95,9 @@ void Display::dynalumInit(const char *roomName, uint16 roomNum) {
 
 	_dynalum.valid = false;
 	delete[] _dynalum.mskBuf;
-	_dynalum.mskBuf = NULL;
+	_dynalum.mskBuf = nullptr;
 	delete[] _dynalum.lumBuf;
-	_dynalum.lumBuf = NULL;
+	_dynalum.lumBuf = nullptr;
 
 	if (!isPalFadingDisabled(roomNum)) {
 		char filename[20];
@@ -752,7 +752,7 @@ void Display::drawBobPasteDown(const uint8 *data, uint16 x, uint16 y, uint16 w,
 }
 
 void Display::drawInventoryItem(const uint8 *data, uint16 x, uint16 y, uint16 w, uint16 h) {
-	if (data != NULL) {
+	if (data != nullptr) {
 		if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
 			uint8 *dst = _panelBuf + y * PANEL_W + x;
 			for (int j = 0; j < h; ++j) {
diff --git a/engines/queen/graphics.cpp b/engines/queen/graphics.cpp
index 2eda781833..5200f7067b 100644
--- a/engines/queen/graphics.cpp
+++ b/engines/queen/graphics.cpp
@@ -109,7 +109,7 @@ void BobSlot::moveOneStep() {
 }
 
 void BobSlot::animOneStep() {
-	if (anim.string.buffer != NULL) {
+	if (anim.string.buffer != nullptr) {
 		--anim.speed;
 		if (anim.speed <= 0) {
 			// jump to next entry
@@ -157,7 +157,7 @@ void BobSlot::animNormal(uint16 firstFrame, uint16 lastFrame, uint16 spd, bool r
 	frameNum = firstFrame;
 	anim.speed = spd;
 	anim.speedBak = spd;
-	anim.string.buffer = NULL;
+	anim.string.buffer = nullptr;
 	anim.normal.firstFrame = firstFrame;
 	anim.normal.lastFrame = lastFrame;
 	anim.normal.rebound = rebound;
@@ -210,7 +210,7 @@ void BobSlot::clear(const Box *defaultBox) {
 	active = false;
 	xflip = false;
 	animating = false;
-	anim.string.buffer = NULL;
+	anim.string.buffer = nullptr;
 	moving = false;
 	scale = 100;
 	box = *defaultBox;
@@ -382,7 +382,7 @@ void Graphics::drawInventoryItem(uint32 frameNum, uint16 x, uint16 y) {
 		BobFrame *bf = _vm->bankMan()->fetchFrame(frameNum);
 		_vm->display()->drawInventoryItem(bf->data, x, y, bf->width, bf->height);
 	} else {
-		_vm->display()->drawInventoryItem(NULL, x, y, 32, 32);
+		_vm->display()->drawInventoryItem(nullptr, x, y, 32, 32);
 	}
 }
 
@@ -858,7 +858,7 @@ void Graphics::erasePersonAnim(uint16 bobNum) {
 	_newAnim[bobNum][0].frame = 0;
 	BobSlot *pbs = bob(bobNum);
 	pbs->animating = false;
-	pbs->anim.string.buffer = NULL;
+	pbs->anim.string.buffer = nullptr;
 }
 
 void Graphics::eraseAllAnims() {
@@ -1148,7 +1148,7 @@ uint16 Graphics::setupPerson(uint16 noun, uint16 curImage) {
 
 	debug(6, "Graphics::setupPerson(%d, %d) - bob = %d name = %s", noun, curImage, pad->bobNum, p.name);
 
-	if (p.anim != NULL) {
+	if (p.anim != nullptr) {
 		curImage = setupPersonAnim(pad, p.anim, curImage);
 	} else {
 		erasePersonAnim(pad->bobNum);
@@ -1158,7 +1158,7 @@ uint16 Graphics::setupPerson(uint16 noun, uint16 curImage) {
 
 uint16 Graphics::allocPerson(uint16 noun, uint16 curImage) {
 	Person p;
-	if (_vm->logic()->initPerson(noun, "", false, &p) && p.anim != NULL) {
+	if (_vm->logic()->initPerson(noun, "", false, &p) && p.anim != nullptr) {
 		curImage += countAnimFrames(p.anim);
 		_personFrames[p.actor->bobNum] = curImage + 1;
 	}
diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp
index f82b994950..64e28ef031 100644
--- a/engines/queen/logic.cpp
+++ b/engines/queen/logic.cpp
@@ -47,9 +47,9 @@
 namespace Queen {
 
 Logic::Logic(QueenEngine *vm)
-	: _credits(NULL), _objectData(NULL), _roomData(NULL), _sfxName(NULL),
-	_itemData(NULL), _graphicData(NULL), _walkOffData(NULL), _objectDescription(NULL),
-	_furnitureData(NULL), _actorData(NULL), _graphicAnim(NULL), _vm(vm) {
+	: _credits(nullptr), _objectData(nullptr), _roomData(nullptr), _sfxName(nullptr),
+	_itemData(nullptr), _graphicData(nullptr), _walkOffData(nullptr), _objectDescription(nullptr),
+	_furnitureData(nullptr), _actorData(nullptr), _graphicAnim(nullptr), _vm(vm) {
 	_joe.x = _joe.y = 0;
 	_joe.scale = 100;
 	_joe.walk = JWM_NORMAL;
@@ -103,7 +103,7 @@ void Logic::readQueenJas() {
 
 	if ((_vm->resource()->isDemo() && _vm->resource()->getPlatform() == Common::kPlatformDOS) ||
 		(_vm->resource()->isInterview() && _vm->resource()->getPlatform() == Common::kPlatformAmiga)) {
-		_sfxName = NULL;
+		_sfxName = nullptr;
 	} else {
 		_sfxName = new uint16[_numRooms + 1];
 		_sfxName[0] = 0;
@@ -373,7 +373,7 @@ WalkOffData *Logic::walkOffPointForObject(int16 obj) const {
 			return &_walkOffData[i];
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 void Logic::joeWalk(JoeWalkMode walking) {
@@ -520,7 +520,7 @@ ActorData *Logic::findActor(uint16 noun, const char *name) const {
 	int16 img = objectData(obj)->image;
 	if (img != -3 && img != -4) {
 		warning("Logic::findActor() - Object %d is not a person", obj);
-		return NULL;
+		return nullptr;
 	}
 
 	// search Bob number for the person
@@ -537,18 +537,18 @@ ActorData *Logic::findActor(uint16 noun, const char *name) const {
 			}
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 bool Logic::initPerson(uint16 noun, const char *name, bool loadBank, Person *pp) {
 	const ActorData *pad = findActor(noun, name);
-	if (pad != NULL) {
+	if (pad != nullptr) {
 		pp->actor = pad;
 		pp->name = actorName(pad->name);
 		if (pad->anim != 0) {
 			pp->anim = actorAnim(pad->anim);
 		} else {
-			pp->anim = NULL;
+			pp->anim = nullptr;
 		}
 		if (loadBank && pad->file != 0) {
 			_vm->bankMan()->load(actorFile(pad->file), pad->bankNum);
@@ -557,7 +557,7 @@ bool Logic::initPerson(uint16 noun, const char *name, bool loadBank, Person *pp)
 		}
 		pp->bobFrame = 31 + pp->actor->bobNum;
 	}
-	return pad != NULL;
+	return pad != nullptr;
 }
 
 uint16 Logic::findPersonNumber(uint16 obj, uint16 room) const {
@@ -603,7 +603,7 @@ void Logic::setupJoeInRoom(bool autoPosition, uint16 scale) {
 		// find the walk off point for the entry object and make
 		// Joe walking to that point
 		const WalkOffData *pwo = walkOffPointForObject(_entryObj);
-		if (pwo != NULL) {
+		if (pwo != nullptr) {
 			oldx = pwo->x;
 			oldy = pwo->y;
 			// entryObj has a walk off point, then walk from there to object x,y
@@ -827,7 +827,7 @@ void Logic::startDialogue(const char *dlgFile, int personInRoom, char *cutaway)
 			makeJoeSpeak(24 + _vm->randomizer.getRandomNumber(2));
 		} else {
 			char cutawayFile[20];
-			if (cutaway == NULL) {
+			if (cutaway == nullptr) {
 				cutaway = cutawayFile;
 			}
 			_vm->display()->fullscreen(true);
@@ -841,7 +841,7 @@ void Logic::startDialogue(const char *dlgFile, int personInRoom, char *cutaway)
 
 void Logic::playCutaway(const char *cutFile, char *next) {
 	char nextFile[20];
-	if (next == NULL) {
+	if (next == nullptr) {
 		next = nextFile;
 	}
 	_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
@@ -855,7 +855,7 @@ void Logic::makeJoeSpeak(uint16 descNum, bool objectType) {
 	}
 	char descFilePrefix[10];
 	sprintf(descFilePrefix, "JOE%04i", descNum);
-	makePersonSpeak(text, NULL, descFilePrefix);
+	makePersonSpeak(text, nullptr, descFilePrefix);
 }
 
 uint16 Logic::findInventoryItem(int invSlot) const {
@@ -1441,7 +1441,7 @@ void Logic::changeRoom() {
 
 void Logic::executeSpecialMove(uint16 sm) {
 	debug(6, "Special move: %d", sm);
-	if (sm < ARRAYSIZE(_specialMoves) && _specialMoves[sm] != 0) {
+	if (sm < ARRAYSIZE(_specialMoves) && _specialMoves[sm] != nullptr) {
 		(this->*_specialMoves[sm])();
 	}
 }
@@ -2074,12 +2074,12 @@ void Logic::stopCredits() {
 	if (_credits) {
 		_vm->display()->clearTexts(0, 199);
 		delete _credits;
-		_credits = NULL;
+		_credits = nullptr;
 	}
 }
 
 void LogicDemo::useJournal() {
-	makePersonSpeak("This is a demo, so I can't load or save games*14", NULL, "");
+	makePersonSpeak("This is a demo, so I can't load or save games*14", nullptr, "");
 }
 
 bool LogicDemo::changeToSpecialRoom() {
diff --git a/engines/queen/music.cpp b/engines/queen/music.cpp
index c65f2de5ef..8a5b3adc08 100644
--- a/engines/queen/music.cpp
+++ b/engines/queen/music.cpp
@@ -37,7 +37,7 @@ namespace Queen {
 MidiMusic::MidiMusic(QueenEngine *vm)
 	: _isPlaying(false), _isLooping(false),
 	_randomLoop(false), _masterVolume(192),
-	_buf(0), _rnd("queenMusic") {
+	_buf(nullptr), _rnd("queenMusic") {
 
 	memset(_channelsTable, 0, sizeof(_channelsTable));
 	_queuePos = _lastSong = _currentSong = 0;
@@ -92,7 +92,7 @@ MidiMusic::MidiMusic(QueenEngine *vm)
 }
 
 MidiMusic::~MidiMusic() {
-	_driver->setTimerCallback(0, 0);
+	_driver->setTimerCallback(nullptr, nullptr);
 	_parser->unloadMusic();
 	delete _parser;
 	_driver->close();
@@ -281,7 +281,7 @@ void MidiMusic::playMusic() {
 	if (*prevSong == 'C' || *prevSong == 'c') {
 		if (_buf) {
 			delete[] _buf;
-			_buf = 0;
+			_buf = nullptr;
 		}
 	}
 
diff --git a/engines/queen/resource.cpp b/engines/queen/resource.cpp
index 7d3739a117..c53c61d59f 100644
--- a/engines/queen/resource.cpp
+++ b/engines/queen/resource.cpp
@@ -59,7 +59,7 @@ static int compareResourceEntry(const void *a, const void *b) {
 }
 
 Resource::Resource()
-	: _resourceEntries(0), _resourceTable(NULL) {
+	: _resourceEntries(0), _resourceTable(nullptr) {
 	memset(&_version, 0, sizeof(_version));
 
 	_currentResourceFileNum = 1;
@@ -95,7 +95,7 @@ ResourceEntry *Resource::resourceEntry(const char *filename) const {
 	Common::String entryName(filename);
 	entryName.toUppercase();
 
-	ResourceEntry *re = NULL;
+	ResourceEntry *re = nullptr;
 	re = (ResourceEntry *)bsearch(entryName.c_str(), _resourceTable, _resourceEntries, sizeof(ResourceEntry), compareResourceEntry);
 	return re;
 }
@@ -103,9 +103,9 @@ ResourceEntry *Resource::resourceEntry(const char *filename) const {
 uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size) {
 	debug(7, "Resource::loadFile('%s')", filename);
 	ResourceEntry *re = resourceEntry(filename);
-	assert(re != NULL);
+	assert(re != nullptr);
 	uint32 sz = re->size - skipBytes;
-	if (size != NULL) {
+	if (size != nullptr) {
 		*size = sz;
 	}
 	byte *dstBuf = new byte[sz];
@@ -117,7 +117,7 @@ uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size)
 void Resource::loadTextFile(const char *filename, Common::StringArray &stringList) {
 	debug(7, "Resource::loadTextFile('%s')", filename);
 	ResourceEntry *re = resourceEntry(filename);
-	assert(re != NULL);
+	assert(re != nullptr);
 	seekResourceFile(re->bundle, re->offset);
 	Common::SeekableSubReadStream stream(&_resourceFile, re->offset, re->offset + re->size);
 	while (true) {
@@ -140,7 +140,7 @@ bool Resource::detectVersion(DetectedGameVersion *ver, Common::File *f) {
 		ver->queenTblOffset = 0;
 	} else {
 		const RetailGameVersion *gameVersion = detectGameVersionFromSize(f->size());
-		if (gameVersion == NULL) {
+		if (gameVersion == nullptr) {
 			warning("Unknown/unsupported FOTAQ version");
 			return false;
 		}
@@ -235,7 +235,7 @@ void Resource::checkJASVersion() {
 		return;
 	}
 	ResourceEntry *re = resourceEntry("QUEEN.JAS");
-	assert(re != NULL);
+	assert(re != nullptr);
 	uint32 offset = re->offset;
 	if (isDemo())
 		offset += JAS_VERSION_OFFSET_DEMO;
@@ -306,18 +306,18 @@ const RetailGameVersion *Resource::detectGameVersionFromSize(uint32 size) {
 			return &_gameVersions[i];
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 Common::File *Resource::findSound(const char *filename, uint32 *size) {
-	assert(strstr(filename, ".SB") != NULL || strstr(filename, ".AMR") != NULL || strstr(filename, ".INS") != NULL);
+	assert(strstr(filename, ".SB") != nullptr || strstr(filename, ".AMR") != nullptr || strstr(filename, ".INS") != nullptr);
 	ResourceEntry *re = resourceEntry(filename);
 	if (re) {
 		*size = re->size;
 		seekResourceFile(re->bundle, re->offset);
 		return &_resourceFile;
 	}
-	return NULL;
+	return nullptr;
 }
 
 } // End of namespace Queen
diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp
index 1071e80a4d..00e0e868bb 100644
--- a/engines/queen/talk.cpp
+++ b/engines/queen/talk.cpp
@@ -68,7 +68,7 @@ bool Talk::speak(
 }
 
 Talk::Talk(QueenEngine *vm)
-	: _vm(vm), _fileData(NULL) {
+	: _vm(vm), _fileData(nullptr) {
 	_vm->input()->talkQuitReset();
 }
 
@@ -91,7 +91,7 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) {
 	memset(&person, 0, sizeof(Person));
 	_vm->logic()->initPerson(personInRoom, "", false, &person);
 
-	if (NULL == person.name) {
+	if (nullptr == person.name) {
 		error("Invalid person object");
 	}
 
@@ -178,7 +178,7 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) {
 			if (_vm->input()->talkQuit())
 				break;
 
-			speak(_talkString[selectedSentence], NULL, _joeVoiceFilePrefix[selectedSentence]);
+			speak(_talkString[selectedSentence], nullptr, _joeVoiceFilePrefix[selectedSentence]);
 		} else {
 			if (person.actor->bobNum > 0) {
 				speak(_talkString[0], &person, otherVoiceFilePrefix);
@@ -335,7 +335,7 @@ void Talk::findDialogueString(uint16 offset, int16 id, int16 max, char *str) {
 			getString(_fileData, offset, str, MAX_STRING_LENGTH, 4);
 			break;
 		} else {
-			getString(_fileData, offset, NULL, MAX_STRING_LENGTH, 4);
+			getString(_fileData, offset, nullptr, MAX_STRING_LENGTH, 4);
 		}
 	}
 }
@@ -437,14 +437,14 @@ void Talk::initialTalk() {
 		if (joeString[0] != '0') {
 			char voiceFilePrefix[MAX_STRING_SIZE];
 			sprintf(voiceFilePrefix, "%2dSSSSJ", _talkKey);
-			speak(joeString, NULL, voiceFilePrefix);
+			speak(joeString, nullptr, voiceFilePrefix);
 		}
 	} else {
 		// Already spoken to them, choose second response
 		if (joe2String[0] != '0') {
 			char voiceFilePrefix[MAX_STRING_SIZE];
 			sprintf(voiceFilePrefix, "%2dXXXXJ", _talkKey);
-			speak(joe2String, NULL, voiceFilePrefix);
+			speak(joe2String, nullptr, voiceFilePrefix);
 		}
 	}
 }
@@ -700,7 +700,7 @@ void Talk::defaultAnimation(
 
 		int len = countSpaces(segment);
 		while (1) {
-			if (parameters != NULL) {
+			if (parameters != nullptr) {
 
 				int bf;
 				if (segment[0] == ' ')
@@ -888,7 +888,7 @@ void Talk::speakSegment(
 
 	//int SF = _vm->grid()->findScale(textX, textY);
 
-	const SpeechParameters *parameters = NULL;
+	const SpeechParameters *parameters = nullptr;
 	int startFrame = 0;
 
 	if (_talkHead && isJoe) {
@@ -1344,7 +1344,7 @@ int16 Talk::selectSentence() {
 	if (selectedSentence > 0) {
 		_vm->display()->clearTexts(0, 198);
 
-		speak(_talkString[selectedSentence], NULL, _joeVoiceFilePrefix[selectedSentence]);
+		speak(_talkString[selectedSentence], nullptr, _joeVoiceFilePrefix[selectedSentence]);
 	}
 
 	_vm->display()->clearTexts(151, 151);


Commit: 2930d377888da3da36d63661936d4f1953033bbc
    https://github.com/scummvm/scummvm/commit/2930d377888da3da36d63661936d4f1953033bbc
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
SAGA: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/saga/actor.cpp
    engines/saga/actor_walk.cpp
    engines/saga/animation.cpp
    engines/saga/detection.cpp
    engines/saga/events.cpp
    engines/saga/font.cpp
    engines/saga/gfx.cpp
    engines/saga/image.cpp
    engines/saga/interface.cpp
    engines/saga/introproc_ite.cpp
    engines/saga/isomap.cpp
    engines/saga/music.cpp
    engines/saga/resource.cpp
    engines/saga/resource_rsc.cpp
    engines/saga/saveload.cpp
    engines/saga/scene.cpp
    engines/saga/script.cpp
    engines/saga/sfuncs.cpp
    engines/saga/sndres.cpp
    engines/saga/sound.cpp
    engines/saga/sprite.cpp


diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index 44575342ba..bf9e5119ec 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -39,7 +39,7 @@
 namespace Saga {
 
 ActorData::ActorData() {
-	_frames = NULL;
+	_frames = nullptr;
 	_frameListResourceId = 0;
 	_speechColor = 0;
 	_inScene = false;
@@ -50,7 +50,7 @@ ActorData::ActorData() {
 	_actionDirection = 0;
 	_actionCycle = 0;
 	_targetObject = 0;
-	_lastZone = NULL;
+	_lastZone = nullptr;
 
 	_cycleFrameSequence = 0;
 	_cycleDelay = 0;
@@ -123,7 +123,7 @@ void ActorData::loadState(uint32 version, Common::InSaveFile *in) {
 	_actionCycle = in->readSint32LE();
 	_targetObject = in->readUint16LE();
 
-	_lastZone = NULL;
+	_lastZone = nullptr;
 	_cycleFrameSequence = in->readSint32LE();
 	_cycleDelay = in->readByte();
 	_cycleTimeCount = in->readByte();
@@ -222,7 +222,7 @@ Actor::Actor(SagaEngine *vm) : _vm(vm) {
 	_pathList.resize(600);
 	_pathListIndex = 0;
 
-	_centerActor = _protagonist = NULL;
+	_centerActor = _protagonist = nullptr;
 	_protagState = 0;
 	_lastTickMsec = 0;
 
@@ -238,7 +238,7 @@ Actor::Actor(SagaEngine *vm) : _vm(vm) {
 
 	// Get actor resource file context
 	_actorContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
-	if (_actorContext == NULL) {
+	if (_actorContext == nullptr) {
 		error("Actor::Actor() resource context not found");
 	}
 
@@ -341,7 +341,7 @@ void Actor::loadActorSpriteList(ActorData *actor) {
 	uint curFrameIndex;
 	int resourceId = actor->_spriteListResourceId;
 
-	if (actor->_frames != NULL) {
+	if (actor->_frames != nullptr) {
 		for (ActorFrameSequences::const_iterator i = actor->_frames->begin(); i != actor->_frames->end(); ++i) {
 			for (int orient = 0; orient < ACTOR_DIRECTIONS_COUNT; orient++) {
 				curFrameIndex = i->directions[orient].frameIndex;
@@ -535,7 +535,7 @@ void Actor::loadObjList(int objectCount, int objectsResourceID) {
 void Actor::takeExit(uint16 actorId, const HitZone *hitZone) {
 	ActorData *actor;
 	actor = getActor(actorId);
-	actor->_lastZone = NULL;
+	actor->_lastZone = nullptr;
 
 	_vm->_scene->changeScene(hitZone->getSceneNumber(), hitZone->getActorsEntrance(), kTransitionNoFade);
 	if (_vm->_interface->getMode() != kPanelSceneSubstitute) {
@@ -601,7 +601,7 @@ ActorData *Actor::getActor(uint16 actorId) {
 	}
 
 	if (actorId == ID_PROTAG) {
-		if (_protagonist == NULL) {
+		if (_protagonist == nullptr) {
 			error("_protagonist == NULL");
 		}
 		return _protagonist;
@@ -715,7 +715,7 @@ ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) {
 	}
 #endif
 
-	return NULL;
+	return nullptr;
 }
 
 void Actor::handleSpeech(int msec) {
@@ -942,7 +942,7 @@ uint16 Actor::hitTest(const Point &testPoint, bool skipProtagonist) {
 	CommonObjectOrderList::iterator drawOrderIterator;
 	CommonObjectDataPointer drawObject;
 	int frameNumber = 0;
-	SpriteList *spriteList = NULL;
+	SpriteList *spriteList = nullptr;
 
 	createDrawOrderList();
 
@@ -977,7 +977,7 @@ void Actor::drawOrderListAdd(const CommonObjectDataPointer& element, CompareFunc
 }
 
 void Actor::createDrawOrderList() {
-	CompareFunction compareFunction = 0;
+	CompareFunction compareFunction = nullptr;
 
 	if (_vm->_scene->getFlags() & kSceneFlagISO) {
 		compareFunction = &tileCommonObjectCompare;
@@ -1073,7 +1073,7 @@ void Actor::drawActors() {
 	CommonObjectOrderList::iterator drawOrderIterator;
 	CommonObjectDataPointer drawObject;
 	int frameNumber = 0;
-	SpriteList *spriteList = NULL;
+	SpriteList *spriteList = nullptr;
 
 	createDrawOrderList();
 
diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp
index 1d34bdd27a..ef4d6fea70 100644
--- a/engines/saga/actor_walk.cpp
+++ b/engines/saga/actor_walk.cpp
@@ -190,7 +190,7 @@ void Actor::updateActorsScene(int actorsEntrance) {
 	_vm->_sound->stopVoice();
 	_activeSpeech.stringsCount = 0;
 	_activeSpeech.playing = false;
-	_protagonist = NULL;
+	_protagonist = nullptr;
 
 	for (ActorDataArray::iterator actor = _actors.begin(); actor != _actors.end(); ++actor) {
 		actor->_inScene = false;
@@ -216,7 +216,7 @@ void Actor::updateActorsScene(int actorsEntrance) {
 	}
 
 	// _protagonist can be null while loading a game from the command line
-	if (_protagonist == NULL)
+	if (_protagonist == nullptr)
 		return;
 
 	if ((actorsEntrance >= 0) && (!_vm->_scene->_entryList.empty())) {
@@ -667,7 +667,7 @@ void Actor::handleActions(int msec, bool setup) {
 		}
 
 		if ((actor->_currentAction >= kActionWalkToPoint) && (actor->_currentAction <= kActionWalkDir)) {
-			hitZone = NULL;
+			hitZone = nullptr;
 
 			if (_vm->_scene->getFlags() & kSceneFlagISO) {
 				actor->_location.toScreenPointUV(hitPoint);
@@ -688,7 +688,7 @@ void Actor::handleActions(int msec, bool setup) {
 			if (_vm->getGameId() == GID_IHNM) {
 				if (_vm->_scene->currentChapterNumber() == 1 && _vm->_scene->currentSceneNumber() == 22)
 					if (hitPoint.x <= 300)
-						hitZone = NULL;
+						hitZone = nullptr;
 			}
 
 			if (hitZone != actor->_lastZone) {
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 25119c6407..3e0ccb98de 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -42,10 +42,10 @@ Anim::Anim(SagaEngine *vm) : _vm(vm) {
 	_cutawayActive = false;
 
 	for (i = 0; i < MAX_ANIMATIONS; i++)
-		_animations[i] = NULL;
+		_animations[i] = nullptr;
 
 	for (i = 0; i < ARRAYSIZE(_cutawayAnimations); i++)
-		_cutawayAnimations[i] = NULL;
+		_cutawayAnimations[i] = nullptr;
 }
 
 Anim::~Anim() {
@@ -461,7 +461,7 @@ void Anim::setCycles(uint16 animId, int cycles) {
 }
 
 int Anim::getCycles(uint16 animId) {
-	if (animId >= MAX_ANIMATIONS && _cutawayAnimations[animId - MAX_ANIMATIONS] == NULL)
+	if (animId >= MAX_ANIMATIONS && _cutawayAnimations[animId - MAX_ANIMATIONS] == nullptr)
 		return 0;
 
 	return getAnimation(animId)->cycles;
@@ -483,7 +483,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) {
 	if (animId < MAX_ANIMATIONS && _cutawayActive)
 		return;
 
-	if (animId >= MAX_ANIMATIONS && _cutawayAnimations[animId - MAX_ANIMATIONS] == NULL) {
+	if (animId >= MAX_ANIMATIONS && _cutawayAnimations[animId - MAX_ANIMATIONS] == nullptr) {
 		// In IHNM, cutaways without an animation bit are not rendered, but the framecount
 		// needs to be updated
 		_vm->_frameCount++;
@@ -610,16 +610,16 @@ void Anim::reset() {
 	uint16 i;
 
 	for (i = 0; i < MAX_ANIMATIONS; i++) {
-		if (_animations[i] != NULL) {
+		if (_animations[i] != nullptr) {
 			delete _animations[i];
-			_animations[i] = NULL;
+			_animations[i] = nullptr;
 		}
 	}
 
 	for (i = 0; i < ARRAYSIZE(_cutawayAnimations); i++) {
-		if (_cutawayAnimations[i] != NULL) {
+		if (_cutawayAnimations[i] != nullptr) {
 			delete _cutawayAnimations[i];
-			_cutawayAnimations[i] = NULL;
+			_cutawayAnimations[i] = nullptr;
 		}
 	}
 }
@@ -649,7 +649,7 @@ int16 Anim::getCurrentFrame(uint16 animId) {
 }
 
 void Anim::decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_t bufLength) {
-	byte *writePointer = NULL;
+	byte *writePointer = nullptr;
 
 	uint16 xStart = 0;
 	uint16 yStart = 0;
@@ -917,7 +917,7 @@ void Anim::animInfo() {
 	_vm->_console->debugPrintf("There are %d animations loaded:\n", animCount);
 
 	for (i = 0; i < MAX_ANIMATIONS; i++) {
-		if (_animations[i] == NULL) {
+		if (_animations[i] == nullptr) {
 			continue;
 		}
 
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index ea9f501c4c..9e04f87f1a 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -30,7 +30,7 @@
 static const PlainGameDescriptor sagaGames[] = {
 	{"ite", "Inherit the Earth: Quest for the Orb"},
 	{"ihnm", "I Have No Mouth and I Must Scream"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 #include "saga/detection_tables.h"
@@ -38,7 +38,7 @@ static const PlainGameDescriptor sagaGames[] = {
 class SagaMetaEngineDetection : public AdvancedMetaEngineDetection {
 public:
 	SagaMetaEngineDetection() : AdvancedMetaEngineDetection(Saga::gameDescriptions, sizeof(Saga::SAGAGameDescription), sagaGames) {
-		static const char *const DIRECTORY_GLOBS[2] = { "music", 0 };
+		static const char *const DIRECTORY_GLOBS[2] = { "music", nullptr };
 		_maxScanDepth = 2;
 		_directoryGlobs = DIRECTORY_GLOBS;
 	}
diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp
index a9eff1184e..d583373ffd 100644
--- a/engines/saga/events.cpp
+++ b/engines/saga/events.cpp
@@ -572,7 +572,7 @@ int Events::handleInterval(Event *event) {
 
 EventColumns *Events::chain(EventColumns *eventColumns, const Event &event) {
 
-	if (eventColumns == NULL) {
+	if (eventColumns == nullptr) {
 		EventColumns tmp;
 
 		_eventList.push_back(tmp);
diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp
index 14c55d7e06..adff8dab12 100644
--- a/engines/saga/font.cpp
+++ b/engines/saga/font.cpp
@@ -216,7 +216,7 @@ void DefaultFont::textDrawRect(FontId fontId, const char *text, const Common::Re
 
 	for (;;) {
 		foundPointer = strchr(searchPointer, ' ');
-		if (foundPointer == NULL) {
+		if (foundPointer == nullptr) {
 			// Ran to the end of the buffer
 			len = endPointer - measurePointer;
 		} else {
@@ -267,7 +267,7 @@ void DefaultFont::textDrawRect(FontId fontId, const char *text, const Common::Re
 			w_total += w;
 			len_total += len;
 			wc++;
-			if (foundPointer == NULL) {
+			if (foundPointer == nullptr) {
 				// Since word hit NULL but fit, we are done
 				textPoint2.x = textPoint.x - (w_total / 2);
 				textPoint2.y = textPoint.y;
@@ -353,7 +353,7 @@ int DefaultFont::getHeight(FontId fontId, const char *text, int width, FontEffec
 
 	for (;;) {
 		foundPointer = strchr(searchPointer, ' ');
-		if (foundPointer == NULL) {
+		if (foundPointer == nullptr) {
 			// Ran to the end of the buffer
 			len = endPointer - measurePointer;
 		} else {
@@ -371,7 +371,7 @@ int DefaultFont::getHeight(FontId fontId, const char *text, int width, FontEffec
 			}
 			// Wrap what we've got and restart
 			textPoint.y += h + TEXT_LINESPACING;
-			if (foundPointer == NULL) {
+			if (foundPointer == nullptr) {
 				// Since word hit NULL but fit, we are done
 				return textPoint.y + h;
 			}
@@ -384,7 +384,7 @@ int DefaultFont::getHeight(FontId fontId, const char *text, int width, FontEffec
 			w_total += w;
 			len_total += len;
 			wc++;
-			if (foundPointer == NULL) {
+			if (foundPointer == nullptr) {
 				// Since word hit NULL but fit, we are done
 				return textPoint.y + h;
 			}
@@ -541,7 +541,7 @@ void DefaultFont::loadFont(FontData *font, uint32 fontResourceId) {
 	debug(1, "Font::loadFont(): Reading fontResourceId %d...", fontResourceId);
 
 	fontContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
-	if (fontContext == NULL) {
+	if (fontContext == nullptr) {
 		error("DefaultFont::Font() resource context not found");
 	}
 
@@ -696,7 +696,7 @@ void DefaultFont::createOutline(FontData *font) {
 	}
 }
 
-SJISFont::SJISFont(SagaEngine *vm) : Font(vm), _font(0) {
+SJISFont::SJISFont(SagaEngine *vm) : Font(vm), _font(nullptr) {
 	_font = Graphics::FontSJIS::createFont(vm->getPlatform());
 	assert(_font);
 }
@@ -710,7 +710,7 @@ void SJISFont::textDrawRect(FontId fontId, const char *text, const Common::Rect
 	int curW = 0;
 	int numChar = 0;
 	const char *pos = text;
-	const char *last = 0;
+	const char *last = nullptr;
 	int checkWidth = (rect.width() - 16) & ~7;
 
 	for (uint16 c = fetchChar(pos); c; c = fetchChar(pos)) {
@@ -727,7 +727,7 @@ void SJISFont::textDrawRect(FontId fontId, const char *text, const Common::Rect
 			if (c == (uint16)'\r' || c == (uint16)'\n')
 				last++;
 			pos = text = last;
-			last = 0;
+			last = nullptr;
 			curW = 0;
 		} else {
 			numChar++;
diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index 269519f027..6344e6fae4 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -174,7 +174,7 @@ void Gfx::initPalette() {
 		return;
 
 	ResourceContext *resourceContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
-	if (resourceContext == NULL) {
+	if (resourceContext == nullptr) {
 		error("Resource::loadGlobalResources() resource context not found");
 	}
 
diff --git a/engines/saga/image.cpp b/engines/saga/image.cpp
index 31a38623f8..230be26102 100644
--- a/engines/saga/image.cpp
+++ b/engines/saga/image.cpp
@@ -295,7 +295,7 @@ void SagaEngine::flipImage(byte *imageBuffer, int columns, int scanlines) {
 
 	tmp_scan.resize(columns);
 	flip_tmp = tmp_scan.getBuffer();
-	if (flip_tmp == NULL) {
+	if (flip_tmp == nullptr) {
 		return;
 	}
 
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index c7897fcfcb..dce2c19d21 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -126,7 +126,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 
 	// Load interface module resource file context
 	_interfaceContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
-	if (_interfaceContext == NULL) {
+	if (_interfaceContext == nullptr) {
 		error("Interface::Interface() resource context not found");
 	}
 
@@ -135,7 +135,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 	_mainPanel.buttonsCount = _vm->getDisplayInfo().mainPanelButtonsCount;
 
 	for (i = 0; i < kVerbTypeIdsMax; i++) {
-		_verbTypeToPanelButton[i] = NULL;
+		_verbTypeToPanelButton[i] = nullptr;
 	}
 
 	for (i = 0; i < _mainPanel.buttonsCount; i++) {
@@ -162,7 +162,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 		_vm->_resource->loadResource(_interfaceContext, _vm->getResourceDescription()->optionPanelResourceId, resourceData);
 		_vm->decodeBGImage(resourceData, _optionPanel.image, &_optionPanel.imageWidth, &_optionPanel.imageHeight);
 	} else {
-		_optionPanel.buttons = NULL;
+		_optionPanel.buttons = nullptr;
 		_optionPanel.buttonsCount = 0;
 		_optionPanel.sprites.clear();
 	}
@@ -217,13 +217,13 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 
 	_mainPanel.x = _vm->getDisplayInfo().mainPanelXOffset;
 	_mainPanel.y = _vm->getDisplayInfo().mainPanelYOffset;
-	_mainPanel.currentButton = NULL;
+	_mainPanel.currentButton = nullptr;
 	_inventoryUpButton = _mainPanel.getButton(_vm->getDisplayInfo().inventoryUpButtonIndex);
 	_inventoryDownButton = _mainPanel.getButton(_vm->getDisplayInfo().inventoryDownButtonIndex);
 
 	_conversePanel.x = _vm->getDisplayInfo().conversePanelXOffset;
 	_conversePanel.y = _vm->getDisplayInfo().conversePanelYOffset;
-	_conversePanel.currentButton = NULL;
+	_conversePanel.currentButton = nullptr;
 	_converseUpButton = _conversePanel.getButton(_vm->getDisplayInfo().converseUpButtonIndex);
 	_converseDownButton = _conversePanel.getButton(_vm->getDisplayInfo().converseDownButtonIndex);
 
@@ -232,7 +232,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 
 	_optionPanel.x = _vm->getDisplayInfo().optionPanelXOffset;
 	_optionPanel.y = _vm->getDisplayInfo().optionPanelYOffset;
-	_optionPanel.currentButton = NULL;
+	_optionPanel.currentButton = nullptr;
 	_optionSaveFileSlider = _optionPanel.getButton(_vm->getDisplayInfo().optionSaveFileSliderIndex);
 	_optionSaveFilePanel = _optionPanel.getButton(_vm->getDisplayInfo().optionSaveFilePanelIndex);
 
@@ -242,7 +242,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 	_quitPanel.imageHeight = _vm->getDisplayInfo().quitPanelHeight;
 	_quitPanel.buttons = _vm->getDisplayInfo().quitPanelButtons;
 	_quitPanel.buttonsCount = _vm->getDisplayInfo().quitPanelButtonsCount;
-	_quitPanel.currentButton = NULL;
+	_quitPanel.currentButton = nullptr;
 
 	_loadPanel.x = _vm->getDisplayInfo().loadPanelXOffset;
 	_loadPanel.y = _vm->getDisplayInfo().loadPanelYOffset;
@@ -250,7 +250,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 	_loadPanel.imageHeight = _vm->getDisplayInfo().loadPanelHeight;
 	_loadPanel.buttons = _vm->getDisplayInfo().loadPanelButtons;
 	_loadPanel.buttonsCount = _vm->getDisplayInfo().loadPanelButtonsCount;
-	_loadPanel.currentButton = NULL;
+	_loadPanel.currentButton = nullptr;
 
 	_savePanel.x = _vm->getDisplayInfo().savePanelXOffset;
 	_savePanel.y = _vm->getDisplayInfo().savePanelYOffset;
@@ -259,7 +259,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 	_savePanel.buttons = _vm->getDisplayInfo().savePanelButtons;
 	_savePanel.buttonsCount = _vm->getDisplayInfo().savePanelButtonsCount;
 	_saveEdit = _savePanel.getButton(_vm->getDisplayInfo().saveEditIndex);
-	_savePanel.currentButton = NULL;
+	_savePanel.currentButton = nullptr;
 
 	_protectPanel.x = _vm->getDisplayInfo().protectPanelXOffset;
 	_protectPanel.y = _vm->getDisplayInfo().protectPanelYOffset;
@@ -268,7 +268,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
 	_protectPanel.buttons = _vm->getDisplayInfo().protectPanelButtons;
 	_protectPanel.buttonsCount = _vm->getDisplayInfo().protectPanelButtonsCount;
 	_protectEdit = _protectPanel.getButton(_vm->getDisplayInfo().protectEditIndex);
-	_protectPanel.currentButton = NULL;
+	_protectPanel.currentButton = nullptr;
 
 	_active = true;
 	_panelMode = _lockedMode = kPanelNull;
@@ -402,14 +402,14 @@ void Interface::setMode(int mode) {
 		// FIXME: Implement IHNM differences from ExecuteInventoryPanel for IHNM (though I believe they're already
 		// implemented)
 
-		_mainPanel.currentButton = NULL;
+		_mainPanel.currentButton = nullptr;
 		break;
 	case kPanelConverse:
-		_conversePanel.currentButton = NULL;
+		_conversePanel.currentButton = nullptr;
 		converseDisplayText();
 		break;
 	case kPanelOption:
-		_optionPanel.currentButton = NULL;
+		_optionPanel.currentButton = nullptr;
 		_vm->fillSaveList();
 		calcOptionSaveSlider();
 		if (_optionSaveFileTitleNumber >= _vm->getDisplayInfo().optionSaveFileVisible) {
@@ -417,13 +417,13 @@ void Interface::setMode(int mode) {
 		}
 		break;
 	case kPanelLoad:
-		_loadPanel.currentButton = NULL;
+		_loadPanel.currentButton = nullptr;
 		break;
 	case kPanelQuit:
-		_quitPanel.currentButton = NULL;
+		_quitPanel.currentButton = nullptr;
 		break;
 	case kPanelSave:
-		_savePanel.currentButton = NULL;
+		_savePanel.currentButton = nullptr;
 		_textInputMaxWidth = _saveEdit->width - 10;
 		_textInput = true;
 		_textInputStringLength = strlen(_textInputString);
@@ -444,7 +444,7 @@ void Interface::setMode(int mode) {
 	case kPanelProtect:
 		if (_vm->getGameId() == GID_ITE) {
 			// This is used as the copy protection panel in ITE
-			_protectPanel.currentButton = NULL;
+			_protectPanel.currentButton = nullptr;
 			_textInputMaxWidth = _protectEdit->width - 10;
 			_textInput = true;
 			_textInputString[0] = 0;
@@ -705,7 +705,7 @@ void Interface::setStatusText(const char *text, int statusColor) {
 			return;
 	}
 
-	assert(text != NULL);
+	assert(text != nullptr);
 	assert(strlen(text) < STATUS_TEXT_LEN);
 
 	if (_vm->_render->getFlags() & RF_MAP || _vm->_interface->getMode() == kPanelPlacard)
@@ -769,7 +769,7 @@ void Interface::draw() {
 		_vm->_gfx->drawRegion(rect, _mainPanel.image.getBuffer());
 
 		for (int i = 0; i < kVerbTypeIdsMax; i++) {
-			if (_verbTypeToPanelButton[i] != NULL) {
+			if (_verbTypeToPanelButton[i] != nullptr) {
 				drawVerbPanel(_verbTypeToPanelButton[i]);
 			}
 		}
@@ -1019,7 +1019,7 @@ void Interface::handleQuitUpdate(const Point& mousePoint) {
 	bool releasedButton;
 
 	_quitPanel.currentButton = quitHitTest(mousePoint);
-	releasedButton = (_quitPanel.currentButton != NULL) && (_quitPanel.currentButton->state > 0) && (!_vm->mouseButtonPressed());
+	releasedButton = (_quitPanel.currentButton != nullptr) && (_quitPanel.currentButton->state > 0) && (!_vm->mouseButtonPressed());
 
 	if (!_vm->mouseButtonPressed()) {
 		_quitPanel.zeroAllButtonState();
@@ -1035,7 +1035,7 @@ void Interface::handleQuitClick(const Point& mousePoint) {
 
 	_quitPanel.zeroAllButtonState();
 
-	if (_quitPanel.currentButton == NULL) {
+	if (_quitPanel.currentButton == nullptr) {
 		return;
 	}
 
@@ -1043,7 +1043,7 @@ void Interface::handleQuitClick(const Point& mousePoint) {
 }
 
 void Interface::setQuit(PanelButton *panelButton) {
-	_quitPanel.currentButton = NULL;
+	_quitPanel.currentButton = nullptr;
 	switch (panelButton->id) {
 		case kTextCancel:
 			setMode(kPanelOption);
@@ -1087,7 +1087,7 @@ void Interface::handleLoadUpdate(const Point& mousePoint) {
 	bool releasedButton;
 
 	_loadPanel.currentButton = loadHitTest(mousePoint);
-	releasedButton = (_loadPanel.currentButton != NULL) && (_loadPanel.currentButton->state > 0) && (!_vm->mouseButtonPressed());
+	releasedButton = (_loadPanel.currentButton != nullptr) && (_loadPanel.currentButton->state > 0) && (!_vm->mouseButtonPressed());
 
 	if (!_vm->mouseButtonPressed()) {
 		_loadPanel.zeroAllButtonState();
@@ -1103,7 +1103,7 @@ void Interface::handleLoadClick(const Point& mousePoint) {
 
 	_loadPanel.zeroAllButtonState();
 
-	if (_loadPanel.currentButton == NULL) {
+	if (_loadPanel.currentButton == nullptr) {
 		return;
 	}
 
@@ -1111,7 +1111,7 @@ void Interface::handleLoadClick(const Point& mousePoint) {
 }
 
 void Interface::setLoad(PanelButton *panelButton) {
-	_loadPanel.currentButton = NULL;
+	_loadPanel.currentButton = nullptr;
 	switch (panelButton->id) {
 		case kTextOK:
 			if (_vm->getGameId() == GID_ITE) {
@@ -1337,7 +1337,7 @@ void Interface::handleSaveUpdate(const Point& mousePoint) {
 
 	validateSaveButtons();
 
-	releasedButton = (_savePanel.currentButton != NULL) &&
+	releasedButton = (_savePanel.currentButton != nullptr) &&
 		(_savePanel.currentButton->state > 0) && (!_vm->mouseButtonPressed());
 
 	if (!_vm->mouseButtonPressed()) {
@@ -1356,7 +1356,7 @@ void Interface::handleSaveClick(const Point& mousePoint) {
 
 	_savePanel.zeroAllButtonState();
 
-	if (_savePanel.currentButton == NULL) {
+	if (_savePanel.currentButton == nullptr) {
 		_textInput = false;
 		return;
 	}
@@ -1368,7 +1368,7 @@ void Interface::handleSaveClick(const Point& mousePoint) {
 }
 
 void Interface::setSave(PanelButton *panelButton) {
-	_savePanel.currentButton = NULL;
+	_savePanel.currentButton = nullptr;
 	uint titleNumber;
 	char *fileName;
 
@@ -1447,7 +1447,7 @@ void Interface::handleOptionUpdate(const Point& mousePoint) {
 
 	validateOptionButtons();
 
-	releasedButton = (_optionPanel.currentButton != NULL) && (_optionPanel.currentButton->state > 0) && (!_vm->mouseButtonPressed());
+	releasedButton = (_optionPanel.currentButton != nullptr) && (_optionPanel.currentButton->state > 0) && (!_vm->mouseButtonPressed());
 
 	if (!_vm->mouseButtonPressed()) {
 		_optionPanel.zeroAllButtonState();
@@ -1467,7 +1467,7 @@ void Interface::handleOptionClick(const Point& mousePoint) {
 
 	_optionPanel.zeroAllButtonState();
 
-	if (_optionPanel.currentButton == NULL) {
+	if (_optionPanel.currentButton == nullptr) {
 		return;
 	}
 
@@ -1544,7 +1544,7 @@ void Interface::handleChapterSelectionClick(const Point& mousePoint) {
 		case kGameObjectHitZone:
 			hitZone = _vm->_scene->_objectMap->getHitZone(objectIdToIndex(obj));
 
-			if (hitZone == NULL)
+			if (hitZone == nullptr)
 				return;
 
 			if (hitZone->getFlags() & kHitZoneEnabled)
@@ -1582,7 +1582,7 @@ void Interface::handleChapterSelectionClick(const Point& mousePoint) {
 }
 
 void Interface::setOption(PanelButton *panelButton) {
-	_optionPanel.currentButton = NULL;
+	_optionPanel.currentButton = nullptr;
 	switch (panelButton->id) {
 	case kTextContinuePlaying:
 		ConfMan.flushToDisk();
@@ -1946,7 +1946,7 @@ void Interface::handleMainClick(const Point& mousePoint) {
 
 	panelButton = _mainPanel.hitTest(mousePoint, kPanelAllButtons);
 
-	if (panelButton != NULL) {
+	if (panelButton != nullptr) {
 		if (panelButton->type == kPanelButtonArrow) {
 			panelButton->state = 1;
 			converseChangePos(panelButton->id);
@@ -2008,7 +2008,7 @@ void Interface::handleMainUpdate(const Point& mousePoint) {
 
 	bool changed = false;
 
-	if ((panelButton != NULL) && (panelButton->type == kPanelButtonArrow)) {
+	if ((panelButton != nullptr) && (panelButton->type == kPanelButtonArrow)) {
 		if (panelButton->state == 1) {
 			inventoryChangePos(panelButton->id);
 		}
@@ -2150,7 +2150,7 @@ void Interface::drawInventory() {
 
 void Interface::setVerbState(int verb, int state) {
 	PanelButton * panelButton = getPanelButtonByVerbType(verb);
-	if (panelButton == NULL) return;
+	if (panelButton == nullptr) return;
 	if (state == 2) {
 		state = (_mainPanel.currentButton == panelButton) ? 1 : 0;
 	}
@@ -2671,7 +2671,7 @@ void Interface::handleConverseUpdate(const Point& mousePoint) {
 	changed = last != _conversePanel.currentButton;
 
 
-	if (_conversePanel.currentButton == NULL) {
+	if (_conversePanel.currentButton == nullptr) {
 		_conversePos = -1;
 		if (changed) {
 			draw();
@@ -2695,7 +2695,7 @@ void Interface::handleConverseUpdate(const Point& mousePoint) {
 void Interface::handleConverseClick(const Point& mousePoint) {
 	_conversePanel.currentButton = converseHitTest(mousePoint);
 
-	if (_conversePanel.currentButton == NULL) {
+	if (_conversePanel.currentButton == nullptr) {
 		return;
 	}
 
diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index fa72abcbee..e43463b65b 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -103,7 +103,7 @@ int Scene::ITEStartProc() {
 	firstScene.loadFlag = kLoadBySceneNumber;
 	firstScene.sceneDescriptor = _vm->getStartSceneNumber();
 	firstScene.sceneSkipTarget = true;
-	firstScene.sceneProc = NULL;
+	firstScene.sceneProc = nullptr;
 	firstScene.transitionType = kTransitionFade;
 	firstScene.actorsEntrance = 0;
 	firstScene.chapter = -1;
@@ -257,7 +257,7 @@ EventColumns *Scene::queueCredits(int delta_time, int duration, int n_credits, c
 	TextListEntry textEntry;
 	TextListEntry *entry;
 	Event event;
-	EventColumns *eventColumns = NULL;
+	EventColumns *eventColumns = nullptr;
 
 	textEntry.knownColor = (_vm->getPlatform() == Common::kPlatformPC98) ? kKnownColorBrightWhite : kKnownColorSubtitleTextColor;
 	textEntry.effectKnownColor = (_vm->getPlatform() == Common::kPlatformPC98) ? kKnownColorVerbTextShadow : kKnownColorTransparent;
@@ -394,7 +394,7 @@ int Scene::ITEIntroAnimProc(int param) {
 
 int Scene::ITEIntroCaveCommonProc(int param, int caveScene) {
 	Event event;
-	EventColumns *eventColumns = NULL;
+	EventColumns *eventColumns = nullptr;
 	const IntroDialogue *dialogue;
 
 	int lang = 0;
@@ -476,7 +476,7 @@ int Scene::ITEIntroCaveCommonProc(int param, int caveScene) {
 
 int Scene::ITEIntroCaveDemoProc(int param) {
 	Event event;
-	EventColumns *eventColumns = NULL;
+	EventColumns *eventColumns = nullptr;
 
 	switch (param) {
 	case SCENE_BEGIN:
diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp
index b820a7e1cb..e7bb97fe9f 100644
--- a/engines/saga/isomap.cpp
+++ b/engines/saga/isomap.cpp
@@ -369,7 +369,7 @@ int16 IsoMap::findMulti(int16 tileIndex, int16 absU, int16 absV, int16 absH) {
 void IsoMap::draw() {
 	_tileClip = _vm->_scene->getSceneClip();
 	_vm->_gfx->drawRect(_tileClip, 0);
-	drawTiles(NULL);
+	drawTiles(nullptr);
 }
 
 void IsoMap::setMapPosition(int x, int y) {
@@ -465,7 +465,7 @@ void IsoMap::drawTiles(const Location *location) {
 				metaTileIndex = _tileMap.tilePlatforms[uc][vc];
 			}
 
-			if (location != NULL) {
+			if (location != nullptr) {
 				rLocation.u() = location->u() - (u2 << 7);
 				rLocation.v() = location->v() - (v2 << 7);
 				rLocation.z = location->z;
@@ -510,7 +510,7 @@ void IsoMap::drawTiles(const Location *location) {
 				metaTileIndex = _tileMap.tilePlatforms[uc][vc];
 			}
 
-			if (location != NULL) {
+			if (location != nullptr) {
 				rLocation.u() = location->u() - (u2 << 7);
 				rLocation.v() = location->v() - (v2 << 7);
 				rLocation.z = location->z;
@@ -678,7 +678,7 @@ void IsoMap::drawPlatform(uint16 platformIndex, const Point &point, int16 absU,
 						tileIndex = findMulti(tileIndex, absU + u, absV + v, absH);
 					}
 
-					drawTile(tileIndex, s, NULL);
+					drawTile(tileIndex, s, nullptr);
 				}
 			}
 		}
@@ -727,7 +727,7 @@ void IsoMap::drawTile(uint16 tileIndex, const Point &point, const Location *loca
 		return;
 	}
 
-	if (location != NULL) {
+	if (location != nullptr) {
 		if (location->z <= -16) {
 			if (location->z <= -48) {
 				if (location->u() < -THRESH8 || location->v() < -THRESH8) {
@@ -1052,7 +1052,7 @@ IsoTileData *IsoMap::getTile(int16 u, int16 v, int16 z) {
 	tileIndex = getTileIndex(u, v, z);
 
 	if (tileIndex == 0) {
-		return NULL;
+		return nullptr;
 	}
 
 	if (tileIndex & SAGA_MULTI_TILE) {
@@ -1257,35 +1257,35 @@ bool IsoMap::findNearestChasm(int16 &u0, int16 &v0, uint16 &direction) {
 	v = v0;
 
 	for (i = 1; i < 5; i++) {
-		if (getTile(u - i, v, 6) == NULL) {
+		if (getTile(u - i, v, 6) == nullptr) {
 			u0 = u - i - 1;
 			v0 = v;
 			direction = kDirDownLeft;
 			return true;
 		}
 
-		if (getTile(u, v - i, 6) == NULL) {
+		if (getTile(u, v - i, 6) == nullptr) {
 			u0 = u;
 			v0 = v - i - 1;
 			direction = kDirDownRight;
 			return true;
 		}
 
-		if (getTile(u - i, v - i, 6) == NULL) {
+		if (getTile(u - i, v - i, 6) == nullptr) {
 			u0 = u - i - 1;
 			v0 = v - i - 1;
 			direction = kDirDown;
 			return true;
 		}
 
-		if (getTile(u + i, v - i, 6) == NULL) {
+		if (getTile(u + i, v - i, 6) == nullptr) {
 			u0 = u + i + 1;
 			v0 = v - i - 1;
 			direction = kDirDownRight;
 			return true;
 		}
 
-		if (getTile(u - i, v + i, 6) == NULL) {
+		if (getTile(u - i, v + i, 6) == nullptr) {
 			u0 = u + i + 1;
 			v0 = v - i - 1;
 			direction = kDirLeft;
@@ -1294,21 +1294,21 @@ bool IsoMap::findNearestChasm(int16 &u0, int16 &v0, uint16 &direction) {
 	}
 
 	for (i = 1; i < 5; i++) {
-		if (getTile(u + i, v, 6) == NULL) {
+		if (getTile(u + i, v, 6) == nullptr) {
 			u0 = u + i + 1;
 			v0 = v;
 			direction = kDirUpRight;
 			return true;
 		}
 
-		if (getTile(u, v + i, 6) == NULL) {
+		if (getTile(u, v + i, 6) == nullptr) {
 			u0 = u;
 			v0 = v + i + 1;
 			direction = kDirUpLeft;
 			return true;
 		}
 
-		if (getTile(u + i, v + i, 6) == NULL) {
+		if (getTile(u + i, v + i, 6) == nullptr) {
 			u0 = u + i + 1;
 			v0 = v + i + 1;
 			direction = kDirUp;
@@ -1370,7 +1370,7 @@ void IsoMap::findDragonTilePath(ActorData* actor, const Location &start, const L
 			}
 
 			tile = getTile(u1, v1, _platformHeight);
-			if (tile != NULL) {
+			if (tile != nullptr) {
 				mask = tile->terrainMask;
 				if (((mask != 0     ) && (tile->getFGDAttr() >= kTerrBlock)) ||
 				    ((mask != 0xFFFF) && (tile->getBGDAttr() >= kTerrBlock))) {
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index e38dce62bb..079df28a2d 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -48,9 +48,9 @@ namespace Saga {
 
 const uint8 Music::MT32_GOODBYE_MSG[] = { 0x47, 0x6F, 0x6F, 0x64, 0x62, 0x79, 0x65, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
 
-Music::Music(SagaEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _parser(0), _driver(0), _driverPC98(0), _musicContext(0) {
+Music::Music(SagaEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _parser(nullptr), _driver(nullptr), _driverPC98(nullptr), _musicContext(nullptr) {
 	_currentVolume = 0;
-	_currentMusicBuffer = NULL;
+	_currentMusicBuffer = nullptr;
 
 	if (_vm->getPlatform() == Common::kPlatformPC98) {
 		_musicType = _driverType = MT_PC98;
@@ -190,7 +190,7 @@ Music::~Music() {
 		delete _parser;
 	}
 	if (_driver) {
-		_driver->setTimerCallback(0, 0);
+		_driver->setTimerCallback(nullptr, nullptr);
 		_driver->close();
 		delete _driver;
 	}
@@ -323,7 +323,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
 	if (_parser) {
 		_parser->unloadMusic();
 		delete _parser;
-		_parser = 0;
+		_parser = nullptr;
 	}
 	if (_driverPC98)
 		_driverPC98->reset();
@@ -344,7 +344,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
 }
 
 bool Music::playDigital(uint32 resourceId, MusicFlags flags) {
-	Audio::SeekableAudioStream *audioStream = NULL;
+	Audio::SeekableAudioStream *audioStream = nullptr;
 	uint32 loopStart = 0;
 	int realTrackNumber = 0;
 
@@ -360,7 +360,7 @@ bool Music::playDigital(uint32 resourceId, MusicFlags flags) {
 	char trackName[2][16];
 	sprintf(trackName[0], "track%d", realTrackNumber);
 	sprintf(trackName[1], "track%02d", realTrackNumber);
-	Audio::SeekableAudioStream *stream = 0;
+	Audio::SeekableAudioStream *stream = nullptr;
 	for (int i = 0; i < 2; ++i) {
 		stream = Audio::SeekableAudioStream::openStreamFile(trackName[i]);
 		if (stream) {
@@ -373,7 +373,7 @@ bool Music::playDigital(uint32 resourceId, MusicFlags flags) {
 
 	if (_vm->getGameId() == GID_ITE) {
 		if (resourceId >= 9 && resourceId <= 34) {
-			if (_digitalMusicContext != NULL) {
+			if (_digitalMusicContext != nullptr) {
 				loopStart = 0;
 				// Fix ITE sunstatm/sunspot score
 				if (resourceId == MUSIC_SUNSPOT)
@@ -484,7 +484,7 @@ void Music::playMidi(uint32 resourceId, MusicFlags flags) {
 
 		// Check if the game is using XMIDI or SMF music
 		if (!memcmp(_currentMusicBuffer->getBuffer(), "FORM", 4)) {
-			_parser = MidiParser::createParser_XMIDI(0, 0, 0);
+			_parser = MidiParser::createParser_XMIDI(nullptr, nullptr, 0);
 		} else {
 			_parser = MidiParser::createParser_SMF(0);
 		}
diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp
index 49a697dbd4..639c646c42 100644
--- a/engines/saga/resource.cpp
+++ b/engines/saga/resource.cpp
@@ -97,7 +97,7 @@ bool ResourceContext::loadResV1(uint32 contextOffset, uint32 contextSize) {
 }
 
 bool ResourceContext::load(SagaEngine *vm, Resource *resource) {
-	if (_fileName == NULL) // IHNM special case
+	if (_fileName == nullptr) // IHNM special case
 		return true;
 
 	if (!_file.open(_fileName))
@@ -328,7 +328,7 @@ void Resource::loadResource(ResourceContext *context, uint32 resourceId, ByteArr
 	// ITE uses several patch files which are loaded and then not needed
 	// anymore (as they're in memory), so close them here. IHNM uses only
 	// 1 patch file, which is reused, so don't close it
-	if (resourceData->patchData != NULL && _vm->getGameId() == GID_ITE)
+	if (resourceData->patchData != nullptr && _vm->getGameId() == GID_ITE)
 		file->close();
 }
 
@@ -339,7 +339,7 @@ ResourceContext *Resource::getContext(uint16 fileType, int serial) {
 			return context;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 } // End of namespace Saga
diff --git a/engines/saga/resource_rsc.cpp b/engines/saga/resource_rsc.cpp
index aaec90e655..c533c03489 100644
--- a/engines/saga/resource_rsc.cpp
+++ b/engines/saga/resource_rsc.cpp
@@ -100,7 +100,7 @@ void ResourceContext_RSC::processPatches(Resource *resource, const GamePatchDesc
 						resourceData->patchData->_patchFile->close();
 					} else {
 						delete resourceData->patchData;
-						resourceData->patchData = NULL;
+						resourceData->patchData = nullptr;
 					}
 				}
 			}
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 9835eda66a..a74c29898a 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -140,7 +140,7 @@ void SagaEngine::fillSaveList() {
 		slotNumber = atoi(slot);
 		if (slotNumber >= 0 && slotNumber < MAX_SAVES) {
 			name = calcSaveFileName(slotNumber);
-			if ((in = _saveFileMan->openForLoading(name)) != NULL) {
+			if ((in = _saveFileMan->openForLoading(name)) != nullptr) {
 				_saveHeader.type = in->readUint32BE();
 				_saveHeader.size = in->readUint32LE();
 				_saveHeader.version = in->readUint32LE();
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 1823d4886b..ae0c473bd8 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -141,7 +141,7 @@ Scene::Scene(SagaEngine *vm) : _vm(vm) {
 
 	// Load scene module resource context
 	_sceneContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
-	if (_sceneContext == NULL) {
+	if (_sceneContext == nullptr) {
 		error("Scene::Scene() scene context not found");
 	}
 
@@ -201,7 +201,7 @@ Scene::Scene(SagaEngine *vm) : _vm(vm) {
 	_sceneResourceId = 0;
 	_inGame = false;
 	_sceneDescription.reset();
-	_sceneProc = NULL;
+	_sceneProc = nullptr;
 	_objectMap = new ObjectMap(_vm);
 	_actionMap = new ObjectMap(_vm);
 }
@@ -475,7 +475,7 @@ void Scene::changeScene(int16 sceneNumber, int actorsEntrance, SceneTransitionTy
 	sceneParams.loadFlag = kLoadBySceneNumber;
 	sceneParams.sceneDescriptor = sceneNumber;
 	sceneParams.transitionType = transitionType;
-	sceneParams.sceneProc = NULL;
+	sceneParams.sceneProc = nullptr;
 	sceneParams.sceneSkipTarget = false;
 	sceneParams.chapter = chapter;
 
@@ -680,7 +680,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) {
 
 	_sceneLoaded = true;
 
-	eventColumns = NULL;
+	eventColumns = nullptr;
 
 	if (loadSceneParams.transitionType == kTransitionFade) {
 
@@ -761,7 +761,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) {
 		_vm->_events->chain(eventColumns, event);
 	}
 
-	if (loadSceneParams.sceneProc == NULL) {
+	if (loadSceneParams.sceneProc == nullptr) {
 		if (!_inGame && _vm->getGameId() == GID_ITE) {
 			_inGame = true;
 			_vm->_interface->setMode(kPanelMain);
@@ -905,7 +905,7 @@ void Scene::loadSceneResourceList(uint32 resourceId, SceneResourceDataArray &res
 void Scene::processSceneResources(SceneResourceDataArray &resourceList) {
 	ByteArray resourceData;
 	const byte *palPointer;
-	SAGAResourceTypes *types = 0;
+	SAGAResourceTypes *types = nullptr;
 	int typesCount = 0;
 	SAGAResourceTypes resType;
 
@@ -1096,7 +1096,7 @@ void Scene::endScene() {
 
 	debug(3, "Ending scene...");
 
-	if (_sceneProc != NULL) {
+	if (_sceneProc != nullptr) {
 		_sceneProc(SCENE_END, this);
 	}
 
diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp
index d468653d48..6a570b9561 100644
--- a/engines/saga/script.cpp
+++ b/engines/saga/script.cpp
@@ -53,7 +53,7 @@ SAGA1Script::SAGA1Script(SagaEngine *vm) : Script(vm) {
 	//initialize member variables
 	_abortEnabled = true;
 	_skipSpeeches = false;
-	_conversingThread = NULL;
+	_conversingThread = nullptr;
 	_firstObjectSet = false;
 	_secondObjectNeeded = false;
 	_pendingVerb = getVerbType(kVerbNone);
@@ -69,12 +69,12 @@ SAGA1Script::SAGA1Script(SagaEngine *vm) : Script(vm) {
 	debug(8, "Initializing scripting subsystem");
 	// Load script resource file context
 	_scriptContext = _vm->_resource->getContext(GAME_SCRIPTFILE);
-	if (_scriptContext == NULL) {
+	if (_scriptContext == nullptr) {
 		error("Script::Script() script context not found");
 	}
 
 	resourceContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
-	if (resourceContext == NULL) {
+	if (resourceContext == nullptr) {
 		error("Script::Script() resource context not found");
 	}
 
@@ -1196,7 +1196,7 @@ void Script::doVerb() {
 			scriptModuleNumber = _vm->_scene->getScriptModuleNumber();
 			hitZone = _vm->_scene->_objectMap->getHitZone(objectIdToIndex(_pendingObject[0]));
 
-			if (hitZone == NULL)
+			if (hitZone == nullptr)
 				return;
 
 			if ((hitZone->getFlags() & kHitZoneExit) == 0) {
@@ -1373,7 +1373,7 @@ void Script::playfieldClick(const Point& mousePoint, bool leftButton) {
 	}
 
 
-	hitZone = NULL;
+	hitZone = nullptr;
 
 	if (objectTypeId(_pendingObject[0]) == kGameObjectHitZone) {
 		 hitZone = _vm->_scene->_objectMap->getHitZone(objectIdToIndex(_pendingObject[0]));
@@ -1383,7 +1383,7 @@ void Script::playfieldClick(const Point& mousePoint, bool leftButton) {
 		}
 	}
 
-	if (hitZone != NULL) {
+	if (hitZone != nullptr) {
 		if (_vm->getGameId() == GID_ITE) {
 			if (hitZone->getFlags() & kHitZoneNoWalk) {
 				_vm->_actor->actorFaceTowardsPoint(ID_PROTAG, pickLocation);
@@ -1515,7 +1515,7 @@ void Script::whichObject(const Point& mousePoint) {
 	newRightButtonVerb = getVerbType(kVerbNone);
 
 	// _protagonist can be null while loading a game from the command line
-	if (_vm->_actor->_protagonist == NULL)
+	if (_vm->_actor->_protagonist == nullptr)
 		return;
 
 	if (_vm->_actor->_protagonist->_currentAction != kActionWalkDir) {
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index 349c8e80ca..4d705ad088 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -302,7 +302,7 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) {
 			else
 				hitZone = _vm->_scene->_actionMap->getHitZone(objectIdToIndex(objectId));
 
-			if (hitZone == NULL)
+			if (hitZone == nullptr)
 				return;
 
 			scriptEntryPointNumber = hitZone->getScriptNumber();
@@ -628,14 +628,14 @@ void Script::sfEnableZone(SCRIPTFUNC_PARAMS) {
 	else
 		hitZone = _vm->_scene->_actionMap->getHitZone(objectIdToIndex(objectId));
 
-	if (hitZone == NULL)
+	if (hitZone == nullptr)
 		return;
 
 	if (flag) {
 		hitZone->setFlag(kHitZoneEnabled);
 	} else {
 		hitZone->clearFlag(kHitZoneEnabled);
-		_vm->_actor->_protagonist->_lastZone = NULL;
+		_vm->_actor->_protagonist->_lastZone = nullptr;
 	}
 }
 
@@ -1530,7 +1530,7 @@ void Script::finishDialog(int strID, int replyID, int flags, int bitOffset) {
 		}
 	}
 
-	_conversingThread = NULL;
+	_conversingThread = nullptr;
 	wakeUpThreads(kWaitTypeDialogBegin);
 }
 
diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp
index bedac99a39..5474be3065 100644
--- a/engines/saga/sndres.cpp
+++ b/engines/saga/sndres.cpp
@@ -48,11 +48,11 @@ namespace Saga {
 #define RID_IHNM_SFX_LUT 265
 #define RID_IHNMDEMO_SFX_LUT 222
 
-SndRes::SndRes(SagaEngine *vm) : _vm(vm), _sfxContext(NULL), _voiceContext(NULL), _voiceSerial(-1) {
+SndRes::SndRes(SagaEngine *vm) : _vm(vm), _sfxContext(nullptr), _voiceContext(nullptr), _voiceSerial(-1) {
 
 	// Load sound module resource file contexts
 	_sfxContext = _vm->_resource->getContext(GAME_SOUNDFILE);
-	if (_sfxContext == NULL) {
+	if (_sfxContext == nullptr) {
 		error("SndRes::SndRes resource context not found");
 	}
 
@@ -125,8 +125,8 @@ void SndRes::setVoiceBank(int serial) {
 		return;
 
 	// Close previous voice bank file
-	if (_voiceContext != NULL) {
-		file = _voiceContext->getFile(NULL);
+	if (_voiceContext != nullptr) {
+		file = _voiceContext->getFile(nullptr);
 		if (file->isOpen()) {
 			file->close();
 		}
@@ -249,7 +249,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
 
 		// If patch data exists for sound resource 4 (used in ITE intro), don't treat this sound as compressed
 		// Patch data for this resource is in file p2_a.iaf or p2_a.voc
-		if (_vm->getGameId() == GID_ITE && resourceId == 4 && context->getResourceData(resourceId)->patchData != NULL)
+		if (_vm->getGameId() == GID_ITE && resourceId == 4 && context->getResourceData(resourceId)->patchData != nullptr)
 			uncompressedSound = true;
 
 		// FIXME: Currently, the SFX.RES file in IHNM cannot be compressed
@@ -285,7 +285,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
 		}
 	}
 
-	buffer.stream = 0;
+	buffer.stream = nullptr;
 
 	// Check for LE sounds
 	if (!context->isBigEndian())
@@ -409,7 +409,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
 	case kSoundFLAC: {
 		readS.skip(9); // skip sfx header
 
-		Audio::SeekableAudioStream *audStream = 0;
+		Audio::SeekableAudioStream *audStream = nullptr;
 		Common::SeekableReadStream *memStream = READ_STREAM(soundResourceLength - 9);
 
 		if (resourceType == kSoundMP3) {
@@ -445,7 +445,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
 
 	if (onlyHeader) {
 		delete buffer.stream;
-		buffer.stream = 0;
+		buffer.stream = nullptr;
 	}
 
 	return result;
diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp
index cbf0caf195..4ef40b7b7e 100644
--- a/engines/saga/sound.cpp
+++ b/engines/saga/sound.cpp
@@ -55,7 +55,7 @@ SndHandle *Sound::getHandle() {
 
 	error("Sound::getHandle(): Too many sound handles");
 
-	return NULL;	// for compilers that don't support NORETURN
+	return nullptr;	// for compilers that don't support NORETURN
 }
 
 void Sound::playSoundBuffer(Audio::SoundHandle *handle, const SoundBuffer &buffer, int volume,
diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp
index ae8ee9cd54..539685f0dc 100644
--- a/engines/saga/sprite.cpp
+++ b/engines/saga/sprite.cpp
@@ -44,7 +44,7 @@ Sprite::Sprite(SagaEngine *vm) : _vm(vm) {
 
 	// Load sprite module resource context
 	_spriteContext = _vm->_resource->getContext(GAME_RESOURCEFILE);
-	if (_spriteContext == NULL) {
+	if (_spriteContext == nullptr) {
 		error("Sprite::Sprite resource context not found");
 	}
 
@@ -178,7 +178,7 @@ void Sprite::getScaledSpriteBuffer(SpriteList &spriteList, uint spriteNumber, in
 			scaleBuffer(&spriteInfo->decodedBuffer.front(), spriteInfo->width, spriteInfo->height, scale, outLength);
 			buffer = &_decodeBuf.front();
 		} else {
-			buffer = NULL;
+			buffer = nullptr;
 		}
 	} else {
 		xAlign = spriteInfo->xAlign;
@@ -273,7 +273,7 @@ void Sprite::drawClip(const Point &spritePointer, int width, int height, const b
 }
 
 void Sprite::draw(SpriteList &spriteList, uint spriteNumber, const Point &screenCoord, int scale, bool clipToScene) {
-	const byte *spriteBuffer = NULL;
+	const byte *spriteBuffer = nullptr;
 	int width  = 0;
 	int height = 0;
 	int xAlign = 0;
@@ -289,7 +289,7 @@ void Sprite::draw(SpriteList &spriteList, uint spriteNumber, const Point &screen
 }
 
 void Sprite::draw(SpriteList &spriteList, uint spriteNumber, const Rect &screenRect, int scale, bool clipToScene) {
-	const byte *spriteBuffer = NULL;
+	const byte *spriteBuffer = nullptr;
 	int width  = 0;
 	int height = 0;
 	int xAlign = 0;
@@ -313,7 +313,7 @@ void Sprite::draw(SpriteList &spriteList, uint spriteNumber, const Rect &screenR
 }
 
 bool Sprite::hitTest(SpriteList &spriteList, uint spriteNumber, const Point &screenCoord, int scale, const Point &testPoint) {
-	const byte *spriteBuffer = NULL;
+	const byte *spriteBuffer = nullptr;
 	int i, j;
 	const byte *srcRowPointer;
 	int width  = 0;
@@ -340,7 +340,7 @@ bool Sprite::hitTest(SpriteList &spriteList, uint spriteNumber, const Point &scr
 }
 
 void Sprite::drawOccluded(SpriteList &spriteList, uint spriteNumber, const Point &screenCoord, int scale, int depth) {
-	const byte *spriteBuffer = NULL;
+	const byte *spriteBuffer = nullptr;
 	int x, y;
 	byte *destRowPointer;
 	const byte *sourceRowPointer;


Commit: f544cb934d7f222087aa8053f7a569fed0e31698
    https://github.com/scummvm/scummvm/commit/f544cb934d7f222087aa8053f7a569fed0e31698
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
SAGA2: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/saga2/actor.cpp
    engines/saga2/assign.cpp
    engines/saga2/audio.cpp
    engines/saga2/automap.cpp
    engines/saga2/band.cpp
    engines/saga2/button.cpp
    engines/saga2/calender.cpp
    engines/saga2/contain.cpp
    engines/saga2/detection.cpp
    engines/saga2/display.cpp
    engines/saga2/dispnode.cpp
    engines/saga2/document.cpp
    engines/saga2/effects.cpp
    engines/saga2/enchant.cpp
    engines/saga2/floating.cpp
    engines/saga2/gamemode.cpp
    engines/saga2/gdraw.cpp
    engines/saga2/gpointer.cpp
    engines/saga2/grequest.cpp
    engines/saga2/gtext.cpp
    engines/saga2/gtextbox.cpp
    engines/saga2/hresmgr.cpp
    engines/saga2/interp.cpp
    engines/saga2/magic.cpp
    engines/saga2/main.cpp
    engines/saga2/mission.cpp
    engines/saga2/modal.cpp
    engines/saga2/motion.cpp
    engines/saga2/msgbox.cpp
    engines/saga2/music.cpp
    engines/saga2/objects.cpp
    engines/saga2/objproto.cpp
    engines/saga2/panel.cpp
    engines/saga2/player.cpp
    engines/saga2/saga2.cpp
    engines/saga2/sagafunc.cpp
    engines/saga2/sensor.cpp
    engines/saga2/shorten.cpp
    engines/saga2/speech.cpp
    engines/saga2/spelcast.cpp
    engines/saga2/speldata.cpp
    engines/saga2/spellio.cpp
    engines/saga2/target.cpp
    engines/saga2/task.cpp
    engines/saga2/terrain.cpp
    engines/saga2/tileload.cpp
    engines/saga2/tilemode.cpp
    engines/saga2/timers.cpp
    engines/saga2/towerfta.cpp
    engines/saga2/uidialog.cpp
    engines/saga2/videobox.cpp
    engines/saga2/weapons.cpp


diff --git a/engines/saga2/actor.cpp b/engines/saga2/actor.cpp
index 16d230e9ad..d330d5a924 100644
--- a/engines/saga2/actor.cpp
+++ b/engines/saga2/actor.cpp
@@ -396,7 +396,7 @@ bool ActorProto::acceptDamageAction(
 		possessorID = GameObject::objectAddress(enactor)->possessor();
 		enactorPtr =    possessorID != Nothing
 		                ? (Actor *)GameObject::objectAddress(possessorID)
-		                :   NULL;
+		                :   nullptr;
 	}
 
 	if (vitality > 0) {
@@ -406,7 +406,7 @@ bool ActorProto::acceptDamageAction(
 		            || (damageScore > 2 && (int16)g_vm->_rnd->getRandomNumber(vitality - 1) < (damageScore * 2))))
 			makeGruntSound(gruntStyle, al);
 
-		if (enactorPtr != NULL) {
+		if (enactorPtr != nullptr) {
 			enactorPtr->handleSuccessfulStrike(
 			    a,
 			    damageScore < vitality ? damageScore : vitality);
@@ -417,7 +417,7 @@ bool ActorProto::acceptDamageAction(
 		if (damageScore >= vitality) {
 			MotionTask::die(*a);
 			AddFactionTally(a->_faction, factionNumKills, 1);
-			if (enactorPtr != NULL)
+			if (enactorPtr != nullptr)
 				enactorPtr->handleSuccessfulKill(a);
 		} else
 			a->handleDamageTaken(damageScore);
@@ -531,7 +531,7 @@ bool ActorProto::acceptStrikeAction(
 	hitChance -= armorAttribs.defenseBonus;
 
 	//  Factor in dodging bonus if any
-	if (a->_moveTask != NULL && a->_moveTask->isDodging(enactorPtr))
+	if (a->_moveTask != nullptr && a->_moveTask->isDodging(enactorPtr))
 		hitChance -= dodgingBonus;
 
 	hitChance = MAX<uint8>(hitChance, 5);
@@ -544,7 +544,7 @@ bool ActorProto::acceptStrikeAction(
 		bool            blocked = false;
 
 		//  Test for block success
-		if (blockingObj != NULL) {
+		if (blockingObj != nullptr) {
 			hitChance =     avgHitChance
 			                + ((int)skillIndex
 			                   - (int)blockingObj->proto()->getSkillValue(dObj))
@@ -621,7 +621,7 @@ bool ActorProto::acceptInsertionAtAction(
 	GameObject  *dObjPtr = GameObject::objectAddress(dObj);
 	Actor       *a = (Actor *)dObjPtr;
 	GameObject  *itemPtr = GameObject::objectAddress(item);
-	GameObject  *extractedObj = NULL;
+	GameObject  *extractedObj = nullptr;
 	Location    oldLoc(itemPtr->getLocation(), itemPtr->IDParent());
 
 	bool        result;
@@ -632,7 +632,7 @@ bool ActorProto::acceptInsertionAtAction(
 		if (num == 0) return false;         //  If mergeing zero, then do nothing
 
 		extractedObj = itemPtr->extractMerged(itemPtr->getExtra() - num);
-		if (extractedObj == NULL)
+		if (extractedObj == nullptr)
 			return false;
 
 		extractedObj->move(oldLoc);
@@ -669,7 +669,7 @@ bool ActorProto::acceptInsertionAtAction(
 		result = true;
 	} else {
 		itemPtr->move(oldLoc);
-		if (extractedObj != NULL)
+		if (extractedObj != nullptr)
 			GameObject::mergeWith(extractedObj, itemPtr, extractedObj->getExtra());
 		result = false;
 	}
@@ -708,7 +708,7 @@ void ActorProto::initiateAttack(ObjectID attacker, ObjectID target) {
 	GameObject  *targetPtr = GameObject::objectAddress(target);
 
 	//  Start the attack motion
-	if (attackerPtr->_appearance != NULL) {
+	if (attackerPtr->_appearance != nullptr) {
 		if (attackerPtr->isActionAvailable(actionSwingHigh))
 			MotionTask::oneHandedSwing(*attackerPtr, *targetPtr);
 		else if (attackerPtr->isActionAvailable(actionTwoHandSwingHigh))
@@ -992,12 +992,12 @@ void Actor::init(
 	_poseInfo.leftObjectOffset.x = _poseInfo.leftObjectOffset.y = 0;
 	_poseInfo.rightObjectOffset.x = _poseInfo.rightObjectOffset.y = 0;
 
-	_appearance          = NULL;
+	_appearance          = nullptr;
 	_cycleCount          = 0;
 	_kludgeCount         = 0;
-	_moveTask            = NULL;
+	_moveTask            = nullptr;
 	_enchantmentFlags    = 0L;
-	_curTask             = NULL;
+	_curTask             = nullptr;
 	_currentGoal         = actorGoalFollowAssignment;
 	_deactivationCounter = 0;
 	_assignment = nullptr;
@@ -1013,12 +1013,12 @@ void Actor::init(
 	_effectiveImmunity   = 0;
 	_recPointsPerUpdate      = BASE_REC_RATE;
 	_currentRecoveryPoints   = 0;
-	_leader              = NULL;
-	_followers           = NULL;
+	_leader              = nullptr;
+	_followers           = nullptr;
 	_followersID = NoBand;
 	for (int i = 0; i < ARMOR_COUNT; i++)
 		_armorObjects[i] = Nothing;
-	_currentTarget       = NULL;
+	_currentTarget       = nullptr;
 	for (int i = 0; i < actorScriptVars; i++)
 		_scriptVar[i] = 0;
 
@@ -1096,9 +1096,9 @@ Actor::Actor() {
 
 Actor::Actor(const ResourceActor &res) : GameObject(res) {
 	//  Fixup the prototype pointer to point to an actor prototype
-	prototype   =   prototype != NULL
+	prototype   =   prototype != nullptr
 	                ? (ProtoObj *)g_vm->_actorProtos[getProtoNum()]
-	                :   NULL;
+	                :   nullptr;
 
 	//  Copy the resource fields
 	_faction             = res.faction;
@@ -1133,12 +1133,12 @@ Actor::Actor(const ResourceActor &res) : GameObject(res) {
 	_poseInfo.leftObjectOffset.x = _poseInfo.leftObjectOffset.y = 0;
 	_poseInfo.rightObjectOffset.x = _poseInfo.rightObjectOffset.y = 0;
 
-	_appearance          = NULL;
+	_appearance          = nullptr;
 	_cycleCount          = 0;
 	_kludgeCount         = 0;
-	_moveTask            = NULL;
+	_moveTask            = nullptr;
 	_enchantmentFlags    = 0L;
-	_curTask             = NULL;
+	_curTask             = nullptr;
 	_currentGoal         = actorGoalFollowAssignment;
 	_deactivationCounter = 0;
 	_assignment = nullptr;
@@ -1153,13 +1153,13 @@ Actor::Actor(const ResourceActor &res) : GameObject(res) {
 	_effectiveImmunity   = 0;
 	_recPointsPerUpdate      = BASE_REC_RATE;
 	_currentRecoveryPoints   = 0;
-	_leader              = NULL;
+	_leader              = nullptr;
 	_leaderID           = Nothing;
-	_followers           = NULL;
+	_followers           = nullptr;
 	_followersID = NoBand;
 	for (int i = 0; i < ARMOR_COUNT; i++)
 		_armorObjects[i] = Nothing;
-	_currentTarget       = NULL;
+	_currentTarget       = nullptr;
 	_currentTargetID    = Nothing;
 	for (int i = 0; i < actorScriptVars; i++)
 		_scriptVar[i] = 0;
@@ -1280,7 +1280,7 @@ Actor::Actor(Common::InSaveFile *in) : GameObject(in) {
 //	Destructor
 
 Actor::~Actor() {
-	if (_appearance != NULL) ReleaseActorAppearance(_appearance);
+	if (_appearance != nullptr) ReleaseActorAppearance(_appearance);
 
 	if (getAssignment())
 		delete getAssignment();
@@ -1306,7 +1306,7 @@ void Actor::write(Common::MemoryWriteStreamDynamic *out) {
 
 	//  Modify the protoype temporarily so the GameObject::write()
 	//  will store the index correctly
-	if (prototype != NULL)
+	if (prototype != nullptr)
 		prototype = g_vm->_objectProtos[getProtoNum()];
 
 	GameObject::write(out, false);
@@ -1350,16 +1350,16 @@ void Actor::write(Common::MemoryWriteStreamDynamic *out) {
 	out->writeSint16LE(_recPointsPerUpdate);
 	out->writeUint16LE(_currentRecoveryPoints);
 
-	_leaderID = (_leader != NULL) ? _leader->thisID() : Nothing;
+	_leaderID = (_leader != nullptr) ? _leader->thisID() : Nothing;
 
 	out->writeUint16LE(_leaderID);
 
-	_followersID = (_followers != NULL) ? getBandID(_followers) : NoBand;
+	_followersID = (_followers != nullptr) ? getBandID(_followers) : NoBand;
 
 	out->writeSint16LE(_followersID);
 	out->write(_armorObjects, ARMOR_COUNT * 2);
 
-	_currentTargetID = _currentTarget != NULL ? _currentTarget->thisID() : Nothing;
+	_currentTargetID = _currentTarget != nullptr ? _currentTarget->thisID() : Nothing;
 
 	out->writeUint16LE(_currentTargetID);
 	out->write(_scriptVar, sizeof(_scriptVar));
@@ -1398,10 +1398,10 @@ void Actor::write(Common::MemoryWriteStreamDynamic *out) {
 	debugC(4, kDebugSaveload, "... _effectiveImmunity = %d", _effectiveImmunity);
 	debugC(4, kDebugSaveload, "... _recPointsPerUpdate = %d", _recPointsPerUpdate);
 	debugC(4, kDebugSaveload, "... _currentRecoveryPoints = %d", _currentRecoveryPoints);
-	debugC(4, kDebugSaveload, "... _leaderID = %d", _leader != NULL ? _leader->thisID() : Nothing);
-	debugC(4, kDebugSaveload, "... _followersID = %d", _followers != NULL ? getBandID(_followers) : NoBand);
+	debugC(4, kDebugSaveload, "... _leaderID = %d", _leader != nullptr ? _leader->thisID() : Nothing);
+	debugC(4, kDebugSaveload, "... _followersID = %d", _followers != nullptr ? getBandID(_followers) : NoBand);
 //	debugC(4, kDebugSaveload, "... armorObjects = %d", armorObjects);
-	debugC(4, kDebugSaveload, "... _currentTargetID = %d", _currentTarget != NULL ? _currentTarget->thisID() : Nothing);
+	debugC(4, kDebugSaveload, "... _currentTargetID = %d", _currentTarget != nullptr ? _currentTarget->thisID() : Nothing);
 //	debugC(4, kDebugSaveload, "... scriptVar = %d", scriptVar);
 }
 
@@ -1478,34 +1478,34 @@ void Actor::deleteActor() {
 	}
 
 	//  Kill task
-	if (_curTask != NULL) {
+	if (_curTask != nullptr) {
 		_curTask->abortTask();
 		delete _curTask;
-		_curTask = NULL;
+		_curTask = nullptr;
 	}
 
 	//  Kill motion task
-	if (_moveTask != NULL)
+	if (_moveTask != nullptr)
 		_moveTask->remove();
 
 	//  If banded, remove from band
-	if (_leader != NULL) {
+	if (_leader != nullptr) {
 		assert(isActor(_leader));
 
 		_leader->removeFollower(this);
-		_leader = NULL;
-	} else if (_followers != NULL) {
+		_leader = nullptr;
+	} else if (_followers != nullptr) {
 		int16       i;
 
 		for (i = 0; i < _followers->size(); i++) {
 			Actor   *follower = (*_followers)[i];
 
-			follower->_leader = NULL;
+			follower->_leader = nullptr;
 			follower->evaluateNeeds();
 		}
 
 		delete _followers;
-		_followers = NULL;
+		_followers = nullptr;
 	}
 
 	//  Place in limbo
@@ -1520,7 +1520,7 @@ void Actor::deleteActor() {
 //	Cause the actor to stop his current motion task is he is interruptable
 
 void Actor::stopMoving() {
-	if (_moveTask != NULL && isInterruptable())
+	if (_moveTask != nullptr && isInterruptable())
 		_moveTask->remove();
 }
 
@@ -1543,22 +1543,22 @@ void Actor::die() {
 	runObjectMethod(dObj, Method_Actor_onDie, scf);
 
 	//  Kill task
-	if (_curTask != NULL) {
+	if (_curTask != nullptr) {
 		_curTask->abortTask();
 		delete _curTask;
-		_curTask = NULL;
+		_curTask = nullptr;
 	}
 
 	//  Kill motion task
-	if (_moveTask != NULL)
+	if (_moveTask != nullptr)
 		_moveTask->remove();
 
 	//  If banded, remove from band
-	if (_leader != NULL) {
+	if (_leader != nullptr) {
 		assert(isActor(_leader));
 
 		_leader->removeFollower(this);
-		_leader = NULL;
+		_leader = nullptr;
 	}
 
 	if (actorToPlayerID(this, playerID))
@@ -1641,22 +1641,22 @@ void Actor::deactivateActor() {
 	debugC(1, kDebugActors, "Actors: De-activated %d  (%s)", thisID() - 32768, objName());
 
 	//  Kill task
-	if (_curTask != NULL) {
+	if (_curTask != nullptr) {
 		_curTask->abortTask();
 		delete _curTask;
-		_curTask = NULL;
+		_curTask = nullptr;
 	}
 
 	//  Kill motion task
-	if (_moveTask != NULL)
+	if (_moveTask != nullptr)
 		_moveTask->remove();
 
 	//  If banded, remove from band
-	if (_leader != NULL) {
+	if (_leader != nullptr) {
 		assert(isActor(_leader));
 
 		_leader->removeFollower(this);
-		_leader = NULL;
+		_leader = nullptr;
 	}
 
 	//  Temporary actors get deleted upon deactivation
@@ -1697,14 +1697,14 @@ void Actor::lobotomize() {
 	scriptCallFrame scf;
 
 	//  Kill task
-	if (_curTask != NULL) {
+	if (_curTask != nullptr) {
 		_curTask->abortTask();
 		delete _curTask;
-		_curTask = NULL;
+		_curTask = nullptr;
 	}
 
 	//  Kill motion task
-	if (_moveTask != NULL)
+	if (_moveTask != nullptr)
 		_moveTask->remove();
 
 	_flags |= lobotomized;
@@ -1824,26 +1824,26 @@ GameObject *Actor::offensiveObject() {
 //	and optionally their scondary defensive object
 
 void Actor::defensiveObject(GameObject **priPtr, GameObject **secPtr) {
-	assert(priPtr != NULL);
+	assert(priPtr != nullptr);
 
 	GameObject      *leftHandObjPtr,
 	                *rightHandObjPtr,
-	                *primary = NULL,
-	                 *secondary = NULL;
+	                *primary = nullptr,
+	                 *secondary = nullptr;
 
 	//  Get a pointer to the left hand object
 	leftHandObjPtr =    _leftHandObject != Nothing
 	                    ? (assert(isObject(_leftHandObject))
 	                       ,   GameObject::objectAddress(_leftHandObject))
-	                    :   NULL;
+	                    :   nullptr;
 
 	//  Get a pointer to the right hand object
 	rightHandObjPtr =   _rightHandObject != Nothing
 	                    ? (assert(isObject(_rightHandObject))
 	                       ,   GameObject::objectAddress(_rightHandObject))
-	                    :   NULL;
+	                    :   nullptr;
 
-	if (leftHandObjPtr != NULL) {
+	if (leftHandObjPtr != nullptr) {
 		GameObject      **rightHandObjDest;
 
 		if (leftHandObjPtr->proto()->canBlock()) {
@@ -1855,11 +1855,11 @@ void Actor::defensiveObject(GameObject **priPtr, GameObject **secPtr) {
 			//  Right hand object may be primary
 			rightHandObjDest = &primary;
 
-		if (rightHandObjPtr != NULL && rightHandObjPtr->proto()->canBlock())
+		if (rightHandObjPtr != nullptr && rightHandObjPtr->proto()->canBlock())
 			//  Right hand object is defensive
 			*rightHandObjDest = rightHandObjPtr;
 	} else {
-		if (rightHandObjPtr != NULL && rightHandObjPtr->proto()->canBlock())
+		if (rightHandObjPtr != nullptr && rightHandObjPtr->proto()->canBlock())
 			//  Right hand object is primary defensive object
 			primary = rightHandObjPtr;
 	}
@@ -1867,7 +1867,7 @@ void Actor::defensiveObject(GameObject **priPtr, GameObject **secPtr) {
 	//  Return the primary pointer
 	*priPtr = primary;
 	//  Return the secondary pointer
-	if (secPtr != NULL) *secPtr = secondary;
+	if (secPtr != nullptr) *secPtr = secondary;
 }
 
 //-----------------------------------------------------------------------
@@ -1875,9 +1875,9 @@ void Actor::defensiveObject(GameObject **priPtr, GameObject **secPtr) {
 //	blocking, if any
 
 GameObject *Actor::blockingObject(Actor *attacker) {
-	return  _moveTask != NULL
+	return  _moveTask != nullptr
 	        ?   _moveTask->blockingObject(attacker)
-	        :   NULL;
+	        :   nullptr;
 }
 
 //-----------------------------------------------------------------------
@@ -1897,7 +1897,7 @@ void Actor::totalArmorAttributes(ArmorAttributes &armorAttribs) {
 		if (_armorObjects[i] != Nothing) {
 			ProtoObj    *armorProto = GameObject::protoAddress(_armorObjects[i]);
 
-			assert(armorProto != NULL);
+			assert(armorProto != nullptr);
 
 			armorAttribs.damageAbsorbtion += armorProto->damageAbsorbtion;
 			if (armorProto->damageDivider != 0)
@@ -1912,7 +1912,7 @@ void Actor::totalArmorAttributes(ArmorAttributes &armorAttribs) {
 
 bool Actor::inAttackRange(const TilePoint &tp) {
 	GameObject  *weapon = offensiveObject();
-	uint16      range = weapon != NULL ? weapon->proto()->maximumRange : 0;
+	uint16      range = weapon != nullptr ? weapon->proto()->maximumRange : 0;
 
 	return inRange(tp, MAX(range, (uint16)kDefaultReach));
 }
@@ -1923,7 +1923,7 @@ bool Actor::inAttackRange(const TilePoint &tp) {
 void Actor::attack(GameObject *target) {
 	GameObject  *weapon = offensiveObject();
 
-	if (weapon != NULL)
+	if (weapon != nullptr)
 		weapon->proto()->initiateAttack(thisID(), target->thisID());
 }
 
@@ -1968,7 +1968,7 @@ int16 Actor::offenseScore() {
 	int16           score = 0;
 	GameObject      *weapon = offensiveObject();
 
-	if (weapon != NULL) {
+	if (weapon != nullptr) {
 		ProtoObj    *proto = weapon->proto();
 
 		score += proto->weaponDamage + (proto->maximumRange / kTileUVSize);
@@ -2001,7 +2001,7 @@ int16 Actor::defenseScore() {
 
 	defensiveObject(&shield);
 
-	if (shield != NULL) {
+	if (shield != nullptr) {
 		ProtoObj    *proto = shield->proto();
 
 		score += proto->defenseBonus;
@@ -2046,7 +2046,7 @@ int16 Actor::setAction(int16 newState, int16 flags) {
 //  RLockHandle( appearance->animations );
 //  RUnlockHandle( appearance->animations );
 
-	if (_appearance == NULL) return 0;
+	if (_appearance == nullptr) return 0;
 
 	//  If this animation has no frames, then return false
 	anim = _appearance->animation(newState);
@@ -2129,7 +2129,7 @@ bool Actor::nextAnimationFrame() {
 //  RLockHandle( appearance->animations );
 //  RUnlockHandle( appearance->animations );
 
-	if (_appearance == NULL) {
+	if (_appearance == nullptr) {
 		if (_animationFlags & animateOnHold) {
 			return false;
 		} else if (_animationFlags & animateRepeat) {
@@ -2219,12 +2219,12 @@ void Actor::dropInventory() {
 
 	for (obj =  _data.childID != Nothing
 	            ?   GameObject::objectAddress(_data.childID)
-	            :   NULL;
-	        obj != NULL;
+	            :   nullptr;
+	        obj != nullptr;
 	        obj = nextObj) {
 		nextObj =   obj->IDNext() != Nothing
 		            ?   GameObject::objectAddress(obj->IDNext())
-		            :   NULL;
+		            :   nullptr;
 
 		//  Delete intangible objects and drop tangible objects
 		if (obj->containmentSet() & ProtoObj::isIntangible)
@@ -2312,9 +2312,9 @@ void Actor::updateAppearance(int32) {
 			if (_flags & fightStance) {
 				GameObject      *weapon = offensiveObject();
 
-				if (weapon == this) weapon = NULL;
+				if (weapon == this) weapon = nullptr;
 
-				if (weapon != NULL) {
+				if (weapon != nullptr) {
 					ProtoObj        *weaponProto = weapon->proto();
 
 					setAction(weaponProto->fightStanceAction(thisID()), 0);
@@ -2394,10 +2394,10 @@ bool Actor::setAvailableAction(int16 action1, int16 action2, int16 action3, int1
 
 void Actor::setGoal(uint8 newGoal) {
 	if (_currentGoal != newGoal) {
-		if (_curTask != NULL) {
+		if (_curTask != nullptr) {
 			_curTask->abortTask();
 			delete _curTask;
-			_curTask = NULL;
+			_curTask = nullptr;
 		}
 
 		_currentGoal = newGoal;
@@ -2428,24 +2428,24 @@ void Actor::evaluateNeeds() {
 					if (isAggressive(playerID))
 						setGoal(actorGoalAttackEnemy);
 					else {
-						if (_leader != NULL && inBandingRange())
+						if (_leader != nullptr && inBandingRange())
 							setGoal(actorGoalAvoidEnemies);
 						else
 							setGoal(actorGoalPreserveSelf);
 					}
-				} else if (_leader != NULL && inBandingRange()) {
+				} else if (_leader != nullptr && inBandingRange()) {
 					setGoal(actorGoalFollowLeader);
 				} else {
 					setGoal(actorGoalFollowAssignment);
 				}
-			} else if (_leader != NULL && inBandingRange()) {
+			} else if (_leader != nullptr && inBandingRange()) {
 				setGoal(actorGoalFollowLeader);
 			} else {
 				setGoal(actorGoalFollowAssignment);
 			}
 		} else {
 			if (_disposition == dispositionEnemy
-			        &&  _appearance != NULL
+			        &&  _appearance != nullptr
 			        &&  !hasEffect(actorNotDefenseless)) {
 				GameObject              *obj;
 				bool                    foundWeapon = false;
@@ -2472,13 +2472,13 @@ void Actor::evaluateNeeds() {
 
 			if (_flags & afraid || hasEffect(actorFear) || hasEffect(actorRepelUndead)) {
 				setGoal(actorGoalPreserveSelf);
-			} else if (_leader != NULL && inBandingRange()) {
+			} else if (_leader != nullptr && inBandingRange()) {
 				setGoal(_leader->evaluateFollowerNeeds(this));
 			} else {
 				SenseInfo       info;
 
 				if (_disposition == dispositionEnemy
-				        && (getAssignment() == NULL
+				        && (getAssignment() == nullptr
 				            ||  canSenseProtaganist(
 				                info,
 				                maxSenseRange)
@@ -2508,10 +2508,10 @@ void Actor::updateState() {
 	if (_actionCounter != 0 && _actionCounter != maxuint8)
 		_actionCounter--;
 
-	if (_appearance != NULL
+	if (_appearance != nullptr
 	        &&  isDead()
 	        &&  isInterruptable()
-	        && (_moveTask == NULL
+	        && (_moveTask == nullptr
 	            ||  _moveTask->motionType != MotionTask::motionTypeDie)) {
 		int16       deadState = isActionAvailable(actionDead)
 		                        ?   actionDead
@@ -2530,7 +2530,7 @@ void Actor::updateState() {
 		if (_flags & specialAttack) {
 			_flags &= ~specialAttack;
 
-			if (_currentTarget != NULL) {
+			if (_currentTarget != nullptr) {
 				scriptCallFrame scf;
 				ObjectID        dObj = thisID();
 
@@ -2555,7 +2555,7 @@ void Actor::updateState() {
 
 			//  Iterate until there is no assignment, or the current
 			//  assignment is valid
-			while (assign != NULL && !assign->isValid()) {
+			while (assign != nullptr && !assign->isValid()) {
 				g_vm->_act->_updatesViaScript++;
 				scriptCallFrame scf;
 				ObjectID        dObj = thisID();
@@ -2582,9 +2582,9 @@ void Actor::updateState() {
 
 			//  If there is no assignment at this point, call the
 			//  schedule to setup a new assignment.
-			if (assign == NULL && _schedule != 0) {
+			if (assign == nullptr && _schedule != 0) {
 				g_vm->_act->_updatesViaScript++;
-				assert(_curTask == NULL);
+				assert(_curTask == nullptr);
 
 				scriptCallFrame scf;
 
@@ -2601,18 +2601,18 @@ void Actor::updateState() {
 			}
 
 			//  Have the assignment create a new task
-			if (assign != NULL && _curTask == NULL)
+			if (assign != nullptr && _curTask == nullptr)
 				_curTask = assign->createTask();
 		}
 		break;
 
 		case actorGoalPreserveSelf:
 
-			if (_leader != NULL || _followers != NULL)
+			if (_leader != nullptr || _followers != nullptr)
 				disband();
 
-			if (_curTask == NULL) {
-				if ((_curTask = newTaskStack(this)) != NULL) {
+			if (_curTask == nullptr) {
+				if ((_curTask = newTaskStack(this)) != nullptr) {
 					Task    *task = new GoAwayFromActorTask(
 					                    _curTask,
 					                    ActorPropertyTarget(
@@ -2621,11 +2621,11 @@ void Actor::updateState() {
 					                        :   actorPropIDEnemy),
 					                    true);
 
-					if (task != NULL)
+					if (task != nullptr)
 						_curTask->setTask(task);
 					else {
 						delete _curTask;
-						_curTask = NULL;
+						_curTask = nullptr;
 					}
 				}
 			}
@@ -2633,9 +2633,9 @@ void Actor::updateState() {
 
 		case actorGoalAttackEnemy:
 
-			if (_curTask == NULL) {
-				if ((_curTask = newTaskStack(this)) != NULL) {
-					uint8   disp =  _leader != NULL
+			if (_curTask == nullptr) {
+				if ((_curTask = newTaskStack(this)) != nullptr) {
+					uint8   disp =  _leader != nullptr
 					                ?   _leader->_disposition
 					                :   _disposition;
 
@@ -2646,11 +2646,11 @@ void Actor::updateState() {
 					                        ?   actorPropIDPlayerActor
 					                        :   actorPropIDEnemy));
 
-					if (task != NULL)
+					if (task != nullptr)
 						_curTask->setTask(task);
 					else {
 						delete _curTask;
-						_curTask = NULL;
+						_curTask = nullptr;
 					}
 				}
 			}
@@ -2659,9 +2659,9 @@ void Actor::updateState() {
 		case actorGoalFollowLeader:
 
 			assert(isActor(_leader));
-			assert(_followers == NULL);
+			assert(_followers == nullptr);
 
-			if (_curTask == NULL)
+			if (_curTask == nullptr)
 				_curTask = _leader->createFollowerTask(this);
 
 			break;
@@ -2669,17 +2669,17 @@ void Actor::updateState() {
 		case actorGoalAvoidEnemies:
 
 			assert(isActor(_leader));
-			assert(_followers == NULL);
+			assert(_followers == nullptr);
 
-			if (_curTask == NULL) {
-				if ((_curTask = newTaskStack(this)) != NULL) {
+			if (_curTask == nullptr) {
+				if ((_curTask = newTaskStack(this)) != nullptr) {
 					Task    *task = new BandAndAvoidEnemiesTask(_curTask);
 
-					if (task != NULL)
+					if (task != nullptr)
 						_curTask->setTask(task);
 					else {
 						delete _curTask;
-						_curTask = NULL;
+						_curTask = nullptr;
 					}
 				}
 			}
@@ -2694,7 +2694,7 @@ void Actor::updateState() {
 void Actor::handleTaskCompletion(TaskResult result) {
 	//  The task is done, get rid of it
 	delete _curTask;
-	_curTask = NULL;
+	_curTask = nullptr;
 
 	switch (_currentGoal) {
 	case actorGoalFollowAssignment: {
@@ -2702,7 +2702,7 @@ void Actor::handleTaskCompletion(TaskResult result) {
 
 		//  If we've gotten to this point, there had better be an
 		//  assignment, or something is amiss
-		assert(assign != NULL);
+		assert(assign != nullptr);
 
 		//  Notify the assignment
 		assign->handleTaskCompletion(result);
@@ -2777,9 +2777,9 @@ void Actor::handleDamageTaken(uint8 damage) {
 				moraleBase -= moraleBase / 2;
 
 			//  Determine how many fellow band members this actor has.
-			if (_leader != NULL)
+			if (_leader != nullptr)
 				fellowBandMembers = _leader->_followers->size();
-			else if (_followers != NULL)
+			else if (_followers != nullptr)
 				fellowBandMembers = _followers->size();
 			else
 				fellowBandMembers = 0;
@@ -2843,7 +2843,7 @@ void Actor::handleSuccessfulKill(Actor *target) {
 		player->vitalityAdvance(points / ratio);
 
 		aStr =  target->getNameIndex() == 0
-		        ?   strchr(vowels, toupper(monsterName[0])) == NULL
+		        ?   strchr(vowels, toupper(monsterName[0])) == nullptr
 		        ?   "a "
 		        :   "an "
 		        :   "";
@@ -2898,13 +2898,13 @@ void Actor::evaluateMeleeAttack(Actor *attacker) {
 		//  objects
 		defensiveObject(&primary, &secondary);
 
-		canBlockWithPrimary =       primary != NULL
+		canBlockWithPrimary =       primary != nullptr
 		                            &&  canBlockWith(primary, relativeDir);
 
 		if (canBlockWithPrimary) {
 			bool            canBlockWithSecondary;
 
-			canBlockWithSecondary =     secondary != NULL
+			canBlockWithSecondary =     secondary != nullptr
 			                            &&  canBlockWith(
 			                                secondary,
 			                                relativeDir);
@@ -2918,9 +2918,9 @@ void Actor::evaluateMeleeAttack(Actor *attacker) {
 				defenseObj = primary;
 			}
 		} else
-			defenseObj = NULL;
+			defenseObj = nullptr;
 
-		if (defenseObj != NULL) {
+		if (defenseObj != nullptr) {
 			//  Start a defensive motion
 			defenseObj->proto()->initiateDefense(
 			    defenseObj->thisID(),
@@ -2939,26 +2939,26 @@ void Actor::evaluateMeleeAttack(Actor *attacker) {
 //	well.
 
 void Actor::bandWith(Actor *newLeader) {
-	assert(_leader == NULL);
+	assert(_leader == nullptr);
 
 	//  If the actor we're banding with is not the leader, then band
 	//  with his leader
-	if (newLeader->_leader != NULL) {
+	if (newLeader->_leader != nullptr) {
 		newLeader = newLeader->_leader;
-		assert(newLeader->_leader == NULL);
+		assert(newLeader->_leader == nullptr);
 	}
 
 	//  If this actor himself does not have followers then its really
 	//  simple, otherwise we need to band all of this actor's followers
 	//  with the new leader.
-	if (_followers == NULL) {
+	if (_followers == nullptr) {
 		if (newLeader->addFollower(this)) _leader = newLeader;
 	} else {
 		int16       i,
 		            oldFollowerCount = _followers->size();
 		Actor       **oldFollowers = new Actor * [oldFollowerCount];
 
-		if (oldFollowers != NULL) {
+		if (oldFollowers != nullptr) {
 			//  Copy the list followers
 			for (i = 0; i < oldFollowerCount; i++) {
 				oldFollowers[i] = (*_followers)[i];
@@ -2969,7 +2969,7 @@ void Actor::bandWith(Actor *newLeader) {
 			for (i = 0; i < oldFollowerCount; i++)
 				oldFollowers[i]->disband();
 
-			assert(_followers == NULL);
+			assert(_followers == nullptr);
 
 			//  Add this actor and all of the old followers to the new
 			//  leader's followers.
@@ -2991,23 +2991,23 @@ void Actor::bandWith(Actor *newLeader) {
 //	Simply causes this actor to be removed from his current band.
 
 void Actor::disband() {
-	if (_leader != NULL) {
+	if (_leader != nullptr) {
 		_leader->removeFollower(this);
-		_leader = NULL;
+		_leader = nullptr;
 
 		evaluateNeeds();
-	} else if (_followers != NULL) {
+	} else if (_followers != nullptr) {
 		int16       i;
 
 		for (i = 0; i < _followers->size(); i++) {
 			Actor   *follower = (*_followers)[i];
 
-			follower->_leader = NULL;
+			follower->_leader = nullptr;
 			follower->evaluateNeeds();
 		}
 
 		delete _followers;
-		_followers = NULL;
+		_followers = nullptr;
 	}
 }
 
@@ -3017,11 +3017,11 @@ void Actor::disband() {
 bool Actor::addFollower(Actor *newBandMember) {
 	//  The new band member should not be a leader of another band or
 	//  a follower of another leader
-	assert(newBandMember->_leader == NULL);
-	assert(newBandMember->_followers == NULL);
+	assert(newBandMember->_leader == nullptr);
+	assert(newBandMember->_followers == nullptr);
 
 	//  Allocate a new band, if needed
-	if (_followers == NULL && (_followers = new Band(this)) == NULL)
+	if (_followers == nullptr && (_followers = new Band(this)) == nullptr)
 		return false;
 
 	return _followers->add(newBandMember);
@@ -3032,14 +3032,14 @@ bool Actor::addFollower(Actor *newBandMember) {
 
 void Actor::removeFollower(Actor *bandMember) {
 	assert(bandMember->_leader == this);
-	assert(_followers != NULL);
+	assert(_followers != nullptr);
 
 	int16       i;
 
 	_followers->remove(bandMember);
 	if (_followers->size() == 0) {
 		delete _followers;
-		_followers = NULL;
+		_followers = nullptr;
 	} else {
 		uint16      moraleBonus = 0;
 
@@ -3077,16 +3077,16 @@ void Actor::removeFollower(Actor *bandMember) {
 TaskStack *Actor::createFollowerTask(Actor *bandMember) {
 	assert(bandMember->_leader == this);
 
-	TaskStack   *ts = NULL;
+	TaskStack   *ts = nullptr;
 
-	if ((ts = newTaskStack(bandMember)) != NULL) {
+	if ((ts = newTaskStack(bandMember)) != nullptr) {
 		Task    *task = new BandTask(ts);
 
-		if (task != NULL)
+		if (task != nullptr)
 			ts->setTask(task);
 		else {
 			delete ts;
-			ts = NULL;
+			ts = nullptr;
 		}
 	}
 
@@ -3116,7 +3116,7 @@ uint8 Actor::evaluateFollowerNeeds(Actor *follower) {
 //  Returns 0 if not moving, 1 if path being calculated,
 //  2 if path being followed.
 bool Actor::pathFindState() {
-	if (_moveTask == NULL)
+	if (_moveTask == nullptr)
 		return 0;
 	if (_moveTask->pathFindTask)
 		return 1;
@@ -3228,7 +3228,7 @@ void Actor::useKnowledge(scriptCallFrame &scf) {
 //	sense a protaganist within a specified range
 
 bool Actor::canSenseProtaganistIndirectly(SenseInfo &info, int16 range) {
-	if (_followers != NULL) {
+	if (_followers != nullptr) {
 		int         i;
 
 		for (i = 0; i < _followers->size(); i++) {
@@ -3248,7 +3248,7 @@ bool Actor::canSenseSpecificActorIndirectly(
     SenseInfo   &info,
     int16       range,
     Actor       *a) {
-	if (_followers != NULL) {
+	if (_followers != nullptr) {
 		int         i;
 
 		for (i = 0; i < _followers->size(); i++) {
@@ -3268,7 +3268,7 @@ bool Actor::canSenseSpecificObjectIndirectly(
     SenseInfo   &info,
     int16       range,
     ObjectID    obj) {
-	if (_followers != NULL) {
+	if (_followers != nullptr) {
 		int         i;
 
 		for (i = 0; i < _followers->size(); i++) {
@@ -3288,7 +3288,7 @@ bool Actor::canSenseActorPropertyIndirectly(
     SenseInfo           &info,
     int16               range,
     ActorPropertyID     prop) {
-	if (_followers != NULL) {
+	if (_followers != nullptr) {
 		int         i;
 
 		for (i = 0; i < _followers->size(); i++) {
@@ -3308,7 +3308,7 @@ bool Actor::canSenseObjectPropertyIndirectly(
     SenseInfo           &info,
     int16               range,
     ObjectPropertyID    prop) {
-	if (_followers != NULL) {
+	if (_followers != nullptr) {
 		int         i;
 
 		for (i = 0; i < _followers->size(); i++) {
@@ -3416,7 +3416,7 @@ void setCombatBehavior(bool enabled) {
 
 	g_vm->_act->_combatBehaviorEnabled = enabled;
 
-	for (player = iter.first(); player != NULL; player = iter.next())
+	for (player = iter.first(); player != nullptr; player = iter.next())
 		player->getActor()->evaluateNeeds();
 }
 
diff --git a/engines/saga2/assign.cpp b/engines/saga2/assign.cpp
index f0ba5a3c67..8c5d868cb5 100644
--- a/engines/saga2/assign.cpp
+++ b/engines/saga2/assign.cpp
@@ -69,11 +69,11 @@ ActorAssignment::~ActorAssignment() {
 
 	//  Determine if the actor has a task initiated by this assignment
 	if (a->_currentGoal == actorGoalFollowAssignment
-	        &&  a->_curTask != NULL) {
+	        &&  a->_curTask != nullptr) {
 		//  If so, abort it
 		a->_curTask->abortTask();
 		delete a->_curTask;
-		a->_curTask = NULL;
+		a->_curTask = nullptr;
 	}
 
 	a->_flags &= ~hasAssignment;
@@ -106,19 +106,19 @@ bool ActorAssignment::isValid() {
 //	Create a TaskStack for this actor and plug in the assignment's Task.
 
 TaskStack *ActorAssignment::createTask() {
-	if (!taskNeeded()) return NULL;
+	if (!taskNeeded()) return nullptr;
 
 	Actor       *a = getActor();
-	TaskStack   *ts = NULL;
+	TaskStack   *ts = nullptr;
 
-	if ((ts = newTaskStack(a)) != NULL) {
+	if ((ts = newTaskStack(a)) != nullptr) {
 		Task    *task = getTask(ts);
 
-		if (task != NULL)
+		if (task != nullptr)
 			ts->setTask(task);
 		else {
 			delete ts;
-			ts = NULL;
+			ts = nullptr;
 		}
 	}
 
@@ -700,7 +700,7 @@ AttendAssignment::AttendAssignment(Actor *a, Common::SeekableReadStream *stream)
 	objID = stream->readUint16LE();
 
 	//  Convert the object ID to an object pointer
-	_obj = objID != Nothing ? GameObject::objectAddress(objID) : NULL;
+	_obj = objID != Nothing ? GameObject::objectAddress(objID) : nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -721,7 +721,7 @@ void AttendAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
 	ObjectID    objID;
 
 	//  Convert the object pointer to an object ID
-	objID = _obj != NULL ? _obj->thisID() : Nothing;
+	objID = _obj != nullptr ? _obj->thisID() : Nothing;
 
 	//  Store the object ID
 	out->writeUint16LE(objID);
@@ -781,13 +781,13 @@ void readAssignment(Actor *a, Common::InSaveFile *in) {
 int32 assignmentArchiveSize(Actor *a) {
 	ActorAssignment     *assign = a->getAssignment();
 
-	return assign != NULL ? sizeof(int16) + assign->archiveSize() : 0;
+	return assign != nullptr ? sizeof(int16) + assign->archiveSize() : 0;
 }
 
 void writeAssignment(Actor *a, Common::MemoryWriteStreamDynamic *out) {
 	ActorAssignment *assign = a->getAssignment();
 
-	if (assign != NULL) {
+	if (assign != nullptr) {
 		out->writeSint16LE(assign->type());
 
 		assign->write(out);
diff --git a/engines/saga2/audio.cpp b/engines/saga2/audio.cpp
index f9e9fb8162..2f36349773 100644
--- a/engines/saga2/audio.cpp
+++ b/engines/saga2/audio.cpp
@@ -103,23 +103,23 @@ void startAudio() {
 	uint32 musicID = haveKillerSoundCard() ? goodMusicID : baseMusicID;
 
 	musicRes = soundResFile->newContext(musicID, "music resource");
-	if (musicRes == NULL)
+	if (musicRes == nullptr)
 		error("Musicians on Strike (No music resource context)!\n");
 
 	soundRes = soundResFile->newContext(soundID, "sound resource");
-	if (soundRes == NULL)
+	if (soundRes == nullptr)
 		error("No sound effect resource context!\n");
 
 	longRes = soundResFile->newContext(soundID, "long sound resource");
-	if (longRes == NULL)
+	if (longRes == nullptr)
 		error("No sound effect resource context!\n");
 
 	loopRes = soundResFile->newContext(loopedID, "loops resource");
-	if (loopRes == NULL)
+	if (loopRes == nullptr)
 		error("No loop effect resource context!\n");
 
 	voiceRes = voiceResFile->newContext(voiceID, "voice resource");
-	if (voiceRes == NULL)
+	if (voiceRes == nullptr)
 		error("Laryngitis Error (No voice resource context)!\n");
 
 	g_vm->_audio->initAudioInterface(musicRes);
@@ -129,7 +129,7 @@ void startAudio() {
 		g_vm->_audio->_clickSizes[0] = 0;
 		g_vm->_audio->_clickSizes[1] = soundRes->size(MKTAG('C', 'L', 'K', 1));
 		g_vm->_audio->_clickSizes[2] = soundRes->size(MKTAG('C', 'L', 'K', 2));
-		g_vm->_audio->_clickData[0] = NULL;
+		g_vm->_audio->_clickData[0] = nullptr;
 		g_vm->_audio->_clickData[1] = (uint8 *)LoadResource(soundRes, MKTAG('C', 'L', 'K', 1), "Click 1");
 		g_vm->_audio->_clickData[2] = (uint8 *)LoadResource(soundRes, MKTAG('C', 'L', 'K', 2), "Click 2");
 	}
@@ -240,7 +240,7 @@ void suspendAudio() {
 
 void resumeAudio() {
 	if (g_vm->_audio) {
-		if (soundRes != NULL || voiceRes != NULL) {
+		if (soundRes != nullptr || voiceRes != nullptr) {
 			g_vm->_audio->resume();
 			resumeLoops();
 			resumeMusic();
@@ -499,7 +499,7 @@ uint32 parse_res_id(char IDstr[]) {
 	uint32 a[5] = {0, 0, 0, 0, 0};
 	uint32 a2;
 	uint32 i, j;
-	assert(IDstr != NULL);
+	assert(IDstr != nullptr);
 	if (strlen(IDstr)) {
 		for (i = 0, j = 0; i < strlen(IDstr); i++) {
 			if (IDstr[i] == ':') {
@@ -517,42 +517,42 @@ uint32 parse_res_id(char IDstr[]) {
 // playback aliases
 
 void PlaySound(char IDstr[]) {
-	if (IDstr == NULL)
+	if (IDstr == nullptr)
 		playSound(0);
 	else
 		playSound(parse_res_id(IDstr));
 }
 
 void PlayLongSound(char IDstr[]) {
-	if (IDstr == NULL)
+	if (IDstr == nullptr)
 		playLongSound(0);
 	else
 		playLongSound(parse_res_id(IDstr));
 }
 
 void PlayVoice(char IDstr[]) {
-	if (IDstr == NULL)
+	if (IDstr == nullptr)
 		playVoice(0);
 	else
 		playVoice(parse_res_id(IDstr));
 }
 
 void PlayLoop(char IDstr[]) {
-	if (IDstr == NULL)
+	if (IDstr == nullptr)
 		playLoop(0);
 	else
 		playLoop(parse_res_id(IDstr));
 }
 
 void PlayLoopAt(char IDstr[], Location l) {
-	if (IDstr == NULL)
+	if (IDstr == nullptr)
 		playLoop(0);
 	else
 		playLoopAt(parse_res_id(IDstr), l);
 }
 
 void PlayMusic(char IDstr[]) {
-	if (IDstr == NULL)
+	if (IDstr == nullptr)
 		playMusic(0);
 	else
 		playMusic(parse_res_id(IDstr));
@@ -738,13 +738,13 @@ bool bufCheckResID(hResContext *hrc, uint32 s) {
 }
 
 bool hResCheckResID(hResContext *hrc, uint32 s) {
-	if (hrc != NULL)
+	if (hrc != nullptr)
 		return hrc->seek(s);
 	return false;
 }
 
 bool hResCheckResID(hResContext *hrc, uint32 s[]) {
-	if (s != NULL) {
+	if (s != nullptr) {
 		if (s[0] == 0)
 			return false;
 
diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index 7b4c1a62c5..f39dacb942 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -54,7 +54,7 @@ requestInfo     rInfo;
 bool autoMapCheat = false;
 #endif
 
-static AutoMap     *pAutoMap = NULL;
+static AutoMap     *pAutoMap = nullptr;
 
 /* ===================================================================== *
    Constants
@@ -137,9 +137,9 @@ static const StaticRect scrollBtnRect = {
 
 
 StaticWindow autoMapDecorations[numAutoMapPanels] = {
-	{autoMapTopPanelRect, NULL, autoMapTopPanelResID},
-	{autoMapMidPanelRect, NULL, autoMapMidPanelResID},
-	{autoMapBotPanelRect, NULL, autoMapBotPanelResID}
+	{autoMapTopPanelRect, nullptr, autoMapTopPanelResID},
+	{autoMapMidPanelRect, nullptr, autoMapMidPanelResID},
+	{autoMapBotPanelRect, nullptr, autoMapBotPanelResID}
 };
 
 
@@ -199,7 +199,7 @@ void AutoMap::locateRegion() {
 	WorldMapData *wMap = &mapList[currentWorld->mapNum];
 
 	areaRes = auxResFile->newContext(MKTAG('A', 'M', 'A', 'P'), "AreaList");
-	assert(areaRes != NULL);
+	assert(areaRes != nullptr);
 
 	stream = loadResourceToStream(areaRes, MKTAG('Z', 'O', 'N', currentWorld->mapNum), "AreaList");
 	regionCount = stream->readUint16LE();
@@ -289,7 +289,7 @@ gPanel *AutoMap::keyTest(int16 key) {
 	case Common::KEYCODE_PAGEDOWN:
 		return this;
 	default:
-		return NULL;
+		return nullptr;
 	}
 }
 
@@ -352,7 +352,7 @@ bool AutoMap::pointerHit(gPanelMessage &msg) {
 		if (win)
 			ri = (requestInfo *)win->userData;
 		else
-			ri = NULL;
+			ri = nullptr;
 
 		if (ri) {
 			ri->running = 0;
@@ -565,7 +565,7 @@ int16 openAutoMap() {
 	closeBtnImage = loadButtonRes(decRes, closeButtonResID, numBtnImages);
 	scrollBtnImage = loadButtonRes(decRes, scrollButtonResID, 2);
 
-	pAutoMap = new AutoMap(autoMapRect, (uint8 *)_summaryData, 0, NULL);
+	pAutoMap = new AutoMap(autoMapRect, (uint8 *)_summaryData, 0, nullptr);
 
 	new GfxCompButton(*pAutoMap, closeAutoMapBtnRect, closeBtnImage, numBtnImages, 0, cmdAutoMapQuit);
 
@@ -591,7 +591,7 @@ int16 openAutoMap() {
 	unloadImageRes(scrollBtnImage, 2);
 	free(_summaryData);
 	resFile->disposeContext(decRes);
-	decRes = NULL;
+	decRes = nullptr;
 
 	// clean up the backwindow
 	mainWindow->invalidate(&autoMapRect);
@@ -608,7 +608,7 @@ APPFUNC(cmdAutoMapQuit) {
 
 	if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
 		win = ev.panel->getWindow();        // get the window pointer
-		ri = win ? (requestInfo *)win->userData : NULL;
+		ri = win ? (requestInfo *)win->userData : nullptr;
 
 		if (ri) {
 			ri->running = 0;
diff --git a/engines/saga2/band.cpp b/engines/saga2/band.cpp
index 063b37a738..ace7b74d02 100644
--- a/engines/saga2/band.cpp
+++ b/engines/saga2/band.cpp
@@ -113,7 +113,7 @@ Band *BandList::newBand() {
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 //----------------------------------------------------------------------
diff --git a/engines/saga2/button.cpp b/engines/saga2/button.cpp
index e24ac4ab74..7b5b4974a1 100644
--- a/engines/saga2/button.cpp
+++ b/engines/saga2/button.cpp
@@ -43,7 +43,7 @@ extern void playMemSound(uint32 s); // play click # s
  * ======================================================================= */
 
 void GfxCompImage::init() {
-	_compImages      = NULL;
+	_compImages      = nullptr;
 	_max             = 0;
 	_min             = 0;
 	_internalAlloc   = false;
@@ -53,7 +53,7 @@ void GfxCompImage::init() {
 }
 
 GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, uint16 ident,
-                       AppFunc *cmd) : gControl(list, box, NULL, ident, cmd) {
+                       AppFunc *cmd) : gControl(list, box, nullptr, ident, cmd) {
 	// setup a single image configuration
 
 	init();
@@ -72,7 +72,7 @@ GfxCompImage::GfxCompImage(gPanelList &list,
                        char a, char b, char c,
                        uint16 resNum, uint16 numImages,
                        uint16 ident,
-                       AppFunc *cmd) : gControl(list, box, NULL, ident, cmd) {
+                       AppFunc *cmd) : gControl(list, box, nullptr, ident, cmd) {
 	uint16 i, rNum;
 
 	init();
@@ -95,7 +95,7 @@ GfxCompImage::GfxCompImage(gPanelList &list,
 
 	// get rid of this context
 	resFile->disposeContext(resContext);
-	resContext = NULL;
+	resContext = nullptr;
 }
 
 GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, const char *text, textPallete &pal, uint16 ident,
@@ -118,7 +118,7 @@ GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, con
 
 GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void **images,
                        int16 numRes, int16 initial,
-                       uint16 ident, AppFunc *cmd) : gControl(list, box, NULL, ident, cmd) {
+                       uint16 ident, AppFunc *cmd) : gControl(list, box, nullptr, ident, cmd) {
 	init();
 
 	if (!images)
@@ -219,7 +219,7 @@ void *GfxCompImage::getCurrentCompImage() {
 	if (_compImages) {
 		return _compImages[_currentImage];  // return the image pointed to by compImage
 	} else {
-		return NULL;
+		return nullptr;
 	}
 }
 
@@ -297,7 +297,7 @@ void GfxCompImage::drawClipped(gPort &port,
  * ===================================================================== */
 
 GfxSpriteImage::GfxSpriteImage(gPanelList &list, const Rect16 &box, GameObject *object, char,
-                           uint16 ident, AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd) {
+                           uint16 ident, AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd) {
 	// get the prototype for the object
 	ProtoObj *proto = object->proto();
 
@@ -324,7 +324,7 @@ void GfxSpriteImage::drawClipped(gPort &port,
 	map.size = _sprPtr->size;
 
 	map.data = (uint8 *)malloc(map.bytes() * sizeof(uint8));
-	if (map.data == NULL) return;
+	if (map.data == nullptr) return;
 
 	memset(map.data, 0, map.bytes());
 
@@ -347,11 +347,11 @@ void GfxCompButton::loadImages(hResContext *con, hResID res1, hResID res2) {
 	if (con) {
 		_forImage = LoadResource(con, res1, "CBtn fore image");
 		_resImage = LoadResource(con, res2, "CBtn res image");
-		_dimImage    = NULL;
+		_dimImage    = nullptr;
 	} else {
-		_forImage    = NULL;
-		_resImage    = NULL;
-		_dimImage    = NULL;
+		_forImage    = nullptr;
+		_resImage    = nullptr;
+		_dimImage    = nullptr;
 	}
 
 	_internalAlloc   = true;
@@ -368,40 +368,40 @@ void GfxCompButton::loadImages(hResID contextID, hResID res1, hResID res2) {
 }
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, hResID resID1, hResID resID2, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd), _extent(box) {
 	loadImages(con, resID1, resID2);
 }
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResID contextID, hResID resID1, hResID resID2, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd), _extent(box) {
 	loadImages(contextID, resID1, resID2);
 }
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd), _extent(box) {
 	loadImages(con, MKTAG(a, b, c, butNum_1), MKTAG(a, b, c, butNum_2));
 }
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResID contextID, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd), _extent(box) {
 	loadImages(contextID, MKTAG(a, b, c, butNum_1), MKTAG(a, b, c, butNum_2));
 }
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, int16 butNum, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd), _extent(box) {
 	loadImages(con, MKTAG('B', 'T', 'N', butNum), MKTAG('B', 'T', 'N', butNum + 1));
 }
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd) {
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd) {
 	if (images[0] && images[1] && numRes == 2) {
 		_forImage    = images[0];
 		_resImage    = images[1];
-		_dimImage    = NULL;
+		_dimImage    = nullptr;
 	} else {
-		_forImage    = NULL;
-		_resImage    = NULL;
-		_dimImage    = NULL;
+		_forImage    = nullptr;
+		_resImage    = nullptr;
+		_dimImage    = nullptr;
 	}
 
 	_internalAlloc   = false;
@@ -410,15 +410,15 @@ GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images,
 }
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, 0, text, pal, ident, cmd) {
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, 0, 0, text, pal, ident, cmd) {
 	if (images[0] && images[1] && numRes == 2) {
 		_forImage    = images[0];
 		_resImage    = images[1];
-		_dimImage    = NULL;
+		_dimImage    = nullptr;
 	} else {
-		_forImage    = NULL;
-		_resImage    = NULL;
-		_dimImage    = NULL;
+		_forImage    = nullptr;
+		_resImage    = nullptr;
+		_dimImage    = nullptr;
 	}
 
 	_internalAlloc   = false;
@@ -427,19 +427,19 @@ GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images,
 }
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, void *newDimImage, bool dimNess, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd) {
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd) {
 	if (images[0] && images[1] && numRes == 2) {
 		_forImage    = images[0];
 		_resImage    = images[1];
 	} else {
-		_forImage    = NULL;
-		_resImage    = NULL;
+		_forImage    = nullptr;
+		_resImage    = nullptr;
 	}
 
 	if (newDimImage) {
 		_dimImage = newDimImage;
 	} else {
-		_dimImage = NULL;
+		_dimImage = nullptr;
 	}
 
 	_internalAlloc   = false;
@@ -449,17 +449,17 @@ GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images,
 
 
 GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void *image, uint16 ident,
-                         AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd)
+                         AppFunc *cmd) : GfxCompImage(list, box, nullptr, ident, cmd)
 
 {
 	if (image) {
 		_forImage    = image;
 		_resImage    = image;
-		_dimImage    = NULL;
+		_dimImage    = nullptr;
 	} else {
-		_forImage    = NULL;
-		_resImage    = NULL;
-		_dimImage    = NULL;
+		_forImage    = nullptr;
+		_resImage    = nullptr;
+		_dimImage    = nullptr;
 	}
 
 	_internalAlloc   = false;
@@ -467,7 +467,7 @@ GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void *image, u
 	_extent          = box;
 }
 
-GfxCompButton::GfxCompButton(gPanelList &list, const StaticRect &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident, AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, 0, text, pal, ident, cmd) {
+GfxCompButton::GfxCompButton(gPanelList &list, const StaticRect &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident, AppFunc *cmd) : GfxCompImage(list, box, nullptr, 0, 0, text, pal, ident, cmd) {
 	if (images[0] && images[1] && numRes == 2) {
 		_forImage = images[0];
 		_resImage = images[1];
@@ -483,10 +483,10 @@ GfxCompButton::GfxCompButton(gPanelList &list, const StaticRect &box, void **ima
 	_extent        = box;
 }
 
-GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, cmd) {
-	_forImage    = NULL;
-	_resImage    = NULL;
-	_dimImage    = NULL;
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, AppFunc *cmd) : GfxCompImage(list, box, nullptr, 0, cmd) {
+	_forImage    = nullptr;
+	_resImage    = nullptr;
+	_dimImage    = nullptr;
 
 	_internalAlloc   = false;
 	_dimmed          = false;
@@ -497,17 +497,17 @@ GfxCompButton::~GfxCompButton() {
 	if (_internalAlloc) {
 		if (_forImage) {
 			free(_forImage);
-			_forImage = NULL;
+			_forImage = nullptr;
 		}
 
 		if (_resImage) {
 			free(_resImage);
-			_resImage = NULL;
+			_resImage = nullptr;
 		}
 
 		if (_dimImage) {
 			free(_dimImage);
-			_dimImage = NULL;
+			_dimImage = nullptr;
 		}
 	}
 }
@@ -644,7 +644,7 @@ void GfxOwnerSelCompButton::select(uint16 val) {
 ************************************************************************/
 
 GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, hResContext *con, char a, char b, char c, int16 resStart, int16 numRes, int16 initial, uint16 ident,
-                                 AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
+                                 AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)nullptr, 0, ident, cmd) {
 	int16   i, k;
 
 
@@ -664,9 +664,9 @@ GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, hResCo
 }
 
 GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, void **newImages, int16 numRes, int16 initial, uint16 ident,
-                                 AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
+                                 AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)nullptr, 0, ident, cmd) {
 	if (!newImages) {
-		_images  = NULL;
+		_images  = nullptr;
 		_max     = 0;
 		_min     = 0;
 		_current = 0;
@@ -687,9 +687,9 @@ GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, void *
 
 GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, void **newImages,
                                  int16 numRes, int16 initial, bool hitResponse, uint16 ident,
-                                 AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
+                                 AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)nullptr, 0, ident, cmd) {
 	if (!newImages) {
-		_images  = NULL;
+		_images  = nullptr;
 		_max     = 0;
 		_min     = 0;
 		_current = 0;
@@ -719,7 +719,7 @@ GfxMultCompButton::~GfxMultCompButton() {
 		}
 
 		free(_images);
-		_images = NULL;
+		_images = nullptr;
 	}
 }
 
diff --git a/engines/saga2/calender.cpp b/engines/saga2/calender.cpp
index b766eff699..f9b5521a74 100644
--- a/engines/saga2/calender.cpp
+++ b/engines/saga2/calender.cpp
@@ -74,7 +74,7 @@ void CalenderTime::write(Common::MemoryWriteStreamDynamic *out) {
 }
 
 void CalenderTime::update() {
-	const char *text = NULL;
+	const char *text = nullptr;
 
 	if (++_frameInHour >= kFramesPerHour) {
 		_frameInHour = 0;
diff --git a/engines/saga2/contain.cpp b/engines/saga2/contain.cpp
index 5e9cdec68d..52c22c5df2 100644
--- a/engines/saga2/contain.cpp
+++ b/engines/saga2/contain.cpp
@@ -212,7 +212,7 @@ ContainerView::ContainerView(
     ContainerNode   &nd,
     const ContainerAppearanceDef &app,
     AppFunc         *cmd)
-	: gControl(list, rect, NULL, 0, cmd),
+	: gControl(list, rect, nullptr, 0, cmd),
 	  iconOrigin(app.iconOrigin),
 	  iconSpacing(app.iconSpacing),
 	  visibleRows(app.rows),
@@ -255,7 +255,7 @@ void ContainerView::totalObjects() {
 	totalBulk   = 0;
 	numObjects  = 0;
 
-	if (containerObject == NULL) return;
+	if (containerObject == nullptr) return;
 
 	RecursiveContainerIterator  iter(containerObject);
 
@@ -288,7 +288,7 @@ ObjectID ContainerView::getObject(int16 slotNum) {
 	ObjectID        objID;
 	GameObject      *item;
 
-	if (containerObject == NULL) return Nothing;
+	if (containerObject == nullptr) return Nothing;
 
 	ContainerIterator   iter(containerObject);
 
@@ -468,7 +468,7 @@ GameObject *ContainerView::getObject(const TilePoint &slot) {
 
 	item = containerObject->child();
 
-	while (item != NULL) {
+	while (item != nullptr) {
 		//  Skip objects that are stacked behind other objects
 		if (item->getLocation().z != 0) {
 			ProtoObj *proto = item->proto();
@@ -488,7 +488,7 @@ GameObject *ContainerView::getObject(const TilePoint &slot) {
 		item = item->next();
 	}
 
-	return NULL;
+	return nullptr;
 
 }
 
@@ -500,7 +500,7 @@ ObjectID ContainerView::pickObjectID(const Point16 &pickPos) {
 	slot = pickObjectSlot(pickPos);
 	item = getObject(slot);
 
-	if (item != NULL) {
+	if (item != nullptr) {
 		return item->thisID();
 	} else {
 		return 0;
@@ -531,7 +531,7 @@ void ContainerView::pointerMove(gPanelMessage &msg) {
 	if (msg.pointerLeave) {
 		g_vm->_cnm->_lastPickedObjectID = Nothing;
 		g_vm->_cnm->_lastPickedObjectQuantity = -1;
-		g_vm->_mouseInfo->setText(NULL);
+		g_vm->_mouseInfo->setText(nullptr);
 		g_vm->_cnm->_mouseText[0] = 0;
 
 		// static bool that tells if the mouse cursor
@@ -550,7 +550,7 @@ void ContainerView::pointerMove(gPanelMessage &msg) {
 
 			if (!node.isAccessable(getCenterActorID())) {
 				g_vm->_mouseInfo->setDoable(false);
-			} else if (mouseObject == NULL) {
+			} else if (mouseObject == nullptr) {
 				g_vm->_mouseInfo->setDoable(true);
 			} else {
 				g_vm->_mouseInfo->setDoable(containerObject->canContain(mouseObject->thisID()));
@@ -576,7 +576,7 @@ bool ContainerView::pointerHit(gPanelMessage &msg) {
 	if (msg.doubleClick && !g_vm->_cnm->_alreadyDone) {
 		dblClick(mouseObject, slotObject, msg);
 	} else { // single click
-		if (mouseObject != NULL) {
+		if (mouseObject != nullptr) {
 			g_vm->_cnm->_alreadyDone = true;    // if object then no doubleClick
 
 			if (g_vm->_mouseInfo->getIntent() == GrabInfo::Drop) {
@@ -627,7 +627,7 @@ void ContainerView::pointerRelease(gPanelMessage &) {
 		g_vm->_cnm->_objToGet->take(getCenterActorID(), g_vm->_cnm->_numPicked);
 
 		// reset the flags and pointer dealing with merged object movement
-		g_vm->_cnm->_objToGet = NULL;
+		g_vm->_cnm->_objToGet = nullptr;
 		g_vm->_cnm->_numPicked = 1;
 		g_vm->_cnm->_amountIndY = -1;
 	}
@@ -670,7 +670,7 @@ void ContainerView::clickOn(
     gPanelMessage &,
     GameObject *,
     GameObject *cObj) {
-	if (cObj != NULL) {
+	if (cObj != nullptr) {
 		if (cObj->proto()->flags & ResourceObjectPrototype::objPropMergeable) {
 			if (!rightButtonState()) {
 				//  just get the object into the cursor
@@ -678,7 +678,7 @@ void ContainerView::clickOn(
 			} else {
 				// activate multi-object get interface if a mergeable object
 				getMerged(cObj);
-				g_vm->_mouseInfo->setText(NULL);
+				g_vm->_mouseInfo->setText(nullptr);
 				g_vm->_cnm->_mouseText[0] = 0;
 			}
 		} else {
@@ -701,7 +701,7 @@ void ContainerView::dblClickOn(
     gPanelMessage &,
     GameObject *mObj,
     GameObject *) {
-	if (mObj != NULL) {
+	if (mObj != nullptr) {
 		ObjectID        possessor = mObj->possessor();
 		ProtoObj        *proto = mObj->proto();
 		PlayerActorID   pID;
@@ -737,7 +737,7 @@ void ContainerView::dropPhysical(
 		                containerObject->thisID());
 
 		//  check if no object in the current slot
-		if (cObj == NULL) {
+		if (cObj == nullptr) {
 			MotionTask::dropObject(*centerActor, *mObj, loc, num);
 
 			WriteStatusF(6, "No object state");
@@ -758,7 +758,7 @@ void ContainerView::usePhysical(
 	assert(g_vm->_mouseInfo->getObject() == mObj);
 	assert(mObj->containmentSet() & ProtoObj::isTangible);
 
-	if (cObj == NULL) {
+	if (cObj == nullptr) {
 		dropPhysical(msg, mObj, cObj);
 	} else {
 		g_vm->_mouseInfo->replaceObject();
@@ -781,7 +781,7 @@ void ContainerView::useConcept(
 	if (containerObject->canContain(mObj->thisID())) {
 		ObjectID    centerActorID = getCenterActorID();
 
-		if (cObj == NULL) {
+		if (cObj == nullptr) {
 			//  If there is no object already in this slot drop the
 			//  mouse object here
 
@@ -813,7 +813,7 @@ void ContainerView::updateMouseText(Point16 &pickPos) {
 	// set the mouse text to null if there is no object to get hints about
 	if (slotID == Nothing) {
 		// clear out the mouse text
-		g_vm->_mouseInfo->setText(NULL);
+		g_vm->_mouseInfo->setText(nullptr);
 		g_vm->_cnm->_mouseText[0] = 0;
 
 		// reset the last picked thingy
@@ -837,7 +837,7 @@ void ContainerView::updateMouseText(Point16 &pickPos) {
 		g_vm->_cnm->_lastPickedObjectQuantity    = slotObject->getExtra();
 
 		// clear out the mouse text
-		g_vm->_mouseInfo->setText(NULL);
+		g_vm->_mouseInfo->setText(nullptr);
 		g_vm->_cnm->_mouseText[0] = 0;
 
 		// reset the alarm flag
@@ -894,7 +894,7 @@ ReadyContainerView::ReadyContainerView(
 		backImages  = backgrounds;
 		numIm       = numRes;
 	} else {
-		backImages  = NULL;
+		backImages  = nullptr;
 		numIm       = 0;
 	}
 }
@@ -1065,7 +1065,7 @@ ContainerWindow::ContainerWindow(ContainerNode &nd,
                                  const char saveas[])
 	: FloatingWindow(nd.position, 0, saveas, cmdWindowFunc) {
 	//  Initialize view to NULL.
-	view = NULL;
+	view = nullptr;
 
 	// create the close button for this window
 	closeCompButton = new GfxCompButton(
@@ -1104,8 +1104,8 @@ ScrollableContainerWindow::ScrollableContainerWindow(
 	                       0,
 	                       cmdScrollFunc);                 // mind app func
 
-	assert(view != NULL);
-	assert(scrollCompButton != NULL);
+	assert(view != nullptr);
+	assert(scrollCompButton != nullptr);
 }
 
 /* ===================================================================== *
@@ -1119,7 +1119,7 @@ TangibleContainerWindow::TangibleContainerWindow(
 	const int weightIndicatorType = 2;
 	objRect = app.iconRect;
 	deathFlag = nd.getType() == ContainerNode::deadType;
-	containerSpriteImg = NULL;
+	containerSpriteImg = nullptr;
 
 	// setup the mass and weight indicator
 	if (deathFlag) {
@@ -1127,7 +1127,7 @@ TangibleContainerWindow::TangibleContainerWindow(
 		setDecorations(deathDecorations,
 		               ARRAYSIZE(deathDecorations),
 		               containerRes, 'F', 'R', 'M');
-		massWeightIndicator = NULL;
+		massWeightIndicator = nullptr;
 	} else {
 		const StaticWindow *winDecs[] =  {
 			brassDecorations,
@@ -1185,7 +1185,7 @@ void TangibleContainerWindow::setContainerSprite() {
 	                         view->containerObject,
 	                         dummy,
 	                         0,
-	                         NULL);
+	                         nullptr);
 }
 
 void TangibleContainerWindow::massBulkUpdate() {
@@ -1222,7 +1222,7 @@ IntangibleContainerWindow::IntangibleContainerWindow(
 	                             0,
 	                             cmdMindContainerFunc);          // mind app func
 
-	assert(mindSelectorCompButton != NULL);
+	assert(mindSelectorCompButton != nullptr);
 
 	mindSelectorCompButton->setResponse(false);
 
@@ -1253,8 +1253,8 @@ EnchantmentContainerWindow::EnchantmentContainerWindow(
 	                       0,
 	                       cmdScrollFunc);                 // mind app func
 
-	assert(view != NULL);
-	assert(scrollCompButton != NULL);
+	assert(view != nullptr);
+	assert(scrollCompButton != nullptr);
 }
 
 /* ===================================================================== *
@@ -1301,7 +1301,7 @@ ContainerNode::ContainerNode(ContainerManager &cl, ObjectID id, int typ) {
 	}
 
 	//  Fill in the initial values.
-	window      = NULL;
+	window      = nullptr;
 	type        = typ;
 	object      = id;
 	owner       = ownerID;
@@ -1319,7 +1319,7 @@ ContainerWindow *ContainerNode::getWindow() {
 
 //  Return the container view for a container node, if it is visible
 ContainerView   *ContainerNode::getView() {
-	return window ? &window->getView() : NULL;
+	return window ? &window->getView() : nullptr;
 }
 
 //  Destructor
@@ -1338,7 +1338,7 @@ void ContainerNode::read(Common::InSaveFile *in) {
 	owner = in->readByte();
 	position.read(in);
 	mindType = in->readByte();
-	window = NULL;
+	window = nullptr;
 	action = 0;
 
 	bool shown = in->readUint16LE();
@@ -1362,24 +1362,24 @@ void ContainerNode::write(Common::MemoryWriteStreamDynamic *out) {
 	out->writeByte(owner);
 	position.write(out);
 	out->writeByte(mindType);
-	out->writeUint16LE(window != NULL);
+	out->writeUint16LE(window != nullptr);
 
 	debugC(4, kDebugSaveload, "... object = %d", object);
 	debugC(4, kDebugSaveload, "... type = %d", type);
 	debugC(4, kDebugSaveload, "... owner = %d", owner);
 	debugC(4, kDebugSaveload, "... position = (%d, %d, %d, %d)", position.x, position.y, position.width, position.height);
 	debugC(4, kDebugSaveload, "... mindType = %d", mindType);
-	debugC(4, kDebugSaveload, "... shown = %d", window != NULL);
+	debugC(4, kDebugSaveload, "... shown = %d", window != nullptr);
 }
 
 //  Close the container window, but leave the node.
 void ContainerNode::hide() {
 	//  close the window, but don't close the object.
-	if (type != readyType && window != NULL) {
+	if (type != readyType && window != nullptr) {
 		position = window->getExtent();     //  Save old window position
 		window->close();
 		delete window;
-		window = NULL;
+		window = nullptr;
 	}
 }
 
@@ -1390,7 +1390,7 @@ void ContainerNode::show() {
 	assert(proto);
 
 	//  open the window; Object should already be "open"
-	if (window == NULL) {
+	if (window == nullptr) {
 		switch (type) {
 		case physicalType:
 			physicalContainerAppearance.rows    = proto->getViewableRows();
@@ -1447,7 +1447,7 @@ ContainerNode *ContainerManager::find(ObjectID id) {
 		if ((*it)->object == id)
 			return *it;
 
-	return NULL;
+	return nullptr;
 }
 
 ContainerNode *ContainerManager::find(ObjectID id, int16 type) {
@@ -1455,7 +1455,7 @@ ContainerNode *ContainerManager::find(ObjectID id, int16 type) {
 		if ((*it)->object == id && (*it)->type == type)
 			return *it;
 
-	return NULL;
+	return nullptr;
 }
 
 //  returns true if the object represented by the container can be
@@ -1576,7 +1576,7 @@ extern int16 openMindType;
 //  kind of container is appropriate, and also if a container of that
 //  type is already open.
 ContainerNode *CreateContainerNode(ObjectID id, bool open, int16) {
-	ContainerNode   *cn = NULL;
+	ContainerNode   *cn = nullptr;
 	GameObject      *obj = GameObject::objectAddress(id);
 	PlayerActorID   owner;
 
@@ -1603,7 +1603,7 @@ ContainerNode *CreateContainerNode(ObjectID id, bool open, int16) {
 
 	//  If node was successfull created, and we wanted it open, and the owner
 	//  is the center actor or no-actor then make the container window visible.
-	if (cn != NULL
+	if (cn != nullptr
 	        &&  open
 	        && (owner == getCenterActorID() || owner == ContainerNode::nobody)) {
 		cn->show();
@@ -1653,7 +1653,7 @@ void initContainers() {
 		return;
 	}
 
-	if (containerRes == NULL)
+	if (containerRes == nullptr)
 		containerRes = resFile->newContext(MKTAG('C', 'O', 'N', 'T'), "cont.resources");
 
 	g_vm->_cnm->_selImage = g_vm->_imageCache->requestImage(imageRes, MKTAG('A', 'M', 'N', 'T'));
@@ -1665,8 +1665,8 @@ void cleanupContainers() {
 	if (containerRes)
 		resFile->disposeContext(containerRes);
 
-	g_vm->_cnm->_selImage = NULL;
-	containerRes = NULL;
+	g_vm->_cnm->_selImage = nullptr;
+	containerRes = nullptr;
 }
 
 void initContainerNodes() {
@@ -1863,7 +1863,7 @@ APPFUNC(cmdMindContainerFunc) {
 		}
 
 		if (ev.value == GfxCompImage::leave) {
-			g_vm->_mouseInfo->setText(NULL);
+			g_vm->_mouseInfo->setText(nullptr);
 		}
 	}
 }
@@ -1880,14 +1880,14 @@ APPFUNC(cmdCloseButtonFunc) {
 		updateContainerWindows();
 
 		// make sure the hint text goes away
-		if (g_vm->_mouseInfo->getObject() == NULL) {
-			g_vm->_mouseInfo->setText(NULL);
+		if (g_vm->_mouseInfo->getObject() == nullptr) {
+			g_vm->_mouseInfo->setText(nullptr);
 		}
 	} else if (ev.eventType == gEventMouseMove) {
 		if (ev.value == GfxCompImage::enter) {
 			g_vm->_mouseInfo->setText(CLOSE_MOUSE);
 		} else if (ev.value == GfxCompImage::leave) {
-			g_vm->_mouseInfo->setText(NULL);
+			g_vm->_mouseInfo->setText(nullptr);
 		}
 	}
 }
@@ -1907,7 +1907,7 @@ APPFUNC(cmdScrollFunc) {
 		if (ev.value == GfxCompImage::enter) {
 			g_vm->_mouseInfo->setText(SCROLL_MOUSE);
 		} else if (ev.value == GfxCompImage::leave) {
-			g_vm->_mouseInfo->setText(NULL);
+			g_vm->_mouseInfo->setText(nullptr);
 		}
 	}
 }
diff --git a/engines/saga2/detection.cpp b/engines/saga2/detection.cpp
index a63f0e8dcc..9b32f45f9e 100644
--- a/engines/saga2/detection.cpp
+++ b/engines/saga2/detection.cpp
@@ -48,7 +48,7 @@ namespace Saga2 {
 static const PlainGameDescriptor saga2Games[] = {
 	{"dino", "Dinotopia"},
 	{"fta2", "Faery Tale Adventure II: Halls of the Dead"},
-	{ 0, 0 }
+	{ nullptr, nullptr }
 };
 
 
@@ -107,7 +107,7 @@ static const SAGA2GameDescription gameDescriptions[] = {
 				{"scripts.hrs",	 GAME_SCRIPTFILE,					"95f33928f6c4f02ee04d2ec5c3314c30", 1041948},
 				{"ftasound.hrs", GAME_SOUNDFILE,					"ce930cb38922e6a03461f55d51b4e165", 12403350},
 				{"ftaimage.hrs", GAME_IMAGEFILE,					"09bb003733b20f924e2e373d2ddcd394", 21127397},
-				{"ftavoice.hrs", GAME_VOICEFILE,					NULL, -1 },
+				{"ftavoice.hrs", GAME_VOICEFILE,					nullptr, -1 },
 				{"fta2win.exe",  GAME_EXECUTABLE,					"9a94854fef932483754a8f929caa0dba", 1093120},
 				AD_LISTEND
 			},
@@ -125,7 +125,7 @@ static const SAGA2GameDescription gameDescriptions[] = {
 static const char *directoryGlobs[] = {
 	"res",
 	"win",
-	0
+	nullptr
 };
 
 class Saga2MetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/saga2/display.cpp b/engines/saga2/display.cpp
index 238f966a5f..25713f5740 100644
--- a/engines/saga2/display.cpp
+++ b/engines/saga2/display.cpp
@@ -111,7 +111,7 @@ void niceScreenStartup() {
 	reDrawScreen();
 	g_vm->_mouseInfo->replaceObject();
 	g_vm->_mouseInfo->clearGauge();
-	g_vm->_mouseInfo->setText(NULL);
+	g_vm->_mouseInfo->setText(nullptr);
 	g_vm->_mouseInfo->setIntent(GrabInfo::WalkTo);
 	resetInputDevices();
 }
diff --git a/engines/saga2/dispnode.cpp b/engines/saga2/dispnode.cpp
index e77ba50cb2..8a38cabad9 100644
--- a/engines/saga2/dispnode.cpp
+++ b/engines/saga2/dispnode.cpp
@@ -110,9 +110,9 @@ void drawDisplayList() {
 
 void  DisplayNodeList::init(uint16 s) {
 	for (int i = 0; i < s; i++) {
-		displayList[i].efx = NULL;
-		displayList[i].nextDisplayed = NULL;
-		displayList[i].object = NULL;
+		displayList[i].efx = nullptr;
+		displayList[i].nextDisplayed = nullptr;
+		displayList[i].object = nullptr;
 		displayList[i].type = nodeTypeObject;
 	}
 }
@@ -163,12 +163,12 @@ void DisplayNodeList::draw() {
 	                *spellSet;
 
 	objectSet = objectSprites;
-	if (objectSet == NULL)
+	if (objectSet == nullptr)
 		error("Object sprites have been dumped!\n");
 
 	if (g_vm->getGameId() == GID_FTA2) {
 		spellSet = spellSprites;
-		if (spellSet == NULL)
+		if (spellSet == nullptr)
 			error("Spell sprites have been dumped!\n");
 	}
 
@@ -219,15 +219,15 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
 				Actor       *a = (Actor *)obj;
 
 				//  Release the actor appearance if loaded
-				if (a->_appearance != NULL) {
+				if (a->_appearance != nullptr) {
 					ReleaseActorAppearance(a->_appearance);
-					a->_appearance = NULL;
+					a->_appearance = nullptr;
 				}
 			}
 		}
 	}
 
-	if (currentWorld == NULL) return;
+	if (currentWorld == nullptr) return;
 
 	DispRegionObjectIterator    iter(currentWorld, viewCenter, loadDist);
 	GameObject *obj = nullptr;
@@ -237,7 +237,7 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
 
 	if (fromScratch)
 		//  Reset the list...
-		DisplayNodeList::head = NULL;
+		DisplayNodeList::head = nullptr;
 
 	for (id = iter.first(&obj, &dist);
 	        id != Nothing;
@@ -256,7 +256,7 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
 				//  If actor is newly entered to the arena
 				//  (appearance == NULL), then load the
 				//  actor's appearance.
-				if (a->_appearance == NULL) {
+				if (a->_appearance == nullptr) {
 					a->_appearance =
 					    LoadActorAppearance(a->_appearanceID, sprStandBank);
 				}
@@ -289,7 +289,7 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
 		GameObject  *ob = sortList[i];
 		DisplayNode **search;
 		TilePoint oLoc = ob->getLocation();
-		dn->nextDisplayed = NULL;
+		dn->nextDisplayed = nullptr;
 		dn->object = ob;
 
 		dn->type = nodeTypeObject;
@@ -378,8 +378,8 @@ void DisplayNode::drawObject() {
 	mCoords.z = 0;
 
 	//  Do not display objects that are on a ripped roof
-	if ((mt = mapList[g_vm->_currentMapNum].lookupMeta(mCoords)) != NULL) {
-		if ((rt = mt->ripTable(g_vm->_currentMapNum)) != NULL) {
+	if ((mt = mapList[g_vm->_currentMapNum].lookupMeta(mCoords)) != nullptr) {
+		if ((rt = mt->ripTable(g_vm->_currentMapNum)) != nullptr) {
 			if (objCoords.z >= rt->zTable[tCoords.u][tCoords.v]) {
 				//  Disable hit-test on the object's box
 				hitBox.width = -1;
@@ -696,7 +696,7 @@ void DisplayNode::drawObject() {
 			//          sc->colorTable = aa->schemeList ? mainColors : identityColors;
 			sc->flipped = (poseFlags & ActorPose::actorFlipped);
 
-			assert(sc->sp != NULL);
+			assert(sc->sp != nullptr);
 			assert(sc->sp->size.x > 0);
 			assert(sc->sp->size.y > 0);
 			assert(sc->sp->size.x < 255);
@@ -714,7 +714,7 @@ void DisplayNode::drawObject() {
 				sc->sp =    prot->getOrientedSprite(
 				                ob,
 				                a->_poseInfo.leftObjectIndex);
-				assert(sc->sp != NULL);
+				assert(sc->sp != nullptr);
 				sc->offset = a->_poseInfo.leftObjectOffset;
 				assert(sc->offset.x < 1000);
 				assert(sc->offset.x > -1000);
@@ -736,7 +736,7 @@ void DisplayNode::drawObject() {
 				sc->sp =    prot->getOrientedSprite(
 				                ob,
 				                a->_poseInfo.rightObjectIndex);
-				assert(sc->sp != NULL);
+				assert(sc->sp != nullptr);
 				assert(sc->sp->size.x > 0);
 				assert(sc->sp->size.y > 0);
 				assert(sc->sp->size.x < 255);
@@ -811,7 +811,7 @@ ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos) {
 	SpriteSet       *objectSet;
 
 	objectSet = objectSprites;
-	if (objectSet == NULL)
+	if (objectSet == nullptr)
 		error("Object sprites have been dumped!");
 
 	for (dn = DisplayNodeList::head; dn; dn = dn->nextDisplayed) {
@@ -846,7 +846,7 @@ ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos) {
 
 						aa = a->_appearance;
 
-						if (aa == NULL) continue;
+						if (aa == nullptr) continue;
 
 						sprPtr = aa->spriteBanks[a->_poseInfo.actorFrameBank];
 						ss = sprPtr;
diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index 3ecc27f2b0..b7e8e161c4 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -150,7 +150,7 @@ CDocument::CDocument(CDocumentAppearance &dApp,
 	decRes = resFile->newContext(app.groupID, "docimage context");
 
 	// init con pointer to NULL
-	illustrationCon = NULL;
+	illustrationCon = nullptr;
 
 	// set the maxium string length
 	maxSize = maxPages * maxLines * maxChars;
@@ -181,7 +181,7 @@ CDocument::CDocument(CDocumentAppearance &dApp,
 
 	// null out the image pointer array
 	for (int16 i = 0; i < maxPages; i++) {
-		images[i] = NULL;
+		images[i] = nullptr;
 	}
 
 	makePages();
@@ -193,7 +193,7 @@ CDocument::CDocument(CDocumentAppearance &dApp,
 
 	// remove the resource handle
 	if (decRes) resFile->disposeContext(decRes);
-	decRes = NULL;
+	decRes = nullptr;
 
 
 }
@@ -210,12 +210,12 @@ CDocument::~CDocument() {
 	// get rid of the working text buffer
 	if (text) {
 		delete[] text;
-		text = NULL;
+		text = nullptr;
 	}
 
 	if (origText) {
 		delete[] origText;
-		origText = NULL;
+		origText = nullptr;
 	}
 
 	// get rid of the resource context
@@ -271,7 +271,7 @@ gPanel *CDocument::keyTest(int16 key) {
 	case Common::KEYCODE_DOWN:
 		return this;
 	default:
-		return NULL;
+		return nullptr;
 	}
 }
 
@@ -322,7 +322,7 @@ bool CDocument::pointerHit(gPanelMessage &msg) {
 		requestInfo     *ri;
 
 		win = getWindow();      // get the window pointer
-		ri = win ? (requestInfo *)win->userData : NULL;
+		ri = win ? (requestInfo *)win->userData : nullptr;
 
 		if (ri) {
 			ri->running = 0;
@@ -729,7 +729,7 @@ int16 openScroll(uint16 textScript) {
 
 
 	// point to book
-	CDocument       *win = NULL;
+	CDocument       *win = nullptr;
 
 	// close button
 	GfxCompButton     *closeScroll;
@@ -744,7 +744,7 @@ int16 openScroll(uint16 textScript) {
 	closeBtnImage = loadButtonRes(decRes, buttonResID, numBtnImages);
 
 	// create the window
-	win = new CDocument(scrollAppearance, bookText, &Script10Font, 0, NULL);
+	win = new CDocument(scrollAppearance, bookText, &Script10Font, 0, nullptr);
 
 	// make the quit button
 	closeScroll = new GfxCompButton(*win, scrollAppearance.closeRect, closeBtnImage, numBtnImages, 0, cmdDocumentQuit);
@@ -788,7 +788,7 @@ int16 openBook(uint16 textScript) {
 
 
 	// point to book
-	CDocument       *win = NULL;
+	CDocument       *win = nullptr;
 
 	GfxCompButton *closeBook;
 	hResContext *decRes;
@@ -796,7 +796,7 @@ int16 openBook(uint16 textScript) {
 	decRes = resFile->newContext(MKTAG('S', 'C', 'R', 'L'), "book resources");
 
 	// create the window
-	win = new CDocument(bookAppearance, bookText, &Script10Font, 0, NULL);
+	win = new CDocument(bookAppearance, bookText, &Script10Font, 0, nullptr);
 
 	// make the quit button
 	closeBook = new GfxCompButton(*win, bookAppearance.closeRect, cmdDocumentQuit);
@@ -834,7 +834,7 @@ int16 openParchment(uint16 textScript) {
 
 
 	// point to book
-	CDocument       *win = NULL;
+	CDocument       *win = nullptr;
 
 	GfxCompButton *closeParchment;
 	hResContext *decRes;
@@ -842,7 +842,7 @@ int16 openParchment(uint16 textScript) {
 	decRes = resFile->newContext(MKTAG('S', 'C', 'R', 'L'), "book resources");
 
 	// create the window
-	win = new CDocument(parchAppearance, bookText, &Script10Font, 0, NULL);
+	win = new CDocument(parchAppearance, bookText, &Script10Font, 0, nullptr);
 	// make the quit button
 	closeParchment = new GfxCompButton(*win, parchAppearance.closeRect, cmdDocumentQuit);
 	closeParchment->accelKey = 0x1B;
@@ -870,7 +870,7 @@ APPFUNC(cmdDocumentQuit) {
 
 	if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
 		win = ev.panel->getWindow();        // get the window pointer
-		ri = win ? (requestInfo *)win->userData : NULL;
+		ri = win ? (requestInfo *)win->userData : nullptr;
 
 		if (ri) {
 			ri->running = 0;
diff --git a/engines/saga2/effects.cpp b/engines/saga2/effects.cpp
index 3d2205ada7..ccd6e661ff 100644
--- a/engines/saga2/effects.cpp
+++ b/engines/saga2/effects.cpp
@@ -170,7 +170,7 @@ void ProtoDrainage::implement(GameObject *cst, SpellTarget *trg, int8) {
 		if (totalDice > 0 && trg->getObject() && isActor(trg->getObject()))
 			offensiveNotification(ac, (Actor *) trg->getObject());
 	} else {
-		ac = NULL;
+		ac = nullptr;
 		totalDice = dice + 6;
 		ObjectID pID = cst->possessor();
 		if (pID != Nothing) {
@@ -197,7 +197,7 @@ void ProtoDrainage::implement(GameObject *cst, SpellTarget *trg, int8) {
 	totalDamage = clamp(0, totalDamage, currentLevel(a, type));
 
 	drainLevel(cst, a, type, totalDamage);
-	if (ac != NULL)
+	if (ac != nullptr)
 		drainLevel(cst, ac, type, -totalDamage);
 }
 
@@ -504,7 +504,7 @@ SPECIALSPELL(DispellCurses) {
 		Actor               *a = (Actor *) trg->getObject();
 		GameObject          *obj;
 		ContainerIterator   iter(a);
-		GameObject          *ToBeDeleted = NULL;
+		GameObject          *ToBeDeleted = nullptr;
 
 		clearEnchantments(a);
 
diff --git a/engines/saga2/enchant.cpp b/engines/saga2/enchant.cpp
index 8b74976a0a..dc6a050645 100644
--- a/engines/saga2/enchant.cpp
+++ b/engines/saga2/enchant.cpp
@@ -57,7 +57,7 @@ ObjectID EnchantObject(
 	enchProto = g_vm->_objectProtos[enchantmentProto];
 
 	ench = GameObject::newObject(); //Create Enchantment
-	if (ench == NULL) return Nothing;
+	if (ench == nullptr) return Nothing;
 
 	//  Fill in the enchantment object. Note that the 'hitpoints'
 	//  of an enchantment are actually the duration of it's life
@@ -247,7 +247,7 @@ void evalObjectEnchantments(GameObject *obj) {
 EnchantmentIterator::EnchantmentIterator(GameObject *container) {
 	//  Get the ID of the 1st object in the sector list
 	baseObject = container;
-	wornObject = NULL;
+	wornObject = nullptr;
 	nextID = Nothing;
 }
 
@@ -268,7 +268,7 @@ ObjectID EnchantmentIterator::next(GameObject **obj) {
 			//  If we were searching a 'worn' object, then pop up a level
 			if (wornObject) {
 				nextID = wornObject->IDNext();
-				wornObject = NULL;
+				wornObject = nullptr;
 				continue;
 			}
 
@@ -282,7 +282,7 @@ ObjectID EnchantmentIterator::next(GameObject **obj) {
 		uint16          cSet = proto->containmentSet();
 
 		if ((cSet & (ProtoObj::isArmor | ProtoObj::isWeapon | ProtoObj::isWearable))
-		        &&  wornObject == NULL
+		        &&  wornObject == nullptr
 		        &&  proto->isObjectBeingUsed(object)) {
 			wornObject = object;
 			nextID = object->IDChild();
diff --git a/engines/saga2/floating.cpp b/engines/saga2/floating.cpp
index 6a91372d2a..acf9d6956c 100644
--- a/engines/saga2/floating.cpp
+++ b/engines/saga2/floating.cpp
@@ -68,7 +68,7 @@ extern bool         allPlayerActorsDead;
 //  Constructor for a background window
 DecoratedWindow::DecoratedWindow(const Rect16 &r, uint16 ident, const char saveas[], AppFunc *cmd)
 	: gWindow(r, ident, saveas, cmd) {
-	decorations = NULL;
+	decorations = nullptr;
 	numDecorations = 0;
 }
 
@@ -325,7 +325,7 @@ bool                DragBar::update;
 FloatingWindow      *DragBar::dragWindow;
 
 DragBar::DragBar(gPanelList &list, const Rect16 &r)
-	: gControl(list, r, NULL, 0, NULL) {
+	: gControl(list, r, nullptr, 0, nullptr) {
 }
 
 bool DragBar::activate(gEventType) {
@@ -370,7 +370,7 @@ void DragBar::pointerDrag(gPanelMessage &msg) {
 void DragBar::pointerRelease(gPanelMessage &) {
 	deactivate();
 	update = false;             // just in case
-	dragWindow = NULL;
+	dragWindow = nullptr;
 }
 
 
@@ -483,7 +483,7 @@ LabeledButton::LabeledButton(gPanelList &list,
 	             cmd) {
 	const char *underscore;
 
-	if ((underscore = strchr(title, '_')) != NULL)
+	if ((underscore = strchr(title, '_')) != nullptr)
 		accelKey = toupper(underscore[1]);
 }
 
@@ -592,7 +592,7 @@ bool FloatingWindow::open() {
 
 	g_vm->_mouseInfo->replaceObject();
 	g_vm->_mouseInfo->clearGauge();
-	g_vm->_mouseInfo->setText(NULL);
+	g_vm->_mouseInfo->setText(nullptr);
 	g_vm->_mouseInfo->setIntent(GrabInfo::WalkTo);
 
 	return gWindow::open();
diff --git a/engines/saga2/gamemode.cpp b/engines/saga2/gamemode.cpp
index fbfe5f1a80..3c35924d3c 100644
--- a/engines/saga2/gamemode.cpp
+++ b/engines/saga2/gamemode.cpp
@@ -37,17 +37,17 @@ namespace Saga2 {
 
 //Initialize Static GameObject Data Members
 
-GameMode    *GameMode::currentMode = NULL;  // pointer to current mode.
-GameMode    *GameMode::newMode = NULL;      // next mode to run
+GameMode    *GameMode::currentMode = nullptr;  // pointer to current mode.
+GameMode    *GameMode::newMode = nullptr;      // next mode to run
 
-GameMode       *GameMode::modeStackPtr[Max_Modes] = { NULL };
-GameMode       *GameMode::newmodeStackPtr[Max_Modes] = { NULL };
+GameMode       *GameMode::modeStackPtr[Max_Modes] = { nullptr };
+GameMode       *GameMode::newmodeStackPtr[Max_Modes] = { nullptr };
 int         GameMode::modeStackCtr = 0;
 int         GameMode::newmodeStackCtr = 0;
 int         GameMode::newmodeFlag = false;
 
 void GameMode::modeUnStack() {
-	modeStackPtr[modeStackCtr] = NULL;                        //Always Start Cleanup At modeStackCtr
+	modeStackPtr[modeStackCtr] = nullptr;                        //Always Start Cleanup At modeStackCtr
 	modeStackPtr[modeStackCtr--]->cleanup();
 	return;
 }
@@ -56,9 +56,9 @@ void GameMode::modeUnStack(int StopHere) {
 	if (!modeStackCtr)   //If Nothing Currently On The Stack
 		return;
 	for (int i = modeStackCtr - 1; i >= StopHere; i--) { //Stop Here Is How Far You Want To Unstack
-		if (modeStackPtr[i] != NULL)
+		if (modeStackPtr[i] != nullptr)
 			modeStackPtr[i]->cleanup();
-		modeStackPtr[i] = NULL;                        //Always Start Cleanup At modeStackCtr
+		modeStackPtr[i] = nullptr;                        //Always Start Cleanup At modeStackCtr
 		modeStackCtr--;                        //Always Start Cleanup At modeStackCtr
 	}
 	return;
@@ -99,7 +99,7 @@ void GameMode::SetStack(GameMode *modeFirst, ...) {
 
 	//Put List In New Array Of GameMode Object Pointers
 
-	while (thisMode != 0) {
+	while (thisMode != nullptr) {
 		newmodeStackPtr[newmodeStackCtr] = thisMode;
 		newmodeStackCtr++;
 		thisMode  = va_arg(Modes, GameMode *);
diff --git a/engines/saga2/gdraw.cpp b/engines/saga2/gdraw.cpp
index 81ecb351ed..622f24b270 100644
--- a/engines/saga2/gdraw.cpp
+++ b/engines/saga2/gdraw.cpp
@@ -969,7 +969,7 @@ bool NewTempPort(gPort &port, int width, int height) {
 	gPixelMap       *map;
 
 	map = (gPixelMap *)TempAlloc(width * height + sizeof(gPixelMap));
-	if (map != NULL) {
+	if (map != nullptr) {
 		map->data = (uint8 *)(map + 1);
 		map->size.x = width;
 		map->size.y = height;
@@ -1008,7 +1008,7 @@ bool NewTempPort(gPort &port, int width, int height) {
 */
 void DisposeTempPort(gPort &port) {
 	if (port.map) TempFree(port.map);
-	port.map = NULL;
+	port.map = nullptr;
 }
 
 } // end of namespace Saga2
diff --git a/engines/saga2/gpointer.cpp b/engines/saga2/gpointer.cpp
index 74e9bd6861..77ddb0df3c 100644
--- a/engines/saga2/gpointer.cpp
+++ b/engines/saga2/gpointer.cpp
@@ -49,7 +49,7 @@ gMousePointer::gMousePointer(gDisplayPort &port) {
 	videoPort = &port;
 
 	//  no imagery at this time.
-	pointerImage = NULL;
+	pointerImage = nullptr;
 }
 
 gMousePointer::~gMousePointer() {
diff --git a/engines/saga2/grequest.cpp b/engines/saga2/grequest.cpp
index 208f0d0c2d..2853acbe9e 100644
--- a/engines/saga2/grequest.cpp
+++ b/engines/saga2/grequest.cpp
@@ -53,7 +53,7 @@ int16 SplitString(
 
 	for (count = 0; count < maxStrings;) {
 		textStart[count++] = text;
-		if ((text = strchr(text, delimiter)) == NULL) break;
+		if ((text = strchr(text, delimiter)) == nullptr) break;
 		*text++ = '\0';
 	}
 	return count;
@@ -66,7 +66,7 @@ static void handleRequestEvent(gEvent &ev) {
 
 	if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
 		win = ev.panel->getWindow();        // get the window pointer
-		ri = win ? (requestInfo *)win->userData : NULL;
+		ri = win ? (requestInfo *)win->userData : nullptr;
 
 		if (ri) {
 			ri->running = 0;
@@ -354,12 +354,12 @@ int16 GameDialogA(
 	                 200,
 	                 100),
 	          0,
-	          NULL,
+	          nullptr,
 	          windowText,
 	          buttonText,
 	          args);
 
-	if (win == NULL) {
+	if (win == nullptr) {
 		//  REM: perhaps a memory alert of some sort???
 		error("Unable to open requester window.");
 	}
@@ -407,11 +407,11 @@ int16 GameDisplayA(
 	                 200,
 	                 100),
 	          0,
-	          NULL,
+	          nullptr,
 	          windowText,
 	          args);
 
-	if (win == NULL) {
+	if (win == nullptr) {
 		//  REM: perhaps a memory alert of some sort???
 		error("Unable to open requester window.");
 	}
diff --git a/engines/saga2/gtext.cpp b/engines/saga2/gtext.cpp
index 6c0a110fe7..6ec6c5dc6a 100644
--- a/engines/saga2/gtext.cpp
+++ b/engines/saga2/gtext.cpp
@@ -510,7 +510,7 @@ int16 gPort::drawClippedString(
 	if (tempMap.bytes() == 0)
 		return 0;
 	tempMap.data = (uint8 *)TempAlloc(tempMap.bytes());
-	if (tempMap.data != NULL) {
+	if (tempMap.data != nullptr) {
 		//  Fill the buffer with background pen if we're
 		//  not doing a transparent blit.
 
diff --git a/engines/saga2/gtextbox.cpp b/engines/saga2/gtextbox.cpp
index 2bacba59d3..82ee40352c 100644
--- a/engines/saga2/gtextbox.cpp
+++ b/engines/saga2/gtextbox.cpp
@@ -675,7 +675,7 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
 				deactivate();                       // deactivate the text box
 		}
 
-		if (onEnter != NULL) {
+		if (onEnter != nullptr) {
 			gEvent ev;
 			ev.eventType = gEventKeyDown ;
 			ev.value = 1;
@@ -687,7 +687,7 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
 	} else if (key == Common::ASCII_ESCAPE) {               // escape key
 		revertEdit();
 		deactivate();                       // deactivate the text box
-		if (onEscape != NULL) {
+		if (onEscape != nullptr) {
 			gEvent ev;
 			ev.eventType = gEventKeyDown ;
 			ev.value = 1;
diff --git a/engines/saga2/hresmgr.cpp b/engines/saga2/hresmgr.cpp
index 9b03652af1..a70c1f231d 100644
--- a/engines/saga2/hresmgr.cpp
+++ b/engines/saga2/hresmgr.cpp
@@ -57,7 +57,7 @@ hResContext::hResContext(hResContext *sire, hResID id, const char desc[]) {
 	_bytepos = 0;
 	_handle = &_file;
 	_base = nullptr;
-	_parent = 0;
+	_parent = nullptr;
 
 	if (!_res->_valid)
 		return;
diff --git a/engines/saga2/interp.cpp b/engines/saga2/interp.cpp
index e2d7ca37e7..65eeade36b 100644
--- a/engines/saga2/interp.cpp
+++ b/engines/saga2/interp.cpp
@@ -174,7 +174,7 @@ uint16 *builtinVTableAddress(int16 btype, uint8 *addr, CallTable **callTab) {
 		break;
 
 	case builtinAbstract:
-		*callTab = NULL;
+		*callTab = nullptr;
 
 		return (uint16 *)addr;
 
@@ -186,7 +186,7 @@ uint16 *builtinVTableAddress(int16 btype, uint8 *addr, CallTable **callTab) {
 	if (script != 0 && lookupExport(script, vtSeg, vtOffset)) {
 		return (uint16 *)segmentAddress(vtSeg, vtOffset);
 	} else
-		return NULL;
+		return nullptr;
 }
 
 uint8 *segmentAddress(uint16 segment, uint16 offset) {
@@ -507,7 +507,7 @@ int16 RRandom(int16 c, int16 s, int16 id) {
 /* ============================================================================ *
                                 Main interpreter
  * ============================================================================ */
-void print_script_name(uint8 *codePtr, const char *descr = NULL) {
+void print_script_name(uint8 *codePtr, const char *descr = nullptr) {
 	char    scriptName[32];
 	uint8   *sym = codePtr - 1;
 	uint8   length = MIN<uint>(*sym, sizeof scriptName - 1);
@@ -827,7 +827,7 @@ bool Thread::interpret() {
 
 				vtableEntry = vtable + (w * 2);
 
-				if (vtable == NULL) {
+				if (vtable == nullptr) {
 					//  Do nothing...
 				} else if (vtableEntry[0] != 0xffff) { // It's a SAGA func
 					programCounter.offset = (pc - codeSeg);
@@ -1681,13 +1681,13 @@ void Thread::clearExtended() {
 void initScripts() {
 	//  Open the script resource group
 	scriptRes = scriptResFile->newContext(sagaID,  "script resources");
-	if (scriptRes == NULL)
+	if (scriptRes == nullptr)
 		error("Unable to open script resource file!\n");
 
 	//  Load the data segment
 	dataSegment = scriptRes->loadResource(dataSegID, "saga data segment");
 
-	if (dataSegment == NULL)
+	if (dataSegment == nullptr)
 		error("Unable to load the SAGA data segment");
 
 	dataSegSize = scriptRes->getSize(dataSegID, "saga data segment");
@@ -1696,7 +1696,7 @@ void initScripts() {
 //	Common::hexdump(dataSegment, dataSegSize);
 
 	exportSegment = scriptRes->loadResource(exportSegID, "saga export segment");
-	assert(exportSegment != NULL);
+	assert(exportSegment != nullptr);
 
 //	Common::hexdump(exportSegment, scriptRes->getSize(exportSegID, "saga export segment"));
 
@@ -1714,7 +1714,7 @@ void cleanupScripts() {
 
 	if (scriptRes)
 		scriptResFile->disposeContext(scriptRes);
-	scriptRes = NULL;
+	scriptRes = nullptr;
 }
 
 //-----------------------------------------------------------------------
diff --git a/engines/saga2/magic.cpp b/engines/saga2/magic.cpp
index 249ce6617e..f47c161c68 100644
--- a/engines/saga2/magic.cpp
+++ b/engines/saga2/magic.cpp
@@ -107,7 +107,7 @@ SkillProto *skillProtoFromID(int16 spellOrObjectID) {
 // initialization call to connect skill prototypes with their spells
 void initializeSkill(SkillProto *oNo, SpellID sNo) {
 	if (sNo > 0 && sNo < totalSpellBookPages) {
-		if (spellBook[sNo].getProto() != NULL)
+		if (spellBook[sNo].getProto() != nullptr)
 			error("Duplicate prototype for spell %d", sNo);
 		spellBook[sNo].setProto(oNo);
 	} else
@@ -131,11 +131,11 @@ bool nonUsable(SkillProto *spell) {
 //-----------------------------------------------------------------------
 // test a target for viability in a given spell
 bool validTarget(GameObject *enactor, GameObject *target, ActiveItem *tag, SkillProto *skill) {
-	assert(enactor != NULL);
-	assert(skill != NULL);
+	assert(enactor != nullptr);
+	assert(skill != nullptr);
 	SpellStuff &sp = spellBook[skill->getSpellID()];
 	int32 range = sp.getRange();
-	if (target != NULL && target->thisID() != Nothing) {
+	if (target != nullptr && target->thisID() != Nothing) {
 #if RANGE_CHECKING
 		if (range > 0 &&
 		        range > (
@@ -161,7 +161,7 @@ bool validTarget(GameObject *enactor, GameObject *target, ActiveItem *tag, Skill
 			return sp.canTarget(spellTargCaster);
 		return sp.canTarget(spellTargObject);
 	}
-	if (tag != NULL) {
+	if (tag != nullptr) {
 		if (range > 0 &&
 		        range > (
 		            enactor->getWorldLocation() -
diff --git a/engines/saga2/main.cpp b/engines/saga2/main.cpp
index 5b2731d3cf..944e27562d 100644
--- a/engines/saga2/main.cpp
+++ b/engines/saga2/main.cpp
@@ -185,7 +185,7 @@ void main_saga2() {
 	cleanExit = gameInitialized;
 
 	if (gameInitialized)
-		mainLoop(cleanExit, 0, NULL);
+		mainLoop(cleanExit, 0, nullptr);
 
 	shutdownGame();
 	gameInitialized = false;
@@ -562,17 +562,17 @@ inline char drive(char *path) {
 static bool openResource(pHResource &hr, const char *fileName) {
 	if (hr)
 		delete hr;
-	hr = NULL;
+	hr = nullptr;
 
 	hr = new hResource(fileName);
 
-	while (hr == NULL || !hr->_valid) {
+	while (hr == nullptr || !hr->_valid) {
 		if (hr) delete hr;
-		hr = NULL;
+		hr = nullptr;
 		hr = new hResource(fileName);
 	}
 
-	if (hr == NULL || !hr->_valid) {
+	if (hr == nullptr || !hr->_valid) {
 		error("openResource: Cannot open resource: %s", fileName);
 //		return false;
 	}
@@ -624,17 +624,17 @@ bool openResources() {
 
 void closeResources() {
 	delete soundResFile;
-	soundResFile = NULL;
+	soundResFile = nullptr;
 	delete voiceResFile;
-	voiceResFile = NULL;
+	voiceResFile = nullptr;
 	delete scriptResFile;
-	scriptResFile = NULL;
+	scriptResFile = nullptr;
 	delete auxResFile;
-	auxResFile = NULL;
+	auxResFile = nullptr;
 	delete objResFile;
-	objResFile = NULL;
+	objResFile = nullptr;
 	delete resFile;
-	resFile = NULL;
+	resFile = nullptr;
 }
 
 /********************************************************************/
@@ -749,7 +749,7 @@ bool initGUIMessagers() {
 		char debItem[16];
 		sprintf(debItem, "Status%1.1d", i);
 		Status[i] = new StatusLineMessager(debItem, i, &g_vm->_mainPort);
-		if (Status[i] == NULL)
+		if (Status[i] == nullptr)
 			return false;
 		sprintf(debItem, "Status%2.2d", i + 10);
 		Status2[i] = new StatusLineMessager(debItem, i, &g_vm->_mainPort, 20, 21 + (11 * i));
@@ -765,9 +765,9 @@ bool initGUIMessagers() {
 void cleanupGUIMessagers() {
 	for (int i = 0; i < 10; i++) {
 		if (Status[i]) delete Status[i];
-		Status[i] = NULL;
+		Status[i] = nullptr;
 		if (Status2[i]) delete Status2[i];
-		Status2[i] = NULL;
+		Status2[i] = nullptr;
 	}
 	cleanupUserDialog();
 }
diff --git a/engines/saga2/mission.cpp b/engines/saga2/mission.cpp
index 8a25b07f9b..bae60a7387 100644
--- a/engines/saga2/mission.cpp
+++ b/engines/saga2/mission.cpp
@@ -37,7 +37,7 @@ ActiveMission       activeMissions[32];
 
 ActiveMission *ActiveMission::newMission(ObjectID genID, uint16 script) {
 	int             i;
-	ActiveMission   *ms = NULL;
+	ActiveMission   *ms = nullptr;
 
 	for (i = 0; i < ARRAYSIZE(activeMissions); i++) {
 		if (!(activeMissions[i]._data.missionFlags & inUse)) {
@@ -46,7 +46,7 @@ ActiveMission *ActiveMission::newMission(ObjectID genID, uint16 script) {
 		}
 	}
 
-	if (!ms) return NULL;
+	if (!ms) return nullptr;
 
 	ms->_data.missionID   = i;
 	ms->_data.generatorID = genID;
diff --git a/engines/saga2/modal.cpp b/engines/saga2/modal.cpp
index 65afd80f65..c75ca61449 100644
--- a/engines/saga2/modal.cpp
+++ b/engines/saga2/modal.cpp
@@ -41,7 +41,7 @@ void ModalModeHandleTask() {}
 void ModalModeHandleKey(short, short);
 
 GameMode        ModalMode = {
-	NULL,                                   // no previous mode
+	nullptr,                                // no previous mode
 	false,                                  // mode is not nestable
 	ModalModeSetup,
 	ModalModeCleanup,
@@ -56,14 +56,14 @@ extern void updateWindowSection(const Rect16 &r);
    Modal Window class member functions
  * ===================================================================== */
 
-ModalWindow *ModalWindow::current = NULL;
+ModalWindow *ModalWindow::current = nullptr;
 
 ModalWindow::ModalWindow(const Rect16 &r, uint16 ident, AppFunc *cmd)
 		: DecoratedWindow(r, ident, "DialogWindow", cmd) {
 	prevModeStackCtr = 0;
 
 	for (int i = 0; i < Max_Modes; i++)
-		prevModeStackPtr[i] = 0;
+		prevModeStackPtr[i] = nullptr;
 }
 
 ModalWindow::~ModalWindow() {
@@ -80,7 +80,7 @@ bool ModalWindow::isModal() {
 bool ModalWindow::open() {
 	g_vm->_mouseInfo->replaceObject();
 	g_vm->_mouseInfo->clearGauge();
-	g_vm->_mouseInfo->setText(NULL);
+	g_vm->_mouseInfo->setText(nullptr);
 	g_vm->_mouseInfo->setIntent(GrabInfo::WalkTo);
 
 	prevModeStackCtr = GameMode::getStack(prevModeStackPtr);
diff --git a/engines/saga2/motion.cpp b/engines/saga2/motion.cpp
index 15b1e795a4..1114912747 100644
--- a/engines/saga2/motion.cpp
+++ b/engines/saga2/motion.cpp
@@ -180,7 +180,7 @@ int32 getPathFindIQ(GameObject *obj) {
 //  be triggered.
 
 void setObjectSurface(GameObject *obj, StandingTileInfo &sti) {
-	ActiveItemID    tagID = sti.surfaceTAG != NULL
+	ActiveItemID    tagID = sti.surfaceTAG != nullptr
 	                        ?   sti.surfaceTAG->thisID()
 	                        :   NoActiveItem;
 
@@ -403,7 +403,7 @@ void MotionTaskList::write(Common::MemoryWriteStreamDynamic *out) {
 void MotionTaskList::cleanup() {
 	for (Common::List<MotionTask *>::iterator it = _list.begin(); it != _list.end(); ++it) {
 		abortPathFind(*it);
-		(*it)->pathFindTask = NULL;
+		(*it)->pathFindTask = nullptr;
 
 		delete *it;
 	}
@@ -479,7 +479,7 @@ void MotionTask::read(Common::InSaveFile *in) {
 	//  Convert the object ID to and object address
 	object =    objectID != Nothing
 	            ?   GameObject::objectAddress(objectID)
-	            :   NULL;
+	            :   nullptr;
 
 	//  If the object is an actor, plug this motion task into the actor
 	if (object && isActor(object))
@@ -524,7 +524,7 @@ void MotionTask::read(Common::InSaveFile *in) {
 
 		//  If this motion task previously had a path finding request
 		//  it must be restarted
-		pathFindTask = NULL;
+		pathFindTask = nullptr;
 	}
 
 	if (motionType == motionTypeThrown || motionType == motionTypeShot) {
@@ -546,13 +546,13 @@ void MotionTask::read(Common::InSaveFile *in) {
 
 			targetObj = targetObjID
 			            ?   GameObject::objectAddress(targetObjID)
-			            :   NULL;
+			            :   nullptr;
 
 			enactorID = in->readUint16LE();
 
 			o.enactor = enactorID != Nothing
 			            ? (Actor *)GameObject::objectAddress(enactorID)
-			            :   NULL;
+			            :   nullptr;
 		}
 	} else if (motionType == motionTypeClimbUp
 	           ||  motionType == motionTypeClimbDown) {
@@ -565,7 +565,7 @@ void MotionTask::read(Common::InSaveFile *in) {
 		ObjectID id = in->readUint16LE();
 		targetObj = id != Nothing
 		            ?   GameObject::objectAddress(id)
-		            :   NULL;
+		            :   nullptr;
 	} else if (motionType == motionTypeWait) {
 		actionCounter = in->readSint16LE();
 	} else if (motionType == motionTypeUseObject
@@ -578,7 +578,7 @@ void MotionTask::read(Common::InSaveFile *in) {
 	    ObjectID directObjID = in->readUint16LE();
 		o.directObject = directObjID != Nothing
 		                ?   GameObject::objectAddress(directObjID)
-		                :   NULL;
+		                :   nullptr;
 
 		direction = in->readByte();
 
@@ -587,14 +587,14 @@ void MotionTask::read(Common::InSaveFile *in) {
 		    ObjectID indirectObjID = in->readUint16LE();
 			o.indirectObject =  indirectObjID != Nothing
 			                    ?   GameObject::objectAddress(indirectObjID)
-			                    :   NULL;
+			                    :   nullptr;
 		} else {
 			if (motionType == motionTypeUseObjectOnTAI
 			        ||  motionType == motionTypeDropObjectOnTAI) {
 			    ActiveItemID tai(in->readSint16LE());
 				o.TAI = tai != NoActiveItem
 				        ?   ActiveItem::activeItemAddress(tai)
-				        :   NULL;
+				        :   nullptr;
 			}
 
 			if (motionType == motionTypeUseObjectOnLocation
@@ -607,7 +607,7 @@ void MotionTask::read(Common::InSaveFile *in) {
 		ActiveItemID tai(in->readSint16LE());
 		o.TAI = tai != NoActiveItem
 		        ?   ActiveItem::activeItemAddress(tai)
-		        :   NULL;
+		        :   nullptr;
 
 		direction = in->readByte();
 	} else if (motionType == motionTypeTwoHandedSwing
@@ -629,7 +629,7 @@ void MotionTask::read(Common::InSaveFile *in) {
 		//  Convert the target object ID to a pointer
 		targetObj = targetObjID != Nothing
 		            ?   GameObject::objectAddress(targetObjID)
-		            :   NULL;
+		            :   nullptr;
 
 		if (motionType == motionTypeCastSpell) {
 			SpellID sid       ;
@@ -641,19 +641,19 @@ void MotionTask::read(Common::InSaveFile *in) {
 			sid = (SpellID)in->readUint32LE();
 			spellObj = sid != nullSpell
 			           ? skillProtoFromID(sid)
-			           : NULL;
+			           : nullptr;
 
 			//  restore object target
 			toid = in->readUint16LE();
 			targetObj = toid != Nothing
 			            ?   GameObject::objectAddress(toid)
-			            :   NULL;
+			            :   nullptr;
 
 			//  restore TAG target
 			ttaid = in->readSint16LE();
 			targetTAG = ttaid != NoActiveItem
 			            ?  ActiveItem::activeItemAddress(ttaid)
-			            :  NULL;
+			            :  nullptr;
 
 			//  restore _data.location target
 			targetLoc.load(in);
@@ -677,11 +677,11 @@ void MotionTask::read(Common::InSaveFile *in) {
 		//  Convert IDs to pointers
 		d.attacker = attackerID != Nothing
 		            ? (Actor *)GameObject::objectAddress(attackerID)
-		            :   NULL;
+		            :   nullptr;
 
 		d.defensiveObj = defensiveObjID != Nothing
 		                ?   GameObject::objectAddress(defensiveObjID)
-		                :   NULL;
+		                :   nullptr;
 
 		//  Restore the defense flags
 		d.defenseFlags = in->readByte();
@@ -704,7 +704,7 @@ void MotionTask::read(Common::InSaveFile *in) {
 		//  Convert ID to pointer
 		d.attacker = attackerID != Nothing
 		            ? (Actor *)GameObject::objectAddress(attackerID)
-		            :   NULL;
+		            :   nullptr;
 
 		//  Restore the action counter
 		actionCounter = in->readSint16LE();
@@ -849,7 +849,7 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 	out->writeUint16LE(flags);
 
 	//  Convert the object pointer to an object ID
-	objectID = object != NULL ? object->thisID() : Nothing;
+	objectID = object != nullptr ? object->thisID() : Nothing;
 
 	//  Store the object ID
 	out->writeUint16LE(objectID);
@@ -907,13 +907,13 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 			ObjectID        targetObjID,
 			                enactorID;
 
-			targetObjID =   targetObj != NULL
+			targetObjID =   targetObj != nullptr
 			                ?   targetObj->thisID()
 			                :   Nothing;
 
 			out->writeUint16LE(targetObjID);
 
-			enactorID = o.enactor != NULL
+			enactorID = o.enactor != nullptr
 			            ?   o.enactor->thisID()
 			            :   Nothing;
 
@@ -927,7 +927,7 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 	} else if (motionType == motionTypeTurn) {
 		out->writeByte(direction);
 	} else if (motionType == motionTypeGive) {
-		if (targetObj != NULL)
+		if (targetObj != nullptr)
 			out->writeUint16LE(targetObj->thisID());
 		else
 			out->writeUint16LE(Nothing);
@@ -938,7 +938,7 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 	           ||  motionType == motionTypeDropObject
 	           ||  motionType == motionTypeDropObjectOnObject
 	           ||  motionType == motionTypeDropObjectOnTAI) {
-		if (o.directObject != NULL)
+		if (o.directObject != nullptr)
 			out->writeUint16LE(o.directObject->thisID());
 		else
 			out->writeUint16LE(Nothing);
@@ -947,14 +947,14 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 
 		if (motionType == motionTypeUseObjectOnObject
 		        ||  motionType == motionTypeDropObjectOnObject) {
-			if (o.indirectObject != NULL)
+			if (o.indirectObject != nullptr)
 				out->writeUint16LE(o.indirectObject->thisID());
 			else
 				out->writeUint16LE(Nothing);
 		} else {
 			if (motionType == motionTypeUseObjectOnTAI
 			        ||  motionType == motionTypeDropObjectOnTAI) {
-				if (o.TAI != NULL)
+				if (o.TAI != nullptr)
 					out->writeSint16LE(o.TAI->thisID());
 				else
 					out->writeSint16LE(NoActiveItem.val);
@@ -967,7 +967,7 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 			}
 		}
 	} else if (motionType == motionTypeUseTAI) {
-		if (o.TAI != NULL)
+		if (o.TAI != nullptr)
 			out->writeSint16LE(o.TAI->thisID());
 		else
 			out->writeSint16LE(NoActiveItem.val);
@@ -987,7 +987,7 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 		out->writeByte(combatMotionType);
 
 		//  Convert the target object pointer to an ID
-		targetObjID = targetObj != NULL ? targetObj->thisID() : Nothing;
+		targetObjID = targetObj != nullptr ? targetObj->thisID() : Nothing;
 
 		//  Store the target object ID
 		out->writeUint16LE(targetObjID);
@@ -995,15 +995,15 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 		if (motionType == motionTypeCastSpell) {
 			//  Convert the spell object pointer to an ID
 
-			SpellID sid         = spellObj != NULL
+			SpellID sid         = spellObj != nullptr
 			                      ? spellObj->getSpellID()
 			                      : nullSpell;
 
-			ObjectID toid       = targetObj != NULL
+			ObjectID toid       = targetObj != nullptr
 			                      ? targetObj->thisID()
 			                      : Nothing;
 
-			ActiveItemID ttaid  = targetTAG != NULL
+			ActiveItemID ttaid  = targetTAG != nullptr
 			                      ? targetTAG->thisID()
 			                      : NoActiveItem;
 
@@ -1033,8 +1033,8 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 		//  Store the direction
 		out->writeByte(direction);
 
-		attackerID = d.attacker != NULL ? d.attacker->thisID() : Nothing;
-		defensiveObjID = d.defensiveObj != NULL ? d.defensiveObj->thisID() : Nothing;
+		attackerID = d.attacker != nullptr ? d.attacker->thisID() : Nothing;
+		defensiveObjID = d.defensiveObj != nullptr ? d.defensiveObj->thisID() : Nothing;
 
 		//  Store the attacker's and defensive object's IDs
 		out->writeUint16LE(attackerID);
@@ -1055,7 +1055,7 @@ void MotionTask::write(Common::MemoryWriteStreamDynamic *out) {
 	           ||  motionType == motionTypeFallDown) {
 		ObjectID        attackerID;
 
-		attackerID = d.attacker != NULL ? d.attacker->thisID() : Nothing;
+		attackerID = d.attacker != nullptr ? d.attacker->thisID() : Nothing;
 
 		//  Store the attacker's ID
 		out->writeUint16LE(attackerID);
@@ -1081,7 +1081,7 @@ void MotionTask::remove(int16 returnVal) {
 	if (isActor(object)) {
 		Actor   *a = (Actor *)object;
 
-		a->_moveTask = NULL;
+		a->_moveTask = nullptr;
 		a->_cycleCount = g_vm->_rnd->getRandomNumber(19);
 
 		//  Make sure the actor is not left in a permanently
@@ -1093,7 +1093,7 @@ void MotionTask::remove(int16 returnVal) {
 	g_vm->_mTaskList->_list.remove(this);
 
 	abortPathFind(this);
-	pathFindTask = NULL;
+	pathFindTask = nullptr;
 
 	wakeUpThread(thread, returnVal);
 }
@@ -1158,7 +1158,7 @@ void MotionTask::turn(Actor &obj, Direction dir) {
 
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&obj)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&obj)) != nullptr) {
 		mt->direction = dir;
 		mt->motionType = motionTypeTurn;
 		mt->flags = reset;
@@ -1171,7 +1171,7 @@ void MotionTask::turn(Actor &obj, Direction dir) {
 void MotionTask::turnTowards(Actor &obj, const TilePoint &where) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&obj)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&obj)) != nullptr) {
 		mt->direction = (where - obj.getLocation()).quickDir();
 		mt->motionType = motionTypeTurn;
 		mt->flags = reset;
@@ -1185,7 +1185,7 @@ void MotionTask::turnTowards(Actor &obj, const TilePoint &where) {
 void MotionTask::give(Actor &actor, Actor &givee) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		mt->targetObj = &givee;
 		mt->motionType = motionTypeGive;
 		mt->flags = reset;
@@ -1198,7 +1198,7 @@ void MotionTask::give(Actor &actor, Actor &givee) {
 void MotionTask::throwObject(GameObject &obj, const TilePoint &velocity) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&obj)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&obj)) != nullptr) {
 		if (obj.isMissile()) obj._data.missileFacing = missileNoFacing;
 		mt->velocity = velocity;
 		mt->motionType = motionTypeThrown;
@@ -1216,7 +1216,7 @@ void MotionTask::throwObjectTo(GameObject &obj, const TilePoint &where) {
 	MotionTask      *mt;
 	const int16     turns = 15;
 
-	if ((mt = g_vm->_mTaskList->newTask(&obj)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&obj)) != nullptr) {
 		if (obj.isMissile()) obj._data.missileFacing = missileNoFacing;
 		mt->calcVelocity(where - obj.getLocation(), turns);
 		mt->motionType = motionTypeThrown;
@@ -1234,7 +1234,7 @@ void MotionTask::shootObject(
     int16 speed) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&obj)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&obj)) != nullptr) {
 		TilePoint   targetLoc = target.getLocation();
 
 		targetLoc.z += target.proto()->height / 2;
@@ -1245,7 +1245,7 @@ void MotionTask::shootObject(
 		if (isActor(&target)) {
 			Actor       *targetActor = (Actor *)⌖
 
-			if (targetActor->_moveTask != NULL) {
+			if (targetActor->_moveTask != nullptr) {
 				MotionTask      *targetMotion = targetActor->_moveTask;
 
 				if (targetMotion->motionType == motionTypeWalk)
@@ -1274,7 +1274,7 @@ void MotionTask::walkTo(
     bool            canAgitate) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		if (!mt->isReflex() && !actor.isImmobile()) {
 			unstickObject(&actor);
 			mt->finalTarget = mt->immediateLocation = target;
@@ -1303,11 +1303,11 @@ void MotionTask::walkToDirect(
     bool            canAgitate) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		if (!mt->isReflex() && !actor.isImmobile()) {
 			//  Abort any pending path finding task
 			abortPathFind(mt);
-			mt->pathFindTask = NULL;
+			mt->pathFindTask = nullptr;
 
 			unstickObject(&actor);
 			mt->motionType = mt->prevMotionType = motionTypeWalk;
@@ -1332,11 +1332,11 @@ void MotionTask::wander(
     bool        run) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		if (!mt->isReflex() && !actor.isImmobile()) {
 			//  Abort any pending path finding task
 			abortPathFind(mt);
-			mt->pathFindTask = NULL;
+			mt->pathFindTask = nullptr;
 
 			unstickObject(&actor);
 			mt->motionType = mt->prevMotionType = motionTypeWalk;
@@ -1362,11 +1362,11 @@ void MotionTask::tetheredWander(
     bool                run) {
 	MotionTask          *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		if (!mt->isReflex() && !actor.isImmobile()) {
 			//  Abort any pending path finding task
 			abortPathFind(mt);
-			mt->pathFindTask = NULL;
+			mt->pathFindTask = nullptr;
 
 			unstickObject(&actor);
 			mt->motionType = mt->prevMotionType = motionTypeWalk;
@@ -1393,7 +1393,7 @@ void MotionTask::tetheredWander(
 void MotionTask::upLadder(Actor &actor) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		if (mt->motionType != motionTypeClimbUp) {
 			mt->motionType = motionTypeClimbUp;
 			mt->flags = reset;
@@ -1407,7 +1407,7 @@ void MotionTask::upLadder(Actor &actor) {
 void MotionTask::downLadder(Actor &actor) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		if (mt->motionType != motionTypeClimbDown) {
 			mt->motionType = motionTypeClimbDown;
 			mt->flags = reset;
@@ -1421,7 +1421,7 @@ void MotionTask::downLadder(Actor &actor) {
 void MotionTask::talk(Actor &actor) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		if (mt->motionType != motionTypeTalk) {
 			mt->motionType = motionTypeTalk;
 			mt->flags = reset;
@@ -1436,7 +1436,7 @@ void MotionTask::talk(Actor &actor) {
 void MotionTask::jump(Actor &actor) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&actor)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&actor)) != nullptr) {
 		if (mt->motionType != motionTypeThrown) {
 			mt->velocity.z = 10;
 			mt->motionType = motionTypeJump;
@@ -1452,7 +1452,7 @@ void MotionTask::jump(Actor &actor) {
 void MotionTask::wait(Actor &a) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeWait) {
 			mt->motionType = motionTypeWait;
 			mt->flags = reset;
@@ -1466,7 +1466,7 @@ void MotionTask::wait(Actor &a) {
 void MotionTask::useObject(Actor &a, GameObject &dObj) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeUseObject) {
 			mt->motionType = motionTypeUseObject;
 			mt->o.directObject = &dObj;
@@ -1485,7 +1485,7 @@ void MotionTask::useObjectOnObject(
     GameObject  &target) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeUseObjectOnObject) {
 			mt->motionType = motionTypeUseObjectOnObject;
 			mt->o.directObject = &dObj;
@@ -1505,7 +1505,7 @@ void MotionTask::useObjectOnTAI(
     ActiveItem  &target) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeUseObjectOnTAI) {
 			mt->motionType = motionTypeUseObjectOnTAI;
 			mt->o.directObject = &dObj;
@@ -1524,7 +1524,7 @@ void MotionTask::useObjectOnLocation(
     const Location  &target) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeUseObjectOnLocation) {
 			mt->motionType = motionTypeUseObjectOnLocation;
 			mt->o.directObject = &dObj;
@@ -1540,7 +1540,7 @@ void MotionTask::useObjectOnLocation(
 void MotionTask::useTAI(Actor &a, ActiveItem &dTAI) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeUseTAI) {
 			mt->motionType = motionTypeUseTAI;
 			mt->o.TAI = &dTAI;
@@ -1558,7 +1558,7 @@ void MotionTask::dropObject(Actor       &a,
                             int16      num) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeDropObject) {
 			mt->motionType = motionTypeDropObject;
 			mt->o.directObject = &dObj;
@@ -1593,7 +1593,7 @@ void MotionTask::dropObjectOnObject(
 
 	//  Otherwise, drop it on the object
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeDropObjectOnObject) {
 			mt->motionType = motionTypeDropObjectOnObject;
 			mt->o.directObject = &dObj;
@@ -1614,7 +1614,7 @@ void MotionTask::dropObjectOnTAI(
     const Location  &loc) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeDropObjectOnTAI) {
 			mt->motionType = motionTypeDropObjectOnTAI;
 			mt->o.directObject = &dObj;
@@ -1646,7 +1646,7 @@ bool MotionTask::isReflex() {
 void MotionTask::twoHandedSwing(Actor &a, GameObject &target) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeTwoHandedSwing) {
 			mt->motionType = motionTypeTwoHandedSwing;
 			mt->targetObj = ⌖
@@ -1661,7 +1661,7 @@ void MotionTask::twoHandedSwing(Actor &a, GameObject &target) {
 void MotionTask::oneHandedSwing(Actor &a, GameObject &target) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeOneHandedSwing) {
 			mt->motionType = motionTypeOneHandedSwing;
 			mt->targetObj = ⌖
@@ -1676,7 +1676,7 @@ void MotionTask::oneHandedSwing(Actor &a, GameObject &target) {
 void MotionTask::fireBow(Actor &a, GameObject &target) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeFireBow) {
 			mt->motionType = motionTypeFireBow;
 			mt->targetObj = ⌖
@@ -1696,7 +1696,7 @@ void MotionTask::castSpell(Actor &a, SkillProto &spell, GameObject &target) {
 	    motionTypeCastSpell;
 
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != type) {
 			mt->motionType = type;
 			mt->spellObj = &spell;
@@ -1715,7 +1715,7 @@ void MotionTask::castSpell(Actor &a, SkillProto &spell, Location &target) {
 	    motionTypeGive :
 	    motionTypeCastSpell;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != type) {
 			mt->motionType = type;
 			mt->spellObj = &spell;
@@ -1734,7 +1734,7 @@ void MotionTask::castSpell(Actor &a, SkillProto &spell, ActiveItem &target) {
 	    motionTypeGive :
 	    motionTypeCastSpell;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != type) {
 			Location loc;
 			assert(target._data.itemType == activeTypeInstance);
@@ -1760,7 +1760,7 @@ void MotionTask::castSpell(Actor &a, SkillProto &spell, ActiveItem &target) {
 void MotionTask::useWand(Actor &a, GameObject &target) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeUseWand) {
 			mt->motionType = motionTypeUseWand;
 			mt->targetObj = ⌖
@@ -1780,7 +1780,7 @@ void MotionTask::twoHandedParry(
     Actor       &opponent) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeTwoHandedParry) {
 			mt->motionType = motionTypeTwoHandedParry;
 			mt->d.attacker = &opponent;
@@ -1800,7 +1800,7 @@ void MotionTask::oneHandedParry(
     Actor       &opponent) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeOneHandedParry) {
 			mt->motionType = motionTypeOneHandedParry;
 			mt->d.attacker = &opponent;
@@ -1820,7 +1820,7 @@ void MotionTask::shieldParry(
     Actor       &opponent) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeShieldParry) {
 			mt->motionType = motionTypeShieldParry;
 			mt->d.attacker = &opponent;
@@ -1837,7 +1837,7 @@ void MotionTask::shieldParry(
 void MotionTask::dodge(Actor &a, Actor &opponent) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeDodge) {
 			mt->motionType = motionTypeDodge;
 			mt->d.attacker = &opponent;
@@ -1855,7 +1855,7 @@ void MotionTask::dodge(Actor &a, Actor &opponent) {
 void MotionTask::acceptHit(Actor &a, Actor &opponent) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeAcceptHit) {
 			mt->motionType = motionTypeAcceptHit;
 			mt->d.attacker = &opponent;
@@ -1870,7 +1870,7 @@ void MotionTask::acceptHit(Actor &a, Actor &opponent) {
 void MotionTask::fallDown(Actor &a, Actor &opponent) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeFallDown) {
 			mt->motionType = motionTypeFallDown;
 			mt->d.attacker = &opponent;
@@ -1885,7 +1885,7 @@ void MotionTask::fallDown(Actor &a, Actor &opponent) {
 void MotionTask::die(Actor &a) {
 	MotionTask      *mt;
 
-	if ((mt = g_vm->_mTaskList->newTask(&a)) != NULL) {
+	if ((mt = g_vm->_mTaskList->newTask(&a)) != nullptr) {
 		if (mt->motionType != motionTypeDie) {
 			mt->motionType = motionTypeDie;
 			mt->flags = reset;
@@ -2144,7 +2144,7 @@ void MotionTask::ballisticAction() {
 		} else {
 			TilePoint       oldVelocity = velocity;
 
-			if (motionType == motionTypeShot && collisionObject != NULL) {
+			if (motionType == motionTypeShot && collisionObject != nullptr) {
 				//  If this motion is for a shot arrow and we did not
 				//  collide with our target object just continue the
 				//  motion as if there was no collision.
@@ -2160,7 +2160,7 @@ void MotionTask::ballisticAction() {
 					} else {
 						//  If the arrow failed to strike continue the
 						//  arrows flight as if there was no collision.
-						targetObj = NULL;
+						targetObj = nullptr;
 						location = newPos;
 						continue;
 					}
@@ -2319,7 +2319,7 @@ bool MotionTask::nextWayPoint() {
 	} else {
 		if (flags & wandering) {
 			immediateLocation = Nowhere;
-			if (pathFindTask == NULL)
+			if (pathFindTask == nullptr)
 				RequestWanderPath(this, getPathFindIQ(object));
 		} else if (flags & agitated) {
 			immediateLocation = Nowhere;
@@ -2333,7 +2333,7 @@ bool MotionTask::nextWayPoint() {
 				//  If no pathfind in progress
 				if ((flags & pathFind)
 				        &&  !(flags & finalPath)
-				        &&  pathFindTask == NULL)
+				        &&  pathFindTask == nullptr)
 					RequestPath(this, getPathFindIQ(object));
 
 				//  Set the immediate target to the final target,
@@ -2748,7 +2748,7 @@ void MotionTask::walkAction() {
 		//  "jumping" as he climbs up a small step.
 
 		if (tHeight >= object->_data.location.z - kMaxSmoothStep
-		        * ((sti.surfaceTile != NULL
+		        * ((sti.surfaceTile != nullptr
 		            && (sti.surfaceTile->combinedTerrainMask() & terrainStair))
 		           ?   4
 		           :   1)
@@ -2758,7 +2758,7 @@ void MotionTask::walkAction() {
 		if (freeFall(newPos, sti) == false) {
 			int16   newAction;
 
-			if (sti.surfaceTile != NULL
+			if (sti.surfaceTile != nullptr
 			        && (sti.surfaceTile->combinedTerrainMask() & terrainStair)
 			        &&  a->isActionAvailable(actionSpecial7)) {
 				Direction   stairsDir;
@@ -2874,7 +2874,7 @@ void MotionTask::upLadderAction() {
 
 		//  Iterate through all the tiles in the actor's tile region
 		for (ti = iter.first(&tileLoc, &sti);
-		        ti != NULL;
+		        ti != nullptr;
 		        ti = iter.next(&tileLoc, &sti)) {
 			if (!(ti->combinedTerrainMask() & terrainLadder)) continue;
 
@@ -2998,7 +2998,7 @@ void MotionTask::downLadderAction() {
 		TileIterator    iter(mapNum, actorTileReg);
 
 		for (ti = iter.first(&tileLoc, &sti);
-		        ti != NULL;
+		        ti != nullptr;
 		        ti = iter.next(&tileLoc, &sti)) {
 			if (!(ti->combinedTerrainMask() & terrainLadder)) continue;
 
@@ -3224,7 +3224,7 @@ void MotionTask::twoHandedSwingAction() {
 		combatMotionType = availableSet->selectRandom();
 		actorAnimation = animationTypeArray[combatMotionType];
 
-		if (a->_appearance != NULL
+		if (a->_appearance != nullptr
 		        &&  a->isActionAvailable(actorAnimation)) {
 			//  Compute the number of frames in the animation before the
 			//  actual strike
@@ -3340,7 +3340,7 @@ void MotionTask::oneHandedSwingAction() {
 		        else*/
 		{
 			actorAnimation = animationTypeArray[combatMotionType];
-			if (a->_appearance != NULL
+			if (a->_appearance != nullptr
 			        &&  a->isActionAvailable(actorAnimation)) {
 				//  Compute the number of frames in the animation before the
 				//  actual strike
@@ -3397,7 +3397,7 @@ GameObject *MotionTask::blockingObject(Actor *thisAttacker) {
 	            && (d.defenseFlags & blocking)
 	            &&  thisAttacker == d.attacker
 	            ?   d.defensiveObj
-	            :   NULL;
+	            :   nullptr;
 }
 
 //-----------------------------------------------------------------------
@@ -3416,7 +3416,7 @@ void MotionTask::fireBowAction() {
 		//  Compute the direction to the target
 		direction = (targetObj->getLocation() - a->getLocation()).quickDir();
 
-		if (a->_appearance != NULL
+		if (a->_appearance != nullptr
 		        &&  a->isActionAvailable(actionFireBow)) {
 			//  Calculate the number of frames in the animation before the
 			//  projectile is actually fired
@@ -3446,7 +3446,7 @@ void MotionTask::fireBowAction() {
 	else {
 		//  If the actors appearance becomes NULL, make sure this action
 		//  no longer depends upon the animation
-		if ((flags & nextAnim) && a->_appearance == NULL)
+		if ((flags & nextAnim) && a->_appearance == nullptr)
 			flags &= ~nextAnim;
 
 		//  If the action counter has reached zero, get a projectile and
@@ -3455,7 +3455,7 @@ void MotionTask::fireBowAction() {
 			GameObject  *missileWeapon;
 
 			missileWeapon = GameObject::objectAddress(a->_leftHandObject);
-			if (missileWeapon != NULL) {
+			if (missileWeapon != nullptr) {
 				GameObject  *proj;
 
 				//  Ask the missile weapon's prototype to get a projectile
@@ -3464,7 +3464,7 @@ void MotionTask::fireBowAction() {
 				            a->thisID());
 
 				//  Shoot the projectile
-				if (proj != NULL) {
+				if (proj != nullptr) {
 					TilePoint   actorLoc = a->getLocation();
 					uint8       actorCrossSection = a->proto()->crossSection,
 					            projCrossSection = proj->proto()->crossSection;
@@ -3511,7 +3511,7 @@ void MotionTask::castSpellAction() {
 		a->turn(direction);
 	else {
 		if (flags & reset) {
-			if (a->_appearance != NULL
+			if (a->_appearance != nullptr
 			        &&  a->isActionAvailable(actionCastSpell)) {
 				//  Calculate the number of frames in the animation before the
 				//  spell is case
@@ -3534,7 +3534,7 @@ void MotionTask::castSpellAction() {
 
 		//  If the actors appearance becomes NULL, make sure this action
 		//  no longer depends upon the animation
-		if ((flags & nextAnim) && a->_appearance == NULL)
+		if ((flags & nextAnim) && a->_appearance == nullptr)
 			flags &= ~nextAnim;
 
 		if (actionCounter == 0) {
@@ -3578,7 +3578,7 @@ void MotionTask::useWandAction() {
 
 		direction = (targetObj->getLocation() - a->getLocation()).quickDir();
 
-		if (a->_appearance != NULL
+		if (a->_appearance != nullptr
 		        &&  a->isActionAvailable(actionUseWand)) {
 			actionCounter = a->animationFrames(actionUseWand, direction) - 1;
 			a->setAction(actionUseWand, 0);
@@ -3613,7 +3613,7 @@ void MotionTask::twoHandedParryAction() {
 
 		direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
 
-		if (a->_appearance != NULL
+		if (a->_appearance != nullptr
 		        &&  a->isActionAvailable(actionTwoHandParry)) {
 			a->setAction(actionTwoHandParry, 0);
 			animationFrames = a->animationFrames(actionTwoHandParry, direction);
@@ -3649,7 +3649,7 @@ void MotionTask::oneHandedParryAction() {
 		direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
 
 		combatMotionType = oneHandedParryHigh;
-		if (a->_appearance != NULL
+		if (a->_appearance != nullptr
 		        &&  a->isActionAvailable(actionParryHigh)) {
 			a->setAction(actionParryHigh, 0);
 			animationFrames = a->animationFrames(actionParryHigh, direction);
@@ -3684,7 +3684,7 @@ void MotionTask::shieldParryAction() {
 
 		direction = (d.attacker->getLocation() - a->getLocation()).quickDir();
 
-		if (a->_appearance != NULL
+		if (a->_appearance != nullptr
 		        &&  a->isActionAvailable(actionShieldParry)) {
 			a->setAction(actionShieldParry, 0);
 			animationFrames = a->animationFrames(actionShieldParry, direction);
@@ -3718,7 +3718,7 @@ void MotionTask::dodgeAction() {
 
 	if (flags & reset) {
 		//  If the attacker is not attacking, we're done
-		if (attackerMotion == NULL
+		if (attackerMotion == nullptr
 		        ||  !attackerMotion->isMeleeAttack()) {
 			a->setInterruptablity(true);
 			remove();
@@ -3729,7 +3729,7 @@ void MotionTask::dodgeAction() {
 		if (attackerMotion->framesUntilStrike() <= 2) {
 			int16       animationFrames;
 
-			if (a->_appearance != NULL
+			if (a->_appearance != nullptr
 			        &&  a->isActionAvailable(actionJumpUp, a->_currentFacing)) {
 				a->setAction(actionJumpUp, 0);
 				animationFrames = a->animationFrames(actionJumpUp, a->_currentFacing);
@@ -3753,7 +3753,7 @@ void MotionTask::dodgeAction() {
 	} else {
 		//  If the actors appearance becomes NULL, make sure this action
 		//  no longer depends upon the animation
-		if ((flags & nextAnim) && a->_appearance == NULL)
+		if ((flags & nextAnim) && a->_appearance == nullptr)
 			flags &= ~nextAnim;
 
 		if (flags & nextAnim) {
@@ -3785,7 +3785,7 @@ void MotionTask::acceptHitAction() {
 		a->_currentFacing =
 		    (d.attacker->getWorldLocation() - a->getLocation()).quickDir();
 
-		if (a->_appearance != NULL
+		if (a->_appearance != nullptr
 		        &&  a->isActionAvailable(actionHit, a->_currentFacing)) {
 			a->setAction(actionHit, 0);
 			animationFrames = a->animationFrames(actionHit, a->_currentFacing);
@@ -3819,7 +3819,7 @@ void MotionTask::acceptHitAction() {
 	} else {
 		//  If the actors appearance becomes NULL, make sure this action
 		//  no longer depends upon the animation
-		if ((flags & nextAnim) && a->_appearance == NULL)
+		if ((flags & nextAnim) && a->_appearance == nullptr)
 			flags &= ~nextAnim;
 
 		if (flags & nextAnim) {
@@ -3843,7 +3843,7 @@ void MotionTask::fallDownAction() {
 		a->_currentFacing =
 		    (d.attacker->getWorldLocation() - a->getLocation()).quickDir();
 
-		if (a->_appearance != NULL
+		if (a->_appearance != nullptr
 		        &&  a->isActionAvailable(actionKnockedDown, a->_currentFacing)) {
 			a->setAction(actionKnockedDown, 0);
 			animationFrames =   a->animationFrames(
@@ -3879,7 +3879,7 @@ void MotionTask::fallDownAction() {
 	} else {
 		//  If the actors appearance becomes NULL, make sure this action
 		//  no longer depends upon the animation
-		if ((flags & nextAnim) && a->_appearance == NULL)
+		if ((flags & nextAnim) && a->_appearance == nullptr)
 			flags &= ~nextAnim;
 
 		if (flags & nextAnim) {
@@ -3902,7 +3902,7 @@ void MotionTask::offensiveMeleeAction() {
 	else {
 		//  If the actors appearance becomes NULL, make sure this action
 		//  no longer depends upon the animation
-		if ((flags & nextAnim) && a->_appearance == NULL)
+		if ((flags & nextAnim) && a->_appearance == nullptr)
 			flags &= ~nextAnim;
 
 		//  If the action counter has reached zero, use the weapon on
@@ -3941,7 +3941,7 @@ void MotionTask::useMagicWeaponAction() {
 	else {
 		//  If the actors appearance becomes NULL, make sure this action
 		//  no longer depends upon the animation
-		if ((flags & nextAnim) && a->_appearance == NULL)
+		if ((flags & nextAnim) && a->_appearance == nullptr)
 			flags &= ~nextAnim;
 
 		//  If the action counter has reached zero, get a spell and
@@ -3951,7 +3951,7 @@ void MotionTask::useMagicWeaponAction() {
 
 			magicWeapon = a->offensiveObject();
 
-			if (magicWeapon != NULL && magicWeapon->IDChild() != Nothing) {
+			if (magicWeapon != nullptr && magicWeapon->IDChild() != Nothing) {
 				GameObject      *spell;
 				SkillProto      *spellProto;
 
@@ -3994,7 +3994,7 @@ void MotionTask::defensiveMeleeAction() {
 	//  Determine if the blocking action has been initiated
 	if (!(d.defenseFlags & blocking)) {
 		//  If the attacker is not attacking, we're done
-		if (attackerMotion == NULL
+		if (attackerMotion == nullptr
 		        ||  !attackerMotion->isMeleeAttack()) {
 			a->setInterruptablity(true);
 			remove();
@@ -4011,13 +4011,13 @@ void MotionTask::defensiveMeleeAction() {
 	} else {
 		//  If the actors appearance becomes NULL, make sure this action
 		//  no longer depends upon the animation
-		if ((flags & nextAnim) && a->_appearance == NULL)
+		if ((flags & nextAnim) && a->_appearance == nullptr)
 			flags &= ~nextAnim;
 
 		//  Run through the animation frames
 		if (!(flags & nextAnim) || a->nextAnimationFrame()) {
 			//  Wait for the attacker's attack
-			if (attackerMotion == NULL
+			if (attackerMotion == nullptr
 			        ||  !attackerMotion->isMeleeAttack()) {
 				a->setInterruptablity(true);
 				remove();
@@ -4707,7 +4707,7 @@ bool checkLadder(Actor *a, const TilePoint &loc) {
 	TileIterator    iter(mapNum, actorTileReg);
 
 	for (ti = iter.first(&tileLoc, &sti);
-	        ti != NULL;
+	        ti != nullptr;
 	        ti = iter.next(&tileLoc, &sti)) {
 		if (!(ti->combinedTerrainMask() & terrainLadder)) continue;
 
diff --git a/engines/saga2/msgbox.cpp b/engines/saga2/msgbox.cpp
index 1f7af57eec..d23877d68f 100644
--- a/engines/saga2/msgbox.cpp
+++ b/engines/saga2/msgbox.cpp
@@ -87,7 +87,7 @@ int16 userDialog(const char *title, const char *msg, const char *btnMsg1, const
 int16 FTAMessageBox(const char *msg, const char *btnMsg1, const char *btnMsg2) {
 	int16 rv = -1;
 	if (userDialogAvailable()) {
-		rv = (0 == userDialog(ERROR_HEADING, msg, btnMsg1, btnMsg2, NULL));
+		rv = (0 == userDialog(ERROR_HEADING, msg, btnMsg1, btnMsg2, nullptr));
 	} else
 		rv = MsgBox(msg, btnMsg1, btnMsg2);
 	return rv;
@@ -114,7 +114,7 @@ APPFUNC(ErrorWindow::cmdMessageWindow) {
 
 	if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
 		win = ev.panel->getWindow();        // get the window pointer
-		ri = win ? (requestInfo *)win->userData : NULL;
+		ri = win ? (requestInfo *)win->userData : nullptr;
 
 		if (ri) {
 			ri->running = 0;
@@ -142,7 +142,7 @@ ErrorWindow::ErrorWindow(const char *msg, const char *btnMsg1, const char *btnMs
 	// button one
 	if (btnMsg1) {
 		new SimpleButton(*this, butBox(numBtns, 0), btnMsg1, 0, cmdMessageWindow);
-		if ((eq = strchr(btnMsg1, '_')) != NULL) {
+		if ((eq = strchr(btnMsg1, '_')) != nullptr) {
 			eq++;
 			if (eq)
 				mbChs1Text[strlen(mbChs1Text)] = *eq;
@@ -152,7 +152,7 @@ ErrorWindow::ErrorWindow(const char *msg, const char *btnMsg1, const char *btnMs
 	// button two
 	if (btnMsg2) {
 		new SimpleButton(*this, butBox(numBtns, 1), btnMsg2, 1, cmdMessageWindow);
-		if ((eq = strchr(btnMsg2, '_')) != NULL) {
+		if ((eq = strchr(btnMsg2, '_')) != nullptr) {
 			eq++;
 			if (eq)
 				mbChs2Text[strlen(mbChs2Text)] = *eq;
@@ -197,7 +197,7 @@ void ErrorWindow::ErrorModeHandleKey(short key, short) {
 }
 
 GameMode        SimpleMode = {
-	NULL,                                   // no previous mode
+	nullptr,                                // no previous mode
 	false,                                  // mode is not nestable
 	ErrorWindow::ErrorModeSetup,
 	ErrorWindow::ErrorModeCleanup,
diff --git a/engines/saga2/music.cpp b/engines/saga2/music.cpp
index eecf3564ad..2261cfb5ef 100644
--- a/engines/saga2/music.cpp
+++ b/engines/saga2/music.cpp
@@ -38,7 +38,7 @@
 
 namespace Saga2 {
 
-Music::Music(hResContext *musicRes) : _musicContext(musicRes), _parser(0) {
+Music::Music(hResContext *musicRes) : _musicContext(musicRes), _parser(nullptr) {
 	static const char *opl2InstDefFilename = "SAMPLE.AD";
 	static const char *opl3InstDefFilename = "SAMPLE.OPL";
 
@@ -91,7 +91,7 @@ Music::~Music() {
 		delete _parser;
 	}
 	if (_driver) {
-		_driver->setTimerCallback(0, 0);
+		_driver->setTimerCallback(nullptr, nullptr);
 		_driver->close();
 		delete _driver;
 	}
@@ -118,7 +118,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
 	if (_parser) {
 		_parser->unloadMusic();
 	} else {
-		_parser = MidiParser::createParser_XMIDI(0, 0, 0);
+		_parser = MidiParser::createParser_XMIDI(nullptr, nullptr, 0);
 
 		_parser->setMidiDriver(_driver);
 		_parser->setTimerRate(_driver->getBaseTempo());
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 92439adff9..064c980423 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -4426,7 +4426,7 @@ void readyContainerSetup() {
 		                      trioReadyContInfo[i].rows,
 		                      trioReadyContInfo[i].cols,
 		                      trioReadyContInfo[i].rows,
-		                      0);
+		                      nullptr);
 
 		TrioCviews[i]->draw();
 	}
@@ -4442,7 +4442,7 @@ void readyContainerSetup() {
 	                  indivReadyContInfoTop.rows,
 	                  indivReadyContInfoTop.cols,
 	                  indivReadyContInfoTop.rows,
-	                  0);
+	                  nullptr);
 
 	indivCviewTop->draw();
 
@@ -4457,7 +4457,7 @@ void readyContainerSetup() {
 	                  indivReadyContInfoBot.rows,
 	                  indivReadyContInfoBot.cols,
 	                  indivReadyContInfoBot.rows,
-	                  0);
+	                  nullptr);
 	indivCviewBot->setScrollOffset(1);   // set the object draw up by one
 	indivCviewBot->draw();
 
diff --git a/engines/saga2/objproto.cpp b/engines/saga2/objproto.cpp
index 5cd59f253b..4445562f76 100644
--- a/engines/saga2/objproto.cpp
+++ b/engines/saga2/objproto.cpp
@@ -152,7 +152,7 @@ bool ProtoObj::useOnAction(ObjectID dObj, ObjectID enactor, ObjectID item) {
 //  UseOn active item command
 bool ProtoObj::useOn(ObjectID dObj, ObjectID enactor, ActiveItem *item) {
 	assert(dObj != Nothing);
-	assert(item != NULL);
+	assert(item != nullptr);
 
 	int16   scrResult;
 
@@ -412,7 +412,7 @@ bool ProtoObj::dropOn(
     const Location  &loc,
     int16           num) {
 	assert(dObj != Nothing);
-	assert(target != NULL);
+	assert(target != nullptr);
 	assert(isWorld(loc.context));
 
 	return dropOnAction(dObj, enactor, target, loc, num);
@@ -791,7 +791,7 @@ uint16  ProtoObj::containmentSet() {
 
 //  return the sprite data
 ObjectSpriteInfo ProtoObj::getSprite(GameObject *obj, enum spriteTypes spr, int16 count) {
-	ObjectSpriteInfo    sprInfo = { NULL, static_cast<bool>((flags & objPropFlipped) != 0) };
+	ObjectSpriteInfo    sprInfo = { nullptr, static_cast<bool>((flags & objPropFlipped) != 0) };
 	int16               openOffset = ((flags & objPropVisOpen) && obj->isOpen()) ? 1 : 0;
 
 	switch (spr) {
@@ -833,7 +833,7 @@ ObjectSpriteInfo ProtoObj::getSprite(GameObject *obj, enum spriteTypes spr, int1
 
 //  return the address of the sprite when held in hand
 Sprite *ProtoObj::getOrientedSprite(GameObject *obj, int16 offset) {
-	return NULL;
+	return nullptr;
 }
 
 int16 ProtoObj::stdActionScript(
@@ -895,12 +895,12 @@ void ProtoObj::initiateDefense(ObjectID, ObjectID, ObjectID) {}
 
 //  Get projectile for missile weapons
 GameObject *ProtoObj::getProjectile(ObjectID, ObjectID) {
-	return NULL;
+	return nullptr;
 }
 
 //  Get spell from a magic object
 GameObject *ProtoObj::getSpell(ObjectID) {
-	return NULL;
+	return nullptr;
 }
 
 //  Determine if this type of object can block an attack
@@ -1067,7 +1067,7 @@ bool InventoryProto::dropAction(
 		ProtoObj            *enactorProto = enactorPtr->proto();
 		TilePoint           enactorLoc(enactorPtr->getLocation());
 		TilePoint           vector = loc - enactorLoc;
-		GameObject          *extractedObj = NULL;
+		GameObject          *extractedObj = nullptr;
 
 		//  Split the merged object if needed.
 		if (dObjPtr->isMergeable()           //  If mergeable
@@ -1075,7 +1075,7 @@ bool InventoryProto::dropAction(
 			if (num == 0) return false;         //  If mergeing zero, then do nothing
 
 			extractedObj = dObjPtr->extractMerged(dObjPtr->getExtra() - num);
-			if (extractedObj == NULL)
+			if (extractedObj == nullptr)
 				return false;
 
 			extractedObj->move(
@@ -1112,7 +1112,7 @@ bool InventoryProto::dropAction(
 			}
 
 			if (startPt == Nowhere) {
-				if (extractedObj != NULL)
+				if (extractedObj != nullptr)
 					GameObject::mergeWith(extractedObj, dObjPtr, extractedObj->getExtra());
 				return false;
 			}
@@ -1142,7 +1142,7 @@ bool InventoryProto::dropOnAction(
     const Location  &loc,
     int16           num) {
 	assert(dObj != Nothing);
-	assert(target != NULL);
+	assert(target != nullptr);
 	assert(isWorld(loc.context));
 
 	if (drop(dObj, enactor, loc, num)) {
@@ -1340,7 +1340,7 @@ bool PhysicalContainerProto::acceptInsertionAtAction(
 
 	GameObject  *dObjPtr = GameObject::objectAddress(dObj);
 	GameObject  *itemPtr = GameObject::objectAddress(item);
-	GameObject  *extractedObj = NULL;
+	GameObject  *extractedObj = nullptr;
 	Location    oldLoc(itemPtr->getLocation(), itemPtr->IDParent());
 
 	//  Split the merged object if needed.
@@ -1349,7 +1349,7 @@ bool PhysicalContainerProto::acceptInsertionAtAction(
 		if (num == 0) return false;         //  If mergeing zero, then do nothing
 
 		extractedObj = itemPtr->extractMerged(itemPtr->getExtra() - num);
-		if (extractedObj == NULL)
+		if (extractedObj == nullptr)
 			return false;
 
 		extractedObj->move(oldLoc);
@@ -1362,7 +1362,7 @@ bool PhysicalContainerProto::acceptInsertionAtAction(
 		return true;
 	}
 	itemPtr->move(oldLoc);
-	if (extractedObj != NULL)
+	if (extractedObj != nullptr)
 		GameObject::mergeWith(extractedObj, itemPtr, extractedObj->getExtra());
 
 	return false;
@@ -1549,10 +1549,10 @@ bool MeleeWeaponProto::useAction(ObjectID dObj, ObjectID enactor) {
 
 		leftHandObjectPtr = a->_leftHandObject != Nothing
 		                    ?   GameObject::objectAddress(a->_leftHandObject)
-		                    :   NULL;
+		                    :   nullptr;
 
 		if (dObjPtr->proto()->isTwoHanded(enactor)
-		        || (leftHandObjectPtr != NULL
+		        || (leftHandObjectPtr != nullptr
 		            &&  leftHandObjectPtr->proto()->isTwoHanded(enactor)))
 			a->holdInLeftHand(Nothing);
 
@@ -1710,7 +1710,7 @@ uint8 MeleeWeaponProto::weaponRating(
 
 	//  If the wielder is on screen yet does not have the attack frames
 	//  for this weapon then this weapon is useless
-	if (wielder->_appearance != NULL
+	if (wielder->_appearance != nullptr
 	        &&  !wielder->isActionAvailable(fightStanceAction(wielderID)))
 		return 0;
 
@@ -1929,13 +1929,13 @@ uint8 BowProto::weaponRating(
 	assert(isActor(wielderID));
 	assert(isObject(targetID) || isActor(targetID));
 
-	if (getProjectile(weaponID_, wielderID) == NULL) return 0;
+	if (getProjectile(weaponID_, wielderID) == nullptr) return 0;
 
 	Actor       *wielder = (Actor *)GameObject::objectAddress(wielderID);
 
 	//  If the wielder is on screen yet does not have the attack frames
 	//  for this weapon then this weapon is useless
-	if (wielder->_appearance != NULL
+	if (wielder->_appearance != nullptr
 	        &&  !wielder->isActionAvailable(fightStanceAction(wielderID)))
 		return 0;
 
@@ -2024,7 +2024,7 @@ uint8 WeaponWandProto::weaponRating(
 
 	//  If the wielder is on screen yet does not have the attack frames
 	//  for this weapon then this weapon is useless
-	if (wielder->_appearance != NULL
+	if (wielder->_appearance != nullptr
 	        &&  !wielder->isActionAvailable(fightStanceAction(wielderID)))
 		return 0;
 
@@ -2065,7 +2065,7 @@ int16 WeaponWandProto::fightStanceAction(ObjectID actor) {
 //	return the address of the sprite when held in hand
 
 Sprite *ProjectileProto::getOrientedSprite(GameObject *, int16) {
-	return NULL;
+	return nullptr;
 }
 
 //-----------------------------------------------------------------------
@@ -2574,7 +2574,7 @@ ObjectSpriteInfo IntangibleObjProto::getSprite(
     GameObject *obj,
     enum spriteTypes spr,
     int16) {
-	ObjectSpriteInfo    sprInfo = { NULL, false };
+	ObjectSpriteInfo    sprInfo = { nullptr, false };
 
 	switch (spr) {
 	case objOnGround:
@@ -2670,7 +2670,7 @@ bool SkillProto::dropAction(ObjectID dObj,  ObjectID enactor, const Location &lo
 	if (isWorld(loc.context)) {
 		Actor       *enactorPtr = (Actor *)GameObject::objectAddress(enactor);
 
-		if (validTarget(enactorPtr, NULL, NULL, this))
+		if (validTarget(enactorPtr, nullptr, nullptr, this))
 			return useOn(dObj, enactor, loc);
 
 		return false;
@@ -2688,7 +2688,7 @@ bool SkillProto::dropOnAction(ObjectID dObj, ObjectID enactor, ObjectID target,
 	if (isWorld(targetPtr->IDParent())) {
 		Actor       *enactorPtr = (Actor *)GameObject::objectAddress(enactor);
 
-		if (validTarget(enactorPtr, targetPtr, NULL, this))
+		if (validTarget(enactorPtr, targetPtr, nullptr, this))
 			return useOn(dObj, enactor, target);
 	}
 
@@ -2703,10 +2703,10 @@ bool SkillProto::dropOnAction(
     int16           num) {
 	assert(isActor(enactor));
 
-	if (target != NULL) {
+	if (target != nullptr) {
 		Actor       *enactorPtr = (Actor *)GameObject::objectAddress(enactor);
 
-		if (validTarget(enactorPtr, NULL, target, this))
+		if (validTarget(enactorPtr, nullptr, target, this))
 			return useOn(dObj, enactor, target);
 	}
 
diff --git a/engines/saga2/panel.cpp b/engines/saga2/panel.cpp
index 6af8e27d52..acc6315ab2 100644
--- a/engines/saga2/panel.cpp
+++ b/engines/saga2/panel.cpp
@@ -116,9 +116,9 @@ gPanel::gPanel(gPanelList &list, const StaticRect &box,
 
 gPanel::~gPanel() {
 	if (this == g_vm->_toolBase->mousePanel)
-		g_vm->_toolBase->mousePanel = NULL;
+		g_vm->_toolBase->mousePanel = nullptr;
 	if (this == g_vm->_toolBase->activePanel)
-		g_vm->_toolBase->activePanel = NULL;
+		g_vm->_toolBase->activePanel = nullptr;
 }
 void gPanel::draw() {}
 void gPanel::drawClipped(gPort &, const Point16 &, const Rect16 &) {}
@@ -172,7 +172,7 @@ bool gPanel::activate(gEventType) {
 }
 
 void gPanel::deactivate() {
-	if (isActive()) g_vm->_toolBase->activePanel = NULL;
+	if (isActive()) g_vm->_toolBase->activePanel = nullptr;
 }
 
 void gPanel::makeActive() {
@@ -190,7 +190,7 @@ void gPanel::drawTitle(enum text_positions placement) {
 	Rect16          r = _extent;
 	const gPixelMap *img = nullptr;
 
-	if (title == NULL)
+	if (title == nullptr)
 		return;
 
 	if (imageLabel) {
@@ -248,11 +248,11 @@ void gPanel::drawTitle(enum text_positions placement) {
 }
 
 gPanel *gPanel::hitTest(const Point16 &p) {
-	return enabled && !ghosted && _extent.ptInside(p) ? this : NULL;
+	return enabled && !ghosted && _extent.ptInside(p) ? this : nullptr;
 }
 
 gPanel *gPanel::keyTest(int16) {
-	return NULL;
+	return nullptr;
 }
 
 /* ===================================================================== *
@@ -271,7 +271,7 @@ gPanelList::gPanelList(gWindow &win, const Rect16 &box, char *newTitle,
 //  Constructor for standalone panels..
 
 gPanelList::gPanelList(gPanelList &list)
-	: gPanel(list, list.window.getExtent(), NULL, 0, NULL) {
+	: gPanel(list, list.window.getExtent(), nullptr, 0, nullptr) {
 	window.contents.push_back(this);
 }
 
@@ -353,11 +353,11 @@ gPanel *gPanelList::hitTest(const Point16 &p) {
 	if (enabled && !ghosted) {
 		for (Common::List<gPanel *>::iterator it = contents.begin(); it != contents.end(); ++it) {
 			ctl = *it;
-			if ((result = ctl->hitTest(p)) != NULL)
+			if ((result = ctl->hitTest(p)) != nullptr)
 				return result;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 gPanel *gPanelList::keyTest(int16 key) {
@@ -367,12 +367,12 @@ gPanel *gPanelList::keyTest(int16 key) {
 	if (enabled && !ghosted) {
 		for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) {
 			ctl = *it;
-			if ((result = ctl->keyTest(key)) != NULL)
+			if ((result = ctl->keyTest(key)) != nullptr)
 				return result;
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 /* ===================================================================== *
@@ -386,7 +386,7 @@ StaticRect    gWindow::dragExtent = {0, 0, 0, 0};            // dragging extent
 StaticPoint16 gWindow::dragOffset = {0, 0};            // offset to window origin
 
 gWindow::gWindow(const Rect16 &box, uint16 ident, const char saveName[], AppFunc *cmd)
-	: gPanelList(*this, box, NULL, ident, cmd)
+	: gPanelList(*this, box, nullptr, ident, cmd)
 	  //, saver(WIIFF_POS|WIIFS_NORMAL|WIIFE_ONEXIT,iniFile,saveName,box,this)
 {
 	openFlag = false;
@@ -435,7 +435,7 @@ bool gWindow::open() {
 	g_vm->_toolBase->leavePanel();
 	g_vm->_toolBase->windowList.push_front(this);
 	g_vm->_toolBase->activeWindow = this;
-	g_vm->_toolBase->setActive(NULL);
+	g_vm->_toolBase->setActive(nullptr);
 
 //	g_vm->_pointer->hide();
 //	if (backSave) backSave->save( *globalPort );
@@ -468,7 +468,7 @@ void gWindow::close() {
 	g_vm->_toolBase->windowList.remove(this);
 
 	g_vm->_toolBase->mouseWindow = g_vm->_toolBase->activeWindow = g_vm->_toolBase->windowList.front();
-	g_vm->_toolBase->mousePanel = g_vm->_toolBase->activePanel = NULL;
+	g_vm->_toolBase->mousePanel = g_vm->_toolBase->activePanel = nullptr;
 }
 
 //  Move the window to the front...
@@ -479,7 +479,7 @@ void gWindow::toFront() {            // re-order the windows
 	g_vm->_toolBase->windowList.remove(this);
 	g_vm->_toolBase->windowList.push_front(this);
 
-	g_vm->_toolBase->activePanel = NULL;
+	g_vm->_toolBase->activePanel = nullptr;
 	g_vm->_toolBase->activeWindow = this;
 
 	//  redraw the window
@@ -663,7 +663,7 @@ void gControl::ghost(bool sel) {
 }
 
 gPanel *gControl::keyTest(int16 key) {
-	return accelKey == key ? this : NULL;
+	return accelKey == key ? this : nullptr;
 }
 
 //  For many controls, the only drawing routine we need is the
@@ -685,7 +685,7 @@ void gControl::draw() {
 
 gGenericControl::gGenericControl(gPanelList &list, const Rect16 &box,
                                  uint16 ident, AppFunc *cmd)
-	: gControl(list, box, NULL, ident, cmd) {
+	: gControl(list, box, nullptr, ident, cmd) {
 	dblClickFlag = false;
 }
 
@@ -737,13 +737,13 @@ void gGenericControl::draw() {
 void gToolBase::setActive(gPanel *ctl) {
 	if (activePanel && activePanel == ctl)  return;
 	if (activePanel) activePanel->deactivate();
-	if (ctl == NULL || ctl->activate(gEventNone)) activePanel = ctl;
+	if (ctl == nullptr || ctl->activate(gEventNone)) activePanel = ctl;
 }
 
 void gToolBase::handleMouse(Common::Event &event, uint32 time) {
 	gWindow         *w = activeWindow;
 	gPanel          *ctl,
-	                *pickPanel = NULL;
+	                *pickPanel = nullptr;
 	static gMouseState prevState;
 	static int32    lastClickTime = 0x8000;
 	static Point16  lastClickPos;
@@ -789,12 +789,12 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
 	        &&  prevState.right != _curMouseState.right) {
 		lastMouseMoveTime = msg.timeStamp;
 		if (mouseHintSet)
-			setMouseTextF(NULL);
+			setMouseTextF(nullptr);
 	}
 
 	//  If there is no active window, then do nothing.
 
-	if (w == NULL) {
+	if (w == nullptr) {
 		prevState = _curMouseState;
 		return;
 	}
@@ -821,7 +821,7 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
 
 	if (((_curMouseState.left  && !leftDrag)            // if left button hit
 	        || (_curMouseState.right && !rightDrag))      // or right button hit
-	        && activePanel != NULL) {           // and a panel is active
+	        && activePanel != nullptr) {           // and a panel is active
 		//  Then we have a button hit event. If the button hit
 		//  is occuring outside the panel, then it should be
 		//  deselected.
@@ -854,7 +854,7 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
 				pickPos.x = _curMouseState.pos.x - w->_extent.x;
 				pickPos.y = _curMouseState.pos.y - w->_extent.y;
 
-				if ((ctl = w->hitTest(pickPos)) != NULL)
+				if ((ctl = w->hitTest(pickPos)) != nullptr)
 					pickPanel = ctl;
 				else
 					pickPanel = w;
@@ -911,7 +911,7 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
 			mousePanel = pickPanel;
 			mousePanel->pointerMove(msg);
 		} else
-			mousePanel = NULL;
+			mousePanel = nullptr;
 	}
 
 	//  Fix up flags because earlier code may have changed them
@@ -957,7 +957,7 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
 
 				if (activeWindow && activeWindow->isModal()) {
 					mouseWindow = activeWindow;
-				} else if (mouseWindow == NULL) {
+				} else if (mouseWindow == nullptr) {
 					mouseWindow = &mousePanel->window;
 				}
 
@@ -997,7 +997,7 @@ void gToolBase::leavePanel() {
 		msg.pointerLeave = 1;
 
 		mousePanel->pointerMove(msg);
-		mousePanel = NULL;
+		mousePanel = nullptr;
 	}
 
 	if (activePanel) activePanel->deactivate();
@@ -1042,7 +1042,7 @@ void gToolBase::handleKeyStroke(Common::Event &event) {
 		if (k != 0) {
 			k = toupper(k);
 
-			if ((ctl = w->keyTest(k)) != NULL) {
+			if ((ctl = w->keyTest(k)) != nullptr) {
 				if (activePanel == ctl) return;
 				if (activePanel) activePanel->deactivate();
 				if (ctl->activate(gEventKeyDown)) {
@@ -1117,7 +1117,7 @@ void LockUI(bool state) {
 		if (lockUINest <= 0) {
 			g_vm->_pointer->hide();
 			enableUIKeys(false);
-			g_vm->_toolBase->setActive(NULL);
+			g_vm->_toolBase->setActive(nullptr);
 		}
 		lockUINest++;
 	} else {
diff --git a/engines/saga2/player.cpp b/engines/saga2/player.cpp
index 7738e7cf9b..74e4d05e8b 100644
--- a/engines/saga2/player.cpp
+++ b/engines/saga2/player.cpp
@@ -568,17 +568,17 @@ void setCenterActor(PlayerActorID newCenter) {
 	g_vm->_cnm->setPlayerNum(newCenter);
 	setEnchantmentDisplay();
 
-	if (a->_curTask != NULL) {
+	if (a->_curTask != nullptr) {
 		a->_curTask->abortTask();
 		delete a->_curTask;
-		a->_curTask = NULL;
+		a->_curTask = nullptr;
 	}
 
 	//  Set the new centers fight stance based upon his aggression state
 	a->setFightStance(g_vm->_playerList[newCenter]->isAggressive());
 
 	// band actors to new center if banding button set
-	for (player = iter.first(); player != NULL; player = iter.next()) {
+	for (player = iter.first(); player != nullptr; player = iter.next()) {
 		player->resolveBanding();
 	}
 
@@ -668,7 +668,7 @@ void autoAdjustAggression() {
 				//  Iterate through the objects in this player actor's
 				//  active region to determine if their are enemy actor's
 				//  in the vicinity.
-				for (iter.first(&obj); obj != NULL; iter.next(&obj)) {
+				for (iter.first(&obj); obj != nullptr; iter.next(&obj)) {
 					Actor       *a;
 
 					if (!isActor(obj)) continue;
@@ -726,7 +726,7 @@ void setBrotherBanding(bool enabled) {
 			PlayerActor         *player;
 
 			//  Update the state of the banding
-			for (player = iter.first(); player != NULL; player = iter.next()) {
+			for (player = iter.first(); player != nullptr; player = iter.next()) {
 				player->resolveBanding();
 			}
 		}
@@ -786,7 +786,7 @@ void handlePlayerActorDeath(PlayerActorID id) {
 		PlayerActor                 *newCenter;
 		LivingPlayerActorIterator   iter;
 
-		if ((newCenter = iter.first()) != NULL)
+		if ((newCenter = iter.first()) != nullptr)
 			setCenterActor(getPlayerActorID(newCenter));
 		else
 			allPlayerActorsDead = true;
@@ -818,11 +818,11 @@ void transportCenterBand(const Location &loc) {
 	LivingPlayerActorIterator   iter;
 
 	center->move(loc);
-	if (center->_moveTask != NULL)
+	if (center->_moveTask != nullptr)
 		center->_moveTask->finishWalk();
 
 	for (player = iter.first();
-	        player != NULL;
+	        player != nullptr;
 	        player = iter.next()) {
 		Actor       *a = player->getActor();
 
@@ -845,7 +845,7 @@ void transportCenterBand(const Location &loc) {
 
 			if (dest != Nowhere) {
 				a->move(Location(dest, loc.context));
-				if (a->_moveTask != NULL)
+				if (a->_moveTask != nullptr)
 					a->_moveTask->finishWalk();
 				player->resolveBanding();
 			}
diff --git a/engines/saga2/saga2.cpp b/engines/saga2/saga2.cpp
index 789a3c5637..e9852aa855 100644
--- a/engines/saga2/saga2.cpp
+++ b/engines/saga2/saga2.cpp
@@ -360,7 +360,7 @@ struct dataChunks {
 	{ &pgRightImageData,		0x004EECB0, 256 },
 	{ &autoWalkImageData,		0x004EEDB0, 228 },
 	{ &gaugeImageData,			0x004EF257, 241 },
-	{ NULL,						0,			0 }
+	{ nullptr,						0,			0 }
 };
 
 void Saga2Engine::loadExeResources() {
diff --git a/engines/saga2/sagafunc.cpp b/engines/saga2/sagafunc.cpp
index 1e448e2e55..1e15d3b730 100644
--- a/engines/saga2/sagafunc.cpp
+++ b/engines/saga2/sagafunc.cpp
@@ -503,7 +503,7 @@ int16 scriptActorSay(int16 *args) {
 	//  If so, then retrieve it. If not, then build a new one and
 	//  retrieve it.
 	sp = speechList.findSpeech(obj->thisID());
-	if (sp == NULL) {
+	if (sp == nullptr) {
 		uint16  spFlags = 0;
 
 		if (flags & speakNoAnimate) spFlags |= Speech::spNoAnimate;
@@ -511,7 +511,7 @@ int16 scriptActorSay(int16 *args) {
 
 		sp = speechList.newTask(obj->thisID(), spFlags);
 
-		if (sp == NULL) return 0;
+		if (sp == nullptr) return 0;
 	}
 
 	//  Loop through each of the arguments.
@@ -528,7 +528,7 @@ int16 scriptActorSay(int16 *args) {
 	if (!(flags & speakContinued)) {
 		//  If we're going to wait for it synchronously
 		if (flags & speakWait) {
-			thisThread->waitForEvent(Thread::waitOther, 0);
+			thisThread->waitForEvent(Thread::waitOther, nullptr);
 			sp->setWakeUp(getThreadID(thisThread));
 		}
 
@@ -554,7 +554,7 @@ int16 scriptActorSayText(int16 *args) {
 	//  Determine if a speech record is being built for this actor.
 	//  If so, then retrieve it. If not, then fail.
 	sp = speechList.findSpeech(obj->thisID());
-	if (sp == NULL) return 0;
+	if (sp == nullptr) return 0;
 
 	stringf(buffer, sizeof buffer, args[0], &args[1]);
 	sp->append(buffer, 0);
@@ -1428,7 +1428,7 @@ int16 scriptActorSetSchedule(int16 *args) {
 
 		a->_schedule = (uint16)args[0];
 
-		if (a->getAssignment() != NULL)
+		if (a->getAssignment() != nullptr)
 			delete a->getAssignment();
 
 		return (int16)oldSchedule;
@@ -1589,7 +1589,7 @@ int16 scriptActorTurn(int16 *args) {
 		uint16      flags = args[1];
 
 		if (flags & moveWait) {
-			thisThread->waitForEvent(Thread::waitOther, 0);
+			thisThread->waitForEvent(Thread::waitOther, nullptr);
 			MotionTask::turn(getThreadID(thisThread), *a, args[0] & 7);
 		} else {
 			MotionTask::turn(*a, args[0] & 7);
@@ -1620,7 +1620,7 @@ int16 scriptActorTurnTowards(int16 *args) {
 		       -   a->getLocation()).quickDir();
 
 		if (flags & moveWait) {
-			thisThread->waitForEvent(Thread::waitOther, 0);
+			thisThread->waitForEvent(Thread::waitOther, nullptr);
 			MotionTask::turn(getThreadID(thisThread), *a, dir);
 		} else {
 			MotionTask::turn(*a, dir);
@@ -1645,7 +1645,7 @@ int16 scriptActorWalk(int16 *args) {
 		uint16      flags = args[3];
 
 		if (flags & moveWait) {
-			thisThread->waitForEvent(Thread::waitOther, 0);
+			thisThread->waitForEvent(Thread::waitOther, nullptr);
 			MotionTask::walkToDirect(
 			    getThreadID(thisThread), *a, dest, flags & moveRun);
 		} else {
@@ -1672,7 +1672,7 @@ int16 scriptActorAssignPatrolRoute(int16 *args) {
 		Actor       *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
 
 		//  Delete the actor's current assignment
-		if (a->getAssignment() != NULL) delete a->getAssignment();
+		if (a->getAssignment() != nullptr) delete a->getAssignment();
 
 		if (new PatrolRouteAssignment(a,
 		            (uint16)args[0]
@@ -1682,7 +1682,7 @@ int16 scriptActorAssignPatrolRoute(int16 *args) {
 		            thisThread->argCount >= 4
 		            ?   args[3]
 		            :   -1)
-		        !=  NULL)
+		        !=  nullptr)
 			return true;
 	}
 
@@ -1704,7 +1704,7 @@ int16 scriptActorAssignPartialPatrolRoute(int16 *args) {
 		Actor       *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
 
 		//  Delete the actor's current assignment
-		if (a->getAssignment() != NULL) delete a->getAssignment();
+		if (a->getAssignment() != nullptr) delete a->getAssignment();
 
 		if (new PatrolRouteAssignment(a,
 		            (uint16)args[0]
@@ -1713,7 +1713,7 @@ int16 scriptActorAssignPartialPatrolRoute(int16 *args) {
 		            (uint8)args[2],
 		            args[3],
 		            args[4])
-		        !=  NULL)
+		        !=  nullptr)
 			return true;
 	}
 
@@ -1737,13 +1737,13 @@ int16 scriptActorAssignBeNearLocation(int16 *args) {
 		TilePoint   targetLoc = TilePoint(args[1], args[2], args[3]);
 
 		//  Delete the actor's current assignment
-		if (a->getAssignment() != NULL) delete a->getAssignment();
+		if (a->getAssignment() != nullptr) delete a->getAssignment();
 
 		if (new HuntToBeNearLocationAssignment(a,
 		            args[0],
 		            targetLoc,
 		            args[4])
-		        !=  NULL)
+		        !=  nullptr)
 			return true;
 	}
 
@@ -1770,14 +1770,14 @@ int16 scriptActorAssignBeNearActor(int16 *args) {
 		targetActor = (Actor *)GameObject::objectAddress(args[1]);
 
 		//  Delete the actor's current assignment
-		if (a->getAssignment() != NULL) delete a->getAssignment();
+		if (a->getAssignment() != nullptr) delete a->getAssignment();
 
 		if (new HuntToBeNearActorAssignment(a,
 		            args[0],
 		            targetActor,
 		            args[2],
 		            args[3])
-		        !=  NULL)
+		        !=  nullptr)
 			return true;
 	}
 
@@ -1799,13 +1799,13 @@ int16 scriptActorAssignKillActor(int16 *args) {
 		targetActor = (Actor *)GameObject::objectAddress(args[1]);
 
 		//  Delete the actor's current assignment
-		if (a->getAssignment() != NULL) delete a->getAssignment();
+		if (a->getAssignment() != nullptr) delete a->getAssignment();
 
 		if (new HuntToKillAssignment(a,
 		            args[0],
 		            targetActor,
 		            args[2])
-		        !=  NULL)
+		        !=  nullptr)
 			return true;
 	}
 
@@ -1827,7 +1827,7 @@ int16 scriptActorAssignTetheredWander(int16 *args) {
 		Actor       *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
 
 		//  Delete the actor's current assignment
-		if (a->getAssignment() != NULL) delete a->getAssignment();
+		if (a->getAssignment() != nullptr) delete a->getAssignment();
 
 		TileRegion  tetherReg;
 		int16       &minU = args[1],
@@ -1854,7 +1854,7 @@ int16 scriptActorAssignTetheredWander(int16 *args) {
 		            (uint16)args[0]
 		            *   CalenderTime::kFramesPerHour,
 		            tetherReg)
-		        !=  NULL)
+		        !=  nullptr)
 			return true;
 	}
 
@@ -1871,14 +1871,14 @@ int16 scriptActorAssignAttend(int16 *args) {
 		Actor       *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
 
 		//  Delete the actor's current assignment
-		if (a->getAssignment() != NULL) delete a->getAssignment();
+		if (a->getAssignment() != nullptr) delete a->getAssignment();
 
 		if (new AttendAssignment(a,
 		            (g_vm->_calender->frameInDay()
 		             + (uint16)args[0])
 		            %   CalenderTime::kFramesPerDay,
 		            GameObject::objectAddress(args[1]))
-		        !=  NULL)
+		        !=  nullptr)
 			return true;
 	}
 
@@ -1894,7 +1894,7 @@ int16 scriptActorRemoveAssignment(int16 *args) {
 	if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
 		Actor       *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
 
-		if (a->getAssignment() != NULL) delete a->getAssignment();
+		if (a->getAssignment() != nullptr) delete a->getAssignment();
 	}
 
 	return 0;
@@ -1941,7 +1941,7 @@ int16 scriptActorGetLeader(int16 *) {
 	if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
 		Actor       *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
 
-		return a->_leader != NULL ? a->_leader->thisID() : Nothing;
+		return a->_leader != nullptr ? a->_leader->thisID() : Nothing;
 	}
 
 	return 0;
@@ -1956,7 +1956,7 @@ int16 scriptActorNumFollowers(int16 *) {
 	if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
 		Actor       *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
 
-		return a->_followers != NULL ? a->_followers->size() : 0;
+		return a->_followers != nullptr ? a->_followers->size() : 0;
 	}
 
 	return 0;
@@ -1971,7 +1971,7 @@ int16 scriptActorGetFollower(int16 *args) {
 	if (isActor(((ObjectData *)thisThread->thisObject)->obj)) {
 		Actor       *a = (Actor *)((ObjectData *)thisThread->thisObject)->obj;
 
-		assert(a->_followers != NULL);
+		assert(a->_followers != nullptr);
 		assert(args[0] < a->_followers->size());
 
 		return (*a->_followers)[args[0]]->thisID();
@@ -2068,7 +2068,7 @@ int16 scriptActorDeductPayment(int16 *args) {
 	ProtoObj    *currencyProto = g_vm->_objectProtos[args[0]];
 	int32       paymentAmount = args[1];
 	int32       paymentFound = 0;
-	GameObject  *obj, *delObj = NULL;
+	GameObject  *obj, *delObj = nullptr;
 	ObjectID    id;
 	bool        mergeable =
 	    currencyProto->flags & ResourceObjectPrototype::objPropMergeable;
@@ -2525,7 +2525,7 @@ int16 scriptTagSetAnimation(int16 *args) {
 	//  If we want to wait until finished
 	if (args[0] & tileAnimateWait) {
 		//  Wait for the animation
-		thisThread->waitForEvent(Thread::waitOther, 0);
+		thisThread->waitForEvent(Thread::waitOther, nullptr);
 
 		//  And start the tile animation
 		TileActivityTask::doScript(*ai, args[1], getThreadID(thisThread));
@@ -2548,7 +2548,7 @@ int16 scriptTagSetWait(int16 *args) {
 
 	if (TileActivityTask::setWait(ai, getThreadID(thisThread))) {
 		//  Wait for the animation
-		thisThread->waitForEvent(Thread::waitOther, 0);
+		thisThread->waitForEvent(Thread::waitOther, nullptr);
 	}
 
 	return 0;
@@ -2744,7 +2744,7 @@ void writeLog( char *str )
 }
 */
 void writeLog(char *str) {
-	FILE        *logFile = NULL;
+	FILE        *logFile = nullptr;
 #ifdef __WATCOMC__
 	time_t time_of_day;
 	auto char buf[26];
@@ -2770,7 +2770,7 @@ void writeLog(char *str) {
 }
 
 void writeObject(char *str) {
-	FILE        *logFile = NULL;
+	FILE        *logFile = nullptr;
 	logFile = fopen("objfile.txt", "a+t");
 	if (logFile) {
 		fputs(str, logFile);
@@ -2820,9 +2820,9 @@ int16 scriptMessageDialog(int16 *args) {
 
 	userDialog(STRING(args[0]),
 	           STRING(args[1]),
-	           args[2] ? STRING(args[2]) : NULL,
-	           NULL,
-	           NULL);
+	           args[2] ? STRING(args[2]) : nullptr,
+	           nullptr,
+	           nullptr);
 
 //	WriteStatusF( 1, buffer );
 	return 0;
@@ -2838,9 +2838,9 @@ int16 scriptChoiceDialog(int16 *args) {
 
 	userDialog(STRING(args[0]),
 	           STRING(args[1]),
-	           args[2] ? STRING(args[2]) : NULL,
-	           args[3] ? STRING(args[3]) : NULL,
-	           args[4] ? STRING(args[4]) : NULL);
+	           args[2] ? STRING(args[2]) : nullptr,
+	           args[3] ? STRING(args[3]) : nullptr,
+	           args[4] ? STRING(args[4]) : nullptr);
 
 //	WriteStatusF( 1, buffer );
 	return 0;
@@ -2902,7 +2902,7 @@ int16 scriptSetGameMode(int16 *args) {
 int16 scriptWait(int16 *args) {
 	MONOLOG(Wait);
 	thisThread->waitAlarm.set(args[0]);
-	thisThread->waitForEvent(Thread::waitDelay, 0);
+	thisThread->waitForEvent(Thread::waitDelay, nullptr);
 	thisThread->setExtended();
 	return 0;
 }
@@ -2910,7 +2910,7 @@ int16 scriptWait(int16 *args) {
 int16 scriptWaitFrames(int16 *args) {
 	MONOLOG(WaitFrames);
 	thisThread->waitFrameAlarm.set(args[0]);
-	thisThread->waitForEvent(Thread::waitFrameDelay, 0);
+	thisThread->waitForEvent(Thread::waitFrameDelay, nullptr);
 	thisThread->setExtended();
 	return 0;
 }
@@ -2965,7 +2965,7 @@ int16 scriptMakeObject(int16 *args) {
 
 	//  REM: We need to throw some kind of SAGA exception...?
 	//  (We don't have SAGA exceptions, only the C kind...)
-	if (obj == NULL) {
+	if (obj == nullptr) {
 		return 0;
 	}
 
@@ -3025,7 +3025,7 @@ int16 scriptMakeActor(int16 *args) {
 
 	//  REM: We need to throw some kind of SAGA exception...?
 	//  (We don't have SAGA exceptions, only the C kind...)
-	if (a == NULL) {
+	if (a == nullptr) {
 		return 0;
 	}
 
@@ -3086,7 +3086,7 @@ int16 scriptPlaySoundFrom(int16 *args) {
 	int32       soundID;
 	soundID = parse_res_id(sID);
 	GameObject *go = GameObject::objectAddress(args[1]);
-	assert(go != NULL);
+	assert(go != nullptr);
 	if (soundID) playSoundAt(soundID, go->notGetWorldLocation());
 
 	return 0;
@@ -3278,7 +3278,7 @@ int16 scriptAssertEvent(int16 *args) {
 	ev.directObject = GameObject::objectAddress(args[1]);
 	ev.indirectObject = args[2] != Nothing
 	                    ?   GameObject::objectAddress(args[2])
-	                    :   NULL;
+	                    :   nullptr;
 
 	assertEvent(ev);
 
@@ -3519,7 +3519,7 @@ int16 scriptSearchRegion(int16 *args) {
 	//  Get a pointer to the world
 	assert(isWorld(args[0]));
 	worldPtr = (GameWorld *)GameObject::objectAddress(args[0]);
-	assert(worldPtr != NULL);
+	assert(worldPtr != nullptr);
 
 	minP.u = MIN(args[1], args[3]);
 	minP.v = MIN(args[2], args[4]);
@@ -3532,9 +3532,9 @@ int16 scriptSearchRegion(int16 *args) {
 	RegionalObjectIterator  iter(worldPtr, minP, maxP);
 
 	//  Iterate through the search region
-	for (searchObj = iter.first(NULL);
+	for (searchObj = iter.first(nullptr);
 	        searchObj != Nothing;
-	        searchObj = iter.next(NULL)) {
+	        searchObj = iter.next(nullptr)) {
 		//  Starting from the 5th argument, until we reach argCount,
 		//  see if the iterated object matches one in the arg list
 		for (int i = 5; i < thisThread->argCount; i++) {
@@ -3561,9 +3561,9 @@ int countObjectsInRegion(GameWorld *worldPtr, TileRegion &tr) {
 	                             tr.min,
 	                             tr.max);
 
-	for (searchObj = iter.first(NULL), count = 0;
+	for (searchObj = iter.first(nullptr), count = 0;
 	        searchObj != Nothing;
-	        searchObj = iter.next(NULL)) {
+	        searchObj = iter.next(nullptr)) {
 		count++;
 	}
 
@@ -3584,9 +3584,9 @@ void listObjectsInRegion(
 	                             tr.min,
 	                             tr.max);
 
-	for (searchObj = iter.first(NULL);
+	for (searchObj = iter.first(nullptr);
 	        searchObj != Nothing;
-	        searchObj = iter.next(NULL)) {
+	        searchObj = iter.next(nullptr)) {
 		*list++ = searchObj;
 	}
 }
@@ -3617,8 +3617,8 @@ int16 scriptSwapRegions(int16 *args) {
 	worldPtr1 = (GameWorld *)GameObject::objectAddress(worldID1);
 	worldPtr2 = (GameWorld *)GameObject::objectAddress(worldID2);
 
-	assert(worldPtr1 != NULL);
-	assert(worldPtr2 != NULL);
+	assert(worldPtr1 != nullptr);
+	assert(worldPtr2 != nullptr);
 
 	region1.min.u = args[1];
 	region1.min.v = args[2];
diff --git a/engines/saga2/sensor.cpp b/engines/saga2/sensor.cpp
index a733d378a2..a31a88a61c 100644
--- a/engines/saga2/sensor.cpp
+++ b/engines/saga2/sensor.cpp
@@ -126,7 +126,7 @@ void readSensor(int16 ctr, Common::InSaveFile *in) {
 }
 
 void writeSensor(Sensor *sensor, Common::MemoryWriteStreamDynamic *out) {
-	assert(sensor != NULL);
+	assert(sensor != nullptr);
 
 	//  Store the sensor type
 	out->writeSint16LE(sensor->getType());
@@ -161,7 +161,7 @@ void checkSensors() {
 			}
 
 			if (sensor->check(info, sFlags)) {
-				assert(info.sensedObject != NULL);
+				assert(info.sensedObject != nullptr);
 				assert(isObject(info.sensedObject) || isActor(info.sensedObject));
 
 				sensor->getObject()->senseObject(sensor->thisID(), info.sensedObject->thisID());
@@ -178,7 +178,7 @@ void checkSensors() {
 //----------------------------------------------------------------------
 
 void assertEvent(const GameEvent &ev) {
-	assert(ev.directObject != NULL);
+	assert(ev.directObject != nullptr);
 	assert(isObject(ev.directObject) || isActor(ev.directObject));
 
 	for (Common::List<Sensor *>::iterator it = g_vm->_sensorList.begin(); it != g_vm->_sensorList.end(); ++it) {
@@ -189,7 +189,7 @@ void assertEvent(const GameEvent &ev) {
 			    sensor->thisID(),
 			    ev.type,
 			    ev.directObject->thisID(),
-			    ev.indirectObject != NULL
+			    ev.indirectObject != nullptr
 			    ?   ev.indirectObject->thisID()
 			    :   Nothing);
 		}
@@ -327,7 +327,7 @@ SensorList *fetchSensorList(GameObject *obj) {
 			return *it;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 /* ===================================================================== *
@@ -486,7 +486,7 @@ bool ObjectSensor::check(SenseInfo &info, uint32 senseFlags) {
 	iter.first(&objToTest);
 
 	for (iter.first(&objToTest);
-	        objToTest != NULL;
+	        objToTest != nullptr;
 	        iter.next(&objToTest)) {
 		if (senseFlags & (1 << actorBlind))
 			continue;
diff --git a/engines/saga2/shorten.cpp b/engines/saga2/shorten.cpp
index d87b804895..47ca2dea6b 100644
--- a/engines/saga2/shorten.cpp
+++ b/engines/saga2/shorten.cpp
@@ -155,10 +155,10 @@ uint32 ShortenGolombReader::getUint32(uint32 numBits) {
 byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, byte &flags) {
 	int32 *buffer[2], *offset[2];	// up to 2 channels
 	int32 *oldValues[2];
-	byte *unpackedBuffer = 0;
+	byte *unpackedBuffer = nullptr;
 	byte *pBuf = unpackedBuffer;
 	int prevSize = 0;
-	int32 *lpc = 0;
+	int32 *lpc = nullptr;
 
 	ShortenGolombReader *gReader;
 	uint32 i, j, version, mean, type, channels, blockSize;
@@ -172,14 +172,14 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 	stream.read(magic, 4);
 	if (memcmp(magic, "ajkg", 4) != 0) {
 		warning("loadShortenFromStream: No 'ajkg' header");
-		return NULL;
+		return nullptr;
 	}
 
 	version = stream.readByte();
 
 	if (version > MAX_SUPPORTED_VERSION) {
 		warning("loadShortenFromStream: Can't decode version %d, maximum supported version is %d", version, MAX_SUPPORTED_VERSION);
-		return NULL;
+		return nullptr;
 	}
 
 	mean = (version < 2) ? 0 : 4;
@@ -216,12 +216,12 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 			// TODO: Perhaps implement this if we find WAV Shorten encoded files
 			warning("loadShortenFromStream: Type WAV is not supported");
 			delete gReader;
-			return NULL;
+			return nullptr;
 		case kTypeAIFF:
 			// TODO: Perhaps implement this if we find AIFF Shorten encoded files
 			warning("loadShortenFromStream: Type AIFF is not supported");
 			delete gReader;
-			return NULL;
+			return nullptr;
 		case kTypeAU1:
 		case kTypeAU2:
 		case kTypeAU3:
@@ -233,7 +233,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 		default:
 			warning("loadShortenFromStream: Type %d is not supported", type);
 			delete gReader;
-			return NULL;
+			return nullptr;
 	}
 
 	// Get channels
@@ -241,7 +241,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 	if (channels != 1 && channels != 2) {
 		warning("loadShortenFromStream: Only 1 or 2 channels are supported, stream contains %d channels", channels);
 		delete gReader;
-		return NULL;
+		return nullptr;
 	}
 
 	// Get block size
@@ -383,7 +383,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 							warning("Safeguard: maxLPC < lpcNum (should never happen)");
 							maxLPC = lpcNum;
 							int32 *tmp = (int32 *) realloc(lpc, maxLPC * 4);
-							if ((tmp != NULL) || (maxLPC == 0)) {
+							if ((tmp != nullptr) || (maxLPC == 0)) {
 								lpc = tmp;
 							} else {
 								error("loadShortenFromStream(): Error while reallocating memory");
@@ -456,7 +456,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 					prevSize = size;
 					size += (blockSize * dataSize);
 					byte *tmp = (byte *) realloc(unpackedBuffer, size);
-					if ((tmp != NULL) || (size == 0)) {
+					if ((tmp != nullptr) || (size == 0)) {
 						unpackedBuffer = tmp;
 					} else {
 						error("loadShortenFromStream(): Error while reallocating memory");
@@ -495,7 +495,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 				prevSize = size;
 				size += vLen;
 				byte *tmp = (byte *) realloc(unpackedBuffer, size);
-				if ((tmp != NULL) || (size == 0)) {
+				if ((tmp != nullptr) || (size == 0)) {
 					unpackedBuffer = tmp;
 				} else {
 					error("loadShortenFromStream(): Error while reallocating memory");
@@ -525,7 +525,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 					free(unpackedBuffer);
 
 				delete gReader;
-				return NULL;
+				return nullptr;
 				break;
 		}
 	}
@@ -552,7 +552,7 @@ Audio::AudioStream *makeShortenStream(Common::SeekableReadStream &stream) {
 	data = loadShortenFromStream(stream, size, rate, flags);
 
 	if (!data)
-		return 0;
+		return nullptr;
 
 	// Since we allocated our own buffer for the data, we must specify DisposeAfterUse::YES.
 	return Audio::makeRawStream(data, size, rate, flags);
diff --git a/engines/saga2/speech.cpp b/engines/saga2/speech.cpp
index 0b81acae94..ba21ccb1ca 100644
--- a/engines/saga2/speech.cpp
+++ b/engines/saga2/speech.cpp
@@ -522,7 +522,7 @@ void Speech::dispose() {
 
 		//  De-allocate the speech data
 		delete[] _speechImage.data;
-		_speechImage.data = NULL;
+		_speechImage.data = nullptr;
 
 		//  Clear the number of active buttons
 		speechLineCount = speechButtonCount = 0;
@@ -550,13 +550,13 @@ void updateSpeech() {
 	Speech          *sp;
 
 	//  if there is a speech object
-	if ((sp = speechList.currentActive()) != NULL) {
+	if ((sp = speechList.currentActive()) != nullptr) {
 		//  If there is no bitmap, then set one up.
 		if (!(sp->speechFlags & Speech::spActive)) {
 			sp->setupActive();
 
 			//  If speech failed to set up, then skip it
-			if (sp->_speechImage.data == NULL) {
+			if (sp->_speechImage.data == nullptr) {
 				sp->dispose();
 				return;
 			}
@@ -587,7 +587,7 @@ void Speech::abortSpeech() {
 	//  Start by displaying first frame straight off, no delay
 	speechFinished.set(0);
 	if (speechFlags & spHasVoice) {
-		PlayVoice(0);
+		PlayVoice(nullptr);
 	}
 }
 
@@ -601,7 +601,7 @@ void abortSpeech() {
 void deleteSpeech(ObjectID id) {         // voice sound sample ID
 	Speech *sp;
 
-	while ((sp = speechList.findSpeech(id)) != NULL) sp->dispose();
+	while ((sp = speechList.findSpeech(id)) != nullptr) sp->dispose();
 }
 
 //-----------------------------------------------------------------------
@@ -882,7 +882,7 @@ SpeechTaskList::SpeechTaskList(Common::InSaveFile *in) {
 	//  Restore the speeches
 	for (int i = 0; i < count; i++) {
 		Speech *sp = new Speech;
-		assert(sp != NULL);
+		assert(sp != nullptr);
 		debugC(3, kDebugSaveload, "Loading Speech %d", i++);
 
 		_inactiveList.push_back(sp);
@@ -975,7 +975,7 @@ Speech *SpeechTaskList::newTask(ObjectID id, uint16 flags) {
 	GameObject          *obj = GameObject::objectAddress(id);
 
 	//  Actors cannot speak if not in the world
-	if (obj->world() != currentWorld) return NULL;
+	if (obj->world() != currentWorld) return nullptr;
 
 	if (speechCount() >= MAX_SPEECH_PTRS) {
 		warning("Too many speech tasks: > %d", MAX_SPEECH_PTRS);
@@ -986,7 +986,7 @@ Speech *SpeechTaskList::newTask(ObjectID id, uint16 flags) {
 #if DEBUG
 	if (sp == NULL) fatal("Ran out of Speech Tasks, Object = %s\n", obj->objName());
 #endif
-	if (sp == NULL) return NULL;
+	if (sp == nullptr) return nullptr;
 
 	debugC(1, kDebugTasks, "Speech: New Task: %p for %p (%s) (flags = %d) (total = %d)", (void *)sp, (void *)obj, obj->objName(), flags, speechCount());
 
@@ -1064,7 +1064,7 @@ APPFUNC(cmdClickSpeech) {
 
 	case gEventMouseDown:
 
-		if ((sp = speechList.currentActive()) != NULL) {
+		if ((sp = speechList.currentActive()) != nullptr) {
 			sp->selectedButton = pickSpeechButton(ev.mouse, sp->_speechImage.size.x, sp->_textPort);
 		}
 		break;
diff --git a/engines/saga2/spelcast.cpp b/engines/saga2/spelcast.cpp
index 49e332f120..0ef7cb12e7 100644
--- a/engines/saga2/spelcast.cpp
+++ b/engines/saga2/spelcast.cpp
@@ -63,11 +63,11 @@ int32 scatterer(int32 i, int32 m, int32 s);
 SpellStuff::SpellStuff() {
 	master = nullSpell;
 	display = nullSpell;
-	prototype = NULL;
+	prototype = nullptr;
 	targetableTypes = spellTargNone;
 	targetTypes = spellApplyNone;
-	effects = NULL;
-	targets = NULL;
+	effects = nullptr;
+	targets = nullptr;
 	manaType = sManaIDSkill;
 	manaUse = 0;
 	shape = eAreaInvisible;
@@ -113,7 +113,7 @@ bool SpellStuff::safe() {
 //	add an internal effect to a spell
 
 void SpellStuff::addEffect(ProtoEffect *pe) {
-	if (effects == NULL)
+	if (effects == nullptr)
 		effects = pe;
 	else {
 		ProtoEffect *tail;
@@ -139,7 +139,7 @@ void SpellStuff::killEffects() {
 	if (effects) {
 		delete effects;
 	}
-	effects = NULL;
+	effects = nullptr;
 }
 
 //-----------------------------------------------------------------------
@@ -205,7 +205,7 @@ void SpellStuff::implement(GameObject *enactor, Location target) {
 	if (effects && targets) {
 		for (SpellTarget *t = targets; t; t = t->next) {
 			if (safe() &&
-			        t->getObject() != NULL &&
+			        t->getObject() != nullptr &&
 			        t->getObject()->thisID() == enactor->thisID() &&
 			        !canTarget(spellTargCaster))
 				continue;
@@ -365,7 +365,7 @@ void SpellStuff::buildTargetList(GameObject *caster, SpellTarget &trg) {
 //	add a target to the target list
 
 void SpellStuff::addTarget(SpellTarget *trg) {
-	if (targets == NULL)
+	if (targets == nullptr)
 		targets = trg;
 	else {
 		SpellTarget *t = targets;
@@ -385,7 +385,7 @@ void SpellStuff::removeTargetList() {
 	case eAreaProjectile:
 	case eAreaExchange:
 	case eAreaMissle:
-		targets = NULL;
+		targets = nullptr;
 		break;
 	case eAreaWall:
 	case eAreaCone:
@@ -395,12 +395,12 @@ void SpellStuff::removeTargetList() {
 	case eAreaStorm:
 	case eAreaSquare:
 		if (targets) delete targets;
-		targets = NULL;
+		targets = nullptr;
 		break;
 	default:
 		error("bad spell");
 	}
-	assert(targets == NULL);
+	assert(targets == nullptr);
 }
 
 //-----------------------------------------------------------------------
@@ -638,11 +638,11 @@ SpellInstance::~SpellInstance() {
 	for (int32 i = 0; i < eList.count; i++) {
 		if (eList.displayList[i].efx)
 			delete eList.displayList[i].efx;
-		eList.displayList[i].efx = NULL;
+		eList.displayList[i].efx = nullptr;
 	}
 	if (target)
 		delete target;
-	target = NULL;
+	target = nullptr;
 }
 
 // ------------------------------------------------------------------
@@ -676,7 +676,7 @@ void SpellInstance::termEffect() {
 		for (int32 i = 0; i < eList.count; i++) {
 			if (eList.displayList[i].efx) {
 				delete eList.displayList[i].efx;
-				eList.displayList[i].efx = NULL;
+				eList.displayList[i].efx = nullptr;
 			}
 		}
 }
@@ -705,7 +705,7 @@ void SpellInstance::initEffect(TilePoint startpoint) {
 bool SpellInstance::buildList() {
 	if (eList.dissipated()) {
 		termEffect();
-		if (effect->next == NULL)
+		if (effect->next == nullptr)
 			return false;
 		effect = effect->next;
 		effSeq++;
@@ -860,14 +860,14 @@ void Effectron::bump() {
 int16 tileNopeHeight(
     const TilePoint &pt,
     Effectron *obj,
-    StandingTileInfo *sti = NULL);
+    StandingTileInfo *sti = nullptr);
 
 //-----------------------------------------------------------------------
 // clone of checkContact()
 blockageType checkNontact(
     Effectron *obj,
     const TilePoint &loc,
-    GameObject **blockResultObj = NULL);
+    GameObject **blockResultObj = nullptr);
 
 //-----------------------------------------------------------------------
 // clone of objectCollision()
@@ -883,7 +883,7 @@ blockageType checkNontact(
 	int32           terrain;
 	GameObject      *blockObj;
 
-	if (blockResultObj) *blockResultObj = NULL;
+	if (blockResultObj) *blockResultObj = nullptr;
 
 	terrain = volumeTerrain(mapNum,
 	                        loc,
@@ -940,9 +940,9 @@ int16 tileNopeHeight(
 		prevCoords.set(metaCoords.u, metaCoords.v, metaCoords.z);
 	}
 
-	if (metaPtr == NULL) return 0L;
+	if (metaPtr == nullptr) return 0L;
 
-	highestTile.surfaceTile = lowestTile.surfaceTile = NULL;
+	highestTile.surfaceTile = lowestTile.surfaceTile = nullptr;
 	highestSupportHeight = -100;
 	lowestSupportHeight = 0x7FFF;
 
@@ -952,7 +952,7 @@ int16 tileNopeHeight(
 	for (int i = 0; i < maxPlatforms; i++) {
 		Platform    *p;
 
-		if ((p = metaPtr->fetchPlatform(mapNum, i)) == NULL)
+		if ((p = metaPtr->fetchPlatform(mapNum, i)) == nullptr)
 			continue;
 
 		if (p->flags & plVisible) {
@@ -995,7 +995,7 @@ int16 tileNopeHeight(
 				            (terrainSurface | terrainRaised))) {
 					highestTile = sti;
 					highestSupportHeight = supportHeight;
-				} else if (highestTile.surfaceTile == NULL &&
+				} else if (highestTile.surfaceTile == nullptr &&
 				           supportHeight <= lowestSupportHeight &&
 				           (ti->combinedTerrainMask() &
 				            (terrainSurface | terrainRaised))) {
@@ -1015,8 +1015,8 @@ int16 tileNopeHeight(
 		return lowestSupportHeight;
 	}
 	if (stiResult) {
-		stiResult->surfaceTile = NULL;
-		stiResult->surfaceTAG = NULL;
+		stiResult->surfaceTile = nullptr;
+		stiResult->surfaceTAG = nullptr;
 		stiResult->surfaceHeight = 0;
 	}
 	return 0;
@@ -1041,7 +1041,7 @@ GameObject *objectNollision(Effectron *obj, const TilePoint &loc) {
 	CircularObjectIterator  iter(obj->world(), loc, obj->brdCall() + 32);
 
 	for (iter.first(&obstacle);
-	        obstacle != NULL;
+	        obstacle != nullptr;
 	        iter.next(&obstacle)) {
 		TilePoint   tp = obstacle->getLocation();
 		ProtoObj    *proto = obstacle->proto();
@@ -1057,7 +1057,7 @@ GameObject *objectNollision(Effectron *obj, const TilePoint &loc) {
 			return obstacle;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 } // end of namespace Saga2
diff --git a/engines/saga2/speldata.cpp b/engines/saga2/speldata.cpp
index 01ad8f20cd..a06d1d693f 100644
--- a/engines/saga2/speldata.cpp
+++ b/engines/saga2/speldata.cpp
@@ -213,7 +213,7 @@ static void loadMagicData() {
 	spellRes =  auxResFile->newContext(
 	                MKTAG('S', 'P', 'E', 'L'),
 	                "spell resources");
-	if (spellRes == NULL || !spellRes->_valid)
+	if (spellRes == nullptr || !spellRes->_valid)
 		error("Error accessing spell resource group.\n");
 	i = 1;
 	ADD_SHOW(eAreaInvisible, 0, 0, 0, 0, diFlagInc, ecFlagNone,  30, MKTAG('S', 'T', 'A', 0), 23, 24);
@@ -228,7 +228,7 @@ static void loadMagicData() {
 		        MKTAG('I', 'N', 'F', i),
 		        "spell");
 
-		if (rsi == NULL)
+		if (rsi == nullptr)
 			error("Unable to load data for spell %d", i);
 
 		spellBook[rsi->spell].setupFromResource(rsi);
@@ -249,7 +249,7 @@ static void loadMagicData() {
 		        MKTAG('E', 'F', 'F', i),
 		        "spell effect");
 
-		if (rse == NULL)
+		if (rse == nullptr)
 			error("Unable to load effects for spell %d", i);
 
 		if (rse->spell)
diff --git a/engines/saga2/spellio.cpp b/engines/saga2/spellio.cpp
index d6576388a2..e47b669f6e 100644
--- a/engines/saga2/spellio.cpp
+++ b/engines/saga2/spellio.cpp
@@ -228,7 +228,7 @@ void cleanupSpellState() {
 // cleanup active spells
 
 StorageSpellTarget::StorageSpellTarget(SpellTarget &st) {
-	GameObject *go = NULL;
+	GameObject *go = nullptr;
 	ActiveItem *ai;
 	type = st.getType();
 	loc = st.getPoint();
@@ -236,7 +236,7 @@ StorageSpellTarget::StorageSpellTarget(SpellTarget &st) {
 		if (type == SpellTarget::spellTargetObject)
 			go = st.getObject();
 		else
-			go = NULL;
+			go = nullptr;
 	}
 
 	if (go)
@@ -247,7 +247,7 @@ StorageSpellTarget::StorageSpellTarget(SpellTarget &st) {
 	if (type == SpellTarget::spellTargetTAG)
 		ai = st.getTAG();
 	else
-		ai = NULL;
+		ai = nullptr;
 
 	if (ai)
 		tag = ai->thisID();
@@ -328,15 +328,15 @@ void StorageSpellInstance::write(Common::MemoryWriteStreamDynamic *out) {
 SpellTarget::SpellTarget(StorageSpellTarget &sst) {
 	type = (SpellTarget::spellTargetType) sst.type;
 	loc = sst.loc;
-	next = NULL;
+	next = nullptr;
 	if (sst.obj != Nothing)
 		obj = GameObject::objectAddress(sst.obj);
 	else
-		obj = NULL;
+		obj = nullptr;
 	if (sst.tag != NoActiveItem)
 		tag = ActiveItem::activeItemAddress(sst.tag);
 	else
-		tag = NULL;
+		tag = nullptr;
 }
 
 SpellInstance::SpellInstance(StorageSpellInstance &ssi) {
@@ -411,7 +411,7 @@ void SpellDisplayList::wipe() {
 	for (int i = 0; i < maxCount; i++)
 		if (spells[i]) {
 			delete spells[i];
-			spells[i] = NULL;
+			spells[i] = nullptr;
 			count--;
 		}
 
diff --git a/engines/saga2/target.cpp b/engines/saga2/target.cpp
index d3c675e397..1972a9d139 100644
--- a/engines/saga2/target.cpp
+++ b/engines/saga2/target.cpp
@@ -241,7 +241,7 @@ TilePoint TileTarget::where(GameWorld *world, const TilePoint &tp) const {
 
 	//  Get the first tile in tile region
 	ti = tIter.first(&tileCoords, &sti);
-	while (ti != NULL) {
+	while (ti != nullptr) {
 		//  If this has the tile ID we are looking for
 		if (isTarget(sti)) {
 			uint16  dist;
@@ -296,7 +296,7 @@ int16 TileTarget::where(
 
 	//  Get the first tile in tile region
 	ti = tIter.first(&tileCoords, &sti);
-	while (ti != NULL) {
+	while (ti != nullptr) {
 		//  Determine if this tile has tile ID we're looking
 		//  for
 		if (isTarget(sti)) {
@@ -473,7 +473,7 @@ TilePoint MetaTileTarget::where(
 
 	//  get the first metatile in region
 	mt = mIter.first(&metaCoords);
-	while (mt != NULL) {
+	while (mt != nullptr) {
 		if (isTarget(mt, world->mapNum, metaCoords)) {
 			uint16  dist;
 
@@ -527,7 +527,7 @@ int16 MetaTileTarget::where(
 
 	//  Get the first metatile in tile region
 	mt = mIter.first(&metaCoords);
-	while (mt != NULL) {
+	while (mt != nullptr) {
 		if (isTarget(mt, world->mapNum, metaCoords)) {
 			uint16  dist;
 
@@ -776,7 +776,7 @@ TilePoint ObjectTarget::where(GameWorld *world, const TilePoint &tp) const {
 
 	//  Iterate through each object in the vicinity
 	for (iter.first(&objPtr, &dist);
-	        objPtr != NULL;
+	        objPtr != nullptr;
 	        iter.next(&objPtr, &dist)) {
 		//  Skip this object if we've already found a closer
 		//  object
@@ -837,13 +837,13 @@ GameObject *ObjectTarget::object(
 	CircularObjectIterator  objIter(world, tp, maxObjDist);
 
 	GameObject     *objPtr,
-	               *bestObj = NULL;
+	               *bestObj = nullptr;
 	int16                   dist,
 	                        bestDist = maxint16;
 
 	//  Iterate through each object in the vicinity
 	for (objIter.first(&objPtr, &dist);
-	        objPtr != NULL;
+	        objPtr != nullptr;
 	        objIter.next(&objPtr, &dist)) {
 		//  Skip this object if we have already found a closer object
 		if (dist > 0 && dist < bestDist) {
@@ -1020,7 +1020,7 @@ GameObject *SpecificObjectTarget::object(
 			return o;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -1155,7 +1155,7 @@ SpecificActorTarget::SpecificActorTarget(Common::SeekableReadStream *stream) {
 	//  Convert the actor ID into an Actor pointer
 	a = actorID != Nothing
 	    ? (Actor *)GameObject::objectAddress(actorID)
-	    :   NULL;
+	    :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -1168,7 +1168,7 @@ inline int32 SpecificActorTarget::archiveSize() const {
 
 void SpecificActorTarget::write(Common::MemoryWriteStreamDynamic *out) const {
 	//  Convert the actor pointer to an actor ID;
-	ObjectID actorID = a != NULL ? a->thisID() : Nothing;
+	ObjectID actorID = a != nullptr ? a->thisID() : Nothing;
 
 	//  Store the actor ID
 	out->writeUint16LE(actorID);
@@ -1267,7 +1267,7 @@ GameObject *SpecificActorTarget::object(
 			return a;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -1305,7 +1305,7 @@ Actor *SpecificActorTarget::actor(
 			return a;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 //----------------------------------------------------------------------
diff --git a/engines/saga2/task.cpp b/engines/saga2/task.cpp
index 68236d6f6e..69f028f679 100644
--- a/engines/saga2/task.cpp
+++ b/engines/saga2/task.cpp
@@ -304,7 +304,7 @@ void TaskStackList::updateTaskStacks() {
 			//  Update the task stack and delete it if it is done
 			if ((result = ts->update()) != taskNotDone) {
 				Actor *a = ts->getActor();
-				assert(a != NULL);
+				assert(a != nullptr);
 
 				a->handleTaskCompletion(result);
 			}
@@ -919,7 +919,7 @@ void TetheredWanderTask::fixup() {
 	//	Restore the gotoTether pointer
 	gotoTether = _gotoTetherID != NoTask
 				 ?	(GotoRegionTask *)getTaskAddress(_gotoTetherID)
-				 :	NULL;
+				 :	nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -947,7 +947,7 @@ void TetheredWanderTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	out->writeSint16LE(maxV);
 
 	//  Archive gotoTether ID
-	if (gotoTether != NULL)
+	if (gotoTether != nullptr)
 		out->writeSint16LE(getTaskID(gotoTether));
 	else
 		out->writeSint16LE(NoTask);
@@ -975,10 +975,10 @@ int16 TetheredWanderTask::getType() const {
 //----------------------------------------------------------------------
 
 void TetheredWanderTask::abortTask() {
-	if (gotoTether != NULL) {
+	if (gotoTether != nullptr) {
 		gotoTether->abortTask();
 		delete gotoTether;
-		gotoTether = NULL;
+		gotoTether = nullptr;
 	} else {
 		MotionTask *actorMotion = stack->getActor()->_moveTask;
 
@@ -1009,17 +1009,17 @@ TaskResult TetheredWanderTask::handleWander() {
 
 	if (actorLoc.u < minU || actorLoc.u >= maxU
 	        ||  actorLoc.v < minV || actorLoc.v >= maxV) {
-		if (gotoTether != NULL)
+		if (gotoTether != nullptr)
 			gotoTether->update();
 		else {
 			gotoTether = new GotoRegionTask(stack, minU, minV, maxU, maxV);
-			if (gotoTether != NULL) gotoTether->update();
+			if (gotoTether != nullptr) gotoTether->update();
 		}
 	} else {
-		if (gotoTether != NULL) {
+		if (gotoTether != nullptr) {
 			gotoTether->abortTask();
 			delete gotoTether;
-			gotoTether = NULL;
+			gotoTether = nullptr;
 		}
 
 		bool            startWander = false;
@@ -1085,7 +1085,7 @@ void GotoTask::fixup() {
 	//	Convert wanderID to a Task pointer
 	wander = _wanderID != NoTask
 	         ? (WanderTask *)getTaskAddress(_wanderID)
-	         :   NULL;
+	         :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -1104,7 +1104,7 @@ void GotoTask::write(Common::MemoryWriteStreamDynamic *out) const {
 
 	//  Convert the wander Task pointer to a TaskID and store it
 	//  in the buffer
-	if (wander != NULL)
+	if (wander != nullptr)
 		out->writeSint16LE(getTaskID(wander));
 	else
 		out->writeSint16LE(NoTask);
@@ -1132,7 +1132,7 @@ void GotoTask::abortTask() {
 	if (wander) {
 		wander->abortTask();
 		delete wander;
-		wander = NULL;
+		wander = nullptr;
 	} else {
 		MotionTask  *actorMotion = stack->getActor()->_moveTask;
 
@@ -1171,9 +1171,9 @@ TaskResult GotoTask::update() {
 	//  If we have a destination, walk there, else wander
 	if (immediateDest != Nowhere) {
 		//  If wandering, cut it out
-		if (wander != NULL) {
+		if (wander != nullptr) {
 			delete wander;
-			wander = NULL;
+			wander = nullptr;
 		}
 
 		//  Determine if there is aready a motion task, and if so,
@@ -1181,7 +1181,7 @@ TaskResult GotoTask::update() {
 		MotionTask  *actorMotion = a->_moveTask;
 		TilePoint   actorLoc = a->getLocation();
 
-		if (actorMotion != NULL && actorMotion->isWalkToDest()) {
+		if (actorMotion != nullptr && actorMotion->isWalkToDest()) {
 			bool        runState = run();
 			TilePoint   motionTarget = actorMotion->getTarget();
 
@@ -1220,11 +1220,11 @@ TaskResult GotoTask::update() {
 	} else {
 		//  If wandering, update the wander task else set up a new
 		//  wander task
-		if (wander != NULL)
+		if (wander != nullptr)
 			wander->update();
 		else {
 			wander = new WanderTask(stack);
-			if (wander != NULL) wander->update();
+			if (wander != nullptr) wander->update();
 		}
 
 		return taskNotDone;
@@ -1553,7 +1553,7 @@ GotoObjectTask::GotoObjectTask(Common::InSaveFile *in, TaskID id) :
 	//  Restore the targetObj pointer
 	targetObj = targetID != Nothing
 	            ?   GameObject::objectAddress(targetID)
-	            :   NULL;
+	            :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -1570,7 +1570,7 @@ void GotoObjectTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	//  Let the base class archive its data
 	GotoObjectTargetTask::write(out);
 
-	if (targetObj != NULL)
+	if (targetObj != nullptr)
 		out->writeUint16LE(targetObj->thisID());
 	else
 		out->writeUint16LE(Nothing);
@@ -1620,7 +1620,7 @@ GotoActorTask::GotoActorTask(Common::InSaveFile *in, TaskID id) :
 	ObjectID targetID = in->readUint16LE();
 	targetActor =   targetID != Nothing
 	                ? (Actor *)GameObject::objectAddress(targetID)
-	                :   NULL;
+	                :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -1637,7 +1637,7 @@ void GotoActorTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	//  Let the base class archive its data
 	GotoObjectTargetTask::write(out);
 
-	if (targetActor != NULL)
+	if (targetActor != nullptr)
 		out->writeUint16LE(targetActor->thisID());
 	else
 		out->writeUint16LE(Nothing);
@@ -1699,7 +1699,7 @@ void GoAwayFromTask::fixup() {
 
 	goTask = _goTaskID != NoTask
 	         ? (GotoLocationTask *)getTaskAddress(_goTaskID)
-	         :   NULL;
+	         :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -1715,7 +1715,7 @@ void GoAwayFromTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	Task::write(out);
 
 	//  Store the subTask's ID
-	if (goTask != NULL)
+	if (goTask != nullptr)
 		out->writeSint16LE(getTaskID(goTask));
 	else
 		out->writeSint16LE(NoTask);
@@ -1740,10 +1740,10 @@ void GoAwayFromTask::mark() {
 //	Abort this task
 
 void GoAwayFromTask::abortTask() {
-	if (goTask != NULL) {
+	if (goTask != nullptr) {
 		goTask->abortTask();
 		delete goTask;
-		goTask = NULL;
+		goTask = nullptr;
 	}
 }
 
@@ -1784,7 +1784,7 @@ TaskResult GoAwayFromTask::update() {
 	} else
 		dest = actorLoc + dirTable_[a->_currentFacing];
 
-	if (goTask != NULL) {
+	if (goTask != nullptr) {
 		if (goTask->getTarget() != dest)
 			goTask->changeTarget(dest);
 
@@ -1793,7 +1793,7 @@ TaskResult GoAwayFromTask::update() {
 		if ((goTask =   flags & run
 		                ?   new GotoLocationTask(stack, dest, 0)
 		                :   new GotoLocationTask(stack, dest))
-		        !=  NULL)
+		        !=  nullptr)
 			goTask->update();
 	}
 
@@ -1814,7 +1814,7 @@ GoAwayFromObjectTask::GoAwayFromObjectTask(Common::InSaveFile *in, TaskID id) :
 	//  Convert the ID to an object pointer
 	obj = objectID != Nothing
 		? GameObject::objectAddress(objectID)
-		: NULL;
+		: nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -1832,7 +1832,7 @@ void GoAwayFromObjectTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	GoAwayFromTask::write(out);
 
 	//  Store the object's ID
-	if (obj != NULL)
+	if (obj != nullptr)
 		out->writeUint16LE(obj->thisID());
 	else
 		out->writeUint16LE(Nothing);
@@ -2089,7 +2089,7 @@ TaskResult HuntTask::update() {
 			GotoTask    *gotoResult;
 
 			//  Try to set up a goto subtask
-			if ((gotoResult = setupGoto()) != NULL) {
+			if ((gotoResult = setupGoto()) != nullptr) {
 				if (huntFlags & huntWander) removeWanderTask();
 
 				subTask = gotoResult;
@@ -2097,7 +2097,7 @@ TaskResult HuntTask::update() {
 			} else {
 				//  If we couldn't setup a goto task, setup a wander task
 				if (!(huntFlags & huntWander)) {
-					if ((subTask = new WanderTask(stack)) != NULL)
+					if ((subTask = new WanderTask(stack)) != nullptr)
 						huntFlags |= huntWander;
 				}
 			}
@@ -2190,7 +2190,7 @@ GotoTask *HuntLocationTask::setupGoto() {
 	//  If there is somewhere to go, setup a goto task, else return NULL
 	return  currentTarget != Nowhere
 	        ?   new GotoLocationTask(stack, currentTarget)
-	        :   NULL;
+	        :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -2309,7 +2309,7 @@ TaskResult HuntToBeNearLocationTask::atTargetUpdate() {
 
 HuntObjectTask::HuntObjectTask(TaskStack *ts, const ObjectTarget &ot) :
 	HuntTask(ts),
-	currentTarget(NULL) {
+	currentTarget(nullptr) {
 	assert(ot.size() <= sizeof(targetMem));
 	debugC(2, kDebugTasks, " - HuntObjectTask");
 	//  Copy the target to the target buffer
@@ -2323,7 +2323,7 @@ HuntObjectTask::HuntObjectTask(Common::InSaveFile *in, TaskID id) : HuntTask(in,
 	//  Convert the ID to a GameObject pointer
 	currentTarget = currentTargetID != Nothing
 	                ?   GameObject::objectAddress(currentTargetID)
-	                :   NULL;
+	                :   nullptr;
 
 	//  Reconstruct the object target
 	readTarget(targetMem, in);
@@ -2344,7 +2344,7 @@ void HuntObjectTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	HuntTask::write(out);
 
 	//  Store the ID
-	if (currentTarget != NULL)
+	if (currentTarget != nullptr)
 		out->writeByte(currentTarget->thisID());
 	else
 		out->writeByte(Nothing);
@@ -2369,7 +2369,7 @@ GotoTask *HuntObjectTask::setupGoto() {
 	//  return NULL
 	return  currentTarget
 	        ?   new GotoObjectTask(stack, currentTarget)
-	        :   NULL;
+	        :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -2653,7 +2653,7 @@ HuntActorTask::HuntActorTask(
     bool                trackFlag) :
 	HuntTask(ts),
 	flags(trackFlag ? track : 0),
-	currentTarget(NULL) {
+	currentTarget(nullptr) {
 	assert(at.size() <= sizeof(targetMem));
 	debugC(2, kDebugTasks, " - HuntActorTask");
 	//  Copy the target to the target buffer
@@ -2670,7 +2670,7 @@ HuntActorTask::HuntActorTask(Common::InSaveFile *in, TaskID id) : HuntTask(in, i
 	//  Convert the ID to a GameObject pointer
 	currentTarget = currentTargetID != Nothing
 	                ? (Actor *)GameObject::objectAddress(currentTargetID)
-	                :   NULL;
+	                :   nullptr;
 
 	//  Reconstruct the object target
 	readTarget(targetMem, in);
@@ -2695,7 +2695,7 @@ void HuntActorTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	out->writeByte(flags);
 
 	//  Store the ID
-	if (currentTarget != NULL)
+	if (currentTarget != nullptr)
 		out->writeUint16LE(currentTarget->thisID());
 	else
 		out->writeUint16LE(Nothing);
@@ -2722,14 +2722,14 @@ GotoTask *HuntActorTask::setupGoto() {
 	            ?   new GotoActorTask( stack, currentTarget, flags & track )
 	            :   NULL;
 	*/
-	if (currentTarget != NULL) {
+	if (currentTarget != nullptr) {
 		return new GotoActorTask(
 		           stack,
 		           currentTarget,
 		           flags & track);
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -2769,7 +2769,7 @@ void HuntToBeNearActorTask::fixup() {
 	//  Convert the task ID to a task pointer
 	goAway = _goAwayID != NoTask
 	         ? (GoAwayFromObjectTask *)getTaskAddress(_goAwayID)
-	         :   NULL;
+	         :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -2790,7 +2790,7 @@ void HuntToBeNearActorTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	HuntActorTask::write(out);
 
 	//  Store the task ID
-	if (goAway != NULL)
+	if (goAway != nullptr)
 		out->writeSint16LE(getTaskID(goAway));
 	else
 		out->writeSint16LE(NoTask);
@@ -2891,10 +2891,10 @@ bool HuntToBeNearActorTask::atTarget() {
 	        &&  stack->getActor()->inRange(targetLoc, range))
 		return true;
 	else {
-		if (goAway != NULL) {
+		if (goAway != nullptr) {
 			goAway->abortTask();
 			delete goAway;
-			goAway = NULL;
+			goAway = nullptr;
 		}
 
 		return false;
@@ -2904,10 +2904,10 @@ bool HuntToBeNearActorTask::atTarget() {
 //----------------------------------------------------------------------
 
 void HuntToBeNearActorTask::atTargetabortTask() {
-	if (goAway != NULL) {
+	if (goAway != nullptr) {
 		goAway->abortTask();
 		delete goAway;
-		goAway = NULL;
+		goAway = nullptr;
 	}
 }
 
@@ -2920,10 +2920,10 @@ TaskResult HuntToBeNearActorTask::atTargetEvaluate() {
 	if (stack->getActor()->inRange(targetLoc, tooClose))
 		return taskNotDone;
 
-	if (goAway != NULL) {
+	if (goAway != nullptr) {
 		goAway->abortTask();
 		delete goAway;
-		goAway = NULL;
+		goAway = nullptr;
 	}
 
 	return taskSucceeded;
@@ -2938,9 +2938,9 @@ TaskResult HuntToBeNearActorTask::atTargetUpdate() {
 	//  Determine if we're TOO close
 	if (a->inRange(targetLoc, tooClose)) {
 		//  Setup a go away task if necessary and update it
-		if (goAway == NULL) {
+		if (goAway == nullptr) {
 			goAway = new GoAwayFromObjectTask(stack, currentTarget);
-			if (goAway != NULL) goAway->update();
+			if (goAway != nullptr) goAway->update();
 		} else
 			goAway->update();
 
@@ -2948,10 +2948,10 @@ TaskResult HuntToBeNearActorTask::atTargetUpdate() {
 	}
 
 	//  Delete the go away task if it exists
-	if (goAway != NULL) {
+	if (goAway != nullptr) {
 		goAway->abortTask();
 		delete goAway;
-		goAway = NULL;
+		goAway = nullptr;
 	}
 
 	return taskSucceeded;
@@ -3072,9 +3072,9 @@ void HuntToKillTask::evaluateTarget() {
 
 	//  Determine if its time to reevaluate the current target actor
 	if (targetEvaluateCtr == 0
-	        || (currentTarget != NULL
+	        || (currentTarget != nullptr
 	            &&  currentTarget->isDead())) {
-		Actor               *bestTarget = NULL;
+		Actor               *bestTarget = nullptr;
 		ActorProto          *proto = (ActorProto *)a->proto();
 		int16               i;
 		Actor               *actorArray[16];
@@ -3130,7 +3130,7 @@ void HuntToKillTask::evaluateTarget() {
 					score =     closenessScore(distArray[i]) * 16
 					            /   actorArray[i]->defenseScore();
 
-					if (score > bestScore || bestTarget == NULL) {
+					if (score > bestScore || bestTarget == nullptr) {
 						bestScore = score;
 						bestTarget = actorArray[i];
 					}
@@ -3159,7 +3159,7 @@ void HuntToKillTask::evaluateTarget() {
 					score =     closenessScore(distArray[i])
 					            *   actorArray[i]->offenseScore();
 
-					if (score > bestScore || bestTarget == NULL) {
+					if (score > bestScore || bestTarget == nullptr) {
 						bestScore = score;
 						bestTarget = actorArray[i];
 					}
@@ -3189,7 +3189,7 @@ void HuntToKillTask::evaluateTarget() {
 					            *   actorArray[i]->offenseScore()
 					            /   actorArray[i]->defenseScore();
 
-					if (score > bestScore || bestTarget == NULL) {
+					if (score > bestScore || bestTarget == nullptr) {
 						bestScore = score;
 						bestTarget = actorArray[i];
 					}
@@ -3220,7 +3220,7 @@ void HuntToKillTask::evaluateTarget() {
 
 bool HuntToKillTask::atTarget() {
 	//  Determine if we're in attack range of the current target
-	return      currentTarget != NULL
+	return      currentTarget != nullptr
 	            &&  stack->getActor()->inAttackRange(
 	                currentTarget->getLocation());
 }
@@ -3267,24 +3267,24 @@ void HuntToKillTask::evaluateWeapon() {
 	int                 bestWeaponRating;
 	ContainerIterator   iter(a);
 
-	bestWeapon = NULL;
+	bestWeapon = nullptr;
 	bestWeaponRating = 0;
 	currentWeapon = a->offensiveObject();
 	//  If the current offensive object is the actor himself then there
 	//  is no current weapon.
-	if (currentWeapon == a) currentWeapon = NULL;
+	if (currentWeapon == a) currentWeapon = nullptr;
 
 	if (!isAutoWeaponSet() && isPlayerActor(a)) {
-		WeaponProto     *weaponProto =  currentWeapon != NULL
+		WeaponProto     *weaponProto =  currentWeapon != nullptr
 		                                ? (WeaponProto *)currentWeapon->proto()
-		                                :   NULL;
+		                                :   nullptr;
 
-		if (currentTarget == NULL) {
+		if (currentTarget == nullptr) {
 			warning("%s: currentTarget = NULL (return)", a->objName());
 			return;
 		}
 
-		if (currentWeapon == NULL
+		if (currentWeapon == nullptr
 		        ||      weaponProto->weaponRating(
 		            a->thisID(),
 		            actorID,
@@ -3329,13 +3329,13 @@ void HuntToKillTask::evaluateWeapon() {
 		}
 	}
 
-	if (bestWeapon != NULL) {
+	if (bestWeapon != nullptr) {
 		if (bestWeapon != currentWeapon)
 			bestWeapon->use(actorID);
 	}
 	//  If there is no useful best weapon and the actor is currently
 	//  wielding a weapon, un-wield the weapon
-	else if (currentWeapon != NULL)
+	else if (currentWeapon != nullptr)
 		currentWeapon->use(actorID);
 }
 
@@ -3354,7 +3354,7 @@ HuntToGiveTask::HuntToGiveTask(Common::InSaveFile *in, TaskID id) : HuntActorTas
 	//  Convert the object ID to a pointer
 	objToGive = objToGiveID != Nothing
 	            ?   GameObject::objectAddress(objToGiveID)
-	            :   NULL;
+	            :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -3373,7 +3373,7 @@ void HuntToGiveTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	HuntActorTask::write(out);
 
 	//  Store the ID
-	if (objToGive != NULL)
+	if (objToGive != nullptr)
 		out->writeUint16LE(objToGive->thisID());
 	else
 		out->writeUint16LE(Nothing);
@@ -3434,7 +3434,7 @@ TaskResult HuntToGiveTask::atTargetUpdate() {
 bool BandTask::BandingRepulsorIterator::first(
     TilePoint   &repulsorVector,
     int16       &repulsorStrength) {
-	assert(a->_leader != NULL && a->_leader->_followers != NULL);
+	assert(a->_leader != nullptr && a->_leader->_followers != nullptr);
 
 	band = a->_leader->_followers;
 	bandIndex = 0;
@@ -3460,7 +3460,7 @@ bool BandTask::BandingRepulsorIterator::first(
 bool BandTask::BandingRepulsorIterator::next(
     TilePoint   &repulsorVector,
     int16       &repulsorStrength) {
-	assert(a->_leader != NULL && a->_leader->_followers != NULL);
+	assert(a->_leader != nullptr && a->_leader->_followers != nullptr);
 	assert(band == a->_leader->_followers);
 	assert(bandIndex < band->size());
 
@@ -3504,7 +3504,7 @@ void BandTask::fixup() {
 	//  Convert the TaskID to a Task pointer
 	attend = _attendID != NoTask
 	         ? (AttendTask *)getTaskAddress(_attendID)
-	         :   NULL;
+	         :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -3525,7 +3525,7 @@ void BandTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	HuntTask::write(out);
 
 	//  Store the attend task ID
-	if (attend != NULL)
+	if (attend != nullptr)
 		out->writeSint16LE(getTaskID(attend));
 	else
 		out->writeSint16LE(NoTask);
@@ -3580,7 +3580,7 @@ void BandTask::evaluateTarget() {
 
 		RepulsorIterator    *repulsorIter = getNewRepulsorIterator();
 
-		if (repulsorIter == NULL) return;
+		if (repulsorIter == nullptr) return;
 
 		//  Count the leader as two band members to double his
 		//  repulsion
@@ -3683,10 +3683,10 @@ bool BandTask::atTarget() {
 
 	if ((actorLoc - currentTarget).quickHDistance() > 6
 	        ||  ABS(actorLoc.z - currentTarget.z) > kMaxStepHeight) {
-		if (attend != NULL) {
+		if (attend != nullptr) {
 			attend->abortTask();
 			delete attend;
-			attend = NULL;
+			attend = nullptr;
 		}
 
 		return false;
@@ -3698,10 +3698,10 @@ bool BandTask::atTarget() {
 //----------------------------------------------------------------------
 
 void BandTask::atTargetabortTask() {
-	if (attend != NULL) {
+	if (attend != nullptr) {
 		attend->abortTask();
 		delete attend;
-		attend = NULL;
+		attend = nullptr;
 	}
 }
 
@@ -3716,11 +3716,11 @@ TaskResult BandTask::atTargetEvaluate() {
 TaskResult BandTask::atTargetUpdate() {
 	Actor       *a = stack->getActor();
 
-	if (attend != NULL)
+	if (attend != nullptr)
 		attend->update();
 	else {
 		attend = new AttendTask(stack, a->_leader);
-		if (attend != NULL)
+		if (attend != nullptr)
 			attend->update();
 	}
 
@@ -3885,7 +3885,7 @@ void FollowPatrolRouteTask::fixup() {
 	//  Convert the TaskID to a Task pointer
 	gotoWayPoint = _gotoWayPointID != NoTask
 	               ? (GotoLocationTask *)getTaskAddress(_gotoWayPointID)
-	               :   NULL;
+	               :   nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -3908,7 +3908,7 @@ void FollowPatrolRouteTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	Task::write(out);
 
 	//  Store the gotoWayPoint ID
-	if (gotoWayPoint != NULL)
+	if (gotoWayPoint != nullptr)
 		out->writeSint16LE(getTaskID(gotoWayPoint));
 	else
 		out->writeSint16LE(NoTask);
@@ -3952,7 +3952,7 @@ void FollowPatrolRouteTask::abortTask() {
 	if (gotoWayPoint) {
 		gotoWayPoint->abortTask();
 		delete gotoWayPoint;
-		gotoWayPoint = NULL;
+		gotoWayPoint = nullptr;
 	}
 }
 
@@ -3998,10 +3998,10 @@ TaskResult FollowPatrolRouteTask::handleFollowPatrolRoute() {
 	        == (currentWayPoint.v >> kTileUVShift)
 	        &&  ABS(actorLoc.z - currentWayPoint.z) <= kMaxStepHeight) {
 		//  Delete the gotoWayPoint task
-		if (gotoWayPoint != NULL) {
+		if (gotoWayPoint != nullptr) {
 			gotoWayPoint->abortTask();
 			delete gotoWayPoint;
-			gotoWayPoint = NULL;
+			gotoWayPoint = nullptr;
 		}
 
 		//  If this way point is the specified last way point,
@@ -4025,11 +4025,11 @@ TaskResult FollowPatrolRouteTask::handleFollowPatrolRoute() {
 
 	//  Setup a gotoWayPoint task if one doesn't already exist and
 	//  update it
-	if (gotoWayPoint != NULL)
+	if (gotoWayPoint != nullptr)
 		gotoWayPoint->update();
 	else {
 		gotoWayPoint = new GotoLocationTask(stack, currentWayPoint);
-		if (gotoWayPoint != NULL) gotoWayPoint->update();
+		if (gotoWayPoint != nullptr) gotoWayPoint->update();
 	}
 
 	return taskNotDone;
@@ -4072,7 +4072,7 @@ AttendTask::AttendTask(Common::InSaveFile *in, TaskID id) : Task(in, id) {
 	//  Convert the object ID to a pointer
 	obj = objID != Nothing
 		? GameObject::objectAddress(objID)
-		: NULL;
+		: nullptr;
 }
 
 //----------------------------------------------------------------------
@@ -4091,7 +4091,7 @@ void AttendTask::write(Common::MemoryWriteStreamDynamic *out) const {
 	Task::write(out);
 
 	//  Store the object ID
-	if (obj != NULL)
+	if (obj != nullptr)
 		out->writeUint16LE(obj->thisID());
 	else
 		out->writeUint16LE(Nothing);
@@ -4110,7 +4110,7 @@ void AttendTask::abortTask() {
 	MotionTask  *actorMotion = stack->getActor()->_moveTask;
 
 	//  Determine if we need to abort the actor motion
-	if (actorMotion != NULL && actorMotion->isTurn())
+	if (actorMotion != nullptr && actorMotion->isTurn())
 		actorMotion->finishTurn();
 }
 
diff --git a/engines/saga2/terrain.cpp b/engines/saga2/terrain.cpp
index fbff213b5a..a942411e82 100644
--- a/engines/saga2/terrain.cpp
+++ b/engines/saga2/terrain.cpp
@@ -37,7 +37,7 @@ extern WorldMapData     *mapList;
 
 static int16        prevMapNum;
 static StaticTilePoint prevCoords = {(int16)minint16, (int16)minint16, (int16)minint16};
-static MetaTilePtr  prevMeta = NULL;
+static MetaTilePtr  prevMeta = nullptr;
 
 /* ===================================================================== *
    Terrain damage info
@@ -133,12 +133,12 @@ uint32 tileTerrain(
 		prevCoords.set(metaCoords.u, metaCoords.v, metaCoords.z);
 	}
 
-	if (metaPtr == NULL) return 0L;
+	if (metaPtr == nullptr) return 0L;
 
 	for (int i = 0; i < maxPlatforms; i++) {
 		Platform    *p;
 
-		if ((p = metaPtr->fetchPlatform(mapNum, i)) == NULL)
+		if ((p = metaPtr->fetchPlatform(mapNum, i)) == nullptr)
 			continue;
 
 		if (p->flags & plVisible) {
@@ -611,8 +611,8 @@ int16 tileSlopeHeight(
 	prevMapNum = mapNum;
 	prevCoords.set(metaCoords.u, metaCoords.v, metaCoords.z);
 
-	if (metaPtr != NULL) {
-		highestTile.surfaceTile = lowestTile.surfaceTile = NULL;
+	if (metaPtr != nullptr) {
+		highestTile.surfaceTile = lowestTile.surfaceTile = nullptr;
 		highestSupportHeight = -100;
 		lowestSupportHeight = 0x7FFF;
 
@@ -622,7 +622,7 @@ int16 tileSlopeHeight(
 		for (i = 0; i < maxPlatforms; i++) {
 			Platform    *p;
 
-			if ((p = metaPtr->fetchPlatform(mapNum, i)) == NULL)
+			if ((p = metaPtr->fetchPlatform(mapNum, i)) == nullptr)
 				continue;
 
 			if (p->flags & plVisible) {
@@ -668,7 +668,7 @@ int16 tileSlopeHeight(
 						highestTile = sti;
 						highestSupportHeight = supportHeight;
 						highestSupportPlatform = i;
-					} else if (highestTile.surfaceTile == NULL &&
+					} else if (highestTile.surfaceTile == nullptr &&
 					           supportHeight <= lowestSupportHeight &&
 					           (ti->combinedTerrainMask() &
 					            (terrainSurface | terrainRaised))) {
@@ -693,8 +693,8 @@ int16 tileSlopeHeight(
 	}
 
 	if (stiResult) {
-		stiResult->surfaceTile = NULL;
-		stiResult->surfaceTAG = NULL;
+		stiResult->surfaceTile = nullptr;
+		stiResult->surfaceTAG = nullptr;
 		stiResult->surfaceHeight = 0;
 	}
 	if (platformResult) *platformResult = 0;
@@ -745,7 +745,7 @@ uint32 objectTerrain(GameObject *obj, StandingTileInfo &sti) {
 	uint32          terrain;
 	TilePoint       loc = obj->getLocation();
 
-	sti.surfaceTAG = NULL;
+	sti.surfaceTAG = nullptr;
 
 	terrain = volumeTerrain(mapNum,
 	                        loc,
@@ -765,8 +765,8 @@ uint32 objectTerrain(GameObject *obj, StandingTileInfo &sti) {
 		//  If the character is indeed standing ON the landscape
 		//  REM: This depends on the nature of the tile I think!!!
 
-		if (sti.surfaceTile == NULL
-		        ||  sti.surfaceTAG == NULL
+		if (sti.surfaceTile == nullptr
+		        ||  sti.surfaceTAG == nullptr
 		        ||  !(sti.surfaceRef.flags & trTileSensitive)
 		        ||  loc.z >= tHeight + 2
 		        /* ||   loc.z >= standingTile->attrs.terrainHeight */) {
@@ -789,7 +789,7 @@ int16 checkBlocked(
 	GameObject      *blockObj;
 	GameWorld       *world;
 
-	if (blockResultObj) *blockResultObj = NULL;
+	if (blockResultObj) *blockResultObj = nullptr;
 
 
 	//  check to make sure the actor recognizes terrain
@@ -844,7 +844,7 @@ int16 checkWalkable(
 	if (supportHeight < loc.z - kMaxStepHeight * 4)
 		return blockageTerrain;
 
-	if (sti.surfaceTile != NULL) {
+	if (sti.surfaceTile != nullptr) {
 		int16               subTileU,
 		                    subTileV,
 		                    mask;
@@ -872,7 +872,7 @@ int16 checkContact(
 	GameObject      *blockObj;
 	GameWorld       *world;
 
-	if (blockResultObj) *blockResultObj = NULL;
+	if (blockResultObj) *blockResultObj = nullptr;
 
 	terrain = volumeTerrain(mapNum,
 	                        loc,
diff --git a/engines/saga2/tileload.cpp b/engines/saga2/tileload.cpp
index dcb6292ee9..f98acc5019 100644
--- a/engines/saga2/tileload.cpp
+++ b/engines/saga2/tileload.cpp
@@ -121,7 +121,7 @@ void drawPlatform(
 					int16 trFlags;
 
 					TileInfo *ti = p.fetchTile(g_vm->_currentMapNum, pCoords, origin, &imageData, h, trFlags);
-					if (ti == NULL)
+					if (ti == nullptr)
 						continue;
 
 					int16 y = tilePos.y - h;
diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index 75f8593bfa..3174026d4d 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -63,7 +63,7 @@ class gStickyDragControl : public gGenericControl {
 	bool    sticky;
 
 public:
-	gStickyDragControl(gPanelList &, const Rect16 &, uint16, AppFunc *cmd = NULL);
+	gStickyDragControl(gPanelList &, const Rect16 &, uint16, AppFunc *cmd = nullptr);
 
 	void setSticky(bool s) {
 		sticky = s;
@@ -163,7 +163,7 @@ static bool navigationDelayed = false;
 //Tile Mode GameMode Object
 
 GameMode            TileMode = {
-	NULL,                                   // no previous mode
+	nullptr,                                // no previous mode
 	false,                                  // mode is not nestable
 	TileModeSetup,
 	TileModeCleanup,
@@ -182,7 +182,7 @@ Alarm               updateAlarm,            // max coord update rate
                     pathFindAlarm;          // mouse click rate for path find
 bool                tileLockFlag;           // true if tile mode is locked
 
-GameObject          *mouseObject = NULL;    // object being dragged
+GameObject          *mouseObject = nullptr;    // object being dragged
 StaticPoint32       lastMousePos = {0, 0};           // Last mouse position over map
 static bool         mousePressed,           // State of mouse button
        clickActionDone = true; // Flag indication wether current
@@ -358,7 +358,7 @@ bool areThereActiveEnemies() {
 	ActiveRegionObjectIterator  iter;
 	GameObject                  *obj = nullptr;
 
-	for (iter.first(&obj); obj != NULL; iter.next(&obj)) {
+	for (iter.first(&obj); obj != nullptr; iter.next(&obj)) {
 		if (isActor(obj)
 		        &&  !((Actor *)obj)->isDead()
 		        && ((Actor *)obj)->_disposition == dispositionEnemy)
@@ -376,10 +376,10 @@ void CheckCombatMood() {
 	static bool         wasHostile = false;
 
 	ar = getActiveRegion(getCenterActorPlayerID());
-	if (ar == NULL) return;
+	if (ar == nullptr) return;
 
 	world = ar->getWorld();
-	if (world == NULL || !isWorld(world)) return;
+	if (world == nullptr || !isWorld(world)) return;
 
 	//  Search for hostile monsters.
 
@@ -394,7 +394,7 @@ void CheckCombatMood() {
 
 	wasHostile = false;
 	clearActiveFactions();
-	for (iter8.first(&obj); obj != NULL; iter8.next(&obj)) {
+	for (iter8.first(&obj); obj != nullptr; iter8.next(&obj)) {
 		if (isActor(obj)
 		        &&  !((Actor *)obj)->isDead()
 		        && ((Actor *)obj)->_disposition == dispositionEnemy) {
@@ -417,7 +417,7 @@ static void evalMouseState() {
 
 	g_vm->_mouseInfo->setDoable(interruptable);
 
-	if (g_vm->_mouseInfo->getObject() != NULL) {
+	if (g_vm->_mouseInfo->getObject() != nullptr) {
 		GameObject  *mObj = g_vm->_mouseInfo->getObject();
 
 		//  If the mouse pointer has an object and the intention
@@ -426,10 +426,10 @@ static void evalMouseState() {
 		//  and if so, wether the other object is within the
 		//  use range of the center actor
 		if (g_vm->_mouseInfo->getIntent() == GrabInfo::Use) {
-			assert(obj != NULL);
+			assert(obj != nullptr);
 
 			if (mObj->containmentSet() & (ProtoObj::isSkill | ProtoObj::isSpell)) {
-				GameObject  *tob = pickedObject != Nothing ? obj : NULL;
+				GameObject  *tob = pickedObject != Nothing ? obj : nullptr;
 				// If it's a spell we need to do more complex testing
 				//   to see if the current target is valid
 				g_vm->_mouseInfo->setDoable(
@@ -565,7 +565,7 @@ static void evalMouseState() {
 
 	if (mousePressed
 	        &&  !clickActionDone
-	        &&  g_vm->_mouseInfo->getObject() == NULL) {
+	        &&  g_vm->_mouseInfo->getObject() == nullptr) {
 		a = getCenterActor();
 
 		//  Since the mouse is being dragged, initiate
@@ -576,7 +576,7 @@ static void evalMouseState() {
 			        &&  !navigationDelayed) {
 				MotionTask  *mt = a->_moveTask;
 
-				if (mt == NULL || !mt->isWalk()) {
+				if (mt == nullptr || !mt->isWalk()) {
 					navigateDirect(walkToPos, runFlag);
 				} else if (updateAlarm.check()) {
 					mt->changeDirectTarget(
@@ -688,7 +688,7 @@ void TileModeCleanup() {
 	delete tileMapControl;
 
 //	This Fixes the mousePanel That's not set up
-	g_vm->_toolBase->mousePanel = NULL;
+	g_vm->_toolBase->mousePanel = nullptr;
 
 	mainWindow->removeDecorations();
 }
@@ -794,7 +794,7 @@ void TileModeHandleTask() {
 				//  without regard to the actual shape of the terrain.
 				tilePickPos = pickTilePos(lastMousePos, a->getLocation());
 				tilePickExactPos = tilePickPos;
-				pickedTAI = NULL;
+				pickedTAI = nullptr;
 			} else {
 				//  Calculate the mouse's position on the tilemap,
 				//  including the shape of the terrain. Actually
@@ -825,7 +825,7 @@ void TileModeHandleTask() {
 				lastPickedObject = pickedObject;
 
 				//  Remove current mouse cursor text and gauge
-				g_vm->_mouseInfo->setText(NULL);
+				g_vm->_mouseInfo->setText(nullptr);
 				g_vm->_mouseInfo->clearGauge();
 
 				//  If mouse in on object set alarm to determine when
@@ -1067,13 +1067,13 @@ static APPFUNC(cmdClickTileMap) {
 		if (ev.value & gGenericControl::leave) {
 			mousePressed = false;
 
-			if (g_vm->_mouseInfo->getObject() == NULL)
+			if (g_vm->_mouseInfo->getObject() == nullptr)
 				g_vm->_mouseInfo->setIntent(GrabInfo::WalkTo);
 			g_vm->_mouseInfo->setDoable(true);
 
 			//  Remove any mouse text
 			lastPickedObject = Nothing;
-			g_vm->_mouseInfo->setText(NULL);
+			g_vm->_mouseInfo->setText(nullptr);
 			g_vm->_mouseInfo->clearGauge();
 		}
 		lastMousePos.set(ev.mouse.x, ev.mouse.y);
@@ -1092,7 +1092,7 @@ static APPFUNC(cmdClickTileMap) {
 			Actor       *centerActorPtr =
 			    (Actor *)GameObject::objectAddress(centerActorID);
 
-			if ((mouseObject = g_vm->_mouseInfo->getObject()) != NULL) {
+			if ((mouseObject = g_vm->_mouseInfo->getObject()) != nullptr) {
 				//  If we are using an intangible object (spell) then consider
 				//  the owner of the spell to be the center actor for the rest
 				//  of this action.
@@ -1130,7 +1130,7 @@ static APPFUNC(cmdClickTileMap) {
 						g_vm->_mouseInfo->replaceObject();
 						clickActionDone = true;
 					}
-				} else if (pickedTAI != NULL) {
+				} else if (pickedTAI != nullptr) {
 					//  we dropped the object onto active terrain
 
 					if (g_vm->_mouseInfo->getDoable()) {
@@ -1239,7 +1239,7 @@ static APPFUNC(cmdClickTileMap) {
 			else {
 				if (g_vm->_mouseInfo->getIntent() == GrabInfo::WalkTo
 				        &&  g_vm->_mouseInfo->getDoable()) {
-					if (pickedTAI == NULL) {
+					if (pickedTAI == nullptr) {
 						navigateDirect(walkToPos, false);
 						//      ( ( gGenericControl * )ev.panel )->disableDblClick();
 					} else {
@@ -1292,7 +1292,7 @@ static APPFUNC(cmdClickTileMap) {
 
 		navigationDelayed = false;
 
-		if ((mouseObject = g_vm->_mouseInfo->getObject()) != NULL) {
+		if ((mouseObject = g_vm->_mouseInfo->getObject()) != nullptr) {
 			g_vm->_mouseInfo->replaceObject();
 			MotionTask::useObject(*getCenterActor(), *mouseObject);
 		} else if (pickedObject != Nothing) {
@@ -1316,7 +1316,7 @@ static APPFUNC(cmdClickTileMap) {
 					clickActionDone = true;
 				}
 			}
-		} else if (pickedTAI != NULL) {
+		} else if (pickedTAI != nullptr) {
 			Actor       *a = getCenterActor();
 			TilePoint   TAILoc;
 
diff --git a/engines/saga2/timers.cpp b/engines/saga2/timers.cpp
index cc028a170c..3c92dd71fc 100644
--- a/engines/saga2/timers.cpp
+++ b/engines/saga2/timers.cpp
@@ -240,12 +240,12 @@ void loadTimers(Common::InSaveFile *in) {
 
 		timer = new Timer(in);
 
-		assert(timer != NULL);
+		assert(timer != nullptr);
 
 		//  Get the objects's timer list
 		timerList = fetchTimerList(timer->getObject());
 
-		assert(timerList != NULL);
+		assert(timerList != nullptr);
 
 		//  Append this timer to the objects's timer list
 		timerList->_timers.push_back(timer);
diff --git a/engines/saga2/towerfta.cpp b/engines/saga2/towerfta.cpp
index fe7e09826a..0647c6cd96 100644
--- a/engines/saga2/towerfta.cpp
+++ b/engines/saga2/towerfta.cpp
@@ -339,11 +339,11 @@ INITIALIZER(initDisplay) {
 TERMINATOR(termDisplay) {
 	if (trioControls) {
 		delete trioControls;
-		trioControls = NULL;
+		trioControls = nullptr;
 	}
 	if (indivControls) {
 		delete indivControls;
-		indivControls = NULL;
+		indivControls = nullptr;
 	}
 }
 
diff --git a/engines/saga2/uidialog.cpp b/engines/saga2/uidialog.cpp
index fff47dcb5e..5eccbc0c4b 100644
--- a/engines/saga2/uidialog.cpp
+++ b/engines/saga2/uidialog.cpp
@@ -208,9 +208,9 @@ static const StaticRect *saveLoadTextRects[kNumSaveLoadTexts] = {
 // save/load dialog window decorations
 
 static StaticWindow saveWindowDecorations[kNumSaveLoadPanels] = {
-	{SLTopPanel, NULL, SLTopPanelResID},
-	{SLMidPanel, NULL, SLMidPanelResID},
-	{SLBotPanel, NULL, SLBotPanelResID}
+	{SLTopPanel, nullptr, SLTopPanelResID},
+	{SLMidPanel, nullptr, SLMidPanelResID},
+	{SLBotPanel, nullptr, SLBotPanelResID}
 };
 
 
@@ -444,9 +444,9 @@ static const StaticRect *optionsTextRects[] = {
 // options dialog window decorations
 
 static StaticWindow optionsDecorations[kNumOptionsPanels] = {
-	{optTopPanel, NULL, optTopPanelResID},
-	{optMidPanel, NULL, optMidPanelResID},
-	{optBotPanel, NULL, optBotPanelResID}
+	{optTopPanel, nullptr, optTopPanelResID},
+	{optMidPanel, nullptr, optMidPanelResID},
+	{optBotPanel, nullptr, optBotPanelResID}
 };
 
 
diff --git a/engines/saga2/videobox.cpp b/engines/saga2/videobox.cpp
index cb4178c7f8..b5b529ef27 100644
--- a/engines/saga2/videobox.cpp
+++ b/engines/saga2/videobox.cpp
@@ -50,7 +50,7 @@ CVideoBox::CVideoBox(const Rect16 &box,
 	vidDec[1].set(vidPanRects[1], vidPan2ResID);
 
 	// null out the decRes pointer
-	decRes = NULL;
+	decRes = nullptr;
 
 	rInfo.result = -1;
 	rInfo.running = false;
@@ -60,7 +60,7 @@ CVideoBox::~CVideoBox() {
 	// remove the resource handle
 	if (decRes)
 		resFile->disposeContext(decRes);
-	decRes = NULL;
+	decRes = nullptr;
 
 	// stop video if not done
 	g_vm->abortVideo();
@@ -90,7 +90,7 @@ bool CVideoBox::pointerHit(gPanelMessage &) {
 	requestInfo     *ri;
 
 	win = getWindow();      // get the window pointer
-	ri = win ? (requestInfo *)win->userData : NULL;
+	ri = win ? (requestInfo *)win->userData : nullptr;
 
 	if (ri) {
 		ri->running = 0;
@@ -176,7 +176,7 @@ int16 openVidBox(char *fileName) {
 
 	g_vm->_pal->quickSavePalette();
 	// create a video box
-	CVideoBox videoBox(area, 0, NULL);
+	CVideoBox videoBox(area, 0, nullptr);
 
 	// open this video box
 	int16 result = videoBox.openVidBox(fileName);
diff --git a/engines/saga2/weapons.cpp b/engines/saga2/weapons.cpp
index a21aaa72a3..df478eccf8 100644
--- a/engines/saga2/weapons.cpp
+++ b/engines/saga2/weapons.cpp
@@ -49,7 +49,7 @@ namespace Saga2 {
 static void loadWeaponData();
 
 ProtoEffect *createNewProtoEffect(Common::SeekableReadStream *stream) {
-	ProtoEffect *pe = NULL;
+	ProtoEffect *pe = nullptr;
 
 	/* int16 item = */stream->readSint16LE();	// spell ID
 	int16 effectGroup = stream->readSint16LE();	// effect group
@@ -69,7 +69,7 @@ ProtoEffect *createNewProtoEffect(Common::SeekableReadStream *stream) {
 
 	switch (effectGroup) {
 	case effectNone:
-		return NULL;
+		return nullptr;
 
 	case effectAttrib:
 		pe = new ProtoEnchantment(makeEnchantmentID(effectGroup, effectType, baseDamage), reserved0, reserved1);
@@ -144,14 +144,14 @@ GameObject *getShieldItem(GameObject *defender) {
    WeaponProtoEffect member functions
  * ===================================================================== */
 WeaponProtoEffect::~WeaponProtoEffect() {
-	if (_effect != NULL)
+	if (_effect != nullptr)
 		delete _effect;
 }
 
 void WeaponProtoEffect::implement(Actor *enactor, GameObject *target, GameObject *, uint8) {
 	SpellTarget targ(target);
 
-	if (_effect != NULL)
+	if (_effect != nullptr)
 		_effect->implement(enactor, &targ);
 }
 
@@ -172,12 +172,12 @@ void WeaponStrikeEffect::implement(Actor *enactor, GameObject *target, GameObjec
 }
 
 WeaponStuff::WeaponStuff() {
-	_effects = NULL;
+	_effects = nullptr;
 	_master = kNullWeapon;
 }
 
 WeaponStuff::~WeaponStuff() {
-	while (_effects != NULL) {
+	while (_effects != nullptr) {
 		WeaponEffect *curEffect = _effects;
 
 		_effects = _effects->_next;
@@ -187,7 +187,7 @@ WeaponStuff::~WeaponStuff() {
 }
 
 void WeaponStuff::killEffects() {
-	while (_effects != NULL) {
+	while (_effects != nullptr) {
 		WeaponEffect *curEffect = _effects;
 
 		_effects = _effects->_next;
@@ -232,10 +232,10 @@ void WeaponStuff::addEffect(Common::SeekableReadStream *stream) {
 		we = new WeaponProtoEffect(stream);
 	}
 
-	if (we == NULL)
+	if (we == nullptr)
 		error("failed to alloc weapon effect");
 
-	if (_effects == NULL)
+	if (_effects == nullptr)
 		_effects = we;
 	else {
 		WeaponEffect *tail;
@@ -246,7 +246,7 @@ void WeaponStuff::addEffect(Common::SeekableReadStream *stream) {
 }
 
 void WeaponStuff::implement(Actor *enactor, GameObject *target, GameObject *strikingObj, uint8 strength) {
-	for (WeaponEffect *we = _effects; we != NULL; we = we->_next)
+	for (WeaponEffect *we = _effects; we != nullptr; we = we->_next)
 		we->implement(enactor, target, strikingObj, strength);
 }
 
@@ -254,7 +254,7 @@ void WeaponStuff::implement(Actor *enactor, GameObject *target, GameObject *stri
 
 static void loadWeaponData() {
 	hResContext *spellRes = auxResFile->newContext(MKTAG('I', 'T', 'E', 'M'), "weapon resources");
-	if (spellRes == NULL || !spellRes->_valid)
+	if (spellRes == nullptr || !spellRes->_valid)
 		error("Error accessing weapon resource group.");
 
 	debugC(1, kDebugLoading, "Loading Weapon Data");


Commit: 940c7bfc1408b56d2623e81c6a64be4ca4bd8896
    https://github.com/scummvm/scummvm/commit/940c7bfc1408b56d2623e81c6a64be4ca4bd8896
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
SCI: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/sci/console.cpp
    engines/sci/detection.cpp
    engines/sci/engine/features.cpp
    engines/sci/engine/file.cpp
    engines/sci/engine/gc.cpp
    engines/sci/engine/kernel.cpp
    engines/sci/engine/kevent.cpp
    engines/sci/engine/kgraphics.cpp
    engines/sci/engine/kmenu.cpp
    engines/sci/engine/kpathing.cpp
    engines/sci/engine/kscripts.cpp
    engines/sci/engine/kstring.cpp
    engines/sci/engine/savegame.cpp
    engines/sci/engine/script.cpp
    engines/sci/engine/script_patches.cpp
    engines/sci/engine/scriptdebug.cpp
    engines/sci/engine/seg_manager.cpp
    engines/sci/engine/segment.cpp
    engines/sci/engine/selector.cpp
    engines/sci/engine/state.cpp
    engines/sci/engine/static_selectors.cpp
    engines/sci/engine/vm.cpp
    engines/sci/engine/workarounds.cpp
    engines/sci/graphics/animate.cpp
    engines/sci/graphics/compare.cpp
    engines/sci/graphics/cursor.cpp
    engines/sci/graphics/maciconbar.cpp
    engines/sci/graphics/menu.cpp
    engines/sci/graphics/paint16.cpp
    engines/sci/graphics/palette.cpp
    engines/sci/graphics/ports.cpp
    engines/sci/graphics/screen.cpp
    engines/sci/graphics/text16.cpp
    engines/sci/graphics/transitions.cpp
    engines/sci/graphics/view.cpp
    engines/sci/metaengine.cpp
    engines/sci/parser/grammar.cpp
    engines/sci/parser/said.cpp
    engines/sci/parser/vocabulary.cpp
    engines/sci/resource/decompressor.cpp
    engines/sci/resource/resource.cpp
    engines/sci/resource/resource_audio.cpp
    engines/sci/sci.cpp
    engines/sci/sound/audio.cpp
    engines/sci/sound/drivers/adlib.cpp
    engines/sci/sound/drivers/cms.cpp
    engines/sci/sound/drivers/fb01.cpp
    engines/sci/sound/drivers/fmtowns.cpp
    engines/sci/sound/drivers/midi.cpp
    engines/sci/sound/drivers/pc9801.cpp
    engines/sci/sound/drivers/pcjr.cpp
    engines/sci/sound/midiparser_sci.cpp
    engines/sci/sound/music.cpp


diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 50f11c3745..af1fdaf3f5 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -647,7 +647,7 @@ bool Console::cmdSetParseNodes(int argc, const char **argv) {
 	} else if (!strcmp(token, "nil")) {
 		nextToken = kParseNil;
 	} else {
-		nextValue = strtol(token, NULL, 0);
+		nextValue = strtol(token, nullptr, 0);
 		nextToken = kParseNumber;
 	}
 
@@ -688,11 +688,11 @@ bool Console::parseResourceNumber36(const char *userParameter, uint16 &resourceN
 	}
 
 	// input: RRRNNVVCCS
-	resourceNumber = strtol(Common::String(userParameter, 3).c_str(), 0, 36);
-	uint16 noun = strtol(Common::String(userParameter + 3, 2).c_str(), 0, 36);
-	uint16 verb = strtol(Common::String(userParameter + 5, 2).c_str(), 0, 36);
-	uint16 cond = strtol(Common::String(userParameter + 7, 2).c_str(), 0, 36);
-	uint16 seq = strtol(Common::String(userParameter + 9, 1).c_str(), 0, 36);
+	resourceNumber = strtol(Common::String(userParameter, 3).c_str(), nullptr, 36);
+	uint16 noun = strtol(Common::String(userParameter + 3, 2).c_str(), nullptr, 36);
+	uint16 verb = strtol(Common::String(userParameter + 5, 2).c_str(), nullptr, 36);
+	uint16 cond = strtol(Common::String(userParameter + 7, 2).c_str(), nullptr, 36);
+	uint16 seq = strtol(Common::String(userParameter + 9, 1).c_str(), nullptr, 36);
 	resourceTuple = ((noun & 0xff) << 24) | ((verb & 0xff) << 16) | ((cond & 0xff) << 8) | (seq & 0xff);
 	return true;
 }
@@ -759,7 +759,7 @@ bool Console::cmdDiskDump(int argc, const char **argv) {
 void Console::cmdDiskDumpWorker(ResourceType resourceType, int resourceNumber, uint32 resourceTuple) {
 	const char *resourceTypeName = getResourceTypeName(resourceType);
 	ResourceId resourceId;
-	Resource *resource = NULL;
+	Resource *resource = nullptr;
 	char outFileName[50];
 
 	switch (resourceType) {
@@ -1062,7 +1062,7 @@ bool Console::cmdRoomNumber(int argc, const char **argv) {
 		debugPrintf("Calling this command with the room number (in decimal or hexadecimal) changes the room\n");
 	} else {
 		Common::String roomNumberStr = argv[1];
-		int roomNumber = strtol(roomNumberStr.c_str(), NULL, roomNumberStr.hasSuffix("h") ? 16 : 10);
+		int roomNumber = strtol(roomNumberStr.c_str(), nullptr, roomNumberStr.hasSuffix("h") ? 16 : 10);
 		_engine->_gamestate->setRoomNumber(roomNumber);
 		debugPrintf("Room number changed to %d (%x in hex)\n", roomNumber, roomNumber);
 	}
@@ -1120,7 +1120,7 @@ bool Console::cmdHexgrep(int argc, const char **argv) {
 
 	ResourceType restype = parseResourceType(argv[1]);
 	int resNumber = 0, resMax = 0;
-	Resource *script = NULL;
+	Resource *script = nullptr;
 
 	if (restype == kResourceTypeInvalid) {
 		debugPrintf("Resource type '%s' is not valid\n", argv[1]);
@@ -1231,7 +1231,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) {
 
 	SciVersion doSoundVersion = _engine->_features->detectDoSoundType();
 	MidiPlayer *player = MidiPlayer_Midi_create(doSoundVersion);
-	MidiParser_SCI *parser = new MidiParser_SCI(doSoundVersion, 0);
+	MidiParser_SCI *parser = new MidiParser_SCI(doSoundVersion, nullptr);
 	parser->setMidiDriver(player);
 
 	Common::List<ResourceId> resources = _engine->getResMan()->listResources(kResourceTypeSound);
@@ -1265,7 +1265,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) {
 			continue;
 		}
 
-		parser->loadMusic(track, NULL, channelFilterMask, doSoundVersion);
+		parser->loadMusic(track, nullptr, channelFilterMask, doSoundVersion);
 		SciSpan<const byte> channelData = parser->getMixedData();
 
 		byte curEvent = 0, prevEvent = 0, command = 0;
@@ -1393,7 +1393,7 @@ bool Console::cmdMapInstrument(int argc, const char **argv) {
 		debugPrintf("Example: %s test_0__XX 1 255\n", argv[0]);
 		debugPrintf("The above example will map the MT-32 instrument \"test 0  XX\" to GM instrument 1\n\n");
 	} else {
-		if (Mt32dynamicMappings != NULL) {
+		if (Mt32dynamicMappings != nullptr) {
 			Mt32ToGmMap newMapping;
 			char *instrumentName = new char[11];
 			Common::strlcpy(instrumentName, argv[1], 11);
@@ -1410,7 +1410,7 @@ bool Console::cmdMapInstrument(int argc, const char **argv) {
 	}
 
 	debugPrintf("Current dynamic mappings:\n");
-	if (Mt32dynamicMappings != NULL) {
+	if (Mt32dynamicMappings != nullptr) {
 		const Mt32ToGmMapList::iterator end = Mt32dynamicMappings->end();
 		for (Mt32ToGmMapList::iterator it = Mt32dynamicMappings->begin(); it != end; ++it) {
 			debugPrintf("\"%s\" -> %d / %d\n", (*it).name, (*it).gmInstr, (*it).gmRhythmKey);
@@ -1632,13 +1632,13 @@ bool Console::cmdRestoreGame(int argc, const char **argv) {
 		return true;
 	}
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdRestartGame(int argc, const char **argv) {
 	_engine->_gamestate->abortScriptProcessing = kAbortRestartGame;
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 // The scripts get IDs ranging from 100->199, because the scripts require us to assign unique ids THAT EVEN STAY BETWEEN
@@ -1843,7 +1843,7 @@ bool Console::cmdSaid(int argc, const char **argv) {
 			spec[len++] = 0xfe;
 			spec[len++] = 0xf6;
 		} else {
-			uint32 s = strtol(argv[p], 0, 16);
+			uint32 s = strtol(argv[p], nullptr, 16);
 			if (s >= 0xf0 && s <= 0xff) {
 				spec[len++] = s;
 			} else {
@@ -2037,7 +2037,7 @@ bool Console::cmdPlayVideo(int argc, const char **argv) {
 	if (filename.hasSuffix(".seq") || filename.hasSuffix(".avi")) {
 		_videoFile = filename;
 		_videoFrameDelay = (argc == 2) ? 10 : atoi(argv[2]);
-		return cmdExit(0, 0);
+		return cmdExit(0, nullptr);
 	} else {
 		debugPrintf("Unknown video file type\n");
 		return true;
@@ -2607,7 +2607,7 @@ bool Console::cmdShowMap(int argc, const char **argv) {
 		debugPrintf("Map %d is not available.\n", map);
 		return true;
 	}
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdSongLib(int argc, const char **argv) {
@@ -2653,7 +2653,7 @@ bool Console::cmdStartSound(int argc, const char **argv) {
 
 	// TODO: Maybe also add a playBed option.
 	g_sci->_soundCmd->startNewSound(number);
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdToggleSound(int argc, const char **argv) {
@@ -2874,8 +2874,8 @@ bool Console::cmdVMVars(int argc, const char **argv) {
 	const char *varType_pre = strchr(varAbbrev, *argv[1]);
 	int varType;
 	int varIndex = 0;
-	reg_t *curValue = NULL;
-	const char *setValue = NULL;
+	reg_t *curValue = nullptr;
+	const char *setValue = nullptr;
 
 	if (!varType_pre) {
 		debugPrintf("Invalid variable type '%c'\n", *argv[1]);
@@ -3344,9 +3344,9 @@ void Console::printOffsets(int scriptNr, uint16 showType) {
 	Common::List<SegmentId> segmentNrList;
 
 	SegmentType curSegmentType = SEG_TYPE_INVALID;
-	SegmentObj *curSegmentObj = NULL;
-	Script *curScriptObj = NULL;
-	const byte *curScriptData = NULL;
+	SegmentObj *curSegmentObj = nullptr;
+	Script *curScriptObj = nullptr;
+	const byte *curScriptData = nullptr;
 
 	segmentNrList.clear();
 	if (scriptNr < 0) {
@@ -3372,9 +3372,9 @@ void Console::printOffsets(int scriptNr, uint16 showType) {
 	int showTypeCount = 0;
 
 	reg_t objectPos;
-	const char *objectNamePtr = NULL;
-	const byte *stringPtr = NULL;
-	const byte *saidPtr = NULL;
+	const char *objectNamePtr = nullptr;
+	const byte *stringPtr = nullptr;
+	const byte *saidPtr = nullptr;
 
 	Common::List<SegmentId>::iterator it;
 	const Common::List<SegmentId>::iterator end = segmentNrList.end();
@@ -3462,7 +3462,7 @@ bool Console::cmdTrace(int argc, const char **argv) {
 		_debugState.runningStep = atoi(argv[1]) - 1;
 	_debugState.debugging = true;
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdStepOver(int argc, const char **argv) {
@@ -3475,7 +3475,7 @@ bool Console::cmdStepEvent(int argc, const char **argv) {
 	_debugState.stopOnEvent = true;
 	_debugState.debugging = true;
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdStepRet(int argc, const char **argv) {
@@ -3483,7 +3483,7 @@ bool Console::cmdStepRet(int argc, const char **argv) {
 	_debugState.seekLevel = _engine->_gamestate->_executionStack.size() - 1;
 	_debugState.debugging = true;
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdStepGlobal(int argc, const char **argv) {
@@ -3497,7 +3497,7 @@ bool Console::cmdStepGlobal(int argc, const char **argv) {
 	_debugState.seekSpecial = atoi(argv[1]);
 	_debugState.debugging = true;
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdStepCallk(int argc, const char **argv) {
@@ -3530,7 +3530,7 @@ bool Console::cmdStepCallk(int argc, const char **argv) {
 	}
 	_debugState.debugging = true;
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdDisassemble(int argc, const char **argv) {
@@ -3569,7 +3569,7 @@ bool Console::cmdDisassemble(int argc, const char **argv) {
 		return true;
 	}
 
-	if (lookupSelector(_engine->_gamestate->_segMan, objAddr, selectorId, NULL, &addr) != kSelectorMethod) {
+	if (lookupSelector(_engine->_gamestate->_segMan, objAddr, selectorId, nullptr, &addr) != kSelectorMethod) {
 		debugPrintf("Not a method.\n");
 		return true;
 	}
@@ -3826,12 +3826,12 @@ bool Console::cmdSend(int argc, const char **argv) {
 	}
 
 	const Object *o = _engine->_gamestate->_segMan->getObject(object);
-	if (o == NULL) {
+	if (o == nullptr) {
 		debugPrintf("Address \"%04x:%04x\" is not an object\n", PRINT_REG(object));
 		return true;
 	}
 
-	SelectorType selector_type = lookupSelector(_engine->_gamestate->_segMan, object, selectorId, NULL, NULL);
+	SelectorType selector_type = lookupSelector(_engine->_gamestate->_segMan, object, selectorId, nullptr, nullptr);
 
 	if (selector_type == kSelectorNone) {
 		debugPrintf("Object does not support selector: \"%s\"\n", selectorName);
@@ -4580,7 +4580,7 @@ bool Console::cmdQuit(int argc, const char **argv) {
 		return true;
 	}
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool Console::cmdAddresses(int argc, const char **argv) {
@@ -4605,7 +4605,7 @@ bool Console::cmdAddresses(int argc, const char **argv) {
 // Returns 0 on success
 static int parse_reg_t(EngineState *s, const char *str, reg_t *dest) {
 	// Pointer to the part of str which contains a numeric offset (if any)
-	const char *offsetStr = NULL;
+	const char *offsetStr = nullptr;
 
 	// Flag that tells whether the value stored in offsetStr is an absolute offset,
 	// or a relative offset against dest->offset.
@@ -4642,7 +4642,7 @@ static int parse_reg_t(EngineState *s, const char *str, reg_t *dest) {
 			return 1; // No matching register
 
 		if (!*offsetStr)
-			offsetStr = NULL;
+			offsetStr = nullptr;
 		else if (*offsetStr != '+' && *offsetStr != '-')
 			return 1;
 	} else if (*str == '&') { // Script relative: "&SCRIPT-ID:OFFSET"
@@ -4836,7 +4836,7 @@ static int parse_reg_t(EngineState *s, const char *str, reg_t *dest) {
 }
 
 bool Console::parseInteger(const char *argument, int &result) {
-	char *endPtr = 0;
+	char *endPtr = nullptr;
 	int idxLen = strlen(argument);
 	const char *lastChar = argument + idxLen - (idxLen == 0 ? 0 : 1);
 
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index ad878c5f7a..1c45a3b350 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -159,7 +159,7 @@ static const PlainGameDescriptor s_sciGameTitles[] = {
 	{"phantasmagoria2", "Phantasmagoria 2: A Puzzle of Flesh"},
 	//{"shivers2",        "Shivers II: Harvest of Souls"},	// Not SCI
 	{"rama",            "RAMA"},
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 } // End of namespace Sci
@@ -177,7 +177,7 @@ static const char *directoryGlobs[] = {
 	"msg",
 	"spanish",
 	"patches",
-	0
+	nullptr
 };
 
 class SciMetaEngineDetection : public AdvancedMetaEngineDetection {
diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index 5279d2bb94..a92c3fa5c1 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -60,7 +60,7 @@ reg_t GameFeatures::getDetectionAddr(const Common::String &objName, Selector slc
 	}
 
 	if (methodNum == -1) {
-		if (lookupSelector(_segMan, objAddr, slc, NULL, &addr) != kSelectorMethod) {
+		if (lookupSelector(_segMan, objAddr, slc, nullptr, &addr) != kSelectorMethod) {
 			error("getDetectionAddr: target selector is not a method of object %s", objName.c_str());
 			return NULL_REG;
 		}
@@ -388,7 +388,7 @@ SciVersion GameFeatures::detectGfxFunctionsType() {
 			if (SELECTOR(overlay) != -1) {
 				// The game has an overlay selector, check how it calls kDrawPic
 				// to determine the graphics functions type used
-				if (lookupSelector(_segMan, rmObjAddr, SELECTOR(overlay), NULL, NULL) == kSelectorMethod) {
+				if (lookupSelector(_segMan, rmObjAddr, SELECTOR(overlay), nullptr, nullptr) == kSelectorMethod) {
 					if (!autoDetectGfxFunctionsType()) {
 						warning("Graphics functions detection failed, taking an educated guess");
 
diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp
index 98d71a15ef..dbb2fa234a 100644
--- a/engines/sci/engine/file.cpp
+++ b/engines/sci/engine/file.cpp
@@ -129,8 +129,8 @@ reg_t file_open(EngineState *s, const Common::String &filename, kFileOpenMode mo
 	englishName.toLowercase();
 
 	Common::String wrappedName = unwrapFilename ? g_sci->wrapFilename(englishName) : englishName;
-	Common::SeekableReadStream *inFile = 0;
-	Common::WriteStream *outFile = 0;
+	Common::SeekableReadStream *inFile = nullptr;
+	Common::WriteStream *outFile = nullptr;
 	Common::SaveFileManager *saveFileMan = g_sci->getSaveFileManager();
 
 	bool isCompressed = true;
@@ -256,12 +256,12 @@ reg_t file_open(EngineState *s, const Common::String &filename, kFileOpenMode mo
 FileHandle *getFileFromHandle(EngineState *s, uint handle) {
 	if ((handle == 0) || ((handle >= kVirtualFileHandleStart) && (handle <= kVirtualFileHandleEnd))) {
 		error("Attempt to use invalid file handle (%d)", handle);
-		return 0;
+		return nullptr;
 	}
 
 	if ((handle >= s->_fileHandles.size()) || !s->_fileHandles[handle].isOpen()) {
 		warning("Attempt to use invalid/unused file handle %d", handle);
-		return 0;
+		return nullptr;
 	}
 
 	return &s->_fileHandles[handle];
@@ -315,7 +315,7 @@ bool fillSavegameDesc(const Common::String &filename, SavegameDesc &desc) {
 		return false;
 	}
 
-	const int id = strtol(filename.end() - 3, NULL, 10);
+	const int id = strtol(filename.end() - 3, nullptr, 10);
 	desc.id = id;
 	// We need to fix date in here, because we save DDMMYYYY instead of
 	// YYYYMMDD, so sorting wouldn't work
@@ -362,7 +362,7 @@ void listSavegames(Common::Array<SavegameDesc> &saves) {
 		//  whose autosave should appear as a normal saved game
 		if (g_sci->getGameId() != GID_QFG3 &&
 			g_sci->getGameId() != GID_QFG4) {
-			const int id = strtol(filename.end() - 3, NULL, 10);
+			const int id = strtol(filename.end() - 3, nullptr, 10);
 			if (id == kNewGameId || id == kAutoSaveId) {
 				continue;
 			}
@@ -474,7 +474,7 @@ int shiftScummVMToSciSaveId(int saveId) {
 }
 #endif
 
-FileHandle::FileHandle() : _in(0), _out(0) {
+FileHandle::FileHandle() : _in(nullptr), _out(nullptr) {
 }
 
 FileHandle::~FileHandle() {
@@ -488,8 +488,8 @@ void FileHandle::close() {
 		delete _in;
 	else
 		delete _out;
-	_in = 0;
-	_out = 0;
+	_in = nullptr;
+	_out = nullptr;
 	_name.clear();
 }
 
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp
index 50f7709baf..0c98f14273 100644
--- a/engines/sci/engine/gc.cpp
+++ b/engines/sci/engine/gc.cpp
@@ -200,7 +200,7 @@ void run_gc(EngineState *s) {
 	for (uint seg = 1; seg < heap.size(); seg++) {
 		SegmentObj *mobj = heap[seg];
 
-		if (mobj != NULL) {
+		if (mobj != nullptr) {
 #ifdef GC_DEBUG_CODE
 			const SegmentType type = mobj->getType();
 			segnames[type] = segmentTypeNames[type];
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index c5f83a2638..9b6c2e8b26 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -174,8 +174,8 @@ void Kernel::loadSelectorNames() {
 static uint16 *parseKernelSignature(const char *kernelName, const char *writtenSig) {
 	const char *curPos;
 	char curChar;
-	uint16 *result = NULL;
-	uint16 *writePos = NULL;
+	uint16 *result = nullptr;
+	uint16 *writePos = nullptr;
 	int size = 0;
 	bool validType = false;
 	bool optionalType = false;
@@ -185,7 +185,7 @@ static uint16 *parseKernelSignature(const char *kernelName, const char *writtenS
 
 	// No signature given? no signature out
 	if (!writtenSig)
-		return NULL;
+		return nullptr;
 
 	// First, we check how many bytes the result will be
 	//  we also check, if the written signature makes any sense
@@ -439,7 +439,7 @@ static const SignatureDebugType signatureDebugTypeList[] = {
 	{ SIG_TYPE_NODE,          "node" },
 	{ SIG_TYPE_ERROR,         "error" },
 	{ SIG_IS_INVALID,         "invalid" },
-	{ 0,                      NULL }
+	{ 0,                      nullptr }
 };
 
 static void kernelSignatureDebugType(Common::String &signatureDetailsStr, const uint16 type) {
@@ -593,11 +593,11 @@ void Kernel::mapFunctions(GameFeatures *features) {
 		Common::String kernelName = _kernelNames[id];
 
 		// Reset the table entry
-		_kernelFuncs[id].function = NULL;
-		_kernelFuncs[id].signature = NULL;
-		_kernelFuncs[id].name = NULL;
-		_kernelFuncs[id].workarounds = NULL;
-		_kernelFuncs[id].subFunctions = NULL;
+		_kernelFuncs[id].function = nullptr;
+		_kernelFuncs[id].signature = nullptr;
+		_kernelFuncs[id].name = nullptr;
+		_kernelFuncs[id].workarounds = nullptr;
+		_kernelFuncs[id].subFunctions = nullptr;
 		_kernelFuncs[id].subFunctionCount = 0;
 		if (kernelName.empty()) {
 			// No name was given -> must be an unknown opcode
@@ -645,7 +645,7 @@ void Kernel::mapFunctions(GameFeatures *features) {
 			_kernelFuncs[id].workarounds = kernelMap->workarounds;
 			if (kernelMap->subFunctions) {
 				// Get version for subfunction identification
-				SciVersion mySubVersion = (SciVersion)kernelMap->function(NULL, 0, NULL).getOffset();
+				SciVersion mySubVersion = (SciVersion)kernelMap->function(nullptr, 0, nullptr).getOffset();
 				// Now check whats the highest subfunction-id for this version
 				const SciKernelMapSubEntry *kernelSubMap = kernelMap->subFunctions;
 				uint16 subFunctionCount = 0;
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index b57b43ac96..a0df295597 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -76,7 +76,7 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
 		reg_t iconObj = NULL_REG;
 		if (g_sci->_gfxMacIconBar->handleEvents(curEvent, iconObj)) {
 			if (!iconObj.isNull()) {
-				invokeSelector(s, iconObj, SELECTOR(select), argc, argv, 0, NULL);
+				invokeSelector(s, iconObj, SELECTOR(select), argc, argv, 0, nullptr);
 			}
 
 			// The mouse press event was handled by the mac icon bar so change
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index e954afbc16..8455ef048e 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -134,7 +134,7 @@ static reg_t kSetCursorSci0(EngineState *s, int argc, reg_t *argv) {
 
 static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) {
 	Common::Point pos;
-	Common::Point *hotspot = NULL;
+	Common::Point *hotspot = nullptr;
 
 	switch (argc) {
 	case 1:
@@ -343,7 +343,7 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) {
 	}
 
 	Common::String sep_str;
-	const char *sep = NULL;
+	const char *sep = nullptr;
 	if ((argc > 4) && (argv[4].getSegment())) {
 		sep_str = s->_segMan->getString(argv[4]);
 		sep = sep_str.c_str();
@@ -889,7 +889,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
 	switch (type) {
 	case SCI_CONTROLS_TYPE_BUTTON:
 	case SCI_CONTROLS_TYPE_TEXTEDIT:
-		splitText = g_sci->strSplitLanguage(text.c_str(), &languageSplitter, NULL);
+		splitText = g_sci->strSplitLanguage(text.c_str(), &languageSplitter, nullptr);
 		break;
 	case SCI_CONTROLS_TYPE_TEXT:
 		splitText = g_sci->strSplitLanguage(text.c_str(), &languageSplitter);
@@ -932,7 +932,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
 			int c = readSelectorValue(s->_segMan, controlObject, SELECTOR(cel));
 			celNo = (c & 0x80) ? c - 256 : c;
 			// Check if the control object specifies a priority selector (like in Jones)
-			if (lookupSelector(s->_segMan, controlObject, SELECTOR(priority), NULL, NULL) == kSelectorVariable)
+			if (lookupSelector(s->_segMan, controlObject, SELECTOR(priority), nullptr, nullptr) == kSelectorVariable)
 				priority = readSelectorValue(s->_segMan, controlObject, SELECTOR(priority));
 			else
 				priority = -1;
@@ -953,7 +953,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
 			upperOffset = readSelectorValue(s->_segMan, controlObject, SELECTOR(topString));
 		} else {
 			// Earlier games use lsTop or brTop
-			if (lookupSelector(s->_segMan, controlObject, SELECTOR(brTop), NULL, NULL) == kSelectorVariable)
+			if (lookupSelector(s->_segMan, controlObject, SELECTOR(brTop), nullptr, nullptr) == kSelectorVariable)
 				upperOffset = readSelectorValue(s->_segMan, controlObject, SELECTOR(brTop));
 			else
 				upperOffset = readSelectorValue(s->_segMan, controlObject, SELECTOR(lsTop));
@@ -1195,7 +1195,7 @@ reg_t kNewWindow(EngineState *s, int argc, reg_t *argv) {
 	Common::String title;
 	if (argv[4 + argextra].getSegment()) {
 		title = s->_segMan->getString(argv[4 + argextra]);
-		title = g_sci->strSplit(title.c_str(), NULL);
+		title = g_sci->strSplit(title.c_str(), nullptr);
 	}
 
 	return g_sci->_gfxPorts->kernelNewWindow(rect1, rect2, style, priority, colorPen, colorBack, title.c_str());
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index fc507dbb38..20ebf4a5f5 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -80,7 +80,7 @@ reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) {
 			return s->r_acc;
 		}
 
-		g_sci->_gfxMenu->kernelDrawStatus(g_sci->strSplit(text.c_str(), NULL).c_str(), colorPen, colorBack);
+		g_sci->_gfxMenu->kernelDrawStatus(g_sci->strSplit(text.c_str(), nullptr).c_str(), colorPen, colorBack);
 	}
 	return s->r_acc;
 }
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index fabedd7d65..f9b35a06c0 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -120,7 +120,7 @@ struct Vertex {
 public:
 	Vertex(const Common::Point &p) : v(p) {
 		costG = HUGE_DISTANCE;
-		path_prev = NULL;
+		path_prev = nullptr;
 	}
 };
 
@@ -152,14 +152,14 @@ public:
 	Vertex *_head;
 
 public:
-	CircularVertexList() : _head(0) {}
+	CircularVertexList() : _head(nullptr) {}
 
 	Vertex *first() const {
 		return _head;
 	}
 
 	void insertAtEnd(Vertex *elm) {
-		if (_head == NULL) {
+		if (_head == nullptr) {
 			elm->_next = elm->_prev = elm;
 			_head = elm;
 		} else {
@@ -184,7 +184,7 @@ public:
 
 	void remove(Vertex *elm) {
 		if (elm->_next == elm) {
-			_head = NULL;
+			_head = nullptr;
 		} else {
 			if (_head == elm)
 				_head = elm->_next;
@@ -194,7 +194,7 @@ public:
 	}
 
 	bool empty() const {
-		return _head == NULL;
+		return _head == nullptr;
 	}
 
 	uint size() const {
@@ -264,11 +264,11 @@ struct PathfindingState {
 	int _width, _height;
 
 	PathfindingState(int width, int height) : _width(width), _height(height) {
-		vertex_start = NULL;
-		vertex_end = NULL;
-		vertex_index = NULL;
-		_prependPoint = NULL;
-		_appendPoint = NULL;
+		vertex_start = nullptr;
+		vertex_end = nullptr;
+		vertex_index = nullptr;
+		_prependPoint = nullptr;
+		_appendPoint = nullptr;
 		vertices = 0;
 	}
 
@@ -898,9 +898,9 @@ static int intersection(const Common::Point &a, const Common::Point &b, const Ve
  *             (Common::Point) *ret: On success, the closest intersection point
  */
 static int nearest_intersection(PathfindingState *s, const Common::Point &p, const Common::Point &q, Common::Point *ret) {
-	Polygon *polygon = 0;
+	Polygon *polygon = nullptr;
 	FloatPoint isec;
-	Polygon *ipolygon = 0;
+	Polygon *ipolygon = nullptr;
 	uint32 dist = HUGE_DISTANCE;
 
 	for (PolygonList::iterator it = s->polygons.begin(); it != s->polygons.end(); ++it) {
@@ -1000,7 +1000,7 @@ static Common::Point *fixup_start_point(PathfindingState *s, const Common::Point
 		case POLY_BARRED_ACCESS:
 		case POLY_NEAREST_ACCESS:
 			if (cont != CONT_OUTSIDE) {
-				if (s->_prependPoint != NULL) {
+				if (s->_prependPoint != nullptr) {
 					// We shouldn't get here twice.
 					// We need to break in this case, otherwise we'll end in an infinite
 					// loop.
@@ -1020,7 +1020,7 @@ static Common::Point *fixup_start_point(PathfindingState *s, const Common::Point
 												(*it)->vertices.size() == 14;
 					if (ignoreEarlierPolygon) {
 						delete s->_prependPoint;
-						s->_prependPoint = NULL;
+						s->_prependPoint = nullptr;
 					} else {
 						break;
 					}
@@ -1028,7 +1028,7 @@ static Common::Point *fixup_start_point(PathfindingState *s, const Common::Point
 
 				if (s->findNearPoint(start, (*it), new_start) != PF_OK) {
 					delete new_start;
-					return NULL;
+					return nullptr;
 				}
 
 				if ((type == POLY_BARRED_ACCESS) || (type == POLY_CONTAINED_ACCESS))
@@ -1078,7 +1078,7 @@ static Common::Point *fixup_end_point(PathfindingState *s, const Common::Point &
 		case POLY_BARRED_ACCESS:
 		case POLY_NEAREST_ACCESS:
 			if (cont != CONT_OUTSIDE) {
-				if (s->_appendPoint != NULL) {
+				if (s->_appendPoint != nullptr) {
 					// We shouldn't get here twice.
 					// Happens in LB2CD, inside the speakeasy when walking from the
 					// speakeasy (room 310) into the bathroom (room 320), after having
@@ -1092,7 +1092,7 @@ static Common::Point *fixup_end_point(PathfindingState *s, const Common::Point &
 				// The original end position is in an invalid location, so we move the point
 				if (s->findNearPoint(end, (*it), new_end) != PF_OK) {
 					delete new_end;
-					return NULL;
+					return nullptr;
 				}
 
 				// For near-point access polygons we need to add the original end point
@@ -1181,7 +1181,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
 
 	if (size == 0) {
 		// If the polygon has no vertices, we skip it
-		return NULL;
+		return nullptr;
 	}
 
 	SegmentRef pointList = segMan->dereference(points);
@@ -1190,7 +1190,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
 	// Refer to bug #4946.
 	if (!pointList.isValid() || pointList.skipByte) {
 		warning("convert_polygon: Polygon data pointer is invalid, skipping polygon");
-		return NULL;
+		return nullptr;
 	}
 
 	// Make sure that we have enough points
@@ -1198,7 +1198,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
 		warning("convert_polygon: Not enough memory allocated for polygon points. "
 				"Expected %d, got %d. Skipping polygon",
 				size * POLY_POINT_SIZE, pointList.maxSize);
-		return NULL;
+		return nullptr;
 	}
 
 	int skip = 0;
@@ -1273,7 +1273,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
 		while (node) {
 			// The node value might be null, in which case there's no polygon to parse.
 			// Happens in LB2 floppy - refer to bug #5195
-			polygon = !node->value.isNull() ? convert_polygon(s, node->value) : NULL;
+			polygon = !node->value.isNull() ? convert_polygon(s, node->value) : nullptr;
 
 			if (polygon) {
 				pf_s->polygons.push_back(polygon);
@@ -1292,7 +1292,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
 	if (!new_start) {
 		warning("AvoidPath: Couldn't fixup start position for pathfinding");
 		delete pf_s;
-		return NULL;
+		return nullptr;
 	}
 
 	Common::Point *new_end = fixup_end_point(pf_s, end);
@@ -1301,7 +1301,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
 		warning("AvoidPath: Couldn't fixup end position for pathfinding");
 		delete new_start;
 		delete pf_s;
-		return NULL;
+		return nullptr;
 	}
 
 	if (opt == 0) {
@@ -1324,7 +1324,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
 				delete new_start;
 				delete new_end;
 				delete pf_s;
-				return NULL;
+				return nullptr;
 			}
 
 			if (err == PF_OK)
@@ -1387,7 +1387,7 @@ static void AStar(PathfindingState *s) {
 	while (!openSet.empty()) {
 		// Find vertex in open set with lowest F cost
 		VertexList::iterator vertex_min_it = openSet.end();
-		Vertex *vertex_min = 0;
+		Vertex *vertex_min = nullptr;
 		uint32 min = HUGE_DISTANCE;
 
 		for (VertexList::iterator it = openSet.begin(); it != openSet.end(); ++it) {
@@ -1399,7 +1399,7 @@ static void AStar(PathfindingState *s) {
 			}
 		}
 
-		assert(vertex_min != 0);	// the vertex cost should never be bigger than HUGE_DISTANCE
+		assert(vertex_min != nullptr);	// the vertex cost should never be bigger than HUGE_DISTANCE
 
 		// Check if we are done
 		if (vertex_min == s->vertex_end)
@@ -1492,7 +1492,7 @@ static reg_t output_path(PathfindingState *p, EngineState *s) {
 	int path_len = 0;
 	reg_t output;
 	Vertex *vertex = p->vertex_end;
-	int unreachable = vertex->path_prev == NULL;
+	int unreachable = vertex->path_prev == nullptr;
 
 	if (!unreachable) {
 		while (vertex) {
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 3f1a51ff4b..8d30b0a8f4 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -320,7 +320,7 @@ reg_t kRespondsTo(EngineState *s, int argc, reg_t *argv) {
 	reg_t obj = argv[0];
 	int selector = argv[1].toUint16();
 
-	return make_reg(0, s->_segMan->isHeapObject(obj) && lookupSelector(s->_segMan, obj, selector, NULL, NULL) != kSelectorNone);
+	return make_reg(0, s->_segMan->isHeapObject(obj) && lookupSelector(s->_segMan, obj, selector, nullptr, nullptr) != kSelectorNone);
 }
 
 } // End of namespace Sci
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 60630be1d6..900c640ceb 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -48,8 +48,8 @@ reg_t kStrCat(EngineState *s, int argc, reg_t *argv) {
 	//  However Space Quest 4 PC-9801 doesn't
 	if ((g_sci->getLanguage() == Common::JA_JPN)
 		&& (getSciVersion() <= SCI_VERSION_01)) {
-		s1 = g_sci->strSplit(s1.c_str(), NULL);
-		s2 = g_sci->strSplit(s2.c_str(), NULL);
+		s1 = g_sci->strSplit(s1.c_str(), nullptr);
+		s2 = g_sci->strSplit(s2.c_str(), nullptr);
 	}
 
 	s1 += s2;
@@ -585,7 +585,7 @@ reg_t kSetQuitStr(EngineState *s, int argc, reg_t *argv) {
 reg_t kStrSplit(EngineState *s, int argc, reg_t *argv) {
 	Common::String format = s->_segMan->getString(argv[1]);
 	Common::String sep_str;
-	const char *sep = NULL;
+	const char *sep = nullptr;
 	if (!argv[2].isNull()) {
 		sep_str = s->_segMan->getString(argv[2]);
 		sep = sep_str.c_str();
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 248b6b60d9..be1d8ee4a1 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -703,9 +703,9 @@ void MusicEntry::saveLoadWithSerializer(Common::Serializer &s) {
 	// pMidiParser and pStreamAud will be initialized when the
 	// sound list is reconstructed in gamestate_restore()
 	if (s.isLoading()) {
-		soundRes = 0;
-		pMidiParser = 0;
-		pStreamAud = 0;
+		soundRes = nullptr;
+		pMidiParser = nullptr;
+		pStreamAud = nullptr;
 		reverb = -1;	// invalid reverb, will be initialized in processInitSound()
 	}
 }
@@ -1420,7 +1420,7 @@ bool gamestate_restore(EngineState *s, int saveId) {
 void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
 	SavegameMetadata meta;
 
-	Common::Serializer ser(fh, 0);
+	Common::Serializer ser(fh, nullptr);
 	sync_SavegameMetadata(ser, meta);
 
 	if (fh->eos()) {
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index c703f0afd2..c86af359d1 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -62,7 +62,7 @@ void Script::freeScript(const bool keepLocalsSegment) {
 	if (!keepLocalsSegment) {
 		_localsSegment = 0;
 	}
-	_localsBlock = NULL;
+	_localsBlock = nullptr;
 	_localsCount = 0;
 
 	_lockers = 1;
@@ -638,14 +638,14 @@ Object *Script::getObject(uint32 offset) {
 	if (_objects.contains(offset))
 		return &_objects[offset];
 	else
-		return 0;
+		return nullptr;
 }
 
 const Object *Script::getObject(uint32 offset) const {
 	if (_objects.contains(offset))
 		return &_objects[offset];
 	else
-		return 0;
+		return nullptr;
 }
 
 Object *Script::scriptObjInit(reg_t obj_pos, bool fullObjectInit) {
@@ -951,7 +951,7 @@ SegmentRef Script::dereference(reg_t pointer) {
 
 LocalVariables *Script::allocLocalsSegment(SegManager *segMan) {
 	if (!getLocalsCount()) { // No locals
-		return NULL;
+		return nullptr;
 	} else {
 		LocalVariables *locals;
 
@@ -987,7 +987,7 @@ void Script::initializeLocals(SegManager *segMan) {
 }
 
 void Script::syncLocalsBlock(SegManager *segMan) {
-	_localsBlock = (_localsSegment == 0) ? NULL : (LocalVariables *)(segMan->getSegment(_localsSegment, SEG_TYPE_LOCALS));
+	_localsBlock = (_localsSegment == 0) ? nullptr : (LocalVariables *)(segMan->getSegment(_localsSegment, SEG_TYPE_LOCALS));
 }
 
 void Script::initializeClasses(SegManager *segMan) {
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 72621e92b1..93dc0b7cbf 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -207,7 +207,7 @@ static const char *const selectorNameTable[] = {
 	"vol",          // SQ6
 	"walkIconItem", // SQ6
 #endif
-	NULL
+	nullptr
 };
 
 enum ScriptPatcherSelectors {
@@ -21795,7 +21795,7 @@ ScriptPatcher::ScriptPatcher() {
 	for (selectorNr = 0; selectorNr < selectorCount; selectorNr++)
 		_selectorIdTable[selectorNr] = -1;
 
-	_runtimeTable = NULL;
+	_runtimeTable = nullptr;
 	_isMacSci11 = false;
 }
 
@@ -22218,9 +22218,9 @@ void ScriptPatcher::enablePatch(const SciScriptPatcherEntry *patchTable, const c
 }
 
 void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) {
-	const SciScriptPatcherEntry *signatureTable = NULL;
-	const SciScriptPatcherEntry *curEntry = NULL;
-	SciScriptPatcherRuntimeEntry *curRuntimeEntry = NULL;
+	const SciScriptPatcherEntry *signatureTable = nullptr;
+	const SciScriptPatcherEntry *curEntry = nullptr;
+	SciScriptPatcherRuntimeEntry *curRuntimeEntry = nullptr;
 	const Sci::SciGameId gameId = g_sci->getGameId();
 
 	switch (gameId) {
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 02e5e733bd..21b57aa374 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -83,7 +83,7 @@ void DebugState::updateActiveBreakpointTypes() {
 // Disassembles one command from the heap, returns address of next command or 0 if a ret was encountered.
 reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag, bool printBytecode, bool printCSyntax) {
 	SegmentObj *mobj = s->_segMan->getSegment(pos.getSegment(), SEG_TYPE_SCRIPT);
-	Script *script_entity = NULL;
+	Script *script_entity = nullptr;
 	reg_t retval = make_reg32(pos.getSegment(), pos.getOffset() + 1);
 	uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc.
 	uint i = 0;
@@ -351,7 +351,7 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag,
 
 			while (stackframe > 0) {
 				int argc = sb[- stackframe + 1].getOffset();
-				const char *name = NULL;
+				const char *name = nullptr;
 				reg_t called_obj_addr = s->xs->objp;
 
 				if (opcode == op_send)
@@ -371,7 +371,7 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag,
 				if (!s->_segMan->getObject(called_obj_addr)) {
 					debugN("INVALID_OBJ");
 				} else {
-					switch (lookupSelector(s->_segMan, called_obj_addr, selector, 0, &fun_ref)) {
+					switch (lookupSelector(s->_segMan, called_obj_addr, selector, nullptr, &fun_ref)) {
 					case kSelectorMethod:
 						debugN("FUNCT");
 						argc += restmod;
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 904f78c8ec..2f9fd6ee1c 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -186,7 +186,7 @@ void SegManager::deallocate(SegmentId seg) {
 
 bool SegManager::isHeapObject(reg_t pos) const {
 	const Object *obj = getObject(pos);
-	if (obj == NULL || (obj && obj->isFreed()))
+	if (obj == nullptr || (obj && obj->isFreed()))
 		return false;
 	Script *scr = getScriptIfLoaded(pos.getSegment());
 	return !(scr && scr->isMarkedAsDeleted());
@@ -213,7 +213,7 @@ Script *SegManager::getScript(const SegmentId seg) {
 Script *SegManager::getScriptIfLoaded(const SegmentId seg) const {
 	SegmentId actualSegment = getActualSegment(seg);
 	if (actualSegment < 1 || (uint)actualSegment >= _heap.size() || !_heap[actualSegment] || _heap[actualSegment]->getType() != SEG_TYPE_SCRIPT)
-		return 0;
+		return nullptr;
 	return (Script *)_heap[actualSegment];
 }
 
@@ -227,7 +227,7 @@ SegmentId SegManager::findSegmentByType(int type) const {
 SegmentObj *SegManager::getSegmentObj(SegmentId seg) const {
 	SegmentId actualSegment = getActualSegment(seg);
 	if (actualSegment < 1 || (uint)actualSegment >= _heap.size() || !_heap[actualSegment])
-		return 0;
+		return nullptr;
 	return _heap[actualSegment];
 }
 
@@ -245,9 +245,9 @@ SegmentObj *SegManager::getSegment(SegmentId seg, SegmentType type) const {
 
 Object *SegManager::getObject(reg_t pos) const {
 	SegmentObj *mobj = getSegmentObj(pos.getSegment());
-	Object *obj = NULL;
+	Object *obj = nullptr;
 
-	if (mobj != NULL) {
+	if (mobj != nullptr) {
 		if (mobj->getType() == SEG_TYPE_CLONES) {
 			CloneTable &ct = *(CloneTable *)mobj;
 			if (ct.isValidEntry(pos.getOffset()))
@@ -473,7 +473,7 @@ byte *SegManager::getHunkPointer(reg_t addr) {
 
 	if (!ht || !ht->isValidEntry(addr.getOffset())) {
 		// Valid SCI behavior, e.g. when loading/quitting
-		return NULL;
+		return nullptr;
 	}
 
 	return (byte *)ht->at(addr.getOffset()).mem;
@@ -535,14 +535,14 @@ reg_t SegManager::newNode(reg_t value, reg_t key) {
 List *SegManager::lookupList(reg_t addr) {
 	if (getSegmentType(addr.getSegment()) != SEG_TYPE_LISTS) {
 		error("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
-		return NULL;
+		return nullptr;
 	}
 
 	ListTable &lt = *(ListTable *)_heap[addr.getSegment()];
 
 	if (!lt.isValidEntry(addr.getOffset())) {
 		error("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
-		return NULL;
+		return nullptr;
 	}
 
 	return &(lt[addr.getOffset()]);
@@ -550,23 +550,23 @@ List *SegManager::lookupList(reg_t addr) {
 
 Node *SegManager::lookupNode(reg_t addr, bool stopOnDiscarded) {
 	if (addr.isNull())
-		return NULL; // Non-error null
+		return nullptr; // Non-error null
 
 	SegmentType type = getSegmentType(addr.getSegment());
 
 	if (type != SEG_TYPE_NODES) {
 		error("Attempt to use non-node %04x:%04x (type %d) as list node", PRINT_REG(addr), type);
-		return NULL;
+		return nullptr;
 	}
 
 	NodeTable &nt = *(NodeTable *)_heap[addr.getSegment()];
 
 	if (!nt.isValidEntry(addr.getOffset())) {
 		if (!stopOnDiscarded)
-			return NULL;
+			return nullptr;
 
 		error("Attempt to use invalid or discarded reference %04x:%04x as list node", PRINT_REG(addr));
-		return NULL;
+		return nullptr;
 	}
 
 	return &(nt[addr.getOffset()]);
@@ -589,7 +589,7 @@ static void *derefPtr(SegManager *segMan, reg_t pointer, int entries, bool wantR
 	SegmentRef ret = segMan->dereference(pointer);
 
 	if (!ret.isValid())
-		return NULL;
+		return nullptr;
 
 	if (ret.isRaw != wantRaw) {
 		warning("Dereferencing pointer %04x:%04x (type %d) which is %s, but expected %s", PRINT_REG(pointer),
@@ -600,12 +600,12 @@ static void *derefPtr(SegManager *segMan, reg_t pointer, int entries, bool wantR
 
 	if (!wantRaw && ret.skipByte) {
 		warning("Unaligned pointer read: %04x:%04x expected with word alignment", PRINT_REG(pointer));
-		return NULL;
+		return nullptr;
 	}
 
 	if (entries > ret.maxSize) {
 		warning("Trying to dereference pointer %04x:%04x beyond end of segment", PRINT_REG(pointer));
-		return NULL;
+		return nullptr;
 	}
 
 	if (ret.isRaw)
@@ -912,7 +912,7 @@ byte *SegManager::allocDynmem(int size, const char *descr, reg_t *addr) {
 	if (size) {
 		d._buf = (byte *)calloc(size, 1);
 	} else {
-		d._buf = NULL;
+		d._buf = nullptr;
 	}
 
 	d._description = descr;
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp
index 2b7eba3aa6..a7f875aeda 100644
--- a/engines/sci/engine/segment.cpp
+++ b/engines/sci/engine/segment.cpp
@@ -37,7 +37,7 @@ namespace Sci {
 //#define GC_DEBUG_VERBOSE // Debug garbage verbosely
 
 SegmentObj *SegmentObj::createSegmentObj(SegmentType type) {
-	SegmentObj *mem = 0;
+	SegmentObj *mem = nullptr;
 	switch (type) {
 	case SEG_TYPE_SCRIPT:
 		mem = new Script();
@@ -155,7 +155,7 @@ SegmentRef LocalVariables::dereference(reg_t pointer) {
 		} else {
 			error("LocalVariables::dereference: Offset at end or out of bounds %04x:%04x", PRINT_REG(pointer));
 		}
-		ret.reg = 0;
+		ret.reg = nullptr;
 	}
 	return ret;
 }
diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index 25e225f2b7..108eec7c99 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -246,7 +246,7 @@ void Kernel::mapSelectors() {
 reg_t readSelector(SegManager *segMan, reg_t object, Selector selectorId) {
 	ObjVarRef address;
 
-	if (lookupSelector(segMan, object, selectorId, &address, NULL) != kSelectorVariable)
+	if (lookupSelector(segMan, object, selectorId, &address, nullptr) != kSelectorVariable)
 		return NULL_REG;
 
 	if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORREAD) {
@@ -274,7 +274,7 @@ void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t
 		error("Attempt to write to invalid selector %d. Address %04x:%04x, %s", selectorId, PRINT_REG(object), origin.toString().c_str());
 	}
 
-	if (lookupSelector(segMan, object, selectorId, &address, NULL) != kSelectorVariable) {
+	if (lookupSelector(segMan, object, selectorId, &address, nullptr) != kSelectorVariable) {
 		const SciCallOrigin origin = g_sci->getEngineState()->getCurrentCallOrigin();
 		error("Selector '%s' of object could not be written to. Address %04x:%04x, %s", g_sci->getKernel()->getSelectorName(selectorId).c_str(), PRINT_REG(object), origin.toString().c_str());
 	}
@@ -301,7 +301,7 @@ void invokeSelector(EngineState *s, reg_t object, int selectorId,
 	stackframe[0] = make_reg(0, selectorId);  // The selector we want to call
 	stackframe[1] = make_reg(0, argc); // Argument count
 
-	slc_type = lookupSelector(s->_segMan, object, selectorId, NULL, NULL);
+	slc_type = lookupSelector(s->_segMan, object, selectorId, nullptr, nullptr);
 
 	if (slc_type == kSelectorNone) {
 		const SciCallOrigin origin = g_sci->getEngineState()->getCurrentCallOrigin();
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index de1f7d34af..d78718036a 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -94,8 +94,8 @@ void EngineState::reset(bool isRestoring) {
 
 	executionStackBase = 0;
 	_executionStackPosChanged = false;
-	stack_base = 0;
-	stack_top = 0;
+	stack_base = nullptr;
+	stack_top = nullptr;
 
 	r_acc = NULL_REG;
 	r_prev = NULL_REG;
@@ -387,7 +387,7 @@ Common::String SciEngine::strSplitLanguage(const char *str, uint16 *languageSpli
 
 	// Don't add subtitle when separator is not set, subtitle language is not set, or
 	// string contains only one language
-	if ((sep == NULL) || (subtitleLanguage == K_LANG_NONE) || (foundLanguage == K_LANG_NONE))
+	if ((sep == nullptr) || (subtitleLanguage == K_LANG_NONE) || (foundLanguage == K_LANG_NONE))
 		return retval;
 
 	// Add subtitle, unless the subtitle language doesn't match the languages in the string
diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp
index ae6c7afc84..01afc8ae15 100644
--- a/engines/sci/engine/static_selectors.cpp
+++ b/engines/sci/engine/static_selectors.cpp
@@ -123,7 +123,7 @@ static const SelectorRemap sciSelectorRemap[] = {
 	{        SCI_VERSION_1_1,        SCI_VERSION_2_1_LATE,    "-super-", 4102 },
 	//
 	{        SCI_VERSION_1_1,        SCI_VERSION_2_1_LATE,     "-info-", 4103 },
-	{        SCI_VERSION_NONE,           SCI_VERSION_NONE,            0,    0 }
+	{        SCI_VERSION_NONE,           SCI_VERSION_NONE,      nullptr,    0 }
 };
 
 struct ClassReference {
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 2ccd379bc5..1efd482989 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -185,7 +185,7 @@ static void write_var(EngineState *s, int type, int index, reg_t value) {
 			if (!stopGroopPos.isNull()) {	// does the game have a stopGroop object?
 				// Find the "client" member variable of the stopGroop object, and update it
 				ObjVarRef varp;
-				if (lookupSelector(s->_segMan, stopGroopPos, SELECTOR(client), &varp, NULL) == kSelectorVariable) {
+				if (lookupSelector(s->_segMan, stopGroopPos, SELECTOR(client), &varp, nullptr) == kSelectorVariable) {
 					reg_t *clientVar = varp.getPointer(s->_segMan);
 					*clientVar = value;
 				}
@@ -228,7 +228,7 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
 
 	uint32 exportAddr = scr->validateExportFunc(pubfunct, false);
 	if (!exportAddr)
-		return NULL;
+		return nullptr;
 
 	assert(argp[0].toUint16() == argc); // The first argument is argc
 	ExecStack xstack(calling_obj, calling_obj, sp, argc, argp,
@@ -293,7 +293,7 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
 			error("Send to invalid selector 0x%x (%s) of object at %04x:%04x", 0xffff & selector, g_sci->getKernel()->getSelectorName(0xffff & selector).c_str(), PRINT_REG(send_obj));
 
 		ExecStackType stackType = EXEC_STACK_TYPE_VARSELECTOR;
-		StackPtr curSP = NULL;
+		StackPtr curSP = nullptr;
 		reg_t curFP = make_reg32(0, 0);
 		if (selectorType == kSelectorMethod) {
 			stackType = EXEC_STACK_TYPE_CALL;
@@ -330,7 +330,7 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
 	// those will get executed by op_ret later.
 	_exec_varselectors(s);
 
-	return s->_executionStack.empty() ? NULL : &(s->_executionStack.back());
+	return s->_executionStack.empty() ? nullptr : &(s->_executionStack.back());
 }
 
 static void addKernelCallToExecStack(EngineState *s, int kernelCallNr, int kernelSubCallNr, int argc, reg_t *argv) {
@@ -383,7 +383,7 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) {
 		s->r_acc = kernelCall.function(s, argc, argv);
 
 		if (g_sci->checkKernelBreakpoint(kernelCall.name))
-			logKernelCall(&kernelCall, NULL, s, argc, argv, s->r_acc);
+			logKernelCall(&kernelCall, nullptr, s, argc, argv, s->r_acc);
 	} else {
 		// Sub-functions available, check signature and call that one directly
 		if (argc < 1)
@@ -580,9 +580,9 @@ void run_vm(EngineState *s) {
 	s->r_rest = 0;	// &rest adjusts the parameter count by this value
 	// Current execution data:
 	s->xs = &(s->_executionStack.back());
-	ExecStack *xs_new = NULL;
+	ExecStack *xs_new = nullptr;
 	Object *obj = s->_segMan->getObject(s->xs->objp);
-	Script *scr = 0;
+	Script *scr = nullptr;
 	Script *local_script = s->_segMan->getScriptIfLoaded(s->xs->local_segment);
 	int old_executionStackBase = s->executionStackBase;
 	// Used to detect the stack bottom, for "physical" returns
@@ -1433,7 +1433,7 @@ void run_vm(EngineState *s) {
 
 reg_t *ObjVarRef::getPointer(SegManager *segMan) const {
 	Object *o = segMan->getObject(obj);
-	return o ? &o->getVariableRef(varindex) : 0;
+	return o ? &o->getVariableRef(varindex) : nullptr;
 }
 
 reg_t *ExecStack::getVarPointer(SegManager *segMan) const {
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 6d86ac4555..5a83165da0 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -78,19 +78,19 @@ static const uint16 sig_arithmetic_ecoq2_1[] = {
 const SciWorkaroundEntry arithmeticWorkarounds[] = {
 	{ GID_CAMELOT,         92,   92,  0,     "endingCartoon2", "changeState", sig_arithmetic_camelot_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_lai: during the ending, sub gets called with no parameters, uses parameter 1 which is theGrail in this case - bug #5237
 	{ GID_ECOQUEST2,      100,    0,  0,               "Rain", "points",        sig_arithmetic_ecoq2_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_or: when giving the papers to the customs officer, gets called against a pointer instead of a number - bug #4939, Spanish version - bug #5750
-	{ GID_FANMADE,        516,  983,  0,             "Wander", "setTarget",                       NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_mul: The Legend of the Lost Jewel Demo (fan made): called with object as second parameter when attacked by insects - bug #5124
-	{ GID_FANMADE,         -1,  935,  0,             "Scaler", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_mul: Zork: The Great Underground Empire (fan made): called with object as second parameter when changing rooms
-	{ GID_GK1,            800,64992,  0,                "Fwd", "doit",                            NULL,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_gt: when Mosely finds Gabriel and Grace near the end of the game, compares the Grooper object with 7
-	{ GID_HOYLE4,         700,   -1,  1,               "Code", "doit",                            NULL,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_add: while bidding in Bridge, an object ("Bid") is added to an object in another segment ("hand3")
-	{ GID_ICEMAN,         199,  977,  0,            "Grooper", "doit",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_add: While dancing with the girl
-	{ GID_MOTHERGOOSE256,  -1,  999,  0,              "Event", "new",                             NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_and: constantly during the game (SCI1 version)
-	{ GID_MOTHERGOOSE256,  -1,    4,  0,              "rm004", "doit",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_or: when going north and reaching the castle (rooms 4 and 37) - bug #5101
-	{ GID_MOTHERGOOSEHIRES,90,   90,  0,      "newGameButton", "select",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_ge: MUMG Deluxe, when selecting "New Game" in the main menu. It tries to compare an integer with a list. Needs to return false for the game to continue.
-	{ GID_PHANTASMAGORIA, 902,    0,  0,                   "", "export 7",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_shr: when starting a chapter in Phantasmagoria
-	{ GID_QFG1VGA,        301,  928,  0,              "Blink", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_div: when entering the inn, Blink:init called with 1 parameter, but 2nd parameter is used for div which happens to be an object.
-	{ GID_QFG2,           200,  200,  0,              "astro", "messages",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_lsi: when getting asked for your name by the astrologer - bug #5152
-	{ GID_QFG3,           780,  999,  0,                   "", "export 6",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_add: trying to talk to yourself at the top of the giant tree - bug #6692
-	{ GID_TORIN,        51400,64928,  0,              "Blink", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_div: when Lycentia knocks Torin out after he removes her collar
+	{ GID_FANMADE,        516,  983,  0,             "Wander", "setTarget",                    nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_mul: The Legend of the Lost Jewel Demo (fan made): called with object as second parameter when attacked by insects - bug #5124
+	{ GID_FANMADE,         -1,  935,  0,             "Scaler", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_mul: Zork: The Great Underground Empire (fan made): called with object as second parameter when changing rooms
+	{ GID_GK1,            800,64992,  0,                "Fwd", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_gt: when Mosely finds Gabriel and Grace near the end of the game, compares the Grooper object with 7
+	{ GID_HOYLE4,         700,   -1,  1,               "Code", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_add: while bidding in Bridge, an object ("Bid") is added to an object in another segment ("hand3")
+	{ GID_ICEMAN,         199,  977,  0,            "Grooper", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_add: While dancing with the girl
+	{ GID_MOTHERGOOSE256,  -1,  999,  0,              "Event", "new",                          nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_and: constantly during the game (SCI1 version)
+	{ GID_MOTHERGOOSE256,  -1,    4,  0,              "rm004", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_or: when going north and reaching the castle (rooms 4 and 37) - bug #5101
+	{ GID_MOTHERGOOSEHIRES,90,   90,  0,      "newGameButton", "select",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_ge: MUMG Deluxe, when selecting "New Game" in the main menu. It tries to compare an integer with a list. Needs to return false for the game to continue.
+	{ GID_PHANTASMAGORIA, 902,    0,  0,                   "", "export 7",                     nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_shr: when starting a chapter in Phantasmagoria
+	{ GID_QFG1VGA,        301,  928,  0,              "Blink", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_div: when entering the inn, Blink:init called with 1 parameter, but 2nd parameter is used for div which happens to be an object.
+	{ GID_QFG2,           200,  200,  0,              "astro", "messages",                     nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_lsi: when getting asked for your name by the astrologer - bug #5152
+	{ GID_QFG3,           780,  999,  0,                   "", "export 6",                     nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_add: trying to talk to yourself at the top of the giant tree - bug #6692
+	{ GID_TORIN,        51400,64928,  0,              "Blink", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_div: when Lycentia knocks Torin out after he removes her collar
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -348,92 +348,92 @@ static const uint16 sig_uninitread_sq1_1[] = {
 // Workarounds for uninitialized reads for parameters
 //    gameID,           room,script,lvl,          object-name, method-name,       local-call-signature, index-range,  workaround
 const SciWorkaroundEntry uninitializedReadForParamWorkarounds[] = {
-	{ GID_GK1,            -1,    12, -1,          "GKIconbar", "showInvItem",                     NULL,     1,     1,{ WORKAROUND_FAKE,   1 } }, // When showing the icon bar containing an inventory item
-	{ GID_HOYLE5,         -1,    15, -1,               "Hand", "add",                             NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When the game adds cards to your hand in any mini-game
-	{ GID_HOYLE5,        700,   730,  0,                 NULL, "runningSuit",                     NULL,     2,     2,{ WORKAROUND_FAKE,   0 } }, // when an opponent is playing in Bridge
-	{ GID_HOYLE5,       1100,    22, -1,           "HandPile", "show",                            NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // when showing money piles in Poker
-	{ GID_LAURABOW2,      -1,    90,  0,          "MuseumRgn", "crowdInRoom",                     NULL,     3,     4,{ WORKAROUND_FAKE,   0 } }, // When actors walk around the museum. Out-of-bounds parameters are read but not used. Doesn't matter, but generates a lot of warnings.
-	{ GID_PHANTASMAGORIA2,-1, 63019,  0,     "WynDocTextView", "cue",                             NULL,     2,     2,{ WORKAROUND_FAKE,   0 } }, // When dragging the slider next to an e-mail message
-	{ GID_QFG3,           -1,    28,  0,               "hero", "changeGait",                      NULL,     2,     2,{ WORKAROUND_FAKE,   0 } }, // When ego's walk style is adjusted throughout the game
-	{ GID_QFG4,           -1,    28,  0,               "hero", "changeGait",                      NULL,     1,     2,{ WORKAROUND_FAKE,   0 } }, // When ego's walk style is adjusted throughout the game (some scripts don't pass either parameter)
-	{ GID_QFG4,           -1, 64924,  0,      "gloryMessager", "nextMsg",                         NULL,     1,     5,{ WORKAROUND_FAKE,   0 } }, // Floppy: when saying a message. Passes 5 non-existent parameters to GloryTalker:say which never reads them, but generates a lot of warnings.
-	{ GID_SHIVERS,        -1, 64918,  0,                "Str", "strip",                           NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When starting a new game and entering a name
-	{ GID_SQ4,            35,   928,  0,           "Narrator", "say",                             NULL,     1,     1,{ WORKAROUND_FAKE,  11 } }, // Clicking smell on sidewalk, fixes message due to missing say parameter in sidewalk1:doVerb(6) - bug #10917
+	{ GID_GK1,            -1,    12, -1,          "GKIconbar", "showInvItem",                  nullptr,     1,     1,{ WORKAROUND_FAKE,   1 } }, // When showing the icon bar containing an inventory item
+	{ GID_HOYLE5,         -1,    15, -1,               "Hand", "add",                          nullptr,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When the game adds cards to your hand in any mini-game
+	{ GID_HOYLE5,        700,   730,  0,              nullptr, "runningSuit",                  nullptr,     2,     2,{ WORKAROUND_FAKE,   0 } }, // when an opponent is playing in Bridge
+	{ GID_HOYLE5,       1100,    22, -1,           "HandPile", "show",                         nullptr,     1,     1,{ WORKAROUND_FAKE,   0 } }, // when showing money piles in Poker
+	{ GID_LAURABOW2,      -1,    90,  0,          "MuseumRgn", "crowdInRoom",                  nullptr,     3,     4,{ WORKAROUND_FAKE,   0 } }, // When actors walk around the museum. Out-of-bounds parameters are read but not used. Doesn't matter, but generates a lot of warnings.
+	{ GID_PHANTASMAGORIA2,-1, 63019,  0,     "WynDocTextView", "cue",                          nullptr,     2,     2,{ WORKAROUND_FAKE,   0 } }, // When dragging the slider next to an e-mail message
+	{ GID_QFG3,           -1,    28,  0,               "hero", "changeGait",                   nullptr,     2,     2,{ WORKAROUND_FAKE,   0 } }, // When ego's walk style is adjusted throughout the game
+	{ GID_QFG4,           -1,    28,  0,               "hero", "changeGait",                   nullptr,     1,     2,{ WORKAROUND_FAKE,   0 } }, // When ego's walk style is adjusted throughout the game (some scripts don't pass either parameter)
+	{ GID_QFG4,           -1, 64924,  0,      "gloryMessager", "nextMsg",                      nullptr,     1,     5,{ WORKAROUND_FAKE,   0 } }, // Floppy: when saying a message. Passes 5 non-existent parameters to GloryTalker:say which never reads them, but generates a lot of warnings.
+	{ GID_SHIVERS,        -1, 64918,  0,                "Str", "strip",                        nullptr,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When starting a new game and entering a name
+	{ GID_SQ4,            35,   928,  0,           "Narrator", "say",                          nullptr,     1,     1,{ WORKAROUND_FAKE,  11 } }, // Clicking smell on sidewalk, fixes message due to missing say parameter in sidewalk1:doVerb(6) - bug #10917
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 // Workarounds for uninitialized reads for temporary variables
 //    gameID,           room,script,lvl,          object-name, method-name,       local-call-signature, index-range,  workaround
 const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
-	{ GID_CAMELOT,        40,    40,  0,               "Rm40", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when looking at the ground at the pool of Siloam - bug #6401
-	{ GID_CASTLEBRAIN,   280,   280,  0,         "programmer", "dispatchEvent",                   NULL,     0,     0, { WORKAROUND_FAKE, 0xf } }, // pressing 'q' on the computer screen in the robot room, and closing the help dialog that pops up (bug #5143). Moves the cursor to the view with the ID returned (in this case, the robot hand)
-	{ GID_CASTLEBRAIN,   320,   325,  0,               "word", "dispatchEvent",                   NULL,    14,    15, { WORKAROUND_FAKE,   0 } }, // holding down enter key during the word search puzzle, temp 14 and 15 - bug #9783
-	{ GID_CNICK_KQ,       -1,     0,  1,          "Character", "say",                             NULL,   504,   505, { WORKAROUND_FAKE,   0 } }, // checkers/backgammon, like in hoyle 3 - temps 504 and 505 - bug #6255
-	{ GID_CNICK_KQ,       -1,   700,  0,           "gcWindow", "open",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when entering the control menu, like in hoyle 3
-	{ GID_CNICK_KQ,      300,   303,  0,      "theDoubleCube", "<noname520>",                     NULL,     5,     5, { WORKAROUND_FAKE,   0 } }, // while playing backgammon with doubling enabled - bug #6426 (same as the theDoubleCube::make workaround for Hoyle 3)
-	{ GID_CNICK_KQ,      300,   303,  0,      "theDoubleCube", "<noname519>",                     NULL,     9,     9, { WORKAROUND_FAKE,   0 } }, // when accepting a double, while playing backgammon with doubling enabled (same as the theDoubleCube::accept workaround for Hoyle 3)
-	{ GID_CNICK_LAURABOW,500,     0,  1,          "<no name>", "<noname446>",                     NULL,   504,   505, { WORKAROUND_FAKE,   0 } }, // Yacht, like in hoyle 3 - temps 504 and 505 - bug #6424
-	{ GID_CNICK_LAURABOW, -1,   700,  0,                 NULL, "open",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when entering control menu - bug #6423 (same as the gcWindow workaround for Hoyle 3)
-	{ GID_CNICK_LAURABOW,100,   100,  0,                 NULL, "<noname144>",                     NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // while playing domino - bug #6429 (same as the dominoHand2 workaround for Hoyle 3)
-	{ GID_CNICK_LAURABOW,100,   110,  0,                 NULL, "doit",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when changing the "Dominoes per hand" setting - bug #6430
-	{ GID_CNICK_LSL,     250,   250,  0,           "increase", "handleEvent",                     NULL,     2,     2, { WORKAROUND_FAKE,   0 } }, // when increasing own bet for blackjack - bug #10184
-	{ GID_CNICK_LONGBOW,   0,     0,  0,          "RH Budget", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when starting the game
-	{ GID_ECOQUEST,       -1,    -1,  0,                 NULL, "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // almost clicking anywhere triggers this in almost all rooms
-	{ GID_ECOQUEST2,      -1,    50,  0,         "talkButton", "cue",                             NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // clicking Ecorder talk button before clicking power button
-	{ GID_FANMADE,       516,   979,  0,                   "", "export 0",                        NULL,    20,    20, { WORKAROUND_FAKE,   0 } }, // Happens in Grotesteing after the logos
-	{ GID_FANMADE,       528,   990,  0,            "GDialog", "doit",                            NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // Happens in Cascade Quest when closing the glossary - bug #5116
+	{ GID_CAMELOT,        40,    40,  0,               "Rm40", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when looking at the ground at the pool of Siloam - bug #6401
+	{ GID_CASTLEBRAIN,   280,   280,  0,         "programmer", "dispatchEvent",                nullptr,     0,     0, { WORKAROUND_FAKE, 0xf } }, // pressing 'q' on the computer screen in the robot room, and closing the help dialog that pops up (bug #5143). Moves the cursor to the view with the ID returned (in this case, the robot hand)
+	{ GID_CASTLEBRAIN,   320,   325,  0,               "word", "dispatchEvent",                nullptr,    14,    15, { WORKAROUND_FAKE,   0 } }, // holding down enter key during the word search puzzle, temp 14 and 15 - bug #9783
+	{ GID_CNICK_KQ,       -1,     0,  1,          "Character", "say",                          nullptr,   504,   505, { WORKAROUND_FAKE,   0 } }, // checkers/backgammon, like in hoyle 3 - temps 504 and 505 - bug #6255
+	{ GID_CNICK_KQ,       -1,   700,  0,           "gcWindow", "open",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when entering the control menu, like in hoyle 3
+	{ GID_CNICK_KQ,      300,   303,  0,      "theDoubleCube", "<noname520>",                  nullptr,     5,     5, { WORKAROUND_FAKE,   0 } }, // while playing backgammon with doubling enabled - bug #6426 (same as the theDoubleCube::make workaround for Hoyle 3)
+	{ GID_CNICK_KQ,      300,   303,  0,      "theDoubleCube", "<noname519>",                  nullptr,     9,     9, { WORKAROUND_FAKE,   0 } }, // when accepting a double, while playing backgammon with doubling enabled (same as the theDoubleCube::accept workaround for Hoyle 3)
+	{ GID_CNICK_LAURABOW,500,     0,  1,          "<no name>", "<noname446>",                  nullptr,   504,   505, { WORKAROUND_FAKE,   0 } }, // Yacht, like in hoyle 3 - temps 504 and 505 - bug #6424
+	{ GID_CNICK_LAURABOW, -1,   700,  0,              nullptr, "open",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when entering control menu - bug #6423 (same as the gcWindow workaround for Hoyle 3)
+	{ GID_CNICK_LAURABOW,100,   100,  0,              nullptr, "<noname144>",                  nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // while playing domino - bug #6429 (same as the dominoHand2 workaround for Hoyle 3)
+	{ GID_CNICK_LAURABOW,100,   110,  0,              nullptr, "doit",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when changing the "Dominoes per hand" setting - bug #6430
+	{ GID_CNICK_LSL,     250,   250,  0,           "increase", "handleEvent",                  nullptr,     2,     2, { WORKAROUND_FAKE,   0 } }, // when increasing own bet for blackjack - bug #10184
+	{ GID_CNICK_LONGBOW,   0,     0,  0,          "RH Budget", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when starting the game
+	{ GID_ECOQUEST,       -1,    -1,  0,              nullptr, "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // almost clicking anywhere triggers this in almost all rooms
+	{ GID_ECOQUEST2,      -1,    50,  0,         "talkButton", "cue",                          nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // clicking Ecorder talk button before clicking power button
+	{ GID_FANMADE,       516,   979,  0,                   "", "export 0",                     nullptr,    20,    20, { WORKAROUND_FAKE,   0 } }, // Happens in Grotesteing after the logos
+	{ GID_FANMADE,       528,   990,  0,            "GDialog", "doit",                         nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // Happens in Cascade Quest when closing the glossary - bug #5116
 	{ GID_FANMADE,       488,     1,  0,         "RoomScript", "doit",        sig_uninitread_fanmade_1,     1,     1, { WORKAROUND_FAKE,   0 } }, // Happens in Ocean Battle while playing - bug #5335
-	{ GID_FREDDYPHARKAS,  -1,    24,  0,              "gcWin", "open",                            NULL,     5,     5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
-	{ GID_FREDDYPHARKAS,  -1,    31,  0,            "quitWin", "open",                            NULL,     5,     5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
-	{ GID_FREDDYPHARKAS, 540,   540,  0,          "WaverCode", "init",                            NULL,     0,     1, { WORKAROUND_FAKE,   0 } }, // Gun pratice mini-game, all temps - 0+1 - bug #5232
-	{ GID_GK1,            -1, 64950, -1,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // sometimes when walk-clicking
-	{ GID_GK1,            -1, 64937, -1,         "GKControls", "dispatchEvent",                   NULL,     6,     6, { WORKAROUND_FAKE,   0 } }, // when using keyboard navigation (tab) in the game settings and hitting 'enter' when over a slider
-	{ GID_GK1,            -1, 64994, -1,               "Game", "save",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
-	{ GID_GK1,            -1, 64994, -1,               "Game", "restore",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
-	{ GID_GK2,            -1,    11,  0,                   "", "export 10",                       NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // When game starts and throughout game. temp1 in Italian version, temp3 in others
-	{ GID_GK2,            -1, 64921, -1,              "Print", "addEdit",                         NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to use the game debugger's flag setting command
-	{ GID_HOYLE1,          4,   104,  0,   "GinRummyCardList", "calcRuns",                        NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // Gin Rummy / right when the game starts
-	{ GID_HOYLE1,          5,   204,  0,            "tableau", "checkRuns",                       NULL,     2,     2, { WORKAROUND_FAKE,   0 } }, // Cribbage / during the game
+	{ GID_FREDDYPHARKAS,  -1,    24,  0,              "gcWin", "open",                         nullptr,     5,     5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
+	{ GID_FREDDYPHARKAS,  -1,    31,  0,            "quitWin", "open",                         nullptr,     5,     5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
+	{ GID_FREDDYPHARKAS, 540,   540,  0,          "WaverCode", "init",                         nullptr,     0,     1, { WORKAROUND_FAKE,   0 } }, // Gun pratice mini-game, all temps - 0+1 - bug #5232
+	{ GID_GK1,            -1, 64950, -1,            "Feature", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // sometimes when walk-clicking
+	{ GID_GK1,            -1, 64937, -1,         "GKControls", "dispatchEvent",                nullptr,     6,     6, { WORKAROUND_FAKE,   0 } }, // when using keyboard navigation (tab) in the game settings and hitting 'enter' when over a slider
+	{ GID_GK1,            -1, 64994, -1,               "Game", "save",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
+	{ GID_GK1,            -1, 64994, -1,               "Game", "restore",                      nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
+	{ GID_GK2,            -1,    11,  0,                   "", "export 10",                    nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // When game starts and throughout game. temp1 in Italian version, temp3 in others
+	{ GID_GK2,            -1, 64921, -1,              "Print", "addEdit",                      nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to use the game debugger's flag setting command
+	{ GID_HOYLE1,          4,   104,  0,   "GinRummyCardList", "calcRuns",                     nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // Gin Rummy / right when the game starts
+	{ GID_HOYLE1,          5,   204,  0,            "tableau", "checkRuns",                    nullptr,     2,     2, { WORKAROUND_FAKE,   0 } }, // Cribbage / during the game
 	{ GID_HOYLE1,          3,    16,  0,                   "", "export 0",     sig_uninitread_hoyle1_1,     3,     3, { WORKAROUND_FAKE,   0 } }, // Hearts / during the game - bug #5299
-	{ GID_HOYLE1,         -1,   997,  0,            "MenuBar", "doit",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // When changing game speed settings - bug #5512
-	{ GID_HOYLE3,         -1,     0,  1,          "Character", "say",                             NULL,   504,   505, { WORKAROUND_FAKE,   0 } }, // when starting checkers or dominoes, first time a character says something - temps 504 and 505
-	{ GID_HOYLE3,         -1,   700,  0,           "gcWindow", "open",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when entering control menu
-	{ GID_HOYLE3,        100,   100,  0,        "dominoHand2", "cue",                             NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // while playing domino - bug #5042
-	{ GID_HOYLE3,        100,   110,  0,           "OKButton", "doit",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when changing the "Dominoes per hand" setting - bug #6430
-	{ GID_HOYLE3,        300,   303,  0,      "theDoubleCube", "make",                            NULL,     5,     5, { WORKAROUND_FAKE,   0 } }, // while playing backgammon with doubling enabled
-	{ GID_HOYLE3,        300,   303,  0,      "theDoubleCube", "accept",                          NULL,     9,     9, { WORKAROUND_FAKE,   0 } }, // when accepting a double, while playing backgammon with doubling enabled
-	{ GID_HOYLE4,         -1,     0,  0,                 NULL, "open",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when selecting "Control" from the menu (temp vars 0-3) - bug #5132
-	{ GID_HOYLE4,        910,    18,  0,                 NULL, "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // during tutorial - bug #5213
-	{ GID_HOYLE4,        910,   910,  0,                 NULL, "setup",                           NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // when selecting "Tutorial" from the main menu - bug #5132
-	{ GID_HOYLE4,        700,   700,  1,         "BridgeHand", "calcQTS",                         NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // when placing a bid in bridge (always)
-	{ GID_HOYLE4,        700,   710,  1, "BridgeStrategyPlay", "checkSplitTops",                  NULL,    10,    10, { WORKAROUND_FAKE,   0 } }, // while playing bridge, objects LeadReturn_Trump, SecondSeat_Trump, ThirdSeat_Trump and others - bug #5794
-	{ GID_HOYLE4,        700,   730,  1,      "BridgeDefense", "beatTheirBest",                   NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // rarely while playing bridge
-	{ GID_HOYLE4,        700,    -1,  1,      "BridgeDefense", "makeContractMinusAce",            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when playing Bridge - bug #11162
-	{ GID_HOYLE4,        700,    -1,  1,      "BridgeDefense", "think",                           NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // sometimes while playing bridge, temp var 3, 17 and others, objects LeadReturn_Trump, ThirdSeat_Trump and others
-	{ GID_HOYLE4,        700,    -1,  1,               "Code", "doit",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when placing a bid in bridge (always), temp var 11, 24, 27, 46, 75, objects compete_tree, compwe_tree, other1_tree, b1 - bugs #5663 and #5794
-	{ GID_HOYLE4,        700,   921,  0,              "Print", "addEdit",                         NULL,    -1,    -1, { WORKAROUND_FAKE, 118 } }, // when saving the game (may also occur in other situations) - bug #6601, bug #6614
+	{ GID_HOYLE1,         -1,   997,  0,            "MenuBar", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // When changing game speed settings - bug #5512
+	{ GID_HOYLE3,         -1,     0,  1,          "Character", "say",                          nullptr,   504,   505, { WORKAROUND_FAKE,   0 } }, // when starting checkers or dominoes, first time a character says something - temps 504 and 505
+	{ GID_HOYLE3,         -1,   700,  0,           "gcWindow", "open",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when entering control menu
+	{ GID_HOYLE3,        100,   100,  0,        "dominoHand2", "cue",                          nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // while playing domino - bug #5042
+	{ GID_HOYLE3,        100,   110,  0,           "OKButton", "doit",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when changing the "Dominoes per hand" setting - bug #6430
+	{ GID_HOYLE3,        300,   303,  0,      "theDoubleCube", "make",                         nullptr,     5,     5, { WORKAROUND_FAKE,   0 } }, // while playing backgammon with doubling enabled
+	{ GID_HOYLE3,        300,   303,  0,      "theDoubleCube", "accept",                       nullptr,     9,     9, { WORKAROUND_FAKE,   0 } }, // when accepting a double, while playing backgammon with doubling enabled
+	{ GID_HOYLE4,         -1,     0,  0,              nullptr, "open",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when selecting "Control" from the menu (temp vars 0-3) - bug #5132
+	{ GID_HOYLE4,        910,    18,  0,              nullptr, "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // during tutorial - bug #5213
+	{ GID_HOYLE4,        910,   910,  0,              nullptr, "setup",                        nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // when selecting "Tutorial" from the main menu - bug #5132
+	{ GID_HOYLE4,        700,   700,  1,         "BridgeHand", "calcQTS",                      nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // when placing a bid in bridge (always)
+	{ GID_HOYLE4,        700,   710,  1, "BridgeStrategyPlay", "checkSplitTops",               nullptr,    10,    10, { WORKAROUND_FAKE,   0 } }, // while playing bridge, objects LeadReturn_Trump, SecondSeat_Trump, ThirdSeat_Trump and others - bug #5794
+	{ GID_HOYLE4,        700,   730,  1,      "BridgeDefense", "beatTheirBest",                nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // rarely while playing bridge
+	{ GID_HOYLE4,        700,    -1,  1,      "BridgeDefense", "makeContractMinusAce",         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when playing Bridge - bug #11162
+	{ GID_HOYLE4,        700,    -1,  1,      "BridgeDefense", "think",                        nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // sometimes while playing bridge, temp var 3, 17 and others, objects LeadReturn_Trump, ThirdSeat_Trump and others
+	{ GID_HOYLE4,        700,    -1,  1,               "Code", "doit",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when placing a bid in bridge (always), temp var 11, 24, 27, 46, 75, objects compete_tree, compwe_tree, other1_tree, b1 - bugs #5663 and #5794
+	{ GID_HOYLE4,        700,   921,  0,              "Print", "addEdit",                      nullptr,    -1,    -1, { WORKAROUND_FAKE, 118 } }, // when saving the game (may also occur in other situations) - bug #6601, bug #6614
 	{ GID_HOYLE4,        300,   300,  0,                   "", "export 2",     sig_uninitread_hoyle4_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // after passing around cards in hearts
-	{ GID_HOYLE4,        400,   400,  1,            "GinHand", "calcRuns",                        NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // sometimes while playing Gin Rummy (e.g. when knocking and placing a card) - bug #5665
-	{ GID_HOYLE4,        500,    17,  1,          "Character", "say",                             NULL,   504,   504, { WORKAROUND_FAKE,   0 } }, // sometimes while playing Cribbage (e.g. when the opponent says "Last Card") - bug #5662
-	{ GID_HOYLE4,        800,   870,  0,     "EuchreStrategy", "thinkLead",                       NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // while playing Euchre, happens at least on 2nd or 3rd turn - bug #6602
-	{ GID_HOYLE4,         -1,   937,  0,            "IconBar", "dispatchEvent",                   NULL,   408,   408, { WORKAROUND_FAKE,   0 } }, // pressing ENTER on scoreboard while mouse is not on OK button, may not happen all the time - bug #6603
-	{ GID_HOYLE5,         -1,    14, -1,                 NULL, "select",                          NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // dragging the sliders in game settings
-	{ GID_HOYLE5,         -1, 64937, -1,                 NULL, "select",                          NULL,     7,     7, { WORKAROUND_FAKE,   0 } }, // clicking the "control" and "options" buttons in the icon bar
-	{ GID_HOYLE5,         -1, 64937, -1,            "IconBar", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // clicking on any button in the icon bar
+	{ GID_HOYLE4,        400,   400,  1,            "GinHand", "calcRuns",                     nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // sometimes while playing Gin Rummy (e.g. when knocking and placing a card) - bug #5665
+	{ GID_HOYLE4,        500,    17,  1,          "Character", "say",                          nullptr,   504,   504, { WORKAROUND_FAKE,   0 } }, // sometimes while playing Cribbage (e.g. when the opponent says "Last Card") - bug #5662
+	{ GID_HOYLE4,        800,   870,  0,     "EuchreStrategy", "thinkLead",                    nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // while playing Euchre, happens at least on 2nd or 3rd turn - bug #6602
+	{ GID_HOYLE4,         -1,   937,  0,            "IconBar", "dispatchEvent",                nullptr,   408,   408, { WORKAROUND_FAKE,   0 } }, // pressing ENTER on scoreboard while mouse is not on OK button, may not happen all the time - bug #6603
+	{ GID_HOYLE5,         -1,    14, -1,              nullptr, "select",                       nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // dragging the sliders in game settings
+	{ GID_HOYLE5,         -1, 64937, -1,              nullptr, "select",                       nullptr,     7,     7, { WORKAROUND_FAKE,   0 } }, // clicking the "control" and "options" buttons in the icon bar
+	{ GID_HOYLE5,         -1, 64937, -1,            "IconBar", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // clicking on any button in the icon bar
 	{ GID_HOYLE5,        300,   300,  0,                   "", "export 2",     sig_uninitread_hoyle5_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // after passing around cards in hearts
-	{ GID_HOYLE5,        400,   400,  1,            "GinHand", "calcRuns",                        NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // when starting Gin
-	{ GID_HOYLE5,        700,   700,  1,         "BridgeHand", "calcQTS",                         NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // when an opponent is playing in Bridge
-	{ GID_HOYLE5,        700,   710,  1, "BridgeStrategyPlay", "checkSplitTops",                  NULL,    10,    10, { WORKAROUND_FAKE,   0 } }, // when playing Bridge - bug #11167
-	{ GID_HOYLE5,        700,   730,  1,      "BridgeDefense", "beatTheirBest",                   NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // when playing Bridge - bug #11171
-	{ GID_HOYLE5,        700,    -1,  1,      "BridgeDefense", "makeContractMinusAce",            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when playing Bridge
-	{ GID_HOYLE5,        700,    -1,  1,      "BridgeDefense", "think",                           NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when an opponent is playing in Bridge, objects LeadSeat_NoTrump and others
-	{ GID_HOYLE5,        700,    -1,  1,               "Code", "doit",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when placing a bid in Bridge, objects c2_tree, other1_tree, compwe_tree - bugs #11168, #11169, #11170, #11183
+	{ GID_HOYLE5,        400,   400,  1,            "GinHand", "calcRuns",                     nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // when starting Gin
+	{ GID_HOYLE5,        700,   700,  1,         "BridgeHand", "calcQTS",                      nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // when an opponent is playing in Bridge
+	{ GID_HOYLE5,        700,   710,  1, "BridgeStrategyPlay", "checkSplitTops",               nullptr,    10,    10, { WORKAROUND_FAKE,   0 } }, // when playing Bridge - bug #11167
+	{ GID_HOYLE5,        700,   730,  1,      "BridgeDefense", "beatTheirBest",                nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // when playing Bridge - bug #11171
+	{ GID_HOYLE5,        700,    -1,  1,      "BridgeDefense", "makeContractMinusAce",         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when playing Bridge
+	{ GID_HOYLE5,        700,    -1,  1,      "BridgeDefense", "think",                        nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when an opponent is playing in Bridge, objects LeadSeat_NoTrump and others
+	{ GID_HOYLE5,        700,    -1,  1,               "Code", "doit",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when placing a bid in Bridge, objects c2_tree, other1_tree, compwe_tree - bugs #11168, #11169, #11170, #11183
 	{ GID_HOYLE5,        700,   753,  0,   "LeadSeat_NoTrump", "think",        sig_uninitread_hoyle5_5,     4,     6, { WORKAROUND_FAKE,   0 } }, // when playing Bridge
-	{ GID_HOYLE5,        700,  1115,  0,                 NULL, "select",                          NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when adjusting the attitude slider in Bridge - bug #11166
-	{ GID_HOYLE5,       1100,    18,  0,               "Tray", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when playing Poker
-	{ GID_HOYLE5,       1100,  1100,  0,         "anteButton", "handleEvent",                     NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when exiting Poker
-	{ GID_HOYLE5,       6029,  6029,  1,        "ControlIcon", "select",                          NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // Solitaire: when changing any slider in the Card Flip mini-game's options window
-	{ GID_HOYLE5,         -1,  6000,  1,              "sHand", "handleEvent",                     NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // Solitaire: when clicking on an empty card base in any game
+	{ GID_HOYLE5,        700,  1115,  0,              nullptr, "select",                       nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when adjusting the attitude slider in Bridge - bug #11166
+	{ GID_HOYLE5,       1100,    18,  0,               "Tray", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when playing Poker
+	{ GID_HOYLE5,       1100,  1100,  0,         "anteButton", "handleEvent",                  nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when exiting Poker
+	{ GID_HOYLE5,       6029,  6029,  1,        "ControlIcon", "select",                       nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // Solitaire: when changing any slider in the Card Flip mini-game's options window
+	{ GID_HOYLE5,         -1,  6000,  1,              "sHand", "handleEvent",                  nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // Solitaire: when clicking on an empty card base in any game
 	{ GID_HOYLE5,       6001,  6001,  0,         "roomScript", "changeState",  sig_uninitread_hoyle5_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // Solitaire: when starting Calculation
 	{ GID_HOYLE5,       6004,  6004,  0,         "roomScript", "changeState",  sig_uninitread_hoyle5_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // Solitaire: when starting Beleaguered Castle
 	{ GID_HOYLE5,       6004,  6004,  0, "beleaguered_castle", "init",         sig_uninitread_hoyle5_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // Solitaire: when starting Beleaguered Castle
@@ -441,171 +441,171 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
 	{ GID_HOYLE5,       6011,  6011,  0,         "roomScript", "changeState",  sig_uninitread_hoyle5_4,     0,     0, { WORKAROUND_FAKE,   0 } }, // Solitaire: when starting La Belle Lucie
 	{ GID_HOYLE5,       6002,  6002,  0,         "roomScript", "changeState",  sig_uninitread_hoyle5_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // Solitaire: when starting Strategy
 	{ GID_HOYLE5,       6002,  6002,  0,           "strategy", "init",         sig_uninitread_hoyle5_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // Solitaire: when starting Strategy
-	{ GID_ISLANDBRAIN,   100,   937,  0,            "IconBar", "dispatchEvent",                   NULL,    58,    58, { WORKAROUND_FAKE,   0 } }, // when using ENTER at the startup menu - bug #5241
-	{ GID_ISLANDBRAIN,   140,   140,  0,              "piece", "init",                            NULL,     3,     3, { WORKAROUND_FAKE,   1 } }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0
-	{ GID_ISLANDBRAIN,   180,   190,  0,               "word", "dispatchEvent",                   NULL,    14,    15, { WORKAROUND_FAKE,   0 } }, // holding down enter key during the word search puzzle, temps 14 and 15
-	{ GID_ISLANDBRAIN,   200,   268,  0,          "anElement", "select",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // elements puzzle, gets used before super TextIcon
+	{ GID_ISLANDBRAIN,   100,   937,  0,            "IconBar", "dispatchEvent",                nullptr,    58,    58, { WORKAROUND_FAKE,   0 } }, // when using ENTER at the startup menu - bug #5241
+	{ GID_ISLANDBRAIN,   140,   140,  0,              "piece", "init",                         nullptr,     3,     3, { WORKAROUND_FAKE,   1 } }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0
+	{ GID_ISLANDBRAIN,   180,   190,  0,               "word", "dispatchEvent",                nullptr,    14,    15, { WORKAROUND_FAKE,   0 } }, // holding down enter key during the word search puzzle, temps 14 and 15
+	{ GID_ISLANDBRAIN,   200,   268,  0,          "anElement", "select",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // elements puzzle, gets used before super TextIcon
 	{ GID_JONES,           1,   232,  0,        "weekendText", "draw",          sig_uninitread_jones_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // jones/cd only - gets called during the game
-	{ GID_JONES,           1,   255,  0,                   "", "export 0",                        NULL,    13,    14, { WORKAROUND_FAKE,   0 } }, // jones/cd only - called when a game ends, temps 13 and 14
-	{ GID_JONES,         764,   255,  0,                   "", "export 0",                        NULL,    13,    14, { WORKAROUND_FAKE,   0 } }, // jones/ega&vga only - called when the game starts, temps 13 and 14
+	{ GID_JONES,           1,   255,  0,                   "", "export 0",                     nullptr,    13,    14, { WORKAROUND_FAKE,   0 } }, // jones/cd only - called when a game ends, temps 13 and 14
+	{ GID_JONES,         764,   255,  0,                   "", "export 0",                     nullptr,    13,    14, { WORKAROUND_FAKE,   0 } }, // jones/ega&vga only - called when the game starts, temps 13 and 14
 	//{ GID_KQ5,            -1,     0,  0,                   "", "export 29",                       NULL,     3,     3, { WORKAROUND_FAKE,   0xf } }, // called when playing harp for the harpies or when aborting dialog in toy shop, is used for kDoAudio - bug #4961
 	// ^^ shouldn't be needed anymore, we got a script patch instead (kq5PatchCdHarpyVolume)
-	{ GID_KQ5,            25,    25,  0,              "rm025", "doit",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // inside witch forest, when going to the room where the walking rock is
-	{ GID_KQ5,            55,    55,  0,         "helpScript", "doit",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when giving the tambourine to the monster in the labyrinth (only happens at one of the locations) - bug #5198
-	{ GID_KQ5,            -1,   755,  0,              "gcWin", "open",                            NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when entering control menu in the FM-Towns version
-	{ GID_KQ6,            -1,    30,  0,               "rats", "changeState",                     NULL,     0,     5, { WORKAROUND_FAKE,   0 } }, // rats in the catacombs (temps 0-5, all temps!) - bugs #4958, #4998, #5017
-	{ GID_KQ6,           210,   210,  0,              "rm210", "scriptCheck",                     NULL,     0,     0, { WORKAROUND_FAKE,   1 } }, // using inventory in that room - bug #4953
-	{ GID_KQ6,           500,   500,  0,              "rm500", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // going to island of the beast
-	{ GID_KQ6,           520,   520,  0,              "rm520", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // going to boiling water trap on beast isle
-	{ GID_KQ6,           720,   720,  0,              "rm720", "warnUser",                        NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when guard opens guard-room door after waiting too long during wedding music
-	{ GID_KQ6,            -1,   903,  0,         "controlWin", "open",                            NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // when opening the controls window (save, load etc)
-	{ GID_KQ6,            -1,   907,  0,             "tomato", "doVerb",                          NULL,     2,     2, { WORKAROUND_FAKE,   0 } }, // when looking at the rotten tomato in the inventory - bug #5331
-	{ GID_KQ6,            -1,   921, -1,              "Print", "addEdit",                         NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when displaying the game debugger's teleport dialog
-	{ GID_KQ6,            -1,   928,  0,                 NULL, "startText",                       NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // gets caused by Text+Audio support (see script patcher)
-	{ GID_KQ7,            -1, 64996,  0,               "User", "handleEvent",                     NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // called when pushing a keyboard key
-	{ GID_KQ7,          2450,  2450,  0,           "exBridge", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // called when walking up to the throne in the cave in chapter 2
-	{ GID_KQ7,          2450,  2450,  0,       "maliciaComes", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when malicia appears at the southeast exit of the main chamber near the end of chapter 2
-	{ GID_KQ7,          5300,  5302,  0,          "putOnMask", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // in chapter 3, after using the mask on Valanice, click the jackalope hair in inventory - bug Trac#9759
-	{ GID_KQ7,          6060, 64964,  0,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // after entering the harp crystal in chapter 5
-	{ GID_KQ7,            -1, 64994, -1,               "Game", "restore",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring from ScummVM launcher in Mac version
-	{ GID_LAURABOW,       37,     0,  0,                "CB1", "doit",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when going up the stairs - bug #5084
-	{ GID_LAURABOW,       -1,   967,  0,             "myIcon", "cycle",                           NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // having any portrait conversation coming up - initial bug #4971
-	{ GID_LAURABOW2,      -1,    24,  0,              "gcWin", "open",                            NULL,     5,     5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
-	{ GID_LAURABOW2,      -1,    21,  0,      "dropCluesCode", "doit",                            NULL,     1,     1, { WORKAROUND_FAKE, 0x7fff } }, // when asking some questions (e.g. the reporter about the burglary, or the policeman about Ziggy). Must be big, as the game scripts perform lt on it and start deleting journal entries - bugs #4979, #5026
-	{ GID_LAURABOW2,      -1,    90,  1,        "MuseumActor", "init",                            NULL,     6,     6, { WORKAROUND_FAKE,   0 } }, // Random actors in museum - bug #5197
-	{ GID_LAURABOW2,     240,   240,  0,     "sSteveAnimates", "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Steve Dorian's idle animation at the docks - bug #5028
-	{ GID_LAURABOW2,      -1,   928,  0,                 NULL, "startText",                       NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // gets caused by Text+Audio support (see script patcher)
-	{ GID_LIGHTHOUSE,     -1,    17,  0,                 NULL, "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when operating the joystick in the puzzle to lower the bridge at the entrance to the workshop, or the joystick that moves the robotic arm in the mini-sub
-	{ GID_LONGBOW,        -1,     0,  0,            "Longbow", "restart",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // When canceling a restart game - bug #5244
-	{ GID_LONGBOW,        -1,   213,  0,              "clear", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // When giving an answer using the druid hand sign code in any room
+	{ GID_KQ5,            25,    25,  0,              "rm025", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // inside witch forest, when going to the room where the walking rock is
+	{ GID_KQ5,            55,    55,  0,         "helpScript", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when giving the tambourine to the monster in the labyrinth (only happens at one of the locations) - bug #5198
+	{ GID_KQ5,            -1,   755,  0,              "gcWin", "open",                         nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when entering control menu in the FM-Towns version
+	{ GID_KQ6,            -1,    30,  0,               "rats", "changeState",                  nullptr,     0,     5, { WORKAROUND_FAKE,   0 } }, // rats in the catacombs (temps 0-5, all temps!) - bugs #4958, #4998, #5017
+	{ GID_KQ6,           210,   210,  0,              "rm210", "scriptCheck",                  nullptr,     0,     0, { WORKAROUND_FAKE,   1 } }, // using inventory in that room - bug #4953
+	{ GID_KQ6,           500,   500,  0,              "rm500", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // going to island of the beast
+	{ GID_KQ6,           520,   520,  0,              "rm520", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // going to boiling water trap on beast isle
+	{ GID_KQ6,           720,   720,  0,              "rm720", "warnUser",                     nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when guard opens guard-room door after waiting too long during wedding music
+	{ GID_KQ6,            -1,   903,  0,         "controlWin", "open",                         nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // when opening the controls window (save, load etc)
+	{ GID_KQ6,            -1,   907,  0,             "tomato", "doVerb",                       nullptr,     2,     2, { WORKAROUND_FAKE,   0 } }, // when looking at the rotten tomato in the inventory - bug #5331
+	{ GID_KQ6,            -1,   921, -1,              "Print", "addEdit",                      nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when displaying the game debugger's teleport dialog
+	{ GID_KQ6,            -1,   928,  0,              nullptr, "startText",                    nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // gets caused by Text+Audio support (see script patcher)
+	{ GID_KQ7,            -1, 64996,  0,               "User", "handleEvent",                  nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // called when pushing a keyboard key
+	{ GID_KQ7,          2450,  2450,  0,           "exBridge", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // called when walking up to the throne in the cave in chapter 2
+	{ GID_KQ7,          2450,  2450,  0,       "maliciaComes", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when malicia appears at the southeast exit of the main chamber near the end of chapter 2
+	{ GID_KQ7,          5300,  5302,  0,          "putOnMask", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // in chapter 3, after using the mask on Valanice, click the jackalope hair in inventory - bug Trac#9759
+	{ GID_KQ7,          6060, 64964,  0,              "DPath", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // after entering the harp crystal in chapter 5
+	{ GID_KQ7,            -1, 64994, -1,               "Game", "restore",                      nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring from ScummVM launcher in Mac version
+	{ GID_LAURABOW,       37,     0,  0,                "CB1", "doit",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when going up the stairs - bug #5084
+	{ GID_LAURABOW,       -1,   967,  0,             "myIcon", "cycle",                        nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // having any portrait conversation coming up - initial bug #4971
+	{ GID_LAURABOW2,      -1,    24,  0,              "gcWin", "open",                         nullptr,     5,     5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
+	{ GID_LAURABOW2,      -1,    21,  0,      "dropCluesCode", "doit",                         nullptr,     1,     1, { WORKAROUND_FAKE, 0x7fff } }, // when asking some questions (e.g. the reporter about the burglary, or the policeman about Ziggy). Must be big, as the game scripts perform lt on it and start deleting journal entries - bugs #4979, #5026
+	{ GID_LAURABOW2,      -1,    90,  1,        "MuseumActor", "init",                         nullptr,     6,     6, { WORKAROUND_FAKE,   0 } }, // Random actors in museum - bug #5197
+	{ GID_LAURABOW2,     240,   240,  0,     "sSteveAnimates", "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Steve Dorian's idle animation at the docks - bug #5028
+	{ GID_LAURABOW2,      -1,   928,  0,              nullptr, "startText",                    nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // gets caused by Text+Audio support (see script patcher)
+	{ GID_LIGHTHOUSE,     -1,    17,  0,              nullptr, "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when operating the joystick in the puzzle to lower the bridge at the entrance to the workshop, or the joystick that moves the robotic arm in the mini-sub
+	{ GID_LONGBOW,        -1,     0,  0,            "Longbow", "restart",                      nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // When canceling a restart game - bug #5244
+	{ GID_LONGBOW,        -1,   213,  0,              "clear", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // When giving an answer using the druid hand sign code in any room
 	{ GID_LONGBOW,        -1,   213,  0,             "letter", "handleEvent", sig_uninitread_longbow_1,     1,     1, { WORKAROUND_FAKE,   0 } }, // When using the druid hand sign code in any room - bug #5035
-	{ GID_LSL1,          250,   250,  0,           "increase", "handleEvent",                     NULL,     2,     2, { WORKAROUND_FAKE,   0 } }, // casino, playing game, increasing bet
-	{ GID_LSL1,          720,   720,  0,              "rm720", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // age check room
-	{ GID_LSL2,           38,    38,  0,        "cloudScript", "changeState",                     NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // entering the room in the middle deck of the ship - bug #5034
-	{ GID_LSL3,          340,   340,  0,        "ComicScript", "changeState",                     NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // right after entering the 3 ethnic groups inside comedy club (temps 200, 201, 202, 203)
-	{ GID_LSL6,          820,    82,  0,                   "", "export 0",                        NULL,     0,   326, { WORKAROUND_FAKE,   0 } }, // when touching the electric fence (temp 193 for English release, temp 293 for French/German, temp 313 for Spanish - used for setting the loop of the death animation), it's not setting it for this death - bug #5103
-	{ GID_LSL6,           -1,    85,  0,          "washcloth", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // washcloth in inventory
-	{ GID_LSL6,           -1,   928, -1,           "Narrator", "startText",                       NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // used by various objects that are even translated in foreign versions, that's why we use the base-class
-	{ GID_LSL6HIRES,      -1,    85,  0,             "LL6Inv", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when creating a new game
-	{ GID_LSL6HIRES,      -1,    85,  0,          "washcloth", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when interacting with the wet washcloth in the inventory - Trac#9811
-	{ GID_LSL6HIRES,     820,    82,  0,                   "", "export 0",                        NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // when touching the electric fence - bug #10361
-	{ GID_LSL6HIRES,      -1, 64950,  1,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // at least when entering swimming pool area
-	{ GID_LSL6HIRES,      -1, 64964,  0,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // during the game
-	{ GID_LSL6HIRES,      -1, 64994, -1,               "Game", "save",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
-	{ GID_LSL6HIRES,      -1, 64994, -1,               "Game", "restore",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
-	{ GID_LSL7,           -1, 64029,  0,          "oMessager", "nextMsg",                         NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // when running the game with subtitles only
-	{ GID_LSL7,           -1, 64017,  0,             "oFlags", "clear",                           NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // demo version, when it starts, and whenever the player chooses to go to the "Strip Liar's Dice" mini game
-	{ GID_LSL7,           -1, 64017,  0,        "oActorFlags", "clear",                           NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // after an NPC walks off the left side of the screen at the Clothing Optional Pool
-	{ GID_LSL7,           -1, 64892,  0,      "oEventHandler", "killAllEventHogs",                NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when looking at the swordfish in the kitchen
-	{ GID_MOTHERGOOSE256, -1,     0,  0,                 "MG", "doit",                            NULL,     5,     5, { WORKAROUND_FAKE,   0 } }, // SCI1.1: When moving the cursor all the way to the left during the game - bug #5224
-	{ GID_MOTHERGOOSE256, -1,   992,  0,             "AIPath", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Happens in the demo and full version. In the demo, it happens when walking two screens from mother goose's house to the north. In the full version, it happens in rooms 7 and 23 - bug #5269
-	{ GID_MOTHERGOOSE256, 90,    90,  0,        "introScript", "changeState",                     NULL,    64,    65, { WORKAROUND_FAKE,   0 } }, // At the very end, after the game is completed and restarted (floppy: temp 64, CD: temp 65) - bug #5626
-	{ GID_MOTHERGOOSEHIRES,-1,64950, -1,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // right when clicking on a child at the start and probably also later
-	{ GID_MOTHERGOOSEHIRES,-1,64950, -1,               "View", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // see above
-	{ GID_PEPPER,         -1,   894,  0,            "Package", "doVerb",                          NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // using the hand on the book in the inventory - bug #5154
-	{ GID_PEPPER,        150,   928,  0,           "Narrator", "startText",                       NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // happens during the non-interactive demo of Pepper
-	{ GID_PEPPER,        260,   260,  0,            "glutton", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // using tomato on General Lee
-	{ GID_PHANTASMAGORIA, -1, 64921, -1,              "Print", "addEdit",                         NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to use the game debugger's flag setting command
-	{ GID_PQ4,            -1,    25,  0,         "iconToggle", "select",                          NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when toggling the icon bar to auto-hide or not
-	{ GID_PQ4,           170,   170, -1,        "hideAndSeek", "handleEvent",                     NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when clicking to move right while still moving left during the Emo shootout - bug #9847
-	{ GID_PQ4,           275, 64964, -1,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when Sherry walks out of the morgue on day 3
-	{ GID_PQ4,           240, 64964, -1,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when encountering Sherry and the reporter outside the morgue at the end of day 3
-	{ GID_PQ4,          2010,  2010, -1,         "enemyShip1", "cantBeHere",                      NULL,     7,     7, { WORKAROUND_FAKE,   0 } }, // when crashing into a UFO in the asteroids minigame in the Shortstop Bar
-	{ GID_PQ4,          2010,  2010, -1,         "enemyShip2", "cantBeHere",                      NULL,     7,     7, { WORKAROUND_FAKE,   0 } }, // when crashing into a UFO in the asteroids minigame in the Shortstop Bar
-	{ GID_PQ4,            -1, 64950, -1,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // floppy: when walking within room 395 (city hall, day 3)
-	{ GID_PQ4,            -1, 64994, -1,               "Game", "save",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
-	{ GID_PQ4,            -1,     0, -1,                "pq4", "restore",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
-	{ GID_PQSWAT,         -1, 64950,  0,                 NULL, "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Using any menus in-game
-	{ GID_PQSWAT,         -1,    73,  0,   "theLashInterface", "transmit",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Clicking the transmit button in LASH
-	{ GID_PQSWAT,       2990,  2990,  0,    "talkToSchienbly", "changeState",                     NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When the video of Schienbly talking for the first time ends
+	{ GID_LSL1,          250,   250,  0,           "increase", "handleEvent",                  nullptr,     2,     2, { WORKAROUND_FAKE,   0 } }, // casino, playing game, increasing bet
+	{ GID_LSL1,          720,   720,  0,              "rm720", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // age check room
+	{ GID_LSL2,           38,    38,  0,        "cloudScript", "changeState",                  nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // entering the room in the middle deck of the ship - bug #5034
+	{ GID_LSL3,          340,   340,  0,        "ComicScript", "changeState",                  nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // right after entering the 3 ethnic groups inside comedy club (temps 200, 201, 202, 203)
+	{ GID_LSL6,          820,    82,  0,                   "", "export 0",                     nullptr,     0,   326, { WORKAROUND_FAKE,   0 } }, // when touching the electric fence (temp 193 for English release, temp 293 for French/German, temp 313 for Spanish - used for setting the loop of the death animation), it's not setting it for this death - bug #5103
+	{ GID_LSL6,           -1,    85,  0,          "washcloth", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // washcloth in inventory
+	{ GID_LSL6,           -1,   928, -1,           "Narrator", "startText",                    nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // used by various objects that are even translated in foreign versions, that's why we use the base-class
+	{ GID_LSL6HIRES,      -1,    85,  0,             "LL6Inv", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when creating a new game
+	{ GID_LSL6HIRES,      -1,    85,  0,          "washcloth", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when interacting with the wet washcloth in the inventory - Trac#9811
+	{ GID_LSL6HIRES,     820,    82,  0,                   "", "export 0",                     nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // when touching the electric fence - bug #10361
+	{ GID_LSL6HIRES,      -1, 64950,  1,            "Feature", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // at least when entering swimming pool area
+	{ GID_LSL6HIRES,      -1, 64964,  0,              "DPath", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // during the game
+	{ GID_LSL6HIRES,      -1, 64994, -1,               "Game", "save",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
+	{ GID_LSL6HIRES,      -1, 64994, -1,               "Game", "restore",                      nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
+	{ GID_LSL7,           -1, 64029,  0,          "oMessager", "nextMsg",                      nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // when running the game with subtitles only
+	{ GID_LSL7,           -1, 64017,  0,             "oFlags", "clear",                        nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // demo version, when it starts, and whenever the player chooses to go to the "Strip Liar's Dice" mini game
+	{ GID_LSL7,           -1, 64017,  0,        "oActorFlags", "clear",                        nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // after an NPC walks off the left side of the screen at the Clothing Optional Pool
+	{ GID_LSL7,           -1, 64892,  0,      "oEventHandler", "killAllEventHogs",             nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when looking at the swordfish in the kitchen
+	{ GID_MOTHERGOOSE256, -1,     0,  0,                 "MG", "doit",                         nullptr,     5,     5, { WORKAROUND_FAKE,   0 } }, // SCI1.1: When moving the cursor all the way to the left during the game - bug #5224
+	{ GID_MOTHERGOOSE256, -1,   992,  0,             "AIPath", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Happens in the demo and full version. In the demo, it happens when walking two screens from mother goose's house to the north. In the full version, it happens in rooms 7 and 23 - bug #5269
+	{ GID_MOTHERGOOSE256, 90,    90,  0,        "introScript", "changeState",                  nullptr,    64,    65, { WORKAROUND_FAKE,   0 } }, // At the very end, after the game is completed and restarted (floppy: temp 64, CD: temp 65) - bug #5626
+	{ GID_MOTHERGOOSEHIRES,-1,64950, -1,            "Feature", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // right when clicking on a child at the start and probably also later
+	{ GID_MOTHERGOOSEHIRES,-1,64950, -1,               "View", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // see above
+	{ GID_PEPPER,         -1,   894,  0,            "Package", "doVerb",                       nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // using the hand on the book in the inventory - bug #5154
+	{ GID_PEPPER,        150,   928,  0,           "Narrator", "startText",                    nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // happens during the non-interactive demo of Pepper
+	{ GID_PEPPER,        260,   260,  0,            "glutton", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // using tomato on General Lee
+	{ GID_PHANTASMAGORIA, -1, 64921, -1,              "Print", "addEdit",                      nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to use the game debugger's flag setting command
+	{ GID_PQ4,            -1,    25,  0,         "iconToggle", "select",                       nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when toggling the icon bar to auto-hide or not
+	{ GID_PQ4,           170,   170, -1,        "hideAndSeek", "handleEvent",                  nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when clicking to move right while still moving left during the Emo shootout - bug #9847
+	{ GID_PQ4,           275, 64964, -1,              "DPath", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when Sherry walks out of the morgue on day 3
+	{ GID_PQ4,           240, 64964, -1,              "DPath", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when encountering Sherry and the reporter outside the morgue at the end of day 3
+	{ GID_PQ4,          2010,  2010, -1,         "enemyShip1", "cantBeHere",                   nullptr,     7,     7, { WORKAROUND_FAKE,   0 } }, // when crashing into a UFO in the asteroids minigame in the Shortstop Bar
+	{ GID_PQ4,          2010,  2010, -1,         "enemyShip2", "cantBeHere",                   nullptr,     7,     7, { WORKAROUND_FAKE,   0 } }, // when crashing into a UFO in the asteroids minigame in the Shortstop Bar
+	{ GID_PQ4,            -1, 64950, -1,            "Feature", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // floppy: when walking within room 395 (city hall, day 3)
+	{ GID_PQ4,            -1, 64994, -1,               "Game", "save",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
+	{ GID_PQ4,            -1,     0, -1,                "pq4", "restore",                      nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
+	{ GID_PQSWAT,         -1, 64950,  0,              nullptr, "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Using any menus in-game
+	{ GID_PQSWAT,         -1,    73,  0,   "theLashInterface", "transmit",                     nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Clicking the transmit button in LASH
+	{ GID_PQSWAT,       2990,  2990,  0,    "talkToSchienbly", "changeState",                  nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // When the video of Schienbly talking for the first time ends
 	{ GID_QFG1,           -1,   210,  0,          "Encounter", "init",           sig_uninitread_qfg1_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1/hq1: going to the brigands hideout
 	{ GID_QFG1VGA,        -1,   210,  0,          "Encounter", "init",        sig_uninitread_qfg1vga_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga: going to the brigands hideout - bug #5515
 	{ GID_QFG1VGA,        -1,   210,  0,          "Encounter", "init",        sig_uninitread_qfg1vga_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: going to the brigands hideout - bug #5515
-	{ GID_QFG1VGA,        58,    58,  0,               "rm58", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,  18 } }, // qfg1vga: casting "detect magic" at giant's cave, temp 0 used instead of spell number
-	{ GID_QFG1VGA,        96,    96,  0,                 NULL, "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: when yorick throws an object
-	{ GID_QFG1VGA,       320,   320,  0,                 NULL, "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: first time entering room 320 when centaur offers fruits and vegetables
-	{ GID_QFG2,           -1,    71,  0,        "theInvSheet", "doit",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // accessing the inventory
-	{ GID_QFG2,           -1,    79,  0,        "TryToMoveTo", "onTarget",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when throwing pot at air elemental, happens when client coordinates are the same as airElemental coordinates. happened to me right after room change - bug #6859
-	{ GID_QFG2,           -1,   701, -1,              "Alley", "at",                              NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when walking inside the alleys in the town - bug #5019 & #5106
-	{ GID_QFG2,           -1,   990,  0,            "Restore", "doit",                            NULL,   364,   364, { WORKAROUND_FAKE,   0 } }, // when pressing enter in restore dialog w/o any saved games present
+	{ GID_QFG1VGA,        58,    58,  0,               "rm58", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,  18 } }, // qfg1vga: casting "detect magic" at giant's cave, temp 0 used instead of spell number
+	{ GID_QFG1VGA,        96,    96,  0,              nullptr, "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: when yorick throws an object
+	{ GID_QFG1VGA,       320,   320,  0,              nullptr, "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: first time entering room 320 when centaur offers fruits and vegetables
+	{ GID_QFG2,           -1,    71,  0,        "theInvSheet", "doit",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // accessing the inventory
+	{ GID_QFG2,           -1,    79,  0,        "TryToMoveTo", "onTarget",                     nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when throwing pot at air elemental, happens when client coordinates are the same as airElemental coordinates. happened to me right after room change - bug #6859
+	{ GID_QFG2,           -1,   701, -1,              "Alley", "at",                           nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when walking inside the alleys in the town - bug #5019 & #5106
+	{ GID_QFG2,           -1,   990,  0,            "Restore", "doit",                         nullptr,   364,   364, { WORKAROUND_FAKE,   0 } }, // when pressing enter in restore dialog w/o any saved games present
 	{ GID_QFG2,          260,   260,  0,             "abdulS", "changeState",    sig_uninitread_qfg2_1,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // During the thief's first mission (in the house), just before Abdul is about to enter the house (where you have to hide in the wardrobe), bug #5153, temps 1 and 2
 	{ GID_QFG2,          260,   260,  0,            "jabbarS", "changeState",    sig_uninitread_qfg2_1,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // During the thief's first mission (in the house), just before Jabbar is about to enter the house (where you have to hide in the wardrobe), bug #5164, temps 1 and 2
-	{ GID_QFG2,          500,   500,  0,   "lightNextCandleS", "changeState",                     NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // Inside the last room, while Ad Avis performs the ritual to summon the genie - bug #5566
-	{ GID_QFG2,           -1,   700,  0,                 NULL, "showSign",                        NULL,    10,    10, { WORKAROUND_FAKE,   0 } }, // Occurs sometimes when reading a sign in Raseir, Shapeir et al - bugs #5627, #5635
-	{ GID_QFG3,          510,   510,  0,         "awardPrize", "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   1 } }, // Simbani warrior challenge, after throwing the spears and retrieving the ring - bug #5277. Must be non-zero, otherwise the prize is awarded twice - bug #6160
+	{ GID_QFG2,          500,   500,  0,   "lightNextCandleS", "changeState",                  nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // Inside the last room, while Ad Avis performs the ritual to summon the genie - bug #5566
+	{ GID_QFG2,           -1,   700,  0,              nullptr, "showSign",                     nullptr,    10,    10, { WORKAROUND_FAKE,   0 } }, // Occurs sometimes when reading a sign in Raseir, Shapeir et al - bugs #5627, #5635
+	{ GID_QFG3,          510,   510,  0,         "awardPrize", "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   1 } }, // Simbani warrior challenge, after throwing the spears and retrieving the ring - bug #5277. Must be non-zero, otherwise the prize is awarded twice - bug #6160
 	{ GID_QFG3,          140,   140,  0,              "rm140", "init",           sig_uninitread_qfg3_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // when importing a character and selecting the previous profession - bug #5163
-	{ GID_QFG3,          330,   330, -1,             "Teller", "doChild",                         NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when talking to King Rajah about "Rajah" (bug #5033, temp 1) or "Tarna" (temp 0), or when clicking on yourself and saying "Greet" (bug #5148, temp 1)
-	{ GID_QFG3,          700,   700, -1,      "monsterIsDead", "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // in the jungle, after winning any fight, bug #5169
-	{ GID_QFG3,          470,   470, -1,              "rm470", "notify",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // closing the character screen in the Simbani village in the room with the bridge, bug #5165
-	{ GID_QFG3,          470,   470, -1,     "<invalid name>", "notify",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // same as previous, with rm470::name used for temp storage by fan patches added by GOG
-	{ GID_QFG3,          490,   490, -1,      "computersMove", "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when finishing awari game, bug #5167
+	{ GID_QFG3,          330,   330, -1,             "Teller", "doChild",                      nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // when talking to King Rajah about "Rajah" (bug #5033, temp 1) or "Tarna" (temp 0), or when clicking on yourself and saying "Greet" (bug #5148, temp 1)
+	{ GID_QFG3,          700,   700, -1,      "monsterIsDead", "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // in the jungle, after winning any fight, bug #5169
+	{ GID_QFG3,          470,   470, -1,              "rm470", "notify",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // closing the character screen in the Simbani village in the room with the bridge, bug #5165
+	{ GID_QFG3,          470,   470, -1,     "<invalid name>", "notify",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // same as previous, with rm470::name used for temp storage by fan patches added by GOG
+	{ GID_QFG3,          490,   490, -1,      "computersMove", "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when finishing awari game, bug #5167
 	{ GID_QFG3,          490,   490, -1,      "computersMove", "changeState",    sig_uninitread_qfg3_2,     4,     4, { WORKAROUND_FAKE,   0 } }, // also when finishing awari game
-	{ GID_QFG3,           -1,    32, -1,            "ProjObj", "doit",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // near the end, when throwing the spear of death or sword, bugs #5282, #11477
-	{ GID_QFG3,           -1,   937, -1,            "IconBar", "dispatchEvent",                   NULL,    58,    58, { WORKAROUND_FAKE,   0 } }, // pressing the Enter key on the main menu screen, bug #13045 (affects multiple room numbers)
-	{ GID_QFG4,           -1,    15, -1,     "charInitScreen", "dispatchEvent",                   NULL,     5,     5, { WORKAROUND_FAKE,   0 } }, // floppy version, when viewing the character screen
-	{ GID_QFG4,           -1,    23, -1,     "tellerControls", "dispatchEvent",                   NULL,     6,     6, { WORKAROUND_FAKE,   0 } }, // floppy version, when using keyboard controls in the conversation interface
-	{ GID_QFG4,           -1,    50, -1,     "sSearchMonster", "changeState",                     NULL,     2,     2, { WORKAROUND_FAKE,   0 } }, // CD version, when searching a chernovy or revenant with speech disabled
-	{ GID_QFG4,           -1, 64917, -1,       "controlPlane", "setBitmap",                       NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // floppy version, when entering the game menu
-	{ GID_QFG4,           -1, 64917, -1,              "Plane", "setBitmap",                       NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // floppy version, happens sometimes in fight scenes
-	{ GID_QFG4,          380,    80, -1,           "myButton", "select",                          NULL,     2,     2, { WORKAROUND_FAKE,   1 } }, // CD version, when clicking on a puzzle piece for the keyhole scrambled picture puzzle
-	{ GID_QFG4,           -1, 64950, -1,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // CD version, at the lake, when meeting the Rusalka and attempting to leave, and after Ad Avis catches you, and finishes his monologue
-	{ GID_QFG4,           -1, 64964,  0,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // CD version, walking down to the monastery basement or entering the Gypsy Camp
-	{ GID_QFG4,           -1, 64950,  0,               "View", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // CD version, in the room with the spider pillar, when climbing on the pillar, or when using the Glide spell in the swamp
-	{ GID_RAMA,           -1, 64950, -1,                 NULL, "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // When clicking on the main game interface, or the main menu buttons, or mousing over things in the main game window
-	{ GID_RAMA,           -1, 64923, -1,              "Inset", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // When receiving a message on the pocket computer at the start of the game
-	{ GID_RAMA,          6107, 6107, -1,                 NULL, "doVerb",         sig_uninitread_rama_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // When pressing keys on the final console in the Avian Lair
+	{ GID_QFG3,           -1,    32, -1,            "ProjObj", "doit",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // near the end, when throwing the spear of death or sword, bugs #5282, #11477
+	{ GID_QFG3,           -1,   937, -1,            "IconBar", "dispatchEvent",                nullptr,    58,    58, { WORKAROUND_FAKE,   0 } }, // pressing the Enter key on the main menu screen, bug #13045 (affects multiple room numbers)
+	{ GID_QFG4,           -1,    15, -1,     "charInitScreen", "dispatchEvent",                nullptr,     5,     5, { WORKAROUND_FAKE,   0 } }, // floppy version, when viewing the character screen
+	{ GID_QFG4,           -1,    23, -1,     "tellerControls", "dispatchEvent",                nullptr,     6,     6, { WORKAROUND_FAKE,   0 } }, // floppy version, when using keyboard controls in the conversation interface
+	{ GID_QFG4,           -1,    50, -1,     "sSearchMonster", "changeState",                  nullptr,     2,     2, { WORKAROUND_FAKE,   0 } }, // CD version, when searching a chernovy or revenant with speech disabled
+	{ GID_QFG4,           -1, 64917, -1,       "controlPlane", "setBitmap",                    nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // floppy version, when entering the game menu
+	{ GID_QFG4,           -1, 64917, -1,              "Plane", "setBitmap",                    nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // floppy version, happens sometimes in fight scenes
+	{ GID_QFG4,          380,    80, -1,           "myButton", "select",                       nullptr,     2,     2, { WORKAROUND_FAKE,   1 } }, // CD version, when clicking on a puzzle piece for the keyhole scrambled picture puzzle
+	{ GID_QFG4,           -1, 64950, -1,            "Feature", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // CD version, at the lake, when meeting the Rusalka and attempting to leave, and after Ad Avis catches you, and finishes his monologue
+	{ GID_QFG4,           -1, 64964,  0,              "DPath", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // CD version, walking down to the monastery basement or entering the Gypsy Camp
+	{ GID_QFG4,           -1, 64950,  0,               "View", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // CD version, in the room with the spider pillar, when climbing on the pillar, or when using the Glide spell in the swamp
+	{ GID_RAMA,           -1, 64950, -1,              nullptr, "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // When clicking on the main game interface, or the main menu buttons, or mousing over things in the main game window
+	{ GID_RAMA,           -1, 64923, -1,              "Inset", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // When receiving a message on the pocket computer at the start of the game
+	{ GID_RAMA,          6107, 6107, -1,              nullptr, "doVerb",         sig_uninitread_rama_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // When pressing keys on the final console in the Avian Lair
 	{ GID_RAMA,          6110, 6110, -1,     "securityKeypad", "newRoom",        sig_uninitread_rama_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // When entering the correct key combination on the security console in the Avian Lair
-	{ GID_SHIVERS,        -1,   952,  0,       "SoundManager", "stop",                            NULL,     2,     2, { WORKAROUND_FAKE,   0 } }, // Just after Sierra logo
-	{ GID_SHIVERS,        -1, 64950,  0,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // When clicking on the locked door at the beginning
-	{ GID_SHIVERS,        -1, 64950,  0,               "View", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // When clicking on the gargoyle eye at the beginning
-	{ GID_SHIVERS,     20311, 64964,  0,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // Just after door puzzle is solved and the metal balls start to roll
-	{ GID_SHIVERS,     29260, 29260,  0,             "spMars", "handleEvent",                     NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // When clicking mars after seeing fortune to align earth etc...
-	{ GID_SHIVERS,     29260, 29260,  0,            "spVenus", "handleEvent",                     NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // When clicking venus after seeing fortune to align earth etc...
-	{ GID_SQ1,           103,   103,  0,               "hand", "internalEvent",                   NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // Spanish (and maybe early versions?) only: when moving cursor over input pad, temps 1 and 2
-	{ GID_SQ1,            -1,   703,  0,                   "", "export 1",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // sub that's called from several objects while on sarien battle cruiser
+	{ GID_SHIVERS,        -1,   952,  0,       "SoundManager", "stop",                         nullptr,     2,     2, { WORKAROUND_FAKE,   0 } }, // Just after Sierra logo
+	{ GID_SHIVERS,        -1, 64950,  0,            "Feature", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // When clicking on the locked door at the beginning
+	{ GID_SHIVERS,        -1, 64950,  0,               "View", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // When clicking on the gargoyle eye at the beginning
+	{ GID_SHIVERS,     20311, 64964,  0,              "DPath", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // Just after door puzzle is solved and the metal balls start to roll
+	{ GID_SHIVERS,     29260, 29260,  0,             "spMars", "handleEvent",                  nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // When clicking mars after seeing fortune to align earth etc...
+	{ GID_SHIVERS,     29260, 29260,  0,            "spVenus", "handleEvent",                  nullptr,     4,     4, { WORKAROUND_FAKE,   0 } }, // When clicking venus after seeing fortune to align earth etc...
+	{ GID_SQ1,           103,   103,  0,               "hand", "internalEvent",                nullptr,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // Spanish (and maybe early versions?) only: when moving cursor over input pad, temps 1 and 2
+	{ GID_SQ1,            -1,   703,  0,                   "", "export 1",                     nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // sub that's called from several objects while on sarien battle cruiser
 	{ GID_SQ1,            -1,   703,  0,         "firePulsar", "changeState",     sig_uninitread_sq1_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // export 1, but called locally (when shooting at aliens)
 	{ GID_SQ1,            -1,   703,  0,      "DeltaurRegion", "init",            sig_uninitread_sq1_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // export 1, but called locally (when teleporting to a deltaur room)
-	{ GID_SQ4,            -1,   398,  0,            "showBox", "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // CD: called when rummaging in Software Excess bargain bin
-	{ GID_SQ4,            -1,   928, -1,           "Narrator", "startText",                       NULL,  1000,  1000, { WORKAROUND_FAKE,   1 } }, // CD: happens in the options dialog and in-game when speech and subtitles are used simultaneously
-	{ GID_SQ4,           395,   395, -1,    "fromStoreScript", "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // CD: happens when shoplifting in Galaxy Galleria - bug #10229
-	{ GID_SQ4,            -1,   708, -1,            "exitBut", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "close" button in the sq4 hintbook - bug #6447
-	{ GID_SQ4,            -1,   708, -1,                   "", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "close" button... in Russian version - bug #5573
-	{ GID_SQ4,            -1,   708, -1,            "prevBut", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "previous" button in the sq4 hintbook - bug #6447
-	{ GID_SQ4,            -1,   708, -1, "\xA8\xE6\xE3 \xAD\xA0\xA7\xA0\xA4.", "doVerb",          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "previous" button... in Russian version - bug #5573
-	{ GID_SQ4,            -1,   708, -1,            "nextBut", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "next" button in the sq4 hintbook - bug #6447
-	{ GID_SQ4,            -1,   708, -1,                  ".", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "next" button... in Russian version - bug #5573
-	{ GID_SQ5,           201,   201,  0,        "buttonPanel", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   1 } }, // when looking at the orange or red button - bug #5112
-	{ GID_SQ6,            -1,     0,  0,                "SQ6", "init",                            NULL,     2,     2, { WORKAROUND_FAKE,   0 } }, // Demo and full version: called when the game starts (demo: room 0, full: room 100)
-	{ GID_SQ6,            -1, 64950, -1,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // called when pressing "Start game" in the main menu, when entering the Orion's Belt bar (room 300), and perhaps other places
-	{ GID_SQ6,            -1, 64964,  0,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // during the game
-	{ GID_SQ6,           210,   210,  0,       "buttonSecret", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // after winning the first round of stooge fighter 3
-	{ GID_SQ6,            -1, 64994, -1,               "Game", "restore",                         NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to load an invalid save game from the launcher
-	{ GID_SQ6,            -1, 64921, -1,              "Print", "addEdit",                         NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to use the game debugger's flag setting command
-	{ GID_SQ6,           105,   105, -1,    "doRestoreScript", "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring from main menu in Mac version
-	{ GID_SQ6,            -1, 64994, -1,               "Game", "save",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
-	{ GID_SQ6,            -1, 64994, -1,               "Game", "restore",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
-	{ GID_TORIN,          -1, 64017,  0,             "oFlags", "clear",                           NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // entering Torin's home in the French version
-	{ GID_TORIN,          -1, 64029,  0,          "oMessager", "nextMsg",                         NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // start of chapter one, or when running with subtitles only
-	{ GID_TORIN,          -1, 64892,  0,      "oEventHandler", "killAllEventHogs",                NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when pressing the hint button when the game is about to transition to a new room (race condition) - Trac#9810
-	{ GID_TORIN,       20100, 64964,  0,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // going down the cliff at the first screen of chapter 2 (washing area)
-	{ GID_TORIN,       61100, 64888,  0,              "Torin", "autorestore",                     NULL,    11,    11, { WORKAROUND_FAKE,   0 } }, // after attempting to restore a save game saved with the wrong game version
+	{ GID_SQ4,            -1,   398,  0,            "showBox", "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // CD: called when rummaging in Software Excess bargain bin
+	{ GID_SQ4,            -1,   928, -1,           "Narrator", "startText",                    nullptr,  1000,  1000, { WORKAROUND_FAKE,   1 } }, // CD: happens in the options dialog and in-game when speech and subtitles are used simultaneously
+	{ GID_SQ4,           395,   395, -1,    "fromStoreScript", "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // CD: happens when shoplifting in Galaxy Galleria - bug #10229
+	{ GID_SQ4,            -1,   708, -1,            "exitBut", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "close" button in the sq4 hintbook - bug #6447
+	{ GID_SQ4,            -1,   708, -1,                   "", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "close" button... in Russian version - bug #5573
+	{ GID_SQ4,            -1,   708, -1,            "prevBut", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "previous" button in the sq4 hintbook - bug #6447
+	{ GID_SQ4,            -1,   708, -1, "\xA8\xE6\xE3 \xAD\xA0\xA7\xA0\xA4.", "doVerb",          nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "previous" button... in Russian version - bug #5573
+	{ GID_SQ4,            -1,   708, -1,            "nextBut", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "next" button in the sq4 hintbook - bug #6447
+	{ GID_SQ4,            -1,   708, -1,                  ".", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // Floppy: happens, when looking at the "next" button... in Russian version - bug #5573
+	{ GID_SQ5,           201,   201,  0,        "buttonPanel", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   1 } }, // when looking at the orange or red button - bug #5112
+	{ GID_SQ6,            -1,     0,  0,                "SQ6", "init",                         nullptr,     2,     2, { WORKAROUND_FAKE,   0 } }, // Demo and full version: called when the game starts (demo: room 0, full: room 100)
+	{ GID_SQ6,            -1, 64950, -1,            "Feature", "handleEvent",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // called when pressing "Start game" in the main menu, when entering the Orion's Belt bar (room 300), and perhaps other places
+	{ GID_SQ6,            -1, 64964,  0,              "DPath", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // during the game
+	{ GID_SQ6,           210,   210,  0,       "buttonSecret", "doVerb",                       nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // after winning the first round of stooge fighter 3
+	{ GID_SQ6,            -1, 64994, -1,               "Game", "restore",                      nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to load an invalid save game from the launcher
+	{ GID_SQ6,            -1, 64921, -1,              "Print", "addEdit",                      nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to use the game debugger's flag setting command
+	{ GID_SQ6,           105,   105, -1,    "doRestoreScript", "changeState",                  nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring from main menu in Mac version
+	{ GID_SQ6,            -1, 64994, -1,               "Game", "save",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
+	{ GID_SQ6,            -1, 64994, -1,               "Game", "restore",                      nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
+	{ GID_TORIN,          -1, 64017,  0,             "oFlags", "clear",                        nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // entering Torin's home in the French version
+	{ GID_TORIN,          -1, 64029,  0,          "oMessager", "nextMsg",                      nullptr,     3,     3, { WORKAROUND_FAKE,   0 } }, // start of chapter one, or when running with subtitles only
+	{ GID_TORIN,          -1, 64892,  0,      "oEventHandler", "killAllEventHogs",             nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // when pressing the hint button when the game is about to transition to a new room (race condition) - Trac#9810
+	{ GID_TORIN,       20100, 64964,  0,              "DPath", "init",                         nullptr,     1,     1, { WORKAROUND_FAKE,   0 } }, // going down the cliff at the first screen of chapter 2 (washing area)
+	{ GID_TORIN,       61100, 64888,  0,              "Torin", "autorestore",                  nullptr,    11,    11, { WORKAROUND_FAKE,   0 } }, // after attempting to restore a save game saved with the wrong game version
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kAbs_workarounds[] = {
-	{ GID_HOYLE1,          1,     1,  0,              "room1", "doit",                      NULL,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // crazy eights - called with objects instead of integers
-	{ GID_HOYLE1,          2,     2,  0,              "room2", "doit",                      NULL,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // old maid - called with objects instead of integers
-	{ GID_HOYLE1,          3,     3,  0,              "room3", "doit",                      NULL,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // hearts - called with objects instead of integers
-	{ GID_QFG1VGA,        -1,    -1,  0,                 NULL, "doit",                      NULL,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // when the game is patched with the NRS patch
-	{ GID_QFG3   ,        -1,    -1,  0,                 NULL, "doit",                      NULL,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // when the game is patched with the NRS patch - bugs #6042, #6043
+	{ GID_HOYLE1,          1,     1,  0,              "room1", "doit",                   nullptr,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // crazy eights - called with objects instead of integers
+	{ GID_HOYLE1,          2,     2,  0,              "room2", "doit",                   nullptr,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // old maid - called with objects instead of integers
+	{ GID_HOYLE1,          3,     3,  0,              "room3", "doit",                   nullptr,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // hearts - called with objects instead of integers
+	{ GID_QFG1VGA,        -1,    -1,  0,              nullptr, "doit",                   nullptr,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // when the game is patched with the NRS patch
+	{ GID_QFG3   ,        -1,    -1,  0,              nullptr, "doit",                   nullptr,     0,     0, { WORKAROUND_FAKE,  0x3e9 } }, // when the game is patched with the NRS patch - bugs #6042, #6043
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kArraySetElements_workarounds[] = {
-	{ GID_GK1,           302, 64918,  0,                "Str", "callKernel",                NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // when erasing a letter on the wall in St Louis Cemetery
-	{ GID_PHANTASMAGORIA, -1, 64918,  0,                "Str", "callKernel",                NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // when starting a new game and selecting a chapter above 1, or when quitting the chase (in every chase room), or when completing chase successfully
+	{ GID_GK1,           302, 64918,  0,                "Str", "callKernel",             nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // when erasing a letter on the wall in St Louis Cemetery
+	{ GID_PHANTASMAGORIA, -1, 64918,  0,                "Str", "callKernel",             nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // when starting a new game and selecting a chapter above 1, or when quitting the chase (in every chase room), or when completing chase successfully
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -614,41 +614,41 @@ const SciWorkaroundEntry kArrayFill_workarounds[] = {
 	// Phantasmagoria Mac calls kArrayFill to zero-initialize new string buffers, but almost
 	//  half of these calls are missing the start-index parameter and so they had no effect.
 	//  Our SCI strings are already zero-initialized and so these calls can be ignored.
-	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "init",                      NULL,     0,     0, { WORKAROUND_IGNORE, 0 } },
-	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "save",                      NULL,     0,     0, { WORKAROUND_IGNORE, 0 } },
-	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "getSaveType",               NULL,     0,     0, { WORKAROUND_IGNORE, 0 } },
-	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "testFlag",                  NULL,     0,     0, { WORKAROUND_IGNORE, 0 } },
-	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "delete",                    NULL,     0,     0, { WORKAROUND_IGNORE, 0 } },
-	{ GID_PHANTASMAGORIA, -1,    90,  0,           "logoRoom", "init",                      NULL,     0,     0, { WORKAROUND_IGNORE, 0 } },
-	{ GID_PHANTASMAGORIA, -1, 45950,  0,            "rm45950", "init",                      NULL,     0,     0, { WORKAROUND_IGNORE, 0 } },
-	{ GID_PQ4,           540, 64918,  0,                "Str", "callKernel",                NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when clicking on Hate Crimes in the computer on day 2
+	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "init",                   nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } },
+	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "save",                   nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } },
+	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "getSaveType",            nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } },
+	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "testFlag",               nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } },
+	{ GID_PHANTASMAGORIA, -1,    38,  0,        "SaveManager", "delete",                 nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } },
+	{ GID_PHANTASMAGORIA, -1,    90,  0,           "logoRoom", "init",                   nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } },
+	{ GID_PHANTASMAGORIA, -1, 45950,  0,            "rm45950", "init",                   nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } },
+	{ GID_PQ4,           540, 64918,  0,                "Str", "callKernel",             nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when clicking on Hate Crimes in the computer on day 2
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kCelHigh_workarounds[] = {
-	{ GID_KQ5,            -1,   255,  0,          "deathIcon", "setSize",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #5049
-	{ GID_PQ2,            -1,   255,  0,              "DIcon", "setSize",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
-	{ GID_SQ1,             1,   255,  0,              "DIcon", "setSize",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #5012
-	{ GID_FANMADE,        -1,   979,  0,              "DIcon", "setSize",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #5144
+	{ GID_KQ5,            -1,   255,  0,          "deathIcon", "setSize",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #5049
+	{ GID_PQ2,            -1,   255,  0,              "DIcon", "setSize",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
+	{ GID_SQ1,             1,   255,  0,              "DIcon", "setSize",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #5012
+	{ GID_FANMADE,        -1,   979,  0,              "DIcon", "setSize",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #5144
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kCelWide_workarounds[] = {
-	{ GID_KQ5,            -1,   255,  0,          "deathIcon", "setSize",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #5049
-	{ GID_PQ2,            -1,   255,  0,              "DIcon", "setSize",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
-	{ GID_SQ1,             1,   255,  0,              "DIcon", "setSize",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #5012
-	{ GID_FANMADE,        -1,   979,  0,              "DIcon", "setSize",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #5144
-	{ GID_LSL6HIRES,      -1,    94,  0,    "ll6ControlPanel",    "init",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when opening the "controls" panel from the main menu, the third argument is missing
+	{ GID_KQ5,            -1,   255,  0,          "deathIcon", "setSize",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #5049
+	{ GID_PQ2,            -1,   255,  0,              "DIcon", "setSize",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
+	{ GID_SQ1,             1,   255,  0,              "DIcon", "setSize",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #5012
+	{ GID_FANMADE,        -1,   979,  0,              "DIcon", "setSize",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #5144
+	{ GID_LSL6HIRES,      -1,    94,  0,    "ll6ControlPanel",    "init",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when opening the "controls" panel from the main menu, the third argument is missing
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kDeleteKey_workarounds[] = {
-	{ GID_HOYLE4,        300,   999,  0,     "handleEventList", "delete",                   NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // restarting hearts, while tray is shown - bug #6604
-	{ GID_HOYLE4,        500,   999,  0,     "handleEventList", "delete",                   NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // restarting cribbage, while tray is shown - bug #6604
-	{ GID_HOYLE4,        975,   999,  0,     "handleEventList", "delete",                   NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // going back to gamelist from hearts/cribbage, while tray is shown - bug #6604
+	{ GID_HOYLE4,        300,   999,  0,     "handleEventList", "delete",                nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // restarting hearts, while tray is shown - bug #6604
+	{ GID_HOYLE4,        500,   999,  0,     "handleEventList", "delete",                nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // restarting cribbage, while tray is shown - bug #6604
+	{ GID_HOYLE4,        975,   999,  0,     "handleEventList", "delete",                nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // going back to gamelist from hearts/cribbage, while tray is shown - bug #6604
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -716,87 +716,87 @@ static const uint16 sig_kDisplay_sq4_1[] = {
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kDisplay_workarounds[] = {
-	{ GID_ISLANDBRAIN,   300,   300,  0,           "geneDude", "show",                       NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when looking at the gene explanation chart - a parameter is an object
-	{ GID_LONGBOW,        95,    95,  0,          "countDown", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during title screen "Robin Hood! Your bow is needed"
-	{ GID_LONGBOW,       220,   220,  0,             "moveOn", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during second room "Outwit and outfight..."
-	{ GID_LONGBOW,       210,   210,  0,               "mama", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during third room "Fall under the spell..."
-	{ GID_LONGBOW,       320,   320,  0,              "flyin", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during fourth room "Conspiracies, love..."
+	{ GID_ISLANDBRAIN,   300,   300,  0,           "geneDude", "show",                    nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when looking at the gene explanation chart - a parameter is an object
+	{ GID_LONGBOW,        95,    95,  0,          "countDown", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during title screen "Robin Hood! Your bow is needed"
+	{ GID_LONGBOW,       220,   220,  0,             "moveOn", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during second room "Outwit and outfight..."
+	{ GID_LONGBOW,       210,   210,  0,               "mama", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during third room "Fall under the spell..."
+	{ GID_LONGBOW,       320,   320,  0,              "flyin", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during fourth room "Conspiracies, love..."
 	{ GID_PQ2,            23,    23,  0,         "rm23Script", "elements",     sig_kDisplay_pq2_1,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when looking at the 2nd page of files in jail - 0x75 as id - bug #5223
 	{ GID_PQ2,            23,    23,  0,         "rm23Script", "handleEvent",  sig_kDisplay_pq2_1,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when looking at the 2nd page of file in jail - 0x75 as id - bug #9670
-	{ GID_QFG1,           11,    11,  0,             "battle", "init",                       NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: When entering battle, 0x75 as id
-	{ GID_SQ3,             1,     1,  0,              "rm001", "handleEvent",                NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // MAC: during intro when pressing enter - a parameter is an object
-	{ GID_SQ4,           397,     0,  0,                   "", "export 12",                  NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // FLOPPY: when going into the computer store - bug #5227
+	{ GID_QFG1,           11,    11,  0,             "battle", "init",                    nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: When entering battle, 0x75 as id
+	{ GID_SQ3,             1,     1,  0,              "rm001", "handleEvent",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // MAC: during intro when pressing enter - a parameter is an object
+	{ GID_SQ4,           397,     0,  0,                   "", "export 12",               nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // FLOPPY: when going into the computer store - bug #5227
 	{ GID_SQ4,           391,   391,  0,          "doCatalog", "changeState",  sig_kDisplay_sq4_1,     0,     0, { WORKAROUND_IGNORE,    0 } }, // CD: clicking on catalog in roboter sale - a parameter is an object
-	{ GID_SQ4,           391,   391,  0,         "choosePlug", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // CD: ordering connector in roboter sale - a parameter is an object
+	{ GID_SQ4,           391,   391,  0,         "choosePlug", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // CD: ordering connector in roboter sale - a parameter is an object
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kDirLoop_workarounds[] = {
-	{ GID_KQ4,             4,   992,  0,              "Avoid", "doit",                      NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when the ogre catches you in front of his house, second parameter points to the same object as the first parameter, instead of being an integer (the angle) - bug #5217
+	{ GID_KQ4,             4,   992,  0,              "Avoid", "doit",                   nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when the ogre catches you in front of his house, second parameter points to the same object as the first parameter, instead of being an integer (the angle) - bug #5217
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kDisposeScript_workarounds[] = {
-	{ GID_LAURABOW,      777,   777,  0,             "myStab", "changeState",               NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: after the will is signed, parameter 0 is an object - bug #4967
-	{ GID_LSL2,           -1,    54,  0,               "rm54", "dispose",                   NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // Amiga: room 55, script tries to kDisposeScript an object (does not happen for DOS) - bug #6818
-	{ GID_MOTHERGOOSEHIRES,37,  337,  0,        "rhymeScript", "changeState",               NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // after the rhyme with the king
-	{ GID_QFG1,           -1,    64,  0,               "rm64", "dispose",                   NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when leaving graveyard, parameter 0 is an object
-	{ GID_SQ4,            -1,   151,  0,        "fightScript", "dispose",                   NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // during fight with Vohaul, parameter 0 is an object, happens in at least room 150
-	{ GID_SQ4,            -1,   152,  0,       "driveCloseUp", "dispose",                   NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when choosing "beam download", parameter 0 is an object, may happen in room 150 and 900 (900 see bug #9812)
-	{ GID_SQ4,           150,   152,  0,                   "", "dispose",                   NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when choosing "beam download"... in Russian version - bug #5573
-	{ GID_SQ4,           900,   152,  0,                   "", "dispose",                   NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // same as above, but for "game over" room
+	{ GID_LAURABOW,      777,   777,  0,             "myStab", "changeState",            nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: after the will is signed, parameter 0 is an object - bug #4967
+	{ GID_LSL2,           -1,    54,  0,               "rm54", "dispose",                nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // Amiga: room 55, script tries to kDisposeScript an object (does not happen for DOS) - bug #6818
+	{ GID_MOTHERGOOSEHIRES,37,  337,  0,        "rhymeScript", "changeState",            nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // after the rhyme with the king
+	{ GID_QFG1,           -1,    64,  0,               "rm64", "dispose",                nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when leaving graveyard, parameter 0 is an object
+	{ GID_SQ4,            -1,   151,  0,        "fightScript", "dispose",                nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // during fight with Vohaul, parameter 0 is an object, happens in at least room 150
+	{ GID_SQ4,            -1,   152,  0,       "driveCloseUp", "dispose",                nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when choosing "beam download", parameter 0 is an object, may happen in room 150 and 900 (900 see bug #9812)
+	{ GID_SQ4,           150,   152,  0,                   "", "dispose",                nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when choosing "beam download"... in Russian version - bug #5573
+	{ GID_SQ4,           900,   152,  0,                   "", "dispose",                nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // same as above, but for "game over" room
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kDoAudioResume_workarounds[] = {
-	{ GID_HOYLE5,         -1,    17,  0,                 NULL, "startAudio",                NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when a character talks during a game
+	{ GID_HOYLE5,         -1,    17,  0,              nullptr, "startAudio",             nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when a character talks during a game
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kDoSoundPlay_workarounds[] = {
-	{ GID_LSL6HIRES,    -1,  64989,   0,          NULL,          "play",                    NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
-	{ GID_QFG4,         -1,  64989,   0,          NULL,          "play",                    NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
-	{ GID_PQ4,          -1,  64989,   0,          NULL,          "play",                    NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
-	{ GID_KQ7,          -1,  64989,   0,          NULL,          "play",                    NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
-	{ GID_SQ6,          -1,      0,   0,          NULL,          "play",                    NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Demo passes an extra null argument on startup
-	{ GID_GK1,          -1,  64989,   0,          NULL,          "play",                    NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Mac version always passes an extra null argument
-	{ GID_GK2,          -1,  64989,   0,          NULL,          "play",                    NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Demo passes an extra null argument when clicking on buttons
+	{ GID_LSL6HIRES,    -1,  64989,   0,          nullptr,          "play",                 nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
+	{ GID_QFG4,         -1,  64989,   0,          nullptr,          "play",                 nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
+	{ GID_PQ4,          -1,  64989,   0,          nullptr,          "play",                 nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
+	{ GID_KQ7,          -1,  64989,   0,          nullptr,          "play",                 nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
+	{ GID_SQ6,          -1,      0,   0,          nullptr,          "play",                 nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Demo passes an extra null argument on startup
+	{ GID_GK1,          -1,  64989,   0,          nullptr,          "play",                 nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Mac version always passes an extra null argument
+	{ GID_GK2,          -1,  64989,   0,          nullptr,          "play",                 nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Demo passes an extra null argument when clicking on buttons
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kDoSoundFade_workarounds[] = {
-	{ GID_KQ5,           213,   989,  0,       "globalSound3", "fade",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when bandits leave the secret temple, parameter 4 is an object - bug #5078
-	{ GID_KQ6,           105,   989,  0,        "globalSound", "fade",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // floppy: during intro, parameter 4 is an object
-	{ GID_KQ6,           460,   989,  0,       "globalSound2", "fade",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // after pulling the black widow's web on the isle of wonder, parameter 4 is an object - bug #4954
-	{ GID_QFG4,           -1, 64989,  1,          "GlorySong", "fade",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // CD version: many places, parameter 4 is an object (the sound object itself)
-	{ GID_SQ5,           800,   989,  0,          "sq5Music1", "fade",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when cutting the wrong part of Goliath with the laser - bug #6341
+	{ GID_KQ5,           213,   989,  0,       "globalSound3", "fade",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when bandits leave the secret temple, parameter 4 is an object - bug #5078
+	{ GID_KQ6,           105,   989,  0,        "globalSound", "fade",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // floppy: during intro, parameter 4 is an object
+	{ GID_KQ6,           460,   989,  0,       "globalSound2", "fade",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // after pulling the black widow's web on the isle of wonder, parameter 4 is an object - bug #4954
+	{ GID_QFG4,           -1, 64989,  1,          "GlorySong", "fade",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // CD version: many places, parameter 4 is an object (the sound object itself)
+	{ GID_SQ5,           800,   989,  0,          "sq5Music1", "fade",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when cutting the wrong part of Goliath with the laser - bug #6341
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGetAngle_workarounds[] = {
-	{ GID_FANMADE,       516,   992,  0,             "Motion", "init",                      NULL,     0,     0, { WORKAROUND_FAKE,      0 } }, // The Legend of the Lost Jewel Demo (fan made): called with third/fourth parameters as objects
-	{ GID_KQ6,            -1,   752,  0,        "throwDazzle", "changeState",               NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // room 740/790 after the Genie is exposed in the Palace (short and long ending), it starts shooting lightning bolts around. An extra 5th parameter is passed - bug #4959 & #5203
-	{ GID_SQ1,            -1,   927,  0,           "PAvoider", "doit",                      NULL,     0,     0, { WORKAROUND_FAKE,      0 } }, // all rooms in Ulence Flats after getting the Pilot Droid: called with a single parameter when the droid is in Roger's path - bug #6016
+	{ GID_FANMADE,       516,   992,  0,             "Motion", "init",                   nullptr,     0,     0, { WORKAROUND_FAKE,      0 } }, // The Legend of the Lost Jewel Demo (fan made): called with third/fourth parameters as objects
+	{ GID_KQ6,            -1,   752,  0,        "throwDazzle", "changeState",            nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // room 740/790 after the Genie is exposed in the Palace (short and long ending), it starts shooting lightning bolts around. An extra 5th parameter is passed - bug #4959 & #5203
+	{ GID_SQ1,            -1,   927,  0,           "PAvoider", "doit",                   nullptr,     0,     0, { WORKAROUND_FAKE,      0 } }, // all rooms in Ulence Flats after getting the Pilot Droid: called with a single parameter when the droid is in Roger's path - bug #6016
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGetCWD_workarounds[] = {
-	{ GID_LSL6,           -1,     0,  0,               "LSL6", "play",                      NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // Mac version passes uninitialized global (zero) on startup, then immediately overwrites it with kGetSaveDir
+	{ GID_LSL6,           -1,     0,  0,               "LSL6", "play",                   nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // Mac version passes uninitialized global (zero) on startup, then immediately overwrites it with kGetSaveDir
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kFileIOOpen_workarounds[] = {
-	{ GID_HOYLE5,         -1, 64990,  0,            "Restore", "doit",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when checking for bridgesg.cat or poker.cat when showing restore dialog
-	{ GID_TORIN,       61000, 61000,  0,       "roSierraLogo", "init",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when the game checks for autosave.cat after the Sierra logo
-	{ GID_TORIN,       61100, 61100,  0,     "roPickAChapter", "init",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when the game checks for autosave.cat after the Sierra logo in the demo
+	{ GID_HOYLE5,         -1, 64990,  0,            "Restore", "doit",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when checking for bridgesg.cat or poker.cat when showing restore dialog
+	{ GID_TORIN,       61000, 61000,  0,       "roSierraLogo", "init",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when the game checks for autosave.cat after the Sierra logo
+	{ GID_TORIN,       61100, 61100,  0,     "roPickAChapter", "init",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when the game checks for autosave.cat after the Sierra logo in the demo
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -822,36 +822,36 @@ const SciWorkaroundEntry kFileIOCheckFreeSpace_workarounds[] = {
 
 //    gameID,           room,script,lvl,          object-name, method-name,              local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kFileIOReadString_workarounds[] = {
-	{ GID_HOYLE5,         -1, 64993,  0,           "version", "readString",                 NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // Zero passed as string when game initializes and VERSION file is present, which only Mac includes. Result is unused
+	{ GID_HOYLE5,         -1, 64993,  0,           "version", "readString",              nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // Zero passed as string when game initializes and VERSION file is present, which only Mac includes. Result is unused
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kFindKey_workarounds[] = {
-	{ GID_ECOQUEST2,     100,   999,  0,            "myList", "contains",                   NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // When Noah Greene gives Adam the Ecorder, and just before the game gives a demonstration, a null reference to a list is passed - bug #4987
-	{ GID_HOYLE4,        300,   999,  0,             "Piles", "contains",                   NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // When passing the three cards in Hearts, a null reference to a list is passed - bug #5664
+	{ GID_ECOQUEST2,     100,   999,  0,            "myList", "contains",                nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // When Noah Greene gives Adam the Ecorder, and just before the game gives a demonstration, a null reference to a list is passed - bug #4987
+	{ GID_HOYLE4,        300,   999,  0,             "Piles", "contains",                nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // When passing the three cards in Hearts, a null reference to a list is passed - bug #5664
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kFrameOut_workarounds[] = {
-	{ GID_PQ4,           360,   360,  0,       "csFrontInset", "init",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When clicking hand on the impounded white car on day 4 - bug #9848
-	{ GID_PQ4,           360,   360,  0,       "csFrontInset", "dispose",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When clicking hand on the impounded white car on day 4
-	{ GID_PQ4,           360,   360,  0,        "copCarInset", "init",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When clicking hand on the impounded police car on day 3
-	{ GID_PQ4,           360,   360,  0,        "copCarInset", "dispose",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the impounded police car on day 3
-	{ GID_PQ4,           275,   275,  0,        "checkSherry", "changeState",               NULL,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When encountering Sherry and Sam in the morgue on day 3
-	{ GID_PQ4,           725,   725,  0,        "fridgeInset", "init",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When opening the refrigerator at the end of day 4
-	{ GID_PQ4,           725,   725,  0,        "fridgeInset", "dispose",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the refrigerator at the end of day 4
-	{ GID_PQ4,           735,   735,  0,           "medInset", "dispose",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the medicine cabinet at the end of day 4
+	{ GID_PQ4,           360,   360,  0,       "csFrontInset", "init",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When clicking hand on the impounded white car on day 4 - bug #9848
+	{ GID_PQ4,           360,   360,  0,       "csFrontInset", "dispose",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When clicking hand on the impounded white car on day 4
+	{ GID_PQ4,           360,   360,  0,        "copCarInset", "init",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When clicking hand on the impounded police car on day 3
+	{ GID_PQ4,           360,   360,  0,        "copCarInset", "dispose",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the impounded police car on day 3
+	{ GID_PQ4,           275,   275,  0,        "checkSherry", "changeState",            nullptr,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When encountering Sherry and Sam in the morgue on day 3
+	{ GID_PQ4,           725,   725,  0,        "fridgeInset", "init",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When opening the refrigerator at the end of day 4
+	{ GID_PQ4,           725,   725,  0,        "fridgeInset", "dispose",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the refrigerator at the end of day 4
+	{ GID_PQ4,           735,   735,  0,           "medInset", "dispose",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the medicine cabinet at the end of day 4
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGraphDrawLine_workarounds[] = {
-	{ GID_ISLANDBRAIN,   300,   300,  0,         "dudeViewer", "show",                       NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when looking at the gene explanation chart, gets called with 1 extra parameter
-	{ GID_SQ1,            43,    43,  0,        "someoneDied", "changeState",                NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when ordering beer, gets called with 1 extra parameter
-	{ GID_SQ1,            71,    71,  0,       "destroyXenon", "changeState",                NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // during the Xenon destruction cutscene (which results in death), gets called with 1 extra parameter - bug #5176
-	{ GID_SQ1,            53,    53,  0,           "blastEgo", "changeState",                NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when Roger is found and zapped by the cleaning robot, gets called with 1 extra parameter - bug #5177
+	{ GID_ISLANDBRAIN,   300,   300,  0,         "dudeViewer", "show",                    nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when looking at the gene explanation chart, gets called with 1 extra parameter
+	{ GID_SQ1,            43,    43,  0,        "someoneDied", "changeState",             nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when ordering beer, gets called with 1 extra parameter
+	{ GID_SQ1,            71,    71,  0,       "destroyXenon", "changeState",             nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // during the Xenon destruction cutscene (which results in death), gets called with 1 extra parameter - bug #5176
+	{ GID_SQ1,            53,    53,  0,           "blastEgo", "changeState",             nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when Roger is found and zapped by the cleaning robot, gets called with 1 extra parameter - bug #5177
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -869,30 +869,30 @@ static const uint16 sig_kGraphSaveBox_ibrain_1[] = {
 
 //    gameID,           room,script,lvl,          object-name, method-name,         local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGraphSaveBox_workarounds[] = {
-	{ GID_CASTLEBRAIN,   420,   427,  0,          "alienIcon", "select",                            NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when selecting a card during the alien card game, gets called with 1 extra parameter
+	{ GID_CASTLEBRAIN,   420,   427,  0,          "alienIcon", "select",                         nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when selecting a card during the alien card game, gets called with 1 extra parameter
 	{ GID_ISLANDBRAIN,   290,   291,  0,         "upElevator", "changeState", sig_kGraphSaveBox_ibrain_1,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when testing in the elevator puzzle, gets called with 1 argument less - 15 is on stack - bug #4943
 	{ GID_ISLANDBRAIN,   290,   291,  0,       "downElevator", "changeState", sig_kGraphSaveBox_ibrain_1,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // see above
 	{ GID_ISLANDBRAIN,   290,   291,  0,    "correctElevator", "changeState", sig_kGraphSaveBox_ibrain_1,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // see above (when testing the correct solution)
-	{ GID_PQ3,           202,   202,  0,            "MapEdit", "movePt",                            NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
+	{ GID_PQ3,           202,   202,  0,            "MapEdit", "movePt",                         nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGraphRestoreBox_workarounds[] = {
-	{ GID_LSL6,           -1,    86,  0,             "LL6Inv", "hide",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // happens during the game, gets called with 1 extra parameter
-	{ GID_MOTHERGOOSE256, -1,    90,  0,        "introScript", "changeState",               NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // happens when restoring after completing a game in SCI1.1 floppy, 2nd parameter is an object from previous game
+	{ GID_LSL6,           -1,    86,  0,             "LL6Inv", "hide",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // happens during the game, gets called with 1 extra parameter
+	{ GID_MOTHERGOOSE256, -1,    90,  0,        "introScript", "changeState",            nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // happens when restoring after completing a game in SCI1.1 floppy, 2nd parameter is an object from previous game
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,   local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGraphFillBoxForeground_workarounds[] = {
-	{ GID_LSL6,           -1,     0,  0,               "LSL6", "hideControls",                NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // happens when giving the bungee key to merrily (room 240) and at least in room 650 too - gets called with additional 5th parameter
+	{ GID_LSL6,           -1,     0,  0,               "LSL6", "hideControls",             nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // happens when giving the bungee key to merrily (room 240) and at least in room 650 too - gets called with additional 5th parameter
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGraphFillBoxAny_workarounds[] = {
-	{ GID_SQ4,            -1,   818,  0,     "iconTextSwitch", "show",                       NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // CD: game menu "text/speech" display - parameter 5 is missing, but the right color number is on the stack
+	{ GID_SQ4,            -1,   818,  0,     "iconTextSwitch", "show",                    nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // CD: game menu "text/speech" display - parameter 5 is missing, but the right color number is on the stack
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -940,123 +940,123 @@ static const uint16 sig_kGraphRedrawBox_sq4_4[] = {
 
 //    gameID,           room,script,lvl,          object-name, method-name,        local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGraphRedrawBox_workarounds[] = {
-	{ GID_SQ4,           405,   405,  0,       "swimAfterEgo", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
-	{ GID_SQ4,           405,   405,  0,                   "", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air... Russian version - bug #5573
-	{ GID_SQ4,           406,   406,  0,        "egoFollowed", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when getting shot by the police - accidental additional parameter specified
-	{ GID_SQ4,            -1,   406,  0,       "swimAndShoot", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
-	{ GID_SQ4,            -1,   406,  0,                   "", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air... Russian version - bug #5573 (is for both egoFollowed and swimAndShoot)
-	{ GID_SQ4,           410,   410,  0,       "swimAfterEgo", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
-	{ GID_SQ4,           410,   410,  0,                   "", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air... Russian version - bug #5573
-	{ GID_SQ4,           411,   411,  0,        "egoFollowed", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when getting shot by the police - accidental additional parameter specified
-	{ GID_SQ4,            -1,   411,  0,       "swimAndShoot", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
-	{ GID_SQ4,            -1,   411,  0,                   "", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air... Russian version - bug #5573
+	{ GID_SQ4,           405,   405,  0,       "swimAfterEgo", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
+	{ GID_SQ4,           405,   405,  0,                   "", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air... Russian version - bug #5573
+	{ GID_SQ4,           406,   406,  0,        "egoFollowed", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when getting shot by the police - accidental additional parameter specified
+	{ GID_SQ4,            -1,   406,  0,       "swimAndShoot", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
+	{ GID_SQ4,            -1,   406,  0,                   "", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air... Russian version - bug #5573 (is for both egoFollowed and swimAndShoot)
+	{ GID_SQ4,           410,   410,  0,       "swimAfterEgo", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
+	{ GID_SQ4,           410,   410,  0,                   "", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air... Russian version - bug #5573
+	{ GID_SQ4,           411,   411,  0,        "egoFollowed", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when getting shot by the police - accidental additional parameter specified
+	{ GID_SQ4,            -1,   411,  0,       "swimAndShoot", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
+	{ GID_SQ4,            -1,   411,  0,                   "", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air... Russian version - bug #5573
 	{ GID_SQ4,           150,   150,  0,        "laserScript", "changeState", sig_kGraphRedrawBox_sq4_1,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when visiting the pedestral where Roger Jr. is trapped, before trashing the brain icon in the programming chapter, accidental additional parameter specified - bug #5479, German - bug #5527
 	{ GID_SQ4,           150,   150,  0,                   "", "changeState", sig_kGraphRedrawBox_sq4_1,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // same as above, for the Russian version - bug #5573
 	{ GID_SQ4,           150,   150,  0,        "laserScript", "changeState", sig_kGraphRedrawBox_sq4_2,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // same as above, for NRS SQ4 Update
 	{ GID_SQ4,            -1,   703,  0,     "shootEgoScript", "changeState", sig_kGraphRedrawBox_sq4_3,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // estros when getting shot by the police - accidental additional parameter specified
 	{ GID_SQ4,            -1,   703,  0,                   "", "changeState", sig_kGraphRedrawBox_sq4_3,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // same as above, for the Russian version
 	{ GID_SQ4,            -1,   703,  0,     "shootEgoScript", "changeState", sig_kGraphRedrawBox_sq4_4,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // same as above, for NRS SQ4 Update
-	{ GID_SQ4,            -1,   704,  0,           "shootEgo", "changeState",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // When shot by Droid in Super Computer Maze (Rooms 500, 505, 510...) - accidental additional parameter specified
-	{ GID_KQ5,            -1,   981,  0,           "myWindow",     "dispose",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when closing any dialog box, accidental additional parameter specified - bug #5031
-	{ GID_KQ5,            -1,   995,  0,               "invW",        "doit",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when closing the inventory window, accidental additional parameter specified
-	{ GID_KQ5,            -1,   995,  0,                   "",    "export 0",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when opening the gem pouch, accidental additional parameter specified - bug #5138
-	{ GID_KQ5,            -1,   403,  0,          "KQ5Window",     "dispose",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the FM Towns version when closing any dialog box, accidental additional parameter specified
+	{ GID_SQ4,            -1,   704,  0,           "shootEgo", "changeState",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // When shot by Droid in Super Computer Maze (Rooms 500, 505, 510...) - accidental additional parameter specified
+	{ GID_KQ5,            -1,   981,  0,           "myWindow",     "dispose",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when closing any dialog box, accidental additional parameter specified - bug #5031
+	{ GID_KQ5,            -1,   995,  0,               "invW",        "doit",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when closing the inventory window, accidental additional parameter specified
+	{ GID_KQ5,            -1,   995,  0,                   "",    "export 0",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when opening the gem pouch, accidental additional parameter specified - bug #5138
+	{ GID_KQ5,            -1,   403,  0,          "KQ5Window",     "dispose",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the FM Towns version when closing any dialog box, accidental additional parameter specified
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kGraphUpdateBox_workarounds[] = {
-	{ GID_PQ3,           202,   202,  0,            "MapEdit", "addPt",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
-	{ GID_PQ3,           202,   202,  0,            "MapEdit", "movePt",                     NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
-	{ GID_PQ3,           202,   202,  0,            "MapEdit", "dispose",                    NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters
+	{ GID_PQ3,           202,   202,  0,            "MapEdit", "addPt",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
+	{ GID_PQ3,           202,   202,  0,            "MapEdit", "movePt",                  nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
+	{ GID_PQ3,           202,   202,  0,            "MapEdit", "dispose",                 nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,    local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kIsObject_workarounds[] = {
-	{ GID_GK1DEMO,       50,   999,  0,                "List", "eachElementDo",                NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // GK1 demo, when asking Grace for messages it gets called with an invalid parameter (type "error") - bug #4950
-	{ GID_ISLANDBRAIN,   -1,   999,  0,                "List", "eachElementDo",                NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // when going to the game options, choosing "Info" and selecting anything from the list, gets called with an invalid parameter (type "error") - bug #4989
-	{ GID_QFG3,          -1,   999,  0,                "List", "eachElementDo",                NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // when asking for something, gets called with type error parameter
+	{ GID_GK1DEMO,       50,   999,  0,                "List", "eachElementDo",             nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // GK1 demo, when asking Grace for messages it gets called with an invalid parameter (type "error") - bug #4950
+	{ GID_ISLANDBRAIN,   -1,   999,  0,                "List", "eachElementDo",             nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // when going to the game options, choosing "Info" and selecting anything from the list, gets called with an invalid parameter (type "error") - bug #4989
+	{ GID_QFG3,          -1,   999,  0,                "List", "eachElementDo",             nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // when asking for something, gets called with type error parameter
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,    local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kListAt_workarounds[] = {
-	{ GID_HOYLE5,        100, 64999,  0,           "theHands", "at",                           NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // After the first hand is dealt in Crazy Eights game in demo, an object is passed instead of a number
-	{ GID_LIGHTHOUSE,     24, 64999,  0,           "LightInv", "at",                           NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // When taking the car keys from the table at the start of the game
+	{ GID_HOYLE5,        100, 64999,  0,           "theHands", "at",                        nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // After the first hand is dealt in Crazy Eights game in demo, an object is passed instead of a number
+	{ GID_LIGHTHOUSE,     24, 64999,  0,           "LightInv", "at",                        nullptr,     0,     0, { WORKAROUND_FAKE, 0 } }, // When taking the car keys from the table at the start of the game
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kLock_workarounds[] = {
-	{ GID_PQSWAT,       6400,  6400,  0,      "rookerTrains3", "changeState",                  NULL,     0,     0, { WORKAROUND_STILLCALL,    0 } }, // After completing Small Arms Training, at the end of the Tactics Training
-	{ GID_PQSWAT,       6400,  6400,  0,      "rookerTrains5", "changeState",                  NULL,     0,     0, { WORKAROUND_STILLCALL,    0 } }, // After completing Small Arms Training, at the end of the Tactics Training
+	{ GID_PQSWAT,       6400,  6400,  0,      "rookerTrains3", "changeState",               nullptr,     0,     0, { WORKAROUND_STILLCALL,    0 } }, // After completing Small Arms Training, at the end of the Tactics Training
+	{ GID_PQSWAT,       6400,  6400,  0,      "rookerTrains5", "changeState",               nullptr,     0,     0, { WORKAROUND_STILLCALL,    0 } }, // After completing Small Arms Training, at the end of the Tactics Training
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kMemory_workarounds[] = {
-	{ GID_LAURABOW2,      -1,   999,  0,                   "", "export 6",                  NULL,     0,     0, { WORKAROUND_FAKE,    0 } }, // during the intro, when exiting the train (room 160), talking to Mr. Augustini, etc. - bug #4944
-	{ GID_SQ1,            -1,   999,  0,                   "", "export 6",                  NULL,     0,     0, { WORKAROUND_FAKE,    0 } }, // during walking Roger around Ulence Flats - bug #6017
+	{ GID_LAURABOW2,      -1,   999,  0,                   "", "export 6",               nullptr,     0,     0, { WORKAROUND_FAKE,    0 } }, // during the intro, when exiting the train (room 160), talking to Mr. Augustini, etc. - bug #4944
+	{ GID_SQ1,            -1,   999,  0,                   "", "export 6",               nullptr,     0,     0, { WORKAROUND_FAKE,    0 } }, // during walking Roger around Ulence Flats - bug #6017
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kMoveCursor_workarounds[] = {
-	{ GID_KQ5,            -1,   937,  0,            "IconBar", "handleEvent",                NULL,     0,     0, { WORKAROUND_IGNORE,  0 } }, // when pressing escape to open the menu, gets called with one parameter instead of 2 - bug #5575
+	{ GID_KQ5,            -1,   937,  0,            "IconBar", "handleEvent",             nullptr,     0,     0, { WORKAROUND_IGNORE,  0 } }, // when pressing escape to open the menu, gets called with one parameter instead of 2 - bug #5575
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kNewWindow_workarounds[] = {
-	{ GID_ECOQUEST,       -1,   981,  0,          "SysWindow", "open",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // EcoQuest 1 demo uses an in-between interpreter from SCI1 to SCI1.1. It's SCI1.1, but uses the SCI1 semantics for this call - bug #4976
+	{ GID_ECOQUEST,       -1,   981,  0,          "SysWindow", "open",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // EcoQuest 1 demo uses an in-between interpreter from SCI1 to SCI1.1. It's SCI1.1, but uses the SCI1 semantics for this call - bug #4976
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kPalVarySetVary_workarounds[] = {
-	{ GID_KQ7,          4600,  4600,  0,      "sRosDogDeath",  "changeState",               NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when dying under Malicia's house, gets called with no parameters (bug #9763)
-	{ GID_KQ7,          4600,  4600,  0,      "sRosDogDeath2", "changeState",               NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when dying under Malicia's house, gets called with no parameters (bug #9763)
-	{ GID_KQ7,          4600,  4600,  0,      "sValDogDeath",  "changeState",               NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when dying under Malicia's house, gets called with no parameters (bug #9763)
-	{ GID_KQ7,          4600,  4600,  0,      "sZapVal",       "changeState",               NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when dying under Malicia's house, gets called with no parameters (bug #9763)
+	{ GID_KQ7,          4600,  4600,  0,      "sRosDogDeath",  "changeState",            nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when dying under Malicia's house, gets called with no parameters (bug #9763)
+	{ GID_KQ7,          4600,  4600,  0,      "sRosDogDeath2", "changeState",            nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when dying under Malicia's house, gets called with no parameters (bug #9763)
+	{ GID_KQ7,          4600,  4600,  0,      "sValDogDeath",  "changeState",            nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when dying under Malicia's house, gets called with no parameters (bug #9763)
+	{ GID_KQ7,          4600,  4600,  0,      "sZapVal",       "changeState",            nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when dying under Malicia's house, gets called with no parameters (bug #9763)
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kPalVarySetPercent_workarounds[] = {
-	{ GID_GK1,           370,   370,  0,        "graceComeOut", "changeState",              NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // there's an extra parameter in GK1, when changing chapters. This extra parameter seems to be a bug or just unimplemented functionality, as there's no visible change from the original in the chapter change room
+	{ GID_GK1,           370,   370,  0,        "graceComeOut", "changeState",           nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // there's an extra parameter in GK1, when changing chapters. This extra parameter seems to be a bug or just unimplemented functionality, as there's no visible change from the original in the chapter change room
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kPalVarySetStart_workarounds[] = {
-	{ GID_PQ4,           170,   170,  0,             "getHit", "changeState",               NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Three extra parameters passed during the gunfight at the end of day 1
+	{ GID_PQ4,           170,   170,  0,             "getHit", "changeState",            nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Three extra parameters passed during the gunfight at the end of day 1
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kPalVaryMergeStart_workarounds[] = {
-	{ GID_PQ4,           170,   170,  0,             "getHit", "changeState",               NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Three extra parameters passed during the gunfight at the end of day 1
+	{ GID_PQ4,           170,   170,  0,             "getHit", "changeState",            nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Three extra parameters passed during the gunfight at the end of day 1
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kPlatform32_workarounds[] = {
-	{ GID_HOYLE5,         -1,     0,  0,             "hoyle4", "newRoom",                   NULL,     0,     0, { WORKAROUND_FAKE,      1 } }, // at the start of the game, incorrectly uses SCI16 calling convention for kPlatform
+	{ GID_HOYLE5,         -1,     0,  0,             "hoyle4", "newRoom",                nullptr,     0,     0, { WORKAROUND_FAKE,      1 } }, // at the start of the game, incorrectly uses SCI16 calling convention for kPlatform
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kRandom_workarounds[] = {
-	{ GID_TORIN,       51400, 64928,  0,              "Blink", "init",                      NULL,     0,     0, { WORKAROUND_FAKE,      0 } }, // at the end of the game, during the cutscene after touching the collar on Lycentia; Trac#9779
-	{ GID_TORIN,       51400, 64928,  0,              "Blink", "cycleDone",                 NULL,     0,     0, { WORKAROUND_FAKE,      0 } }, // at the end of the game, during the cutscene after touching the collar on Lycentia; Trac#9779
+	{ GID_TORIN,       51400, 64928,  0,              "Blink", "init",                   nullptr,     0,     0, { WORKAROUND_FAKE,      0 } }, // at the end of the game, during the cutscene after touching the collar on Lycentia; Trac#9779
+	{ GID_TORIN,       51400, 64928,  0,              "Blink", "cycleDone",              nullptr,     0,     0, { WORKAROUND_FAKE,      0 } }, // at the end of the game, during the cutscene after touching the collar on Lycentia; Trac#9779
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kReadNumber_workarounds[] = {
-	{ GID_CNICK_LAURABOW,100,   101,  0,          "dominoes.opt", "doit",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // When dominoes.opt is present, the game scripts call kReadNumber with an extra integer parameter - bug #6425
-	{ GID_HOYLE3,        100,   101,  0,          "dominoes.opt", "doit",                   NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // When dominoes.opt is present, the game scripts call kReadNumber with an extra integer parameter - bug #6425
+	{ GID_CNICK_LAURABOW,100,   101,  0,          "dominoes.opt", "doit",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // When dominoes.opt is present, the game scripts call kReadNumber with an extra integer parameter - bug #6425
+	{ GID_HOYLE3,        100,   101,  0,          "dominoes.opt", "doit",                nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // When dominoes.opt is present, the game scripts call kReadNumber with an extra integer parameter - bug #6425
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -1080,21 +1080,21 @@ const SciWorkaroundEntry kResCheck_workarounds[] = {
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kPaletteUnsetFlag_workarounds[] = {
-	{ GID_QFG4DEMO,      100,   100,  0,            "doMovie", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // after the Sierra logo, no flags are passed, thus the call is meaningless - bug #4947
+	{ GID_QFG4DEMO,      100,   100,  0,            "doMovie", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // after the Sierra logo, no flags are passed, thus the call is meaningless - bug #4947
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kSetCursor_workarounds[] = {
-	{ GID_KQ5,            -1,   768,  0,           "KQCursor", "init",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // CD: gets called with 4 additional "900d" parameters
-	{ GID_MOTHERGOOSEHIRES,-1,    0, -1,                 "MG", "setCursor",                 NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // At the start of the game, an object is passed as the cel number
+	{ GID_KQ5,            -1,   768,  0,           "KQCursor", "init",                   nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // CD: gets called with 4 additional "900d" parameters
+	{ GID_MOTHERGOOSEHIRES,-1,    0, -1,                 "MG", "setCursor",              nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // At the start of the game, an object is passed as the cel number
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kSetPort_workarounds[] = {
-	{ GID_LSL6,          740,   740,  0,              "rm740", "drawPic",                    NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // ending scene, is called with additional 3 (!) parameters
-	{ GID_QFG3,          830,   830,  0,        "portalOpens", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when the portal appears during the end, gets called with 4 parameters - bug #5174
+	{ GID_LSL6,          740,   740,  0,              "rm740", "drawPic",                 nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // ending scene, is called with additional 3 (!) parameters
+	{ GID_QFG3,          830,   830,  0,        "portalOpens", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when the portal appears during the end, gets called with 4 parameters - bug #5174
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -1112,14 +1112,14 @@ static const uint16 sig_kStrAt_ibrain_1[] = {
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kStrAt_workarounds[] = {
-	{ GID_CASTLEBRAIN,   220,   220,  0,         "robotJokes", "animateOnce",                NULL,     0,     0, { WORKAROUND_FAKE,      0 } }, // when trying to view the terminal at the end of the maze without having collected any robot jokes - bug #5127
+	{ GID_CASTLEBRAIN,   220,   220,  0,         "robotJokes", "animateOnce",             nullptr,     0,     0, { WORKAROUND_FAKE,      0 } }, // when trying to view the terminal at the end of the maze without having collected any robot jokes - bug #5127
 	{ GID_ISLANDBRAIN,   300,   310,  0,         "childBreed", "changeState", sig_kStrAt_ibrain_1,     0,     0, { WORKAROUND_FAKE,      0 } }, // when clicking Breed to get the second-generation cyborg hybrid (Standard difficulty), the two parameters are swapped - bug #5088
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,   local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kStrCpy_workarounds[] = {
-	{ GID_MOTHERGOOSE,    23,    23,  0,          "talkScript", "changeState",                NULL,     0,     0, { WORKAROUND_FAKE,      0 } }, // when talking to the girl in scene 23, there's no destination parameter (script bug - wrong instruction order). The original source is used directly afterwards in kDisplay, to show the girl's text - bug #6485
+	{ GID_MOTHERGOOSE,    23,    23,  0,          "talkScript", "changeState",             nullptr,     0,     0, { WORKAROUND_FAKE,      0 } }, // when talking to the girl in scene 23, there's no destination parameter (script bug - wrong instruction order). The original source is used directly afterwards in kDisplay, to show the girl's text - bug #6485
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -1143,21 +1143,21 @@ const SciWorkaroundEntry kStrLen_workarounds[] = {
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kUnLoad_workarounds[] = {
-	{ GID_ECOQUEST,      380,    61,  0,              "gotIt", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // CD version: after talking to the dolphin the first time, a 3rd parameter is passed by accident
-	{ GID_ECOQUEST,      380,    69,  0,   "lookAtBlackBoard", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // German version, when closing the blackboard closeup in the dolphin room, a 3rd parameter is passed by accident - bug #5483
-	{ GID_LAURABOW2,      -1,    -1,  0,           "sCartoon", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // DEMO: during the intro, a 3rd parameter is passed by accident - bug #4966
-	{ GID_LSL6,          130,   130,  0,    "recruitLarryScr", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during intro, a 3rd parameter is passed by accident
-	{ GID_LSL6,          740,   740,  0,        "showCartoon", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during ending, 4 additional parameters are passed by accident
-	{ GID_LSL6HIRES,     740,   740,  0,        "showCartoon", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during ending, multiple additional parameters are passed by accident
-	{ GID_LSL6HIRES,     130,   130,  0,    "recruitLarryScr", "changeState",                NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during intro, a 3rd parameter is passed by accident
-	{ GID_SQ1,            43,   303,  0,            "slotGuy", "dispose",                    NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when leaving ulence flats bar, parameter 1 is not passed - script error
-	{ GID_QFG4,           -1,   110,  0,            "dreamer", "dispose",                    NULL,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during the dream sequence, a 3rd parameter is passed by accident
+	{ GID_ECOQUEST,      380,    61,  0,              "gotIt", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // CD version: after talking to the dolphin the first time, a 3rd parameter is passed by accident
+	{ GID_ECOQUEST,      380,    69,  0,   "lookAtBlackBoard", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // German version, when closing the blackboard closeup in the dolphin room, a 3rd parameter is passed by accident - bug #5483
+	{ GID_LAURABOW2,      -1,    -1,  0,           "sCartoon", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // DEMO: during the intro, a 3rd parameter is passed by accident - bug #4966
+	{ GID_LSL6,          130,   130,  0,    "recruitLarryScr", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during intro, a 3rd parameter is passed by accident
+	{ GID_LSL6,          740,   740,  0,        "showCartoon", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during ending, 4 additional parameters are passed by accident
+	{ GID_LSL6HIRES,     740,   740,  0,        "showCartoon", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during ending, multiple additional parameters are passed by accident
+	{ GID_LSL6HIRES,     130,   130,  0,    "recruitLarryScr", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during intro, a 3rd parameter is passed by accident
+	{ GID_SQ1,            43,   303,  0,            "slotGuy", "dispose",                 nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // when leaving ulence flats bar, parameter 1 is not passed - script error
+	{ GID_QFG4,           -1,   110,  0,            "dreamer", "dispose",                 nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // during the dream sequence, a 3rd parameter is passed by accident
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kScrollWindowAdd_workarounds[] = {
-	{ GID_PHANTASMAGORIA, 45, 64907,  0,   "ScrollableWindow", "addString",                  NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // ScrollWindow interface passes the last two parameters twice
+	{ GID_PHANTASMAGORIA, 45, 64907,  0,   "ScrollableWindow", "addString",               nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // ScrollWindow interface passes the last two parameters twice
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
@@ -1179,14 +1179,14 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
 		int16 inheritanceLevel = 0;
 		Common::String searchObjectName = g_sci->getSciLanguageString(curObjectName, K_LANG_ENGLISH);
 		reg_t searchObject = lastCall->sendp;
-		const byte *curScriptPtr = NULL;
+		const byte *curScriptPtr = nullptr;
 		uint32 curScriptSize = 0;
 		bool matched = false;
 
 		do {
 			workaround = workaroundList;
 			while (workaround->methodName) {
-				bool objectNameMatches = (workaround->objectName == NULL) ||
+				bool objectNameMatches = (workaround->objectName == nullptr) ||
 										 (workaround->objectName == searchObjectName);
 
 				if (workaround->gameId == gameId
@@ -1204,7 +1204,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
 							if (!curScriptPtr) {
 								// get script data
 								int segmentId = g_sci->getEngineState()->_segMan->getScriptSegment(curScriptNr);
-								SegmentObj *segmentObj = NULL;
+								SegmentObj *segmentObj = nullptr;
 								if (segmentId) {
 									segmentObj = g_sci->getEngineState()->_segMan->getScriptIfLoaded(segmentId);
 								}
@@ -1275,82 +1275,82 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
 static const SciMessageWorkaroundEntry messageWorkarounds[] = {
 	// game              media             language       room   mod    n    v    c   s    workaround-type          mod    n    v    c   s tlk  idx  len  text
 	// Clicking Do on bulldozer at camp after Gonzales leaves. Message has wrong cond.
-	{ GID_ECOQUEST2,     SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  560,   1,   4,   0,  1, { MSG_WORKAROUND_REMAP,    560,   1,   4,   4,  1, 99,   0,   0, NULL } },
+	{ GID_ECOQUEST2,     SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  560,   1,   4,   0,  1, { MSG_WORKAROUND_REMAP,    560,   1,   4,   4,  1, 99,   0,   0, nullptr } },
 	// FPFP CD has several message sequences where audio and text were left out of sync - bug #10964
 	//  Some of the texts just say "Dummy Msg" and the real values are concatenated in the first record.
 	// Lever Brothers' intro
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  1, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99,   0,  25, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  2, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99,  26,  20, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  3, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99,  47,  58, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  4, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 106,  34, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  5, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 141,  27, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  6, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 169,  29, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  7, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 199,  52, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  8, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 252,  37, NULL } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  1, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99,   0,  25, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  2, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99,  26,  20, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  3, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99,  47,  58, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  4, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 106,  34, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  5, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 141,  27, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  6, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 169,  29, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  7, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 199,  52, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  24,   0,   0,  8, { MSG_WORKAROUND_EXTRACT,  220,  24,   0,   0,  1, 99, 252,  37, nullptr } },
 	// Kenny's intro
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  30,   0,   0,  3, { MSG_WORKAROUND_EXTRACT,  220,  30,   0,   0,  3, 99,   0,  14, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  30,   0,   0,  4, { MSG_WORKAROUND_EXTRACT,  220,  30,   0,   0,  3, 99,  15, 245, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  30,   0,   0,  5, { MSG_WORKAROUND_EXTRACT,  220,  30,   0,   0,  4, 99,   0,   0, NULL } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  30,   0,   0,  3, { MSG_WORKAROUND_EXTRACT,  220,  30,   0,   0,  3, 99,   0,  14, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  30,   0,   0,  4, { MSG_WORKAROUND_EXTRACT,  220,  30,   0,   0,  3, 99,  15, 245, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  220,  30,   0,   0,  5, { MSG_WORKAROUND_EXTRACT,  220,  30,   0,   0,  4, 99,   0,   0, nullptr } },
 	// Helen swatting flies
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  1, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  1, 53,   0,  42, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  2, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  1, 53,  43,  93, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  3, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  1, 53, 137,  72, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  4, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  2, 53,   0,   0, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  5, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  1, 53, 210,  57, NULL } },
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  6, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  3, 12,   0,   0, NULL } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  1, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  1, 53,   0,  42, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  2, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  1, 53,  43,  93, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  3, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  1, 53, 137,  72, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  4, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  2, 53,   0,   0, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  5, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  1, 53, 210,  57, nullptr } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  660,  35,   0,   0,  6, { MSG_WORKAROUND_EXTRACT,  660,  35,   0,   0,  3, 12,   0,   0, nullptr } },
 	// Wrong talker when clicking guns on Srini in room 300
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  300,  17,  47,   0,  1, { MSG_WORKAROUND_EXTRACT,  300,  17,  47,   0,  1, 40,   0,   0, NULL } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  300,  17,  47,   0,  1, { MSG_WORKAROUND_EXTRACT,  300,  17,  47,   0,  1, 40,   0,   0, nullptr } },
 	// Missing message when clicking full bottles of water on spigot in room 320
-	{ GID_FREDDYPHARKAS, SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  320,  16,  34,   7,  1, { MSG_WORKAROUND_REMAP,    320,  37,  34,   7,  1,  0,   0,   0, NULL } },
+	{ GID_FREDDYPHARKAS, SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  320,  16,  34,   7,  1, { MSG_WORKAROUND_REMAP,    320,  37,  34,   7,  1,  0,   0,   0, nullptr } },
 	// Missing message when clicking flashlight and other items on Magentia in room 290, floppy 1.0 - bug #10782
-	{ GID_GK1,           SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  290,   8,   0,  35,  1, { MSG_WORKAROUND_REMAP,    290,   8,   0,   0,  1,  0,   0,   0, NULL } },
+	{ GID_GK1,           SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  290,   8,   0,  35,  1, { MSG_WORKAROUND_REMAP,    290,   8,   0,   0,  1,  0,   0,   0, nullptr } },
 	// Missing message when clicking photocopy of the veve on the artist after giving sketch and original veve in room 410 - bug #10818
-	{ GID_GK1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  410,   3,  48,  31,  1, { MSG_WORKAROUND_REMAP,    410,   3,  24,  31,  1,  0,   0,   0, NULL } },
+	{ GID_GK1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  410,   3,  48,  31,  1, { MSG_WORKAROUND_REMAP,    410,   3,  24,  31,  1,  0,   0,   0, nullptr } },
 	// Missing message when clicking operate on Loreli's right chair in room 420, floppy 1.0 - bug #10820
-	{ GID_GK1,           SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  420,   4,   8,   3,  1, { MSG_WORKAROUND_REMAP,    420,   4,   8,   7,  1,  0,   0,   0, NULL } },
+	{ GID_GK1,           SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  420,   4,   8,   3,  1, { MSG_WORKAROUND_REMAP,    420,   4,   8,   7,  1,  0,   0,   0, nullptr } },
 	// Clicking money on Loreli when sitting or dancing in room 420 - bug #10819
 	//  The script transposes sitting vs dancing responses, passes an invalid cond for one of them, and the
 	//  audio36 for the the other has the wrong tuple, which we fix in the audio36 workarounds.
-	{ GID_GK1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  420,   2,  32,   3,  1, { MSG_WORKAROUND_REMAP,    420,   2,  32,   0,  1,  0,   0,   0, NULL } },
-	{ GID_GK1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  420,   2,  32,   0,  1, { MSG_WORKAROUND_REMAP,    420,   2,  32,   2,  1,  0,   0,   0, NULL } },
+	{ GID_GK1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  420,   2,  32,   3,  1, { MSG_WORKAROUND_REMAP,    420,   2,  32,   0,  1,  0,   0,   0, nullptr } },
+	{ GID_GK1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  420,   2,  32,   0,  1, { MSG_WORKAROUND_REMAP,    420,   2,  32,   2,  1,  0,   0,   0, nullptr } },
 	// Clicking one of Gabriel's letters on Gerde in room 120 after getting his address in some versions
-	{ GID_GK2,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  120,  18,  63,   0,  1, { MSG_WORKAROUND_REMAP,    120,  18,  44,   0,  1,  0,   0,   0, NULL } },
-	{ GID_GK2,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  120,  18,  64,   0,  1, { MSG_WORKAROUND_REMAP,    120,  18,  44,   0,  1,  0,   0,   0, NULL } },
+	{ GID_GK2,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  120,  18,  63,   0,  1, { MSG_WORKAROUND_REMAP,    120,  18,  44,   0,  1,  0,   0,   0, nullptr } },
+	{ GID_GK2,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  120,  18,  64,   0,  1, { MSG_WORKAROUND_REMAP,    120,  18,  44,   0,  1,  0,   0,   0, nullptr } },
 	// Clicking any item other than the dagger on theater vent in room 11853
-	{ GID_GK2,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1, 1185,   4,   0,   0,  1, { MSG_WORKAROUND_REMAP,   1185,   4,  62,   0,  1,  0,   0,   0, NULL } },
+	{ GID_GK2,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1, 1185,   4,   0,   0,  1, { MSG_WORKAROUND_REMAP,   1185,   4,  62,   0,  1,  0,   0,   0, nullptr } },
 	// During the common Game Over cutscene, the "Ticket, please!" message has the incorrect audio
 	//  "Tickets only!", which is the response the skeleton gives when talking to him in the land
 	//  of the dead. Normally people wouldn't have noticed, but ScummVM supports audio + subtitles
 	//  in this game at the same time. We could fix this either way because there are non-buggy
 	//  versions of each message. "Ticket, please!" is the correct message but "Tickets only!"
 	//  is the audio that everyone is used to, so we make the text match "Tickets only!" on CD.
-	{ GID_KQ6,           SCI_MEDIA_CD,     K_LANG_NONE,     -1,  640,   1,   0,   1,  1, { MSG_WORKAROUND_REMAP,    640,   5,   0,   0,  2, 83,   0,   0, NULL } },
+	{ GID_KQ6,           SCI_MEDIA_CD,     K_LANG_NONE,     -1,  640,   1,   0,   1,  1, { MSG_WORKAROUND_REMAP,    640,   5,   0,   0,  2, 83,   0,   0, nullptr } },
 	// Clicking the drink-me potion on ego in the castle basement hallways while guards are around
-	{ GID_KQ6,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  840,   3,  14,   1,  1, { MSG_WORKAROUND_REMAP,    899,   0,   0, 198,  1, 99,   0,   0, NULL } },
-	{ GID_KQ6,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  899,   1,  14,   1,  1, { MSG_WORKAROUND_REMAP,    899,   0,   0, 198,  1, 99,   0,   0, NULL } },
+	{ GID_KQ6,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  840,   3,  14,   1,  1, { MSG_WORKAROUND_REMAP,    899,   0,   0, 198,  1, 99,   0,   0, nullptr } },
+	{ GID_KQ6,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  899,   1,  14,   1,  1, { MSG_WORKAROUND_REMAP,    899,   0,   0, 198,  1, 99,   0,   0, nullptr } },
 	// Asking Yvette about Tut in act 2 party in floppy version - bug #10723
 	//  The last two sequences in this five part message reveal a murder that hasn't occurred yet.
 	//  We skip these as to not spoil the plot, but only in the act 2 rooms, as the message is used
 	//  in later acts where all five parts are appropriate. Sierra fixed this in the CD version by
 	//  creating a new three-sequence message for act 2 to accomplish the same thing.
-	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_NONE,    350, 1885,   1,   6,  16,  4, { MSG_WORKAROUND_REMAP,   1885,   1,   6,  16,  6,  0,   0,   0, NULL } },
-	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_NONE,    360, 1885,   1,   6,  16,  4, { MSG_WORKAROUND_REMAP,   1885,   1,   6,  16,  6,  0,   0,   0, NULL } },
-	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_NONE,    370, 1885,   1,   6,  16,  4, { MSG_WORKAROUND_REMAP,   1885,   1,   6,  16,  6,  0,   0,   0, NULL } },
+	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_NONE,    350, 1885,   1,   6,  16,  4, { MSG_WORKAROUND_REMAP,   1885,   1,   6,  16,  6,  0,   0,   0, nullptr } },
+	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_NONE,    360, 1885,   1,   6,  16,  4, { MSG_WORKAROUND_REMAP,   1885,   1,   6,  16,  6,  0,   0,   0, nullptr } },
+	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_NONE,    370, 1885,   1,   6,  16,  4, { MSG_WORKAROUND_REMAP,   1885,   1,   6,  16,  6,  0,   0,   0, nullptr } },
 	// Missing message when clicking carbon paper on desk lamp in room 550, floppy 1.0 - bug #10706
-	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  550,   5,  39,   6,  1, { MSG_WORKAROUND_REMAP,    550,  45,  39,   6,  1,  0,   0,   0, NULL } },
+	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_NONE,     -1,  550,   5,  39,   6,  1, { MSG_WORKAROUND_REMAP,    550,  45,  39,   6,  1,  0,   0,   0, nullptr } },
 	// Looking at coal in room 720, message is prepended with carriage return and newline
-	{ GID_LAURABOW2,     SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  720,  12,   1,   0,  1, { MSG_WORKAROUND_EXTRACT,  720,  12,   1,   0,  1, 99,   2, 255, NULL } },
+	{ GID_LAURABOW2,     SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  720,  12,   1,   0,  1, { MSG_WORKAROUND_EXTRACT,  720,  12,   1,   0,  1, 99,   2, 255, nullptr } },
 	// Using the hand icon on Keith in the Blue Room (missing message) - bug #6253
-	{ GID_PQ1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,   38,  10,   4,   8,  1, { MSG_WORKAROUND_REMAP,     38,  10,   4,   9,  1,  0,   0,   0, NULL } },
+	{ GID_PQ1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,   38,  10,   4,   8,  1, { MSG_WORKAROUND_REMAP,     38,  10,   4,   9,  1,  0,   0,   0, nullptr } },
 	// Using the eye icon on Keith in the Blue Room (no message and wrong talker) - bug #6253
-	{ GID_PQ1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,   38,  10,   1,   0,  1, { MSG_WORKAROUND_EXTRACT,   38,  10,   1,  13,  1, 99,   0,   0, NULL } },
+	{ GID_PQ1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,   38,  10,   1,   0,  1, { MSG_WORKAROUND_EXTRACT,   38,  10,   1,  13,  1, 99,   0,   0, nullptr } },
 	// Talking to Kaspar the shopkeeper - bug #6250
-	{ GID_QFG1VGA,       SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  322,  14,   1,  19,  1, { MSG_WORKAROUND_REMAP,    322,  14,   2,  19,  1,  0,   0,   0, NULL } },
+	{ GID_QFG1VGA,       SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  322,  14,   1,  19,  1, { MSG_WORKAROUND_REMAP,    322,  14,   2,  19,  1,  0,   0,   0, nullptr } },
 	// Remove the "a:" floppy drive prefix from the default character export
 	//  filename "a:shadows.sav". We do this for SCI16 games in kDrawControl.
-	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,   52,   2,   0,  10,  1, { MSG_WORKAROUND_EXTRACT,   52,   2,   0,  10,  1, 99,   2,  11, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,   52,   2,   0,  10,  1, { MSG_WORKAROUND_EXTRACT,   52,   2,   0,  10,  1, 99,   2,  11, nullptr } },
 	// Talking with the Leshy and telling him about "bush in goo" - bug #10137
-	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  579,   0,   0,   0,  1, { MSG_WORKAROUND_REMAP,    579,   0,   1,   0,  1,  0,   0,   0, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  579,   0,   0,   0,  1, { MSG_WORKAROUND_REMAP,    579,   0,   1,   0,  1,  0,   0,   0, nullptr } },
 	// Examining the statue inventory item from the monastery - bug #10770
 	// The description says "squid-like monster", yet the icon is
 	// clearly an insect. It turned Chief into "an enormous beetle". We
@@ -1370,20 +1370,20 @@ static const SciMessageWorkaroundEntry messageWorkarounds[] = {
 	// with Rusalka's last text. The orphaned audio (seq:3) has its
 	// tuple remapped to seq:2 in an audio workaround below.
 	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  520,   2,  59,   0,  1, { MSG_WORKAROUND_FAKE,     520,   2,  59,   0,  1, 28,   0,   0, "Thank you for the beautiful flowers.  No one has been so nice to me since I can remember." } },
-	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  520,   2,  59,   0,  2, { MSG_WORKAROUND_EXTRACT,  520,   2,  59,   0,  1, 28,   0,   0, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_ENGLISH,  -1,  520,   2,  59,   0,  2, { MSG_WORKAROUND_EXTRACT,  520,   2,  59,   0,  1, 28,   0,   0, nullptr } },
 	// Wrong talker when asking gnome about himself in room 320 - bug #11030.
 	//  This incorrect value caused the narrator to accidentally voice these
 	//  messages in the CD version instead of the actor who played the gnome.
 	//  There's nothing we can do about that but we can at least set the correct
 	//  talker so that the message boxes appear in the correct screen location.
-	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  322,  10, 149,   1,  1, { MSG_WORKAROUND_EXTRACT,  322,  10, 149,   1,  1, 13,   0,   0, NULL } },
-	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  322,  10, 149,   1,  2, { MSG_WORKAROUND_EXTRACT,  322,  10, 149,   1,  2, 13,   0,   0, NULL } },
-	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  322,  10, 149,   1,  3, { MSG_WORKAROUND_EXTRACT,  322,  10, 149,   1,  3, 13,   0,   0, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  322,  10, 149,   1,  1, { MSG_WORKAROUND_EXTRACT,  322,  10, 149,   1,  1, 13,   0,   0, nullptr } },
+	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  322,  10, 149,   1,  2, { MSG_WORKAROUND_EXTRACT,  322,  10, 149,   1,  2, 13,   0,   0, nullptr } },
+	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  322,  10, 149,   1,  3, { MSG_WORKAROUND_EXTRACT,  322,  10, 149,   1,  3, 13,   0,   0, nullptr } },
 	// Wrong verb when clicking lock pick or toolkit on gnome's door in room 320
 	//  while not having enough lock picking skill.
-	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  320,   9,   9,   7,  1, { MSG_WORKAROUND_REMAP,    320,   9,  42,   7,  1, 99,   0,   0, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  320,   9,   9,   7,  1, { MSG_WORKAROUND_REMAP,    320,   9,  42,   7,  1, 99,   0,   0, nullptr } },
 	// Wrong modNum (missing parameter) when clicking your only dagger in room 625
-	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  625,   4,   6,  34,  1, { MSG_WORKAROUND_REMAP,    620,   4,   6,  34,  1, 99,   0,   0, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  625,   4,   6,  34,  1, { MSG_WORKAROUND_REMAP,    620,   4,   6,  34,  1, 99,   0,   0, nullptr } },
 	// This fixes the error message shown when speech and subtitles are
 	// enabled simultaneously in SQ4 - the (very) long dialog when Roger
 	// is talking with the aliens is missing - bug #6067.
@@ -1395,9 +1395,9 @@ static const SciMessageWorkaroundEntry messageWorkarounds[] = {
 	// Just output an empty string here instead of showing an error.
 	{ GID_SQ4,           SCI_MEDIA_CD,     K_LANG_NONE,     -1,   16,   7,   0,   3,  1, { MSG_WORKAROUND_FAKE,      16,   7,   0,   3,  1,  7,   0,   0, "" } },
 	// Missing message when clicking talk in room 520 - bug #10915
-	{ GID_SQ4,           SCI_MEDIA_CD,     K_LANG_NONE,     -1,  510,  99,   0,   3,  1, { MSG_WORKAROUND_REMAP,    500,  99,   0,   3,  1,  0,   0,   0, NULL } },
+	{ GID_SQ4,           SCI_MEDIA_CD,     K_LANG_NONE,     -1,  510,  99,   0,   3,  1, { MSG_WORKAROUND_REMAP,    500,  99,   0,   3,  1,  0,   0,   0, nullptr } },
 	// Missing message when looking at hole in room 740
-	{ GID_SQ6,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  740,   3,   1,   8,  1, { MSG_WORKAROUND_REMAP,    740,   3,  88,   8,  1, 99,   0,   0, NULL } },
+	{ GID_SQ6,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,  740,   3,   1,   8,  1, { MSG_WORKAROUND_REMAP,    740,   3,  88,   8,  1, 99,   0,   0, nullptr } },
 	SCI_MESSAGEWORKAROUNDENTRY_TERMINATOR
 };
 
@@ -1409,15 +1409,15 @@ static const SciMessageWorkaroundEntry messageWorkarounds[] = {
 static const SciMessageWorkaroundEntry audio36Workarounds[] = {
 	// game              media             language       room   mod    n    v    c   s    workaround-type          mod    n    v    c   s tlk  idx  len  text
 	// Clicking money on Lorelei when dancing - bug #10819 (see message workarounds above)
-	{ GID_GK1,           SCI_MEDIA_CD,     K_LANG_NONE,     -1,  420,   2,  32,   0,  1, { MSG_WORKAROUND_REMAP,    420,   2,  32,   3,  1,  0,   0,   0, NULL } },
+	{ GID_GK1,           SCI_MEDIA_CD,     K_LANG_NONE,     -1,  420,   2,  32,   0,  1, { MSG_WORKAROUND_REMAP,    420,   2,  32,   3,  1,  0,   0,   0, nullptr } },
 	// Clicking Von Glower's letter on Gabriel in room 1120
-	{ GID_GK2,           SCI_MEDIA_ALL,    K_LANG_ENGLISH,  -1, 1120,   5,  96,   0,  1, { MSG_WORKAROUND_REMAP,   1120,   5,   2,   0,  1,  0,   0,   0, NULL } },
+	{ GID_GK2,           SCI_MEDIA_ALL,    K_LANG_ENGLISH,  -1, 1120,   5,  96,   0,  1, { MSG_WORKAROUND_REMAP,   1120,   5,   2,   0,  1,  0,   0,   0, nullptr } },
 	// Clicking Look on floor grate in room 510 - bug #10848
-	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_NONE,     -1,  510,  23,   1,   0,  1, { MSG_WORKAROUND_REMAP,    510, 199,   1,   0,  1,  0,   0,   0, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_NONE,     -1,  510,  23,   1,   0,  1, { MSG_WORKAROUND_REMAP,    510, 199,   1,   0,  1,  0,   0,   0, nullptr } },
 	// Clicking flowers on Rusalka - bug #10849 (see message workarounds above)
-	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_NONE,     -1,  520,   2,  59,   0,  2, { MSG_WORKAROUND_REMAP,    520,   2,  59,   0,  3,  0,   0,   0, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_NONE,     -1,  520,   2,  59,   0,  2, { MSG_WORKAROUND_REMAP,    520,   2,  59,   0,  3,  0,   0,   0, nullptr } },
 	// Casting glide spell in room 593 when standing on water
-	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_NONE,     -1,  593,   5,   6,   7,  1, { MSG_WORKAROUND_REMAP,    570,   2,   6,  14,  1,  0,   0,   0, NULL } },
+	{ GID_QFG4,          SCI_MEDIA_CD,     K_LANG_NONE,     -1,  593,   5,   6,   7,  1, { MSG_WORKAROUND_REMAP,    570,   2,   6,  14,  1,  0,   0,   0, nullptr } },
 	SCI_MESSAGEWORKAROUNDENTRY_TERMINATOR
 };
 
@@ -1427,7 +1427,7 @@ static const SciMessageWorkaroundEntry audio36Workarounds[] = {
 static const SciMessageWorkaroundEntry sync36Workarounds[] = {
 	// game              media             language       room   mod    n    v    c   s    workaround-type          mod    n    v    c   s tlk  idx  len  text
 	// Asking yvette about tut in act 2 is missing a sync resource but a duplicate message has a sync resource - bug #9956
-	{ GID_LAURABOW2,     SCI_MEDIA_CD,     K_LANG_NONE,     -1, 1885,   1,   6,  30,  2, { MSG_WORKAROUND_REMAP,   1885,   1,   6,  10,  2,  0,   0,   0, NULL } },
+	{ GID_LAURABOW2,     SCI_MEDIA_CD,     K_LANG_NONE,     -1, 1885,   1,   6,  30,  2, { MSG_WORKAROUND_REMAP,   1885,   1,   6,  10,  2,  0,   0,   0, nullptr } },
 	SCI_MESSAGEWORKAROUNDENTRY_TERMINATOR
 };
 
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index 3e3a0814aa..73b348390b 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -200,7 +200,7 @@ void GfxAnimate::makeSortedList(List *list) {
 	_lastCastData.clear();
 
 	// Fill the list
-	for (listNr = 0; curNode != 0; listNr++) {
+	for (listNr = 0; curNode != nullptr; listNr++) {
 		AnimateEntry listEntry;
 		const reg_t curObject = curNode->value;
 		listEntry.object = curObject;
@@ -255,7 +255,7 @@ void GfxAnimate::makeSortedList(List *list) {
 }
 
 void GfxAnimate::fill(byte &old_picNotValid) {
-	GfxView *view = NULL;
+	GfxView *view = nullptr;
 	AnimateList::iterator it;
 	const AnimateList::iterator end = _list.end();
 
@@ -576,7 +576,7 @@ void GfxAnimate::reAnimate(Common::Rect rect) {
 
 void GfxAnimate::addToPicDrawCels() {
 	reg_t curObject;
-	GfxView *view = NULL;
+	GfxView *view = nullptr;
 	AnimateList::iterator it;
 	const AnimateList::iterator end = _list.end();
 
diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp
index 41578e3d76..e01d513f20 100644
--- a/engines/sci/graphics/compare.cpp
+++ b/engines/sci/graphics/compare.cpp
@@ -109,7 +109,7 @@ uint16 GfxCompare::kernelOnControl(byte screenMask, const Common::Rect &rect) {
 }
 
 void GfxCompare::kernelSetNowSeen(reg_t objectReference) {
-	GfxView *view = NULL;
+	GfxView *view = nullptr;
 	Common::Rect celRect(0, 0);
 	GuiResourceId viewId = (GuiResourceId)readSelectorValue(_segMan, objectReference, SELECTOR(view));
 	int16 loopNo = readSelectorValue(_segMan, objectReference, SELECTOR(loop));
@@ -123,7 +123,7 @@ void GfxCompare::kernelSetNowSeen(reg_t objectReference) {
 	view = _cache->getView(viewId);
 	view->getCelRect(loopNo, celNo, x, y, z, celRect);
 
-	if (lookupSelector(_segMan, objectReference, SELECTOR(nsTop), NULL, NULL) == kSelectorVariable) {
+	if (lookupSelector(_segMan, objectReference, SELECTOR(nsTop), nullptr, nullptr) == kSelectorVariable) {
 		setNSRect(objectReference, celRect);
 	}
 }
@@ -203,7 +203,7 @@ bool GfxCompare::kernelIsItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo,
 }
 
 void GfxCompare::kernelBaseSetter(reg_t object) {
-	if (lookupSelector(_segMan, object, SELECTOR(brLeft), NULL, NULL) == kSelectorVariable) {
+	if (lookupSelector(_segMan, object, SELECTOR(brLeft), nullptr, nullptr) == kSelectorVariable) {
 		int16 x = readSelectorValue(_segMan, object, SELECTOR(x));
 		int16 y = readSelectorValue(_segMan, object, SELECTOR(y));
 		int16 z = (SELECTOR(z) > -1) ? readSelectorValue(_segMan, object, SELECTOR(z)) : 0;
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp
index c07a9696db..c8b400d2b0 100644
--- a/engines/sci/graphics/cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -52,10 +52,10 @@ GfxCursor::GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *sc
 
 	_zoomZoneActive = false;
 	_zoomZone = Common::Rect();
-	_zoomCursorView = 0;
+	_zoomCursorView = nullptr;
 	_zoomCursorLoop = 0;
 	_zoomCursorCel = 0;
-	_zoomPicView = 0;
+	_zoomPicView = nullptr;
 	_zoomColor = 0;
 	_zoomMultiplier = 0;
 
@@ -442,9 +442,9 @@ void GfxCursor::kernelClearZoomZone() {
 	_zoomMultiplier = 0;
 	_zoomZoneActive = false;
 	delete _zoomCursorView;
-	_zoomCursorView = 0;
+	_zoomCursorView = nullptr;
 	delete _zoomPicView;
-	_zoomPicView = 0;
+	_zoomPicView = nullptr;
 	_cursorSurface.clear();
 }
 
diff --git a/engines/sci/graphics/maciconbar.cpp b/engines/sci/graphics/maciconbar.cpp
index 7b2b2a9754..cf34dde238 100644
--- a/engines/sci/graphics/maciconbar.cpp
+++ b/engines/sci/graphics/maciconbar.cpp
@@ -43,7 +43,7 @@ GfxMacIconBar::GfxMacIconBar() {
 	else
 		_inventoryIndex = 4;
 
-	_inventoryIcon = 0;
+	_inventoryIcon = nullptr;
 	_allDisabled = true;
 }
 
@@ -56,7 +56,7 @@ void GfxMacIconBar::initIcons(uint16 count, reg_t *objs) {
 	freeIcons();
 	_iconBarItems.clear();
 	_lastX = 0;
-	_inventoryIcon = 0;
+	_inventoryIcon = nullptr;
 	_allDisabled = true;
 
 	for (uint16 i = 0; i < count; i++) {
@@ -93,7 +93,7 @@ void GfxMacIconBar::addIcon(reg_t obj) {
 	if (iconIndex != _inventoryIndex)
 		item.selectedImage = createImage(iconIndex, true);
 	else
-		item.selectedImage = 0;
+		item.selectedImage = nullptr;
 
 	item.enabled = true;
 
@@ -195,7 +195,7 @@ void GfxMacIconBar::setIconEnabled(int16 iconIndex, bool enabled) {
 }
 
 void GfxMacIconBar::setInventoryIcon(int16 icon) {
-	Graphics::Surface *surface = 0;
+	Graphics::Surface *surface = nullptr;
 
 	if (icon >= 0)
 		surface = loadPict(ResourceId(kResourceTypeMacPict, icon));
@@ -206,7 +206,7 @@ void GfxMacIconBar::setInventoryIcon(int16 icon) {
 		if ((icon < 0) || surface) {
 			_inventoryIcon->free();
 			delete _inventoryIcon;
-			_inventoryIcon = 0;
+			_inventoryIcon = nullptr;
 		}
 	}
 
@@ -220,12 +220,12 @@ Graphics::Surface *GfxMacIconBar::loadPict(ResourceId id) {
 	Resource *res = g_sci->getResMan()->findResource(id, false);
 
 	if (!res || res->size() == 0)
-		return 0;
+		return nullptr;
 
 	Image::PICTDecoder pictDecoder;
 	Common::MemoryReadStream stream(res->toStream());
 	if (!pictDecoder.loadStream(stream))
-		return 0;
+		return nullptr;
 
 	Graphics::Surface *surface = new Graphics::Surface();
 	surface->copyFrom(*pictDecoder.getSurface());
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index 45f0ba3402..efd01c8396 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -45,7 +45,7 @@ GfxMenu::GfxMenu(EventManager *event, SegManager *segMan, GfxPorts *ports, GfxPa
 
 	_menuSaveHandle = NULL_REG;
 	_barSaveHandle = NULL_REG;
-	_oldPort = NULL;
+	_oldPort = nullptr;
 	_mouseOldState = false;
 
 	reset();
@@ -281,7 +281,7 @@ GuiMenuItemEntry *GfxMenu::findItem(uint16 menuId, uint16 itemId) {
 
 		listIterator++;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void GfxMenu::kernelSetAttribute(uint16 menuId, uint16 itemId, uint16 attributeId, reg_t value) {
@@ -388,7 +388,7 @@ void GfxMenu::calculateMenuWidth() {
 	menuIterator = _list.begin();
 	while (menuIterator != menuEnd) {
 		menuEntry = *menuIterator;
-		menuEntry->textSplit = g_sci->strSplit(menuEntry->text.c_str(), NULL);
+		menuEntry->textSplit = g_sci->strSplit(menuEntry->text.c_str(), nullptr);
 		_text16->StringWidth(menuEntry->textSplit.c_str(), 0, menuEntry->textWidth, dummyHeight);
 
 		menuIterator++;
@@ -408,7 +408,7 @@ void GfxMenu::calculateMenuAndItemWidth() {
 	while (itemIterator != itemEnd) {
 		itemEntry = *itemIterator;
 		// Split the text now for multilingual SCI01 games
-		itemEntry->textSplit = g_sci->strSplit(itemEntry->text.c_str(), NULL);
+		itemEntry->textSplit = g_sci->strSplit(itemEntry->text.c_str(), nullptr);
 		_text16->StringWidth(itemEntry->textSplit.c_str(), 0, itemEntry->textWidth, dummyHeight);
 		_text16->StringWidth(itemEntry->textRightAligned.c_str(), 0, itemEntry->textRightAlignedWidth, dummyHeight);
 
@@ -421,7 +421,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) {
 	int16 keyPress, keyModifier;
 	GuiMenuItemList::iterator itemIterator = _itemList.begin();
 	GuiMenuItemList::iterator itemEnd = _itemList.end();
-	GuiMenuItemEntry *itemEntry = NULL;
+	GuiMenuItemEntry *itemEntry = nullptr;
 	bool forceClaimed = false;
 
 	switch (eventType) {
@@ -473,7 +473,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) {
 				itemIterator++;
 			}
 			if (itemIterator == itemEnd)
-				itemEntry = NULL;
+				itemEntry = nullptr;
 		}
 		break;
 
@@ -495,7 +495,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) {
 			itemIterator++;
 		}
 		if (itemIterator == itemEnd)
-			itemEntry = NULL;
+			itemEntry = nullptr;
 		break;
 
 	case kSciEventMousePress: {
@@ -530,7 +530,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) {
 	}
 	if (_oldPort) {
 		_ports->setPort(_oldPort);
-		_oldPort = NULL;
+		_oldPort = nullptr;
 	}
 
 	if ((itemEntry) || (forceClaimed))
@@ -544,8 +544,8 @@ GuiMenuItemEntry *GfxMenu::interactiveGetItem(uint16 menuId, uint16 itemId, bool
 	GuiMenuItemList::iterator itemIterator = _itemList.begin();
 	GuiMenuItemList::iterator itemEnd = _itemList.end();
 	GuiMenuItemEntry *itemEntry;
-	GuiMenuItemEntry *firstItemEntry = NULL;
-	GuiMenuItemEntry *lastItemEntry = NULL;
+	GuiMenuItemEntry *firstItemEntry = nullptr;
+	GuiMenuItemEntry *lastItemEntry = nullptr;
 
 	// Fixup menuId if needed
 	if (menuId > _list.size())
@@ -843,7 +843,7 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() {
 				switch (curEvent.character) {
 				case kSciKeyEsc:
 					_curMenuId = curItemEntry->menuId; _curItemId = curItemEntry->id;
-					return NULL;
+					return nullptr;
 				case kSciKeyEnter:
 					if (curItemEntry->enabled)  {
 						_curMenuId = curItemEntry->menuId; _curItemId = curItemEntry->id;
@@ -935,7 +935,7 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() {
 			break;
 
 		case kSciEventQuit:
-			return NULL;
+			return nullptr;
 
 		default:
 			break;
@@ -952,7 +952,7 @@ GuiMenuItemEntry *GfxMenu::interactiveWithMouse() {
 	uint16 newMenuId = 0, newItemId = 0;
 	uint16 curMenuId = 0, curItemId = 0;
 	bool firstMenuChange = true;
-	GuiMenuItemEntry *curItemEntry = NULL;
+	GuiMenuItemEntry *curItemEntry = nullptr;
 
 	_oldPort = _ports->setPort(_ports->_menuPort);
 	calculateMenuAndItemWidth();
@@ -970,9 +970,9 @@ GuiMenuItemEntry *GfxMenu::interactiveWithMouse() {
 		switch (curEvent.type) {
 		case kSciEventMouseRelease:
 			if ((curMenuId == 0) || (curItemId == 0))
-				return NULL;
+				return nullptr;
 			if ((!curItemEntry->enabled) || (curItemEntry->separatorLine))
-				return NULL;
+				return nullptr;
 			return curItemEntry;
 
 		case kSciEventNone:
@@ -1013,7 +1013,7 @@ GuiMenuItemEntry *GfxMenu::interactiveWithMouse() {
 		}
 
 	}
-	return NULL;
+	return nullptr;
 }
 
 void GfxMenu::kernelDrawStatus(const char *text, int16 colorPen, int16 colorBack) {
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index b33f4f87cb..29688e9952 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -49,8 +49,8 @@ GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, GfxCache *ca
 	  _transitions(transitions), _audio(audio), _EGAdrawingVisualize(false) {
 
 	// _animate and _text16 will be initialized later on
-	_animate = NULL;
-	_text16 = NULL;
+	_animate = nullptr;
+	_text16 = nullptr;
 }
 
 GfxPaint16::~GfxPaint16() {
@@ -145,7 +145,7 @@ void GfxPaint16::drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 c
 			// need to get coordinates from upscaledHiresHandle. I'm not sure if
 			// this is what we are supposed to do or if there is some other bug
 			// that actually makes coordinates to be 0 in the first place.
-			byte *memoryPtr = NULL;
+			byte *memoryPtr = nullptr;
 			memoryPtr = _segMan->getHunkPointer(upscaledHiresHandle);
 			if (memoryPtr) {
 				Common::Rect upscaledHiresRect;
@@ -350,7 +350,7 @@ reg_t GfxPaint16::bitsSave(const Common::Rect &rect, byte screenMask) {
 }
 
 void GfxPaint16::bitsGetRect(reg_t memoryHandle, Common::Rect *destRect) {
-	byte *memoryPtr = NULL;
+	byte *memoryPtr = nullptr;
 
 	if (!memoryHandle.isNull()) {
 		memoryPtr = _segMan->getHunkPointer(memoryHandle);
@@ -362,7 +362,7 @@ void GfxPaint16::bitsGetRect(reg_t memoryHandle, Common::Rect *destRect) {
 }
 
 void GfxPaint16::bitsRestore(reg_t memoryHandle) {
-	byte *memoryPtr = NULL;
+	byte *memoryPtr = nullptr;
 
 	if (!memoryHandle.isNull()) {
 		memoryPtr = _segMan->getHunkPointer(memoryHandle);
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index d8b2f93cb9..427211c2b6 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -82,7 +82,7 @@ GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen)
 
 	palVaryInit();
 
-	_macClut = 0;
+	_macClut = nullptr;
 	loadMacIconBarPalette();
 
 	switch (_resMan->getViewType()) {
diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp
index 6462b654c5..278775e9d2 100644
--- a/engines/sci/graphics/ports.cpp
+++ b/engines/sci/graphics/ports.cpp
@@ -128,7 +128,7 @@ void GfxPorts::init(bool usesOldGfxFunctions, GfxPaint16 *paint16, GfxText16 *te
 	_wmgrPort->curLeft = 0;
 	_windowList.push_front(_wmgrPort);
 
-	_picWind = addWindow(Common::Rect(0, offTop, _screen->getScriptWidth(), _screen->getScriptHeight()), 0, 0, SCI_WINDOWMGR_STYLE_TRANSPARENT | SCI_WINDOWMGR_STYLE_NOFRAME, 0, true);
+	_picWind = addWindow(Common::Rect(0, offTop, _screen->getScriptWidth(), _screen->getScriptHeight()), nullptr, nullptr, SCI_WINDOWMGR_STYLE_TRANSPARENT | SCI_WINDOWMGR_STYLE_NOFRAME, 0, true);
 	// For SCI0 games till kq4 (.502 - not including) we set _picWind top to offTop instead
 	//  Because of the menu/status bar
 	if (_usesOldGfxFunctions)
@@ -210,12 +210,12 @@ reg_t GfxPorts::kernelGetActive() {
 }
 
 reg_t GfxPorts::kernelNewWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
-	Window *wnd = NULL;
+	Window *wnd = nullptr;
 
 	if (restoreRect.bottom != 0 && restoreRect.right != 0)
 		wnd = addWindow(dims, &restoreRect, title, style, priority, false);
 	else
-		wnd = addWindow(dims, NULL, title, style, priority, false);
+		wnd = addWindow(dims, nullptr, title, style, priority, false);
 	wnd->penClr = colorPen;
 	wnd->backClr = colorBack;
 	drawWindow(wnd);
@@ -422,7 +422,7 @@ Window *GfxPorts::addWindow(const Common::Rect &dims, const Common::Rect *restor
 
 	pwnd->rect.moveTo(pwnd->rect.left + pwnd->dims.left - oldleft, pwnd->rect.top + pwnd->dims.top - oldtop);
 
-	if (restoreRect == 0)
+	if (restoreRect == nullptr)
 		pwnd->restoreRect = pwnd->dims;
 
 	if (pwnd->restoreRect.top < 0 && g_sci->getPlatform() == Common::kPlatformMacintosh &&
diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp
index 24b6569f04..a3ebbc3023 100644
--- a/engines/sci/graphics/screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -181,7 +181,7 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) {
 	Graphics::PixelFormat format8 = Graphics::PixelFormat::createFormatCLUT8();
 	const Graphics::PixelFormat *format = &format8;
 	if (ConfMan.getBool("rgb_rendering"))
-		format = 0; // Backend's preferred mode; RGB if available
+		format = nullptr; // Backend's preferred mode; RGB if available
 
 	if (g_sci->hasMacIconBar()) {
 		// For SCI1.1 Mac games with the custom icon bar, we need to expand the screen
@@ -209,14 +209,14 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) {
 		if (_paletteModsEnabled)
 			_paletteMapScreen = (byte *)calloc(_displayPixels, 1);
 		else
-			_paletteMapScreen = 0;
+			_paletteMapScreen = nullptr;
 	} else {
-		_displayedScreen = 0;
-		_palette = 0;
-		_rgbScreen = 0;
-		_paletteMapScreen = 0;
+		_displayedScreen = nullptr;
+		_palette = nullptr;
+		_rgbScreen = nullptr;
+		_paletteMapScreen = nullptr;
 	}
-	_backupScreen = 0;
+	_backupScreen = nullptr;
 }
 
 GfxScreen::~GfxScreen() {
@@ -908,7 +908,7 @@ int16 *GfxScreen::unditherGetDitheredBgColors() {
 	if (_unditheringEnabled)
 		return _ditheredPicColors;
 	else
-		return NULL;
+		return nullptr;
 }
 
 void GfxScreen::debugShowMap(int mapNo) {
diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp
index f354e6f048..2ed898ddab 100644
--- a/engines/sci/graphics/text16.cpp
+++ b/engines/sci/graphics/text16.cpp
@@ -49,10 +49,10 @@ GfxText16::~GfxText16() {
 }
 
 void GfxText16::init() {
-	_font = NULL;
-	_codeFonts = NULL;
+	_font = nullptr;
+	_codeFonts = nullptr;
 	_codeFontsCount = 0;
-	_codeColors = NULL;
+	_codeColors = nullptr;
 	_codeColorsCount = 0;
 	_useEarlyGetLongestTextCalculations = g_sci->_features->useEarlyGetLongestTextCalculations();
 }
@@ -62,14 +62,14 @@ GuiResourceId GfxText16::GetFontId() {
 }
 
 GfxFont *GfxText16::GetFont() {
-	if ((_font == NULL) || (_font->getResourceId() != _ports->_curPort->fontId))
+	if ((_font == nullptr) || (_font->getResourceId() != _ports->_curPort->fontId))
 		_font = _cache->getFont(_ports->_curPort->fontId);
 
 	return _font;
 }
 
 void GfxText16::SetFont(GuiResourceId fontId) {
-	if ((_font == NULL) || (_font->getResourceId() != fontId))
+	if ((_font == nullptr) || (_font->getResourceId() != fontId))
 		_font = _cache->getFont(fontId);
 
 	_ports->_curPort->fontId = _font->getResourceId();
@@ -103,7 +103,7 @@ int16 GfxText16::CodeProcessing(const char *&text, GuiResourceId orgFontId, int1
 	//  c -> sets textColor to current port pen color
 	//  cX -> sets textColor to _textColors[X-1]
 	curCode = textCode[0];
-	curCodeParm = strtol(textCode+1, NULL, 10);
+	curCodeParm = strtol(textCode+1, nullptr, 10);
 	if (!Common::isDigit(textCode[1])) {
 		curCodeParm = -1;
 	}
@@ -196,7 +196,7 @@ static const uint16 text16_shiftJIS_punctuation_SCI01[] = {
 int16 GfxText16::GetLongest(const char *&textPtr, int16 maxWidth, GuiResourceId orgFontId) {
 	uint16 curChar = 0;
 	const char *textStartPtr = textPtr;
-	const char *lastSpacePtr = NULL;
+	const char *lastSpacePtr = nullptr;
 	int16 lastSpaceCharCount = 0;
 	int16 curCharCount = 0, resultCharCount = 0;
 	uint16 curWidth = 0, tempWidth = 0;
diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp
index 96ed3eacb6..4661d7ea79 100644
--- a/engines/sci/graphics/transitions.cpp
+++ b/engines/sci/graphics/transitions.cpp
@@ -103,7 +103,7 @@ void GfxTransitions::init() {
 	_oldScreen = new byte[_screen->getDisplayHeight() * _screen->getDisplayWidth()];
 
 	if (getSciVersion() >= SCI_VERSION_1_LATE)
-		_translationTable = NULL;
+		_translationTable = nullptr;
 	else
 		_translationTable = oldTransitionIDs;
 
@@ -156,7 +156,7 @@ void GfxTransitions::updateScreenAndWait(uint32 shouldBeAtMsec) {
 const GfxTransitionTranslateEntry *GfxTransitions::translateNumber (int16 number, const GfxTransitionTranslateEntry *tablePtr) {
 	while (1) {
 		if (tablePtr->orgId == 255)
-			return NULL;
+			return nullptr;
 		if (tablePtr->orgId == number)
 			return tablePtr;
 		tablePtr++;
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 095804e13c..e4d14161f4 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -419,7 +419,7 @@ uint16 GfxView::getCelCount(int16 loopNo) const {
 }
 
 Palette *GfxView::getPalette() {
-	return _embeddedPal ? &_viewPalette : NULL;
+	return _embeddedPal ? &_viewPalette : nullptr;
 }
 
 bool GfxView::isScaleable() {
diff --git a/engines/sci/metaengine.cpp b/engines/sci/metaengine.cpp
index ff760e435f..4fd7b1a011 100644
--- a/engines/sci/metaengine.cpp
+++ b/engines/sci/metaengine.cpp
@@ -508,7 +508,7 @@ static char s_fallbackGameIdBuf[256];
 static ADGameDescription s_fallbackDesc = {
 	"",
 	"",
-	AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
+	AD_ENTRY1(nullptr, nullptr), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
 	Common::UNK_LANG,
 	Common::kPlatformDOS,
 	ADGF_NO_FLAGS,
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp
index 05764ba0a8..ac463f31b0 100644
--- a/engines/sci/parser/grammar.cpp
+++ b/engines/sci/parser/grammar.cpp
@@ -71,7 +71,7 @@ struct ParseRuleList {
 
 	void print() const;
 
-	ParseRuleList(ParseRule *r) : rule(r), next(0) {
+	ParseRuleList(ParseRule *r) : rule(r), next(nullptr) {
 		int term = rule->_data[rule->_firstSpecial];
 		terminal = ((term & TOKEN_TERMINAL) ? term : 0);
 	}
@@ -150,7 +150,7 @@ static ParseRule *_vinsert(ParseRule *turkey, ParseRule *stuffing) {
 
 	// If no TOKEN_NON_NT found, or if it doesn't match the id of 'stuffing', abort.
 	if ((firstnt == turkey->_data.size()) || (turkey->_data[firstnt] != stuffing->_id))
-		return NULL;
+		return nullptr;
 
 	// Create a new rule as a copy of 'turkey', where the token firstnt has been substituted
 	// by the rule 'stuffing'.
@@ -183,7 +183,7 @@ static ParseRule *_vbuild_rule(const parse_tree_branch_t *branch) {
 		else if (type > VOCAB_TREE_NODE_LAST_WORD_STORAGE)
 			tokens += 5;
 		else
-			return NULL; // invalid
+			return nullptr; // invalid
 	}
 
 	ParseRule *rule = new ParseRule();
@@ -225,7 +225,7 @@ static ParseRule *_vsatisfy_rule(ParseRule *rule, const ResultWordList &input) {
 	int dep;
 
 	if (!rule->_numSpecials)
-		return NULL;
+		return nullptr;
 
 	dep = rule->_data[rule->_firstSpecial];
 
@@ -270,7 +270,7 @@ static ParseRule *_vsatisfy_rule(ParseRule *rule, const ResultWordList &input) {
 
 		return retval;
 	} else
-		return NULL;
+		return nullptr;
 }
 
 void Vocabulary::freeRuleList(ParseRuleList *list) {
@@ -332,7 +332,7 @@ static ParseRuleList *_vocab_split_rule_list(ParseRuleList *list) {
 	assert(list);
 	if (!list->next || (list->next->terminal)) {
 		ParseRuleList *tmp = list->next;
-		list->next = NULL;
+		list->next = nullptr;
 		return tmp;
 	} else
 		return _vocab_split_rule_list(list->next);
@@ -342,8 +342,8 @@ static void _vocab_free_empty_rule_list(ParseRuleList *list) {
 	assert(list);
 	if (list->next)
 		_vocab_free_empty_rule_list(list->next);
-	list->next = 0;
-	list->rule = 0;
+	list->next = nullptr;
+	list->rule = nullptr;
 	delete list;
 }
 
@@ -363,7 +363,7 @@ static int _vocab_rule_list_length(ParseRuleList *list) {
 }
 
 static ParseRuleList *_vocab_clone_rule_list_by_id(ParseRuleList *list, int id) {
-	ParseRuleList *result = NULL;
+	ParseRuleList *result = nullptr;
 	ParseRuleList *seeker = list;
 
 	while (seeker) {
@@ -380,7 +380,7 @@ ParseRuleList *Vocabulary::buildGNF(bool verbose) {
 	int iterations = 0;
 	int termrules = 0;
 	int ntrules_nr;
-	ParseRuleList *ntlist = NULL;
+	ParseRuleList *ntlist = nullptr;
 	ParseRuleList *tlist, *new_tlist;
 	Console *con = g_sci->getSciDebugger();
 
@@ -388,7 +388,7 @@ ParseRuleList *Vocabulary::buildGNF(bool verbose) {
 		ParseRule *rule = _vbuild_rule(&_parserBranches[i]);
 		if (!rule) {
 			freeRuleList(ntlist);
-			return NULL;
+			return nullptr;
 		}
 		ntlist = _vocab_add_rule(ntlist, rule);
 	}
@@ -400,10 +400,10 @@ ParseRuleList *Vocabulary::buildGNF(bool verbose) {
 		con->debugPrintf("Starting with %d rules\n", ntrules_nr);
 
 	new_tlist = tlist;
-	tlist = NULL;
+	tlist = nullptr;
 
 	do {
-		ParseRuleList *new_new_tlist = NULL;
+		ParseRuleList *new_new_tlist = nullptr;
 		ParseRuleList *ntseeker, *tseeker;
 
 		ntseeker = ntlist;
@@ -437,7 +437,7 @@ ParseRuleList *Vocabulary::buildGNF(bool verbose) {
 		con->debugPrintf("%d allocd rules\n", _allocd_rules);
 		con->debugPrintf("Freeing rule list...\n");
 		freeRuleList(tlist);
-		return NULL;
+		return nullptr;
 	}
 
 	return tlist;
@@ -447,8 +447,8 @@ static int _vbpt_pareno(ParseTreeNode *nodes, int *pos, int base) {
 	// Opens parentheses
 	nodes[base].left = &nodes[(*pos) + 1];
 	nodes[++(*pos)].type = kParseTreeBranchNode;
-	nodes[*pos].left = 0;
-	nodes[*pos].right = 0;
+	nodes[*pos].left = nullptr;
+	nodes[*pos].right = nullptr;
 	return *pos;
 }
 
@@ -456,8 +456,8 @@ static int _vbpt_parenc(ParseTreeNode *nodes, int *pos, int paren) {
 	// Closes parentheses for appending
 	nodes[paren].right = &nodes[++(*pos)];
 	nodes[*pos].type = kParseTreeBranchNode;
-	nodes[*pos].left = 0;
-	nodes[*pos].right = 0;
+	nodes[*pos].left = nullptr;
+	nodes[*pos].right = nullptr;
 	return *pos;
 }
 
@@ -466,11 +466,11 @@ static int _vbpt_append(ParseTreeNode *nodes, int *pos, int base, int value) {
 	nodes[base].left = &nodes[++(*pos)];
 	nodes[*pos].type = kParseTreeLeafNode;
 	nodes[*pos].value = value;
-	nodes[*pos].right = 0;
+	nodes[*pos].right = nullptr;
 	nodes[base].right = &nodes[++(*pos)];
 	nodes[*pos].type = kParseTreeBranchNode;
-	nodes[*pos].left = 0;
-	nodes[*pos].right = 0;
+	nodes[*pos].left = nullptr;
+	nodes[*pos].right = nullptr;
 	return *pos;
 }
 
@@ -478,7 +478,7 @@ static int _vbpt_terminate(ParseTreeNode *nodes, int *pos, int base, int value)
 	// Terminates, overwriting a nextwrite forknode
 	nodes[base].type = kParseTreeLeafNode;
 	nodes[base].value = value;
-	nodes[base].right = 0;
+	nodes[base].right = nullptr;
 	return *pos;
 }
 static int _vbpt_append_word(ParseTreeNode *nodes, int *pos, int base, int value) {
@@ -487,8 +487,8 @@ static int _vbpt_append_word(ParseTreeNode *nodes, int *pos, int base, int value
 	nodes[base].value = value;
 	nodes[base].right = &nodes[++(*pos)];
 	nodes[*pos].type = kParseTreeBranchNode;
-	nodes[*pos].left = 0;
-	nodes[*pos].right = 0;
+	nodes[*pos].left = nullptr;
+	nodes[*pos].right = nullptr;
 	return *pos;
 }
 
@@ -496,7 +496,7 @@ static int _vbpt_terminate_word(ParseTreeNode *nodes, int *pos, int base, int va
 	// Terminates, overwriting a nextwrite forknode
 	nodes[base].type = kParseTreeWordNode;
 	nodes[base].value = value;
-	nodes[base].right = 0;
+	nodes[base].right = nullptr;
 	return *pos;
 }
 
@@ -537,14 +537,14 @@ int Vocabulary::parseGNF(const ResultWordListList &words, bool verbose) {
 	Console *con = g_sci->getSciDebugger();
 	// Get the start rules:
 	ParseRuleList *work = _vocab_clone_rule_list_by_id(_parserRules, _parserBranches[0].data[1]);
-	ParseRuleList *results = NULL;
+	ParseRuleList *results = nullptr;
 	uint word = 0;
 	const uint words_nr = words.size();
 	ResultWordListList::const_iterator words_iter;
 
 	for (words_iter = words.begin(); words_iter != words.end(); ++words_iter, ++word) {
-		ParseRuleList *new_work = NULL;
-		ParseRuleList *reduced_rules = NULL;
+		ParseRuleList *new_work = nullptr;
+		ParseRuleList *reduced_rules = nullptr;
 		ParseRuleList *seeker, *subseeker;
 
 		if (verbose)
@@ -559,7 +559,7 @@ int Vocabulary::parseGNF(const ResultWordListList &words, bool verbose) {
 			seeker = seeker->next;
 		}
 
-		if (reduced_rules == NULL) {
+		if (reduced_rules == nullptr) {
 			freeRuleList(work);
 			if (verbose)
 				con->debugPrintf("No results.\n");
@@ -593,7 +593,7 @@ int Vocabulary::parseGNF(const ResultWordListList &words, bool verbose) {
 		work = new_work;
 		if (verbose)
 			con->debugPrintf("Now at %d candidates\n", _vocab_rule_list_length(work));
-		if (work == NULL) {
+		if (work == nullptr) {
 			if (verbose)
 				con->debugPrintf("No results.\n");
 			return 1;
@@ -618,11 +618,11 @@ int Vocabulary::parseGNF(const ResultWordListList &words, bool verbose) {
 
 		_parserNodes[1].type = kParseTreeLeafNode;
 		_parserNodes[1].value = 0x141;
-		_parserNodes[1].right = 0;
+		_parserNodes[1].right = nullptr;
 
 		_parserNodes[2].type = kParseTreeBranchNode;
-		_parserNodes[2].left = 0;
-		_parserNodes[2].right = 0;
+		_parserNodes[2].left = nullptr;
+		_parserNodes[2].right = nullptr;
 
 		pos = 2;
 
diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp
index f56be50cb1..79db3df91b 100644
--- a/engines/sci/parser/said.cpp
+++ b/engines/sci/parser/said.cpp
@@ -91,7 +91,7 @@ static ParseTreeNode* said_next_node() {
 static ParseTreeNode* said_leaf_node(ParseTreeNode* pos, int value) {
 	pos->type = kParseTreeLeafNode;
 	pos->value = value;
-	pos->right = 0;
+	pos->right = nullptr;
 
 	return pos;
 }
@@ -99,7 +99,7 @@ static ParseTreeNode* said_leaf_node(ParseTreeNode* pos, int value) {
 static ParseTreeNode* said_word_node(ParseTreeNode* pos, int value) {
 	pos->type = kParseTreeWordNode;
 	pos->value = value;
-	pos->right = 0;
+	pos->right = nullptr;
 
 	return pos;
 }
@@ -163,7 +163,7 @@ static bool said_attach_subtree(ParseTreeNode* pos, int major, int minor,
 				said_leaf_node(said_next_node(), major),
 				said_branch_attach_left(subtree,
 					said_leaf_node(said_next_node(), minor))),
-			0));
+			nullptr));
 
 	return retval;
 }
@@ -206,7 +206,7 @@ static bool parsePart2(ParseTreeNode* parentNode, bool& nonempty) {
 	int curTreePos = said_tree_pos;
 	ParseTreeNode* curRightChild = parentNode->right;
 
-	ParseTreeNode* newNode = said_branch_node(said_next_node(), 0, 0);
+	ParseTreeNode* newNode = said_branch_node(said_next_node(), nullptr, nullptr);
 
 	nonempty = true;
 
@@ -263,7 +263,7 @@ static bool parsePart3(ParseTreeNode* parentNode, bool& nonempty) {
 	int curTreePos = said_tree_pos;
 	ParseTreeNode* curRightChild = parentNode->right;
 
-	ParseTreeNode* newNode = said_branch_node(said_next_node(), 0, 0);
+	ParseTreeNode* newNode = said_branch_node(said_next_node(), nullptr, nullptr);
 
 	bool found;
 
@@ -345,7 +345,7 @@ static bool parseRef(ParseTreeNode* parentNode) {
 	int curTreePos = said_tree_pos;
 	ParseTreeNode* curRightChild = parentNode->right;
 
-	ParseTreeNode* newNode = said_branch_node(said_next_node(), 0, 0);
+	ParseTreeNode* newNode = said_branch_node(said_next_node(), nullptr, nullptr);
 
 	ParseTreeNode* newParent = parentNode;
 
@@ -362,7 +362,7 @@ static bool parseRef(ParseTreeNode* parentNode) {
 
 			newParent = newParent->right;
 
-			newNode = said_branch_node(said_next_node(), 0, 0);
+			newNode = said_branch_node(said_next_node(), nullptr, nullptr);
 
 			found = parseRef(newNode);
 
@@ -435,7 +435,7 @@ static bool parseListEntry(ParseTreeNode* parentNode) {
 	int curTreePos = said_tree_pos;
 	ParseTreeNode* curRightChild = parentNode->right;
 
-	ParseTreeNode* newNode = said_branch_node(said_next_node(), 0, 0);
+	ParseTreeNode* newNode = said_branch_node(said_next_node(), nullptr, nullptr);
 
 	bool found;
 
@@ -522,7 +522,7 @@ static bool parseExpr(ParseTreeNode* parentNode) {
 	int curTreePos = said_tree_pos;
 	ParseTreeNode* curRightChild = parentNode->right;
 
-	ParseTreeNode* newNode = said_branch_node(said_next_node(), 0, 0);
+	ParseTreeNode* newNode = said_branch_node(said_next_node(), nullptr, nullptr);
 
 	bool ret = false;
 	bool found;
@@ -557,7 +557,7 @@ static bool parseSpec(ParseTreeNode* parentNode) {
 	int curTreePos = said_tree_pos;
 	ParseTreeNode* curRightChild = parentNode->right;
 
-	ParseTreeNode* newNode = said_branch_node(said_next_node(), 0, 0);
+	ParseTreeNode* newNode = said_branch_node(said_next_node(), nullptr, nullptr);
 
 	bool ret = false;
 
@@ -600,7 +600,7 @@ static bool parseSpec(ParseTreeNode* parentNode) {
 	if (said_tokens[said_token] == TOKEN_GT) {
 		said_token++;
 
-		newNode = said_branch_node(said_next_node(), 0,
+		newNode = said_branch_node(said_next_node(), nullptr,
 						said_leaf_node(said_next_node(), TOKEN_GT));
 
 		said_attach_subtree(newParent, 0x14B, TOKEN_GT, newNode);
@@ -622,7 +622,7 @@ static bool parseSpec(ParseTreeNode* parentNode) {
 static bool buildSaidTree() {
 	said_branch_node(said_tree, &said_tree[1], &said_tree[2]);
 	said_leaf_node(&said_tree[1], 0x141); // Magic number #1
-	said_branch_node(&said_tree[2], &said_tree[3], 0);
+	said_branch_node(&said_tree[2], &said_tree[3], nullptr);
 	said_leaf_node(&said_tree[3], 0x13f); // Magic number #2
 
 	said_tree_pos = SAID_TREE_START;
@@ -636,7 +636,7 @@ static bool buildSaidTree() {
 		// No terminator, so parse error.
 
 		// Rollback
-		said_tree[2].right = 0;
+		said_tree[2].right = nullptr;
 		said_token = 0;
 		said_tree_pos = SAID_TREE_START;
 		return false;
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 05ca31f179..15fde59793 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -31,13 +31,13 @@
 namespace Sci {
 
 Vocabulary::Vocabulary(ResourceManager *resMan, bool foreign) : _resMan(resMan), _foreign(foreign) {
-	_parserRules = NULL;
+	_parserRules = nullptr;
 
 	memset(_parserNodes, 0, sizeof(_parserNodes));
 	// Mark parse tree as unused
 	_parserNodes[0].type = kParseTreeLeafNode;
 	_parserNodes[0].value = 0;
-	_parserNodes[0].right = 0;
+	_parserNodes[0].right = nullptr;
 
 	_synonyms.clear(); // No synonyms
 
@@ -67,7 +67,7 @@ Vocabulary::Vocabulary(ResourceManager *resMan, bool foreign) : _resMan(resMan),
 			_parserRules = buildGNF();
 	} else {
 		debug(2, "Assuming that this game does not use a parser.");
-		_parserRules = NULL;
+		_parserRules = nullptr;
 	}
 
 	loadAltInputs();
@@ -661,7 +661,7 @@ bool Vocabulary::tokenizeString(ResultWordListList &retval, const char *sentence
 	unsigned char c;
 	int wordLen = 0;
 
-	*error = NULL;
+	*error = nullptr;
 
 	do {
 		c = sentence[pos_in_sentence++];
@@ -826,7 +826,7 @@ int Vocabulary::parseNodes(int *i, int *pos, int type, int nr, int argc, const c
 	if (type == kParseNumber) {
 		_parserNodes[*pos += 1].type = kParseTreeLeafNode;
 		_parserNodes[*pos].value = nr;
-		_parserNodes[*pos].right = 0;
+		_parserNodes[*pos].right = nullptr;
 		return *pos;
 	}
 	if (type == kParseEndOfInput) {
@@ -853,7 +853,7 @@ int Vocabulary::parseNodes(int *i, int *pos, int type, int nr, int argc, const c
 			} else if (!strcmp(token, "nil")) {
 				nextToken = kParseNil;
 			} else {
-				nextValue = strtol(token, NULL, 0);
+				nextValue = strtol(token, nullptr, 0);
 				nextToken = kParseNumber;
 			}
 		}
@@ -899,7 +899,7 @@ static ParseTreeNode* scanForMajor(ParseTreeNode *tree, int major) {
 		if (node_major(tree) == major)
 			return tree;
 		else
-			return 0;
+			return nullptr;
 	}
 
 	ParseTreeNode* ptr = tree->right;
@@ -913,12 +913,12 @@ static ParseTreeNode* scanForMajor(ParseTreeNode *tree, int major) {
 	}
 
 	if (major == 0x141)
-		return 0;
+		return nullptr;
 
 	// If not found, go into a 0x141 and try again
 	tree = scanForMajor(tree, 0x141);
 	if (!tree)
-		return 0;
+		return nullptr;
 	return scanForMajor(tree, major);
 }
 
diff --git a/engines/sci/resource/decompressor.cpp b/engines/sci/resource/decompressor.cpp
index 7af234a381..bab8e37f19 100644
--- a/engines/sci/resource/decompressor.cpp
+++ b/engines/sci/resource/decompressor.cpp
@@ -152,7 +152,7 @@ void DecompressorLZW::init(Common::ReadStream *src, byte *dest, uint32 nPacked,
 
 int DecompressorLZW::unpack(Common::ReadStream *src, byte *dest, uint32 nPacked,
 								uint32 nUnpacked) {
-	byte *buffer = NULL;
+	byte *buffer = nullptr;
 
 	switch (_compression) {
 	case kCompLZW:	// SCI0 LZW compression
diff --git a/engines/sci/resource/resource.cpp b/engines/sci/resource/resource.cpp
index 9af85d61a9..0c2b01dcb1 100644
--- a/engines/sci/resource/resource.cpp
+++ b/engines/sci/resource/resource.cpp
@@ -303,7 +303,7 @@ ResourceSource *ResourceManager::addPatchDir(const Common::String &dirname) {
 	ResourceSource *newsrc = new DirectoryResourceSource(dirname);
 
 	_sources.push_back(newsrc);
-	return 0;
+	return nullptr;
 }
 
 ResourceSource *ResourceManager::findVolume(ResourceSource *map, int volume_nr) {
@@ -313,7 +313,7 @@ ResourceSource *ResourceManager::findVolume(ResourceSource *map, int volume_nr)
 			return src;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 // Resource manager constructors and operations
@@ -402,7 +402,7 @@ Common::SeekableReadStream *ResourceManager::getVolumeFile(ResourceSource *sourc
 	}
 	// failed
 	delete file;
-	return NULL;
+	return nullptr;
 }
 
 void ResourceManager::disposeVolumeFileStream(Common::SeekableReadStream *fileStream, Sci::ResourceSource *source) {
@@ -445,7 +445,7 @@ static Common::Array<uint32> resTypeToMacTags(ResourceType type);
 
 void MacResourceForkResourceSource::loadResource(ResourceManager *resMan, Resource *res) {
 	ResourceType type = res->getType();
-	Common::SeekableReadStream *stream = 0;
+	Common::SeekableReadStream *stream = nullptr;
 
 	if (type == kResourceTypeAudio36 || type == kResourceTypeSync36) {
 		// Handle audio36/sync36, convert back to audio/sync
@@ -749,7 +749,7 @@ int ResourceManager::addAppropriateSources() {
 }
 
 int ResourceManager::addAppropriateSourcesForDetection(const Common::FSList &fslist) {
-	ResourceSource *map = 0;
+	ResourceSource *map = nullptr;
 	Common::Array<ResourceSource *> sci21Maps;
 
 #ifdef ENABLE_SCI32
@@ -1013,7 +1013,7 @@ void ResourceManager::init() {
 	_memoryLRU = 0;
 	_LRU.clear();
 	_resMap.clear();
-	_audioMapSCI1 = NULL;
+	_audioMapSCI1 = nullptr;
 #ifdef ENABLE_SCI32
 	_currentDiscNo = 1;
 #endif
@@ -1021,7 +1021,7 @@ void ResourceManager::init() {
 		_patcher = new ResourcePatcher(g_sci->getGameId(), g_sci->getLanguage());
 		addSource(_patcher);
 	} else {
-		_patcher = NULL;
+		_patcher = nullptr;
 	};
 
 	// FIXME: put this in an Init() function, so that we can error out if detection fails completely
@@ -1214,7 +1214,7 @@ Resource *ResourceManager::findResource(ResourceId id, bool lock) {
 	Resource *retval = testResource(id);
 
 	if (!retval)
-		return NULL;
+		return nullptr;
 
 	if (retval->_status == kResStatusNoMalloc)
 		loadResource(retval);
@@ -1296,9 +1296,9 @@ const char *ResourceManager::versionDescription(ResVersion version) const {
 }
 
 ResVersion ResourceManager::detectMapVersion() {
-	Common::SeekableReadStream *fileStream = 0;
+	Common::SeekableReadStream *fileStream = nullptr;
 	byte buff[6];
-	ResourceSource *rsrc= 0;
+	ResourceSource *rsrc= nullptr;
 
 	for (Common::List<ResourceSource *>::iterator it = _sources.begin(); it != _sources.end(); ++it) {
 		rsrc = *it;
@@ -1339,7 +1339,7 @@ ResVersion ResourceManager::detectMapVersion() {
 		// check if 0 or 01 - try to read resources in SCI0 format and see if exists
 		fileStream->seek(0, SEEK_SET);
 		while (fileStream->read(buff, 6) == 6 && !(buff[0] == 0xFF && buff[1] == 0xFF && buff[2] == 0xFF)) {
-			if (findVolume(rsrc, (buff[5] & 0xFC) >> 2) == NULL) {
+			if (findVolume(rsrc, (buff[5] & 0xFC) >> 2) == nullptr) {
 				delete fileStream;
 				return kResVersionSci1Middle;
 			}
@@ -1400,7 +1400,7 @@ ResVersion ResourceManager::detectMapVersion() {
 }
 
 ResVersion ResourceManager::detectVolVersion() {
-	Common::SeekableReadStream *fileStream = 0;
+	Common::SeekableReadStream *fileStream = nullptr;
 	ResourceSource *rsrc;
 
 	for (Common::List<ResourceSource *>::iterator it = _sources.begin(); it != _sources.end(); ++it) {
@@ -1594,8 +1594,8 @@ bool ResourceManager::isBlacklistedPatch(const ResourceId &resId) const {
 
 // version-agnostic patch application
 void ResourceManager::processPatch(ResourceSource *source, ResourceType resourceType, uint16 resourceNr, uint32 tuple) {
-	Common::SeekableReadStream *fileStream = 0;
-	Resource *newrsc = 0;
+	Common::SeekableReadStream *fileStream = nullptr;
+	Resource *newrsc = nullptr;
 	ResourceId resId = ResourceId(resourceType, resourceNr, tuple);
 	ResourceType checkForType = resourceType;
 
@@ -1714,12 +1714,12 @@ ResourceId convertPatchNameBase36(ResourceType type, const Common::String &filen
 	// uint16 resourceId, byte noun, byte verb, byte cond, byte seq
 
 	// Skip patch type character
-	uint16 resourceNr = strtol(Common::String(filename.c_str() + 1, 3).c_str(), 0, 36); // 3 characters
-	uint16 noun = strtol(Common::String(filename.c_str() + 4, 2).c_str(), 0, 36);       // 2 characters
-	uint16 verb = strtol(Common::String(filename.c_str() + 6, 2).c_str(), 0, 36);       // 2 characters
+	uint16 resourceNr = strtol(Common::String(filename.c_str() + 1, 3).c_str(), nullptr, 36); // 3 characters
+	uint16 noun = strtol(Common::String(filename.c_str() + 4, 2).c_str(), nullptr, 36);       // 2 characters
+	uint16 verb = strtol(Common::String(filename.c_str() + 6, 2).c_str(), nullptr, 36);       // 2 characters
 	// Skip '.'
-	uint16 cond = strtol(Common::String(filename.c_str() + 9, 2).c_str(), 0, 36);       // 2 characters
-	uint16 seq = strtol(Common::String(filename.c_str() + 11, 1).c_str(), 0, 36);       // 1 character
+	uint16 cond = strtol(Common::String(filename.c_str() + 9, 2).c_str(), nullptr, 36);       // 2 characters
+	uint16 seq = strtol(Common::String(filename.c_str() + 11, 1).c_str(), nullptr, 36);       // 1 character
 
 	return ResourceId(type, resourceNr, noun, verb, cond, seq);
 }
@@ -1849,7 +1849,7 @@ void ResourceManager::readResourcePatches() {
 
 			// SCI1 scheme
 			if (Common::isDigit(name[0])) {
-				char *end = 0;
+				char *end = nullptr;
 				resourceNr = strtol(name.c_str(), &end, 10);
 				bAdd = (*end == '.'); // Ensure the next character is the period
 			} else {
@@ -1871,7 +1871,7 @@ void ResourceManager::readResourcePatches() {
 }
 
 int ResourceManager::readResourceMapSCI0(ResourceSource *map) {
-	Common::SeekableReadStream *fileStream = 0;
+	Common::SeekableReadStream *fileStream = nullptr;
 	ResourceType type = kResourceTypeInvalid;	// to silence a false positive in MSVC
 	uint16 number, id;
 	uint32 offset;
@@ -1950,7 +1950,7 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) {
 }
 
 int ResourceManager::readResourceMapSCI1(ResourceSource *map) {
-	Common::SeekableReadStream *fileStream = 0;
+	Common::SeekableReadStream *fileStream = nullptr;
 
 	if (map->_resourceFile) {
 		fileStream = map->_resourceFile->createReadStream();
@@ -2030,7 +2030,7 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) {
 				return SCI_ERROR_NO_RESOURCE_FILES_FOUND;
 			}
 
-			Resource *resource =  NULL;
+			Resource *resource =  nullptr;
 			if (!_resMap.tryGetVal(resId,resource)) {
 				addResource(resId, source, fileOffset, 0, map->getLocationName());
 			} else {
@@ -2386,7 +2386,7 @@ int Resource::decompress(ResVersion volVersion, Common::SeekableReadStream *file
 		return errorNum;
 
 	// getting a decompressor
-	Decompressor *dec = NULL;
+	Decompressor *dec = nullptr;
 	switch (compression) {
 	case kCompNone:
 		dec = new Decompressor;
@@ -2445,7 +2445,7 @@ ResourceCompression ResourceManager::getViewCompression() {
 
 	// Test 10 views to see if any are compressed
 	for (int i = 0; i < 1000; i++) {
-		Common::SeekableReadStream *fileStream = 0;
+		Common::SeekableReadStream *fileStream = nullptr;
 		Resource *res = testResource(ResourceId(kResourceTypeView, i));
 
 		if (!res)
diff --git a/engines/sci/resource/resource_audio.cpp b/engines/sci/resource/resource_audio.cpp
index 908b555331..1e181b4fd7 100644
--- a/engines/sci/resource/resource_audio.cpp
+++ b/engines/sci/resource/resource_audio.cpp
@@ -729,7 +729,7 @@ void ResourceManager::setAudioLanguage(int language) {
 		_sources.remove(_audioMapSCI1);
 		delete _audioMapSCI1;
 
-		_audioMapSCI1 = NULL;
+		_audioMapSCI1 = nullptr;
 	}
 
 	Common::String filename = Common::String::format("AUDIO%03d", language);
@@ -982,7 +982,7 @@ SoundResource::Track *SoundResource::getTrackByType(byte type) {
 		if (_tracks[trackNr].type == type)
 			return &_tracks[trackNr];
 	}
-	return NULL;
+	return nullptr;
 }
 
 SoundResource::Track *SoundResource::getDigitalTrack() {
@@ -990,7 +990,7 @@ SoundResource::Track *SoundResource::getDigitalTrack() {
 		if (_tracks[trackNr].digitalChannelNr != -1)
 			return &_tracks[trackNr];
 	}
-	return NULL;
+	return nullptr;
 }
 
 // Gets the filter mask for SCI0 sound resources
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 705f56bd98..0e21cb6323 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -300,7 +300,7 @@ Common::Error SciEngine::run() {
 
 	_kernel = new Kernel(_resMan, segMan);
 	_features = new GameFeatures(segMan, _kernel);
-	_vocabulary = hasParser() ? new Vocabulary(_resMan, false) : NULL;
+	_vocabulary = hasParser() ? new Vocabulary(_resMan, false) : nullptr;
 
 	_gamestate = new EngineState(segMan);
 	_guestAdditions = new GuestAdditions(_gamestate, _features, _kernel);
@@ -524,7 +524,7 @@ void SciEngine::suggestDownloadGK2SubTitlesPatch() {
 bool SciEngine::initGame() {
 	// Script 0 needs to be allocated here before anything else!
 	int script0Segment = _gamestate->_segMan->getScriptSegment(0, SCRIPT_GET_LOCK);
-	DataStack *stack = _gamestate->_segMan->allocateStack(VM_STACK_SIZE, NULL);
+	DataStack *stack = _gamestate->_segMan->allocateStack(VM_STACK_SIZE, nullptr);
 
 	_gamestate->_msgState = new MessageState(_gamestate->_segMan);
 	_gamestate->gcCountDown = GC_INTERVAL - 1;
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index 80e03e8d22..d0f870fda0 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -364,10 +364,10 @@ static byte *readSOLAudio(Common::SeekableReadStream *audioStream, uint32 &size,
 }
 
 Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 volume, int *sampleLen) {
-	Audio::SeekableAudioStream *audioSeekStream = 0;
-	Audio::RewindableAudioStream *audioStream = 0;
+	Audio::SeekableAudioStream *audioSeekStream = nullptr;
+	Audio::RewindableAudioStream *audioStream = nullptr;
 	uint32 size = 0;
-	byte *data = 0;
+	byte *data = nullptr;
 	byte flags = 0;
 	Sci::Resource *audioRes;
 
@@ -377,14 +377,14 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32
 		audioRes = _resMan->findResource(ResourceId(kResourceTypeAudio, number), false);
 		if (!audioRes) {
 			warning("Failed to find audio entry %i", number);
-			return NULL;
+			return nullptr;
 		}
 	} else {
 		audioRes = _resMan->findResource(ResourceId(kResourceTypeAudio36, volume, number), false);
 		if (!audioRes) {
 			warning("Failed to find audio entry (%i, %i, %i, %i, %i)", volume, (number >> 24) & 0xff,
 					(number >> 16) & 0xff, (number >> 8) & 0xff, number & 0xff);
-			return NULL;
+			return nullptr;
 		}
 	}
 
diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp
index 59e4fa0050..133c0d97bd 100644
--- a/engines/sci/sound/drivers/adlib.cpp
+++ b/engines/sci/sound/drivers/adlib.cpp
@@ -49,7 +49,7 @@ public:
 	};
 
 	MidiDriver_AdLib(SciVersion version) : _version(version), _isSCI0(version < SCI_VERSION_1_EARLY), _playSwitch(true), _masterVolume(15),
-		_numVoiceMax(version == SCI_VERSION_0_EARLY ? 8 : kVoices), _rhythmKeyMap(), _opl(0), _adlibTimerParam(0), _adlibTimerProc(0), _stereo(false), _isOpen(false) { }
+		_numVoiceMax(version == SCI_VERSION_0_EARLY ? 8 : kVoices), _rhythmKeyMap(), _opl(nullptr), _adlibTimerParam(nullptr), _adlibTimerProc(nullptr), _stereo(false), _isOpen(false) { }
 	~MidiDriver_AdLib() override { }
 
 	// MidiDriver
@@ -59,8 +59,8 @@ public:
 	void send(uint32 b) override;
 	void initTrack(SciSpan<const byte> &header);
 
-	MidiChannel *allocateChannel() override { return NULL; }
-	MidiChannel *getPercussionChannel() override { return NULL; }
+	MidiChannel *allocateChannel() override { return nullptr; }
+	MidiChannel *getPercussionChannel() override { return nullptr; }
 	bool isOpen() const override { return _isOpen; }
 	uint32 getBaseTempo() override { return 1000000 / OPL::OPL::kDefaultCallbackFrequency; }
 
@@ -180,7 +180,7 @@ public:
 	MidiPlayer_AdLib(SciVersion soundVersion) : MidiPlayer(soundVersion) { _driver = new MidiDriver_AdLib(soundVersion); }
 	~MidiPlayer_AdLib() override {
 		delete _driver;
-		_driver = 0;
+		_driver = nullptr;
 	}
 
 	int open(ResourceManager *resMan) override;
@@ -907,7 +907,7 @@ uint32 MidiDriver_AdLib::property(int prop, uint32 param) {
 
 
 int MidiPlayer_AdLib::open(ResourceManager *resMan) {
-	assert(resMan != NULL);
+	assert(resMan != nullptr);
 
 	// Load up the patch.003 file, parse out the instruments
 	Resource *res = resMan->findResource(ResourceId(kResourceTypePatch, 3), false);
diff --git a/engines/sci/sound/drivers/cms.cpp b/engines/sci/sound/drivers/cms.cpp
index b7004cd073..8f8cc38fbb 100644
--- a/engines/sci/sound/drivers/cms.cpp
+++ b/engines/sci/sound/drivers/cms.cpp
@@ -197,8 +197,8 @@ public:
 
 	void onTimer() override;
 
-	MidiChannel *allocateChannel() override { return 0; }
-	MidiChannel *getPercussionChannel() override { return 0; }
+	MidiChannel *allocateChannel() override { return nullptr; }
+	MidiChannel *getPercussionChannel() override { return nullptr; }
 
 	bool isStereo() const override { return true; }
 	int getRate() const override { return _rate; }
@@ -254,7 +254,7 @@ private:
 };
 
 CMSVoice::CMSVoice(uint8 id, MidiDriver_CMS* driver, CMSEmulator *cms, SciSpan<const uint8>& patchData) : _id(id), _regOffset(id > 5 ? id - 6 : id), _portOffset(id > 5 ? 2 : 0),
-	_driver(driver), _cms(cms), _assign(0xFF), _note(0xFF), _sustained(false), _duration(0), _releaseDuration(0), _secondaryVoice(0), _patchData(patchData) {
+	_driver(driver), _cms(cms), _assign(0xFF), _note(0xFF), _sustained(false), _duration(0), _releaseDuration(0), _secondaryVoice(nullptr), _patchData(patchData) {
 	assert(_id < 12);
 	_octaveRegs[_id >> 1] = 0;
 }
@@ -384,7 +384,7 @@ void CMSVoice_V0::programChange(int program) {
 		if (data.getUint8At(pos) == 0xFF) {
 			_secondaryVoice->stop();
 			_secondaryVoice->_assign = 0xFF;
-			_secondaryVoice = 0;
+			_secondaryVoice = nullptr;
 		} else {
 			_secondaryVoice->setPanMask(_panMask);
 			_secondaryVoice->programChange(program);
@@ -471,7 +471,7 @@ void CMSVoice_V0::update() {
 
 void CMSVoice_V0::reset() {
 	_envState = kReady;
-	_secondaryVoice = 0;
+	_secondaryVoice = nullptr;
 	_assign = _note = _envNote = 0xFF;
 	_panMask = _id & 1 ? 0xF0 : 0x0F;
 	_envTL = 0;
@@ -744,7 +744,7 @@ const int CMSVoice_V1::_velocityTable[32] = {
 };
 
 MidiDriver_CMS::MidiDriver_CMS(Audio::Mixer* mixer, ResourceManager* resMan, SciVersion version) : MidiDriver_Emulated(mixer), _resMan(resMan),
-	_version(version), _cms(0), _rate(0), _playSwitch(true), _masterVolume(0), _numVoicesPrimary(version > SCI_VERSION_0_LATE ? 12 : 8),
+	_version(version), _cms(nullptr), _rate(0), _playSwitch(true), _masterVolume(0), _numVoicesPrimary(version > SCI_VERSION_0_LATE ? 12 : 8),
 	_actualTimerInterval(1000000 / _baseFreq), _reqTimerInterval(1000000/60), _numVoicesSecondary(version > SCI_VERSION_0_LATE ? 0 : 4) {
 	memset(_voice, 0, sizeof(_voice));
 	_updateTimer = _reqTimerInterval;
@@ -1108,7 +1108,7 @@ void MidiDriver_CMS::unbindVoices(int channelNr, int voices, bool bindSecondary)
 				if (sec) {
 					sec->stop();
 					sec->_assign = 0xFF;
-					_voice[i]->_secondaryVoice = 0;
+					_voice[i]->_secondaryVoice = nullptr;
 				}
 
 				--voices;
@@ -1145,7 +1145,7 @@ void MidiDriver_CMS::unbindVoices(int channelNr, int voices, bool bindSecondary)
 			if (sec) {
 				sec->stop();
 				sec->_assign = 0xFF;
-				_voice[voiceNr]->_secondaryVoice = 0;
+				_voice[voiceNr]->_secondaryVoice = nullptr;
 			}
 
 			--voices;
@@ -1329,7 +1329,7 @@ public:
 
 	void playSwitch(bool play) override { _driver->property(MidiDriver_CMS::MIDI_PROP_PLAYSWITCH, play ? 1 : 0); }
 
-	const char *reportMissingFiles() override { return _filesMissing ? _requiredFiles : 0; }
+	const char *reportMissingFiles() override { return _filesMissing ? _requiredFiles : nullptr; }
 
 private:
 	bool _filesMissing;
@@ -1350,7 +1350,7 @@ int MidiPlayer_CMS::open(ResourceManager *resMan) {
 }
 
 void MidiPlayer_CMS::close() {
-	_driver->setTimerCallback(0, 0);
+	_driver->setTimerCallback(nullptr, nullptr);
 	_driver->close();
 	delete _driver;
 	_driver = nullptr;
diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp
index 9e9ad2ad9b..1fbfd6f39a 100644
--- a/engines/sci/sound/drivers/fb01.cpp
+++ b/engines/sci/sound/drivers/fb01.cpp
@@ -146,8 +146,8 @@ private:
 	byte _sysExBuf[kMaxSysExSize];
 };
 
-MidiPlayer_Fb01::MidiPlayer_Fb01(SciVersion version) : MidiPlayer(version), _playSwitch(true), _masterVolume(15), _timerParam(NULL), _timerProc(NULL),
-	_numParts(version > SCI_VERSION_0_LATE ? kVoices : 0), _isOpen(false), _missingFiles(0) {
+MidiPlayer_Fb01::MidiPlayer_Fb01(SciVersion version) : MidiPlayer(version), _playSwitch(true), _masterVolume(15), _timerParam(nullptr), _timerProc(nullptr),
+	_numParts(version > SCI_VERSION_0_LATE ? kVoices : 0), _isOpen(false), _missingFiles(nullptr) {
 	MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI);
 	_driver = MidiDriver::createMidi(dev);
 
@@ -157,7 +157,7 @@ MidiPlayer_Fb01::MidiPlayer_Fb01(SciVersion version) : MidiPlayer(version), _pla
 
 MidiPlayer_Fb01::~MidiPlayer_Fb01() {
 	if (_driver)
-		_driver->setTimerCallback(NULL, NULL);
+		_driver->setTimerCallback(nullptr, nullptr);
 	close();
 	delete _driver;
 }
@@ -520,7 +520,7 @@ void MidiPlayer_Fb01::midiTimerCallback(void *p) {
 }
 
 void MidiPlayer_Fb01::setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) {
-	_driver->setTimerCallback(NULL, NULL);
+	_driver->setTimerCallback(nullptr, nullptr);
 
 	_timerParam = timer_param;
 	_timerProc = timer_proc;
@@ -554,7 +554,7 @@ void MidiPlayer_Fb01::sendBanks(const SciSpan<const byte> &data) {
 }
 
 int MidiPlayer_Fb01::open(ResourceManager *resMan) {
-	assert(resMan != NULL);
+	assert(resMan != nullptr);
 
 	int retval = _driver->open();
 	if (retval != 0) {
@@ -630,7 +630,7 @@ int MidiPlayer_Fb01::open(ResourceManager *resMan) {
 
 void MidiPlayer_Fb01::close() {
 	if (_driver)
-		_driver->setTimerCallback(NULL, NULL);
+		_driver->setTimerCallback(nullptr, nullptr);
 	_isOpen = false;
 	if (_driver)
 		_driver->close();
diff --git a/engines/sci/sound/drivers/fmtowns.cpp b/engines/sci/sound/drivers/fmtowns.cpp
index 850f520860..b98d19ac83 100644
--- a/engines/sci/sound/drivers/fmtowns.cpp
+++ b/engines/sci/sound/drivers/fmtowns.cpp
@@ -113,8 +113,8 @@ public:
 	void setSoundOn(bool toggle);
 
 	uint32 getBaseTempo() override;
-	MidiChannel *allocateChannel() override { return 0; }
-	MidiChannel *getPercussionChannel() override { return 0; }
+	MidiChannel *allocateChannel() override { return nullptr; }
+	MidiChannel *getPercussionChannel() override { return nullptr; }
 
 	void timerCallback(int timerId) override;
 
@@ -404,7 +404,7 @@ int TownsMidiPart::allocateChannel() {
 	return chan;
 }
 
-MidiDriver_FMTowns::MidiDriver_FMTowns(Audio::Mixer *mixer, SciVersion version) : _version(version), _timerProc(0), _timerProcPara(0), _baseTempo(10080), _ready(false), _isOpen(false), _masterVolume(0x0f), _soundOn(true) {
+MidiDriver_FMTowns::MidiDriver_FMTowns(Audio::Mixer *mixer, SciVersion version) : _version(version), _timerProc(nullptr), _timerProcPara(nullptr), _baseTempo(10080), _ready(false), _isOpen(false), _masterVolume(0x0f), _soundOn(true) {
 	_intf = new TownsAudioInterface(mixer, this, true);
 	_out = new TownsChannel*[6];
 	for (int i = 0; i < 6; i++)
@@ -420,19 +420,19 @@ MidiDriver_FMTowns::~MidiDriver_FMTowns() {
 	if (_parts) {
 		for (int i = 0; i < 16; i++) {
 			delete _parts[i];
-			_parts[i] = 0;
+			_parts[i] = nullptr;
 		}
 		delete[] _parts;
-		_parts = 0;
+		_parts = nullptr;
 	}
 
 	if (_out) {
 		for (int i = 0; i < 6; i++) {
 			delete _out[i];
-			_out[i] = 0;
+			_out[i] = nullptr;
 		}
 		delete[] _out;
-		_out = 0;
+		_out = nullptr;
 	}
 }
 
diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp
index 7a967b308c..865992eb32 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -125,7 +125,7 @@ static const byte defaultSci32GMPatch[] = {
 };
 #endif
 
-Mt32ToGmMapList *Mt32dynamicMappings = NULL;
+Mt32ToGmMapList *Mt32dynamicMappings = nullptr;
 
 class MidiPlayer_Midi : public MidiPlayer {
 public:
@@ -260,7 +260,7 @@ MidiPlayer_Midi::~MidiPlayer_Midi() {
 	const Mt32ToGmMapList::iterator end = Mt32dynamicMappings->end();
 	for (Mt32ToGmMapList::iterator it = Mt32dynamicMappings->begin(); it != end; ++it) {
 		delete[] (*it).name;
-		(*it).name = 0;
+		(*it).name = nullptr;
 	}
 
 	Mt32dynamicMappings->clear();
@@ -1060,7 +1060,7 @@ bool MidiPlayer_Midi::readD110SysEx() {
 byte MidiPlayer_Midi::lookupGmInstrument(const char *iname) {
 	int i = 0;
 
-	if (Mt32dynamicMappings != NULL) {
+	if (Mt32dynamicMappings != nullptr) {
 		const Mt32ToGmMapList::iterator end = Mt32dynamicMappings->end();
 		for (Mt32ToGmMapList::iterator it = Mt32dynamicMappings->begin(); it != end; ++it) {
 			if (scumm_strnicmp(iname, (*it).name, 10) == 0)
@@ -1080,7 +1080,7 @@ byte MidiPlayer_Midi::lookupGmInstrument(const char *iname) {
 byte MidiPlayer_Midi::lookupGmRhythmKey(const char *iname) {
 	int i = 0;
 
-	if (Mt32dynamicMappings != NULL) {
+	if (Mt32dynamicMappings != nullptr) {
 		const Mt32ToGmMapList::iterator end = Mt32dynamicMappings->end();
 		for (Mt32ToGmMapList::iterator it = Mt32dynamicMappings->begin(); it != end; ++it) {
 			if (scumm_strnicmp(iname, (*it).name, 10) == 0)
@@ -1244,7 +1244,7 @@ void MidiPlayer_Midi::resetMt32() {
 }
 
 int MidiPlayer_Midi::open(ResourceManager *resMan) {
-	assert(resMan != NULL);
+	assert(resMan != nullptr);
 
 	int retval = _driver->open();
 	if (retval != 0) {
@@ -1414,7 +1414,7 @@ void MidiPlayer_Midi::close() {
 		sendMt32SysEx(0x200000, SciSpan<const byte>(_goodbyeMsg, _mt32LCDSize), true);
 	}
 
-	_driver->setTimerCallback(NULL, NULL);
+	_driver->setTimerCallback(nullptr, nullptr);
 	_driver->close();
 }
 
diff --git a/engines/sci/sound/drivers/pc9801.cpp b/engines/sci/sound/drivers/pc9801.cpp
index 42214c86b1..39b4e844a9 100644
--- a/engines/sci/sound/drivers/pc9801.cpp
+++ b/engines/sci/sound/drivers/pc9801.cpp
@@ -291,8 +291,8 @@ public:
 
 	void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) override;
 	uint32 getBaseTempo() override;
-	MidiChannel *allocateChannel() override { return 0; }
-	MidiChannel *getPercussionChannel() override { return 0; }
+	MidiChannel *allocateChannel() override { return nullptr; }
+	MidiChannel *getPercussionChannel() override { return nullptr; }
 
 	void timerCallbackB() override;
 
@@ -745,9 +745,9 @@ void SoundChannel_PC9801_FM2OP::programChange(uint8 program) {
 }
 
 bool SoundChannel_PC9801_FM2OP::prepareFrequencyAndVolume(bool updateVolume) {
-	if (recalculateFrequency(_note, _opFreqOffset[_operatorFrqIndex[0]], 0, &_frequencyCourse, &_frequencyNoteModifier) == -1)
+	if (recalculateFrequency(_note, _opFreqOffset[_operatorFrqIndex[0]], nullptr, &_frequencyCourse, &_frequencyNoteModifier) == -1)
 		return false;
-	if (recalculateFrequency(_note, _opFreqOffset[_operatorFrqIndex[1]], 0, &_frequencyCourse2, &_frequencyNoteModifier2) == -1)
+	if (recalculateFrequency(_note, _opFreqOffset[_operatorFrqIndex[1]], nullptr, &_frequencyCourse2, &_frequencyNoteModifier2) == -1)
 		return false;
 
 	sendFrequency();
@@ -1315,11 +1315,11 @@ void MidiPart_PC9801::assignFreeChannels() {
 	MidiDriver_PC9801::assignFreeChannels(freeChan);
 }
 
-MidiPart_PC9801 **MidiDriver_PC9801::_parts = 0;
+MidiPart_PC9801 **MidiDriver_PC9801::_parts = nullptr;
 
 MidiDriver_PC9801::MidiDriver_PC9801(Audio::Mixer *mixer, SciVersion version)
-	: _mixer(mixer), _version(version), _pc98a(0), _chan(0), _numChan(6), _internalVersion(0xFF), _ssgPatchOffset(0xFF), _patchSize(0),
-	_timerProc(0), _timerProcPara(0), _baseTempo(10080), _ready(false), _isOpen(false), _masterVolume(0x0f) ,_soundOn(true), _playID(0),
+	: _mixer(mixer), _version(version), _pc98a(nullptr), _chan(nullptr), _numChan(6), _internalVersion(0xFF), _ssgPatchOffset(0xFF), _patchSize(0),
+	_timerProc(nullptr), _timerProcPara(nullptr), _baseTempo(10080), _ready(false), _isOpen(false), _masterVolume(0x0f) ,_soundOn(true), _playID(0),
 	_polyphony(9), _channelMask1(0x10), _channelMask2(0x02) {
 }
 
@@ -1395,7 +1395,7 @@ int MidiDriver_PC9801::open() {
 		else if (channelConfig[config][i] == 2)
 			_chan[i] = new SoundChannel_PC9801_SSG(numSSG++, _pc98a, _parts, _version, *_instrumentData, _ssgPatchOffset, _patchSize, _soundOn);
 		else
-			_chan[i] = 0;
+			_chan[i] = nullptr;
 	}
 
 	for (int i = 0; i < 16; ++i)
@@ -1416,24 +1416,24 @@ void MidiDriver_PC9801::close() {
 	_isOpen = _ready = false;
 
 	delete _pc98a;
-	_pc98a = 0;
+	_pc98a = nullptr;
 
 	if (_parts) {
 		for (int i = 0; i < 16; ++i) {
 			delete _parts[i];
-			_parts[i] = 0;
+			_parts[i] = nullptr;
 		}
 		delete[] _parts;
-		_parts = 0;
+		_parts = nullptr;
 	}
 
 	if (_chan) {
 		for (int i = 0; i < _numChan; ++i) {
 			delete _chan[i];
-			_chan[i] = 0;
+			_chan[i] = nullptr;
 		}
 		delete[] _chan;
-		_chan = 0;
+		_chan = nullptr;
 	}
 
 	_instrumentData.clear();
diff --git a/engines/sci/sound/drivers/pcjr.cpp b/engines/sci/sound/drivers/pcjr.cpp
index 3f8bad7b2f..4caa634d30 100644
--- a/engines/sci/sound/drivers/pcjr.cpp
+++ b/engines/sci/sound/drivers/pcjr.cpp
@@ -73,8 +73,8 @@ public:
 	int open() override { return open(kMaxChannels); }
 	void close() override;
 	void send(uint32 b) override;
-	MidiChannel *allocateChannel() override { return NULL; }
-	MidiChannel *getPercussionChannel() override { return NULL; }
+	MidiChannel *allocateChannel() override { return nullptr; }
+	MidiChannel *getPercussionChannel() override { return nullptr; }
 
 	// AudioStream
 	bool isStereo() const override { return false; }
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 85e22aacd8..d27231431b 100644
--- a/engines/sci/sound/midiparser_sci.cpp
+++ b/engines/sci/sound/midiparser_sci.cpp
@@ -56,7 +56,7 @@ MidiParser_SCI::MidiParser_SCI(SciVersion soundVersion, SciMusic *music) :
 	_volume = 127;
 
 	_resetOnPause = false;
-	_pSnd = 0;
+	_pSnd = nullptr;
 
 	_mainThreadCalled = false;
 
@@ -67,7 +67,7 @@ MidiParser_SCI::~MidiParser_SCI() {
 	unloadMusic();
 	// we do this, so that MidiParser won't be able to call his own ::allNotesOff()
 	//  this one would affect all channels and we can't let that happen
-	_driver = 0;
+	_driver = nullptr;
 }
 
 void MidiParser_SCI::mainThreadBegin() {
@@ -449,8 +449,8 @@ void MidiParser_SCI::unloadMusic() {
 		_music->removeTrackInitCommandsFromQueue(_pSnd);
 	}
 	_numTracks = 0;
-	_pSnd = 0;
-	_track = 0;
+	_pSnd = nullptr;
+	_track = nullptr;
 	_activeTrack = 255;
 	_resetOnPause = false;
 	_mixedData.clear();
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 80bf7d695a..80a360d88b 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -47,9 +47,9 @@ SciMusic::SciMusic(SciVersion soundVersion, bool useDigitalSFX)
 	_playList.reserve(10);
 
 	for (int i = 0; i < 16; i++) {
-		_usedChannel[i] = 0;
+		_usedChannel[i] = nullptr;
 		_channelRemap[i] = -1;
-		_channelMap[i]._song = 0;
+		_channelMap[i]._song = nullptr;
 		_channelMap[i]._channel = -1;
 	}
 
@@ -183,7 +183,7 @@ void SciMusic::init() {
 	if (getSciVersion() <= SCI_VERSION_0_LATE)
 		_globalReverb = _pMidiDrv->getReverb();	// Init global reverb for SCI0
 
-	_currentlyPlayingSample = NULL;
+	_currentlyPlayingSample = nullptr;
 	_timeCounter = 0;
 	_needsRemap = false;
 }
@@ -316,7 +316,7 @@ MusicEntry *SciMusic::getSlot(reg_t obj) {
 			return *i;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 MusicEntry *SciMusic::getFirstSlotWithStatus(SoundStatus status) {
@@ -324,7 +324,7 @@ MusicEntry *SciMusic::getFirstSlotWithStatus(SoundStatus status) {
 		if ((*i)->status == status)
 			return *i;
 	}
-	return 0;
+	return nullptr;
 }
 
 void SciMusic::setGlobalReverb(int8 reverb) {
@@ -375,7 +375,7 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
 	// since they will no longer be valid.
 	for (int i = 0; i < 16; ++i) {
 		if (_channelMap[i]._song == pSnd) {
-			_channelMap[i]._song = 0;
+			_channelMap[i]._song = nullptr;
 			_channelMap[i]._channel = -1;
 		}
 	}
@@ -429,7 +429,7 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
 								size, track->digitalSampleRate, flags, DisposeAfterUse::NO);
 			assert(pSnd->pStreamAud);
 			delete pSnd->pLoopStream;
-			pSnd->pLoopStream = 0;
+			pSnd->pLoopStream = nullptr;
 			pSnd->soundType = Audio::Mixer::kSFXSoundType;
 			pSnd->hCurrentAud = Audio::SoundHandle();
 			pSnd->playBed = false;
@@ -439,7 +439,7 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
 			// play MIDI track
 			Common::StackLock lock(_mutex);
 			pSnd->soundType = Audio::Mixer::kMusicSoundType;
-			if (pSnd->pMidiParser == NULL) {
+			if (pSnd->pMidiParser == nullptr) {
 				pSnd->pMidiParser = new MidiParser_SCI(_soundVersion, this);
 				pSnd->pMidiParser->setMidiDriver(_pMidiDrv);
 				pSnd->pMidiParser->setTimerRate(_dwTempo);
@@ -523,7 +523,7 @@ void SciMusic::soundPlay(MusicEntry *pSnd, bool restoring) {
 
 	uint playListCount = _playList.size();
 	uint playListNo = playListCount;
-	MusicEntry *alreadyPlaying = NULL;
+	MusicEntry *alreadyPlaying = nullptr;
 
 	// searching if sound is already in _playList
 	for (uint i = 0; i < playListCount; i++) {
@@ -662,7 +662,7 @@ void SciMusic::soundStop(MusicEntry *pSnd) {
 		} else {
 #endif
 			if (_currentlyPlayingSample == pSnd)
-				_currentlyPlayingSample = NULL;
+				_currentlyPlayingSample = nullptr;
 			_pMixer->stopHandle(pSnd->hCurrentAud);
 #ifdef ENABLE_SCI32
 		}
@@ -723,7 +723,7 @@ void SciMusic::soundKill(MusicEntry *pSnd) {
 		pSnd->pMidiParser->unloadMusic();
 		pSnd->pMidiParser->mainThreadEnd();
 		delete pSnd->pMidiParser;
-		pSnd->pMidiParser = NULL;
+		pSnd->pMidiParser = nullptr;
 	}
 
 	_mutex.unlock();
@@ -736,16 +736,16 @@ void SciMusic::soundKill(MusicEntry *pSnd) {
 #endif
 			if (_currentlyPlayingSample == pSnd) {
 				// Forget about this sound, in case it was currently playing
-				_currentlyPlayingSample = NULL;
+				_currentlyPlayingSample = nullptr;
 			}
 			_pMixer->stopHandle(pSnd->hCurrentAud);
 #ifdef ENABLE_SCI32
 		}
 #endif
 		delete pSnd->pStreamAud;
-		pSnd->pStreamAud = NULL;
+		pSnd->pStreamAud = nullptr;
 		delete pSnd->pLoopStream;
-		pSnd->pLoopStream = 0;
+		pSnd->pLoopStream = nullptr;
 		pSnd->isSample = false;
 	}
 
@@ -933,7 +933,7 @@ void SciMusic::printSongInfo(reg_t obj, Console *con) {
 MusicEntry::MusicEntry() {
 	soundObj = NULL_REG;
 
-	soundRes = 0;
+	soundRes = nullptr;
 	resourceId = 0;
 
 	dataInc = 0;
@@ -960,9 +960,9 @@ MusicEntry::MusicEntry() {
 
 	soundType = Audio::Mixer::kMusicSoundType;
 
-	pStreamAud = 0;
-	pLoopStream = 0;
-	pMidiParser = 0;
+	pStreamAud = nullptr;
+	pLoopStream = nullptr;
+	pMidiParser = nullptr;
 	isSample = false;
 
 	for (int i = 0; i < 16; ++i) {
@@ -1055,7 +1055,7 @@ void ChannelRemapping::swap(int i, int j) {
 void ChannelRemapping::evict(int i) {
 	_freeVoices += _voices[i];
 
-	_map[i]._song = 0;
+	_map[i]._song = nullptr;
 	_map[i]._channel = -1;
 	_prio[i] = 0;
 	_voices[i] = 0;
@@ -1064,7 +1064,7 @@ void ChannelRemapping::evict(int i) {
 
 void ChannelRemapping::clear() {
 	for (int i = 0; i < 16; ++i) {
-		_map[i]._song = 0;
+		_map[i]._song = nullptr;
 		_map[i]._channel = -1;
 		_prio[i] = 0;
 		_voices[i] = 0;
@@ -1116,7 +1116,7 @@ void SciMusic::remapChannels(bool mainThread) {
 	// Save current map, and then start from an empty map
 	for (int i = 0; i < 16; ++i) {
 		currentMap[i] = _channelMap[i];
-		_channelMap[i]._song = 0;
+		_channelMap[i]._song = nullptr;
 		_channelMap[i]._channel = -1;
 	}
 
@@ -1182,7 +1182,7 @@ void SciMusic::remapChannels(bool mainThread) {
 		}
 
 		_channelMap[i] = map->_map[i];
-		map->_map[i]._song = 0; // mark as done
+		map->_map[i]._song = nullptr; // mark as done
 
 		// If this channel was not yet mapped to the device, reset it
 		if (currentMap[i] != _channelMap[i]) {
@@ -1215,7 +1215,7 @@ void SciMusic::remapChannels(bool mainThread) {
 			if (map->_map[i] == currentMap[j]) {
 				// found it
 				_channelMap[j] = map->_map[i];
-				map->_map[i]._song = 0; // mark as done
+				map->_map[i]._song = nullptr; // mark as done
 #ifdef DEBUG_REMAP
 				debug(" Keeping song %d, channel %d on device channel %d", songIndex, _channelMap[j]._channel, j);
 #endif
@@ -1238,9 +1238,9 @@ void SciMusic::remapChannels(bool mainThread) {
 		}
 
 		for (int j = _driverLastChannel; j >= _driverFirstChannel; --j) {
-			if (_channelMap[j]._song == 0) {
+			if (_channelMap[j]._song == nullptr) {
 				_channelMap[j] = map->_map[i];
-				map->_map[i]._song = 0;
+				map->_map[i]._song = nullptr;
 #ifdef DEBUG_REMAP
 				debug(" Mapping song %d, channel %d to device channel %d", songIndex, _channelMap[j]._channel, j);
 #endif
@@ -1335,7 +1335,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 			// our target
 			int devChannel = -1;
 
-			if (dontRemap && map->_map[c]._song == 0) {
+			if (dontRemap && map->_map[c]._song == nullptr) {
 				// unremappable channel, with channel still free
 				devChannel = c;
 			}


Commit: ed5489929ca20c3cf54c6b74d692e4d35b8c942c
    https://github.com/scummvm/scummvm/commit/ed5489929ca20c3cf54c6b74d692e4d35b8c942c
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
SCUMM: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/scumm/actor.cpp
    engines/scumm/akos.cpp
    engines/scumm/bomp.cpp
    engines/scumm/boxes.cpp
    engines/scumm/camera.cpp
    engines/scumm/cdda.cpp
    engines/scumm/charset-fontdata.cpp
    engines/scumm/charset.cpp
    engines/scumm/costume.cpp
    engines/scumm/cursor.cpp
    engines/scumm/debugger.cpp
    engines/scumm/detection.cpp
    engines/scumm/file.cpp
    engines/scumm/file_nes.cpp
    engines/scumm/gfx.cpp
    engines/scumm/gfx_towns.cpp
    engines/scumm/he/moonbase/ai_node.cpp
    engines/scumm/he/moonbase/ai_tree.cpp
    engines/scumm/he/resource_he.cpp
    engines/scumm/he/script_v60he.cpp
    engines/scumm/he/sound_he.cpp
    engines/scumm/imuse/drivers/amiga.cpp
    engines/scumm/imuse/drivers/fmtowns.cpp
    engines/scumm/imuse/drivers/mac_m68k.cpp
    engines/scumm/imuse/drivers/pcspk.cpp
    engines/scumm/imuse/imuse.cpp
    engines/scumm/imuse/imuse_part.cpp
    engines/scumm/imuse/imuse_player.cpp
    engines/scumm/imuse/instrument.cpp
    engines/scumm/imuse/sysex_scumm.cpp
    engines/scumm/imuse_digi/dimuse_bndmgr.cpp
    engines/scumm/imuse_digi/dimuse_codecs.cpp
    engines/scumm/imuse_digi/dimuse_sndmgr.cpp
    engines/scumm/input.cpp
    engines/scumm/midiparser_ro.cpp
    engines/scumm/object.cpp
    engines/scumm/palette.cpp
    engines/scumm/players/player_ad.cpp
    engines/scumm/players/player_apple2.cpp
    engines/scumm/players/player_mac.cpp
    engines/scumm/players/player_mod.cpp
    engines/scumm/players/player_nes.cpp
    engines/scumm/players/player_pce.cpp
    engines/scumm/players/player_sid.cpp
    engines/scumm/players/player_towns.cpp
    engines/scumm/players/player_v1.cpp
    engines/scumm/players/player_v2.cpp
    engines/scumm/players/player_v2a.cpp
    engines/scumm/players/player_v2base.cpp
    engines/scumm/players/player_v2cms.cpp
    engines/scumm/players/player_v3a.cpp
    engines/scumm/resource.cpp
    engines/scumm/resource_v4.cpp
    engines/scumm/room.cpp
    engines/scumm/saveload.cpp
    engines/scumm/script.cpp
    engines/scumm/script_v0.cpp
    engines/scumm/script_v2.cpp
    engines/scumm/script_v4.cpp
    engines/scumm/script_v5.cpp
    engines/scumm/script_v6.cpp
    engines/scumm/scumm.cpp
    engines/scumm/smush/channel.cpp
    engines/scumm/smush/codec37.cpp
    engines/scumm/smush/codec47.cpp
    engines/scumm/smush/imuse_channel.cpp
    engines/scumm/smush/saud_channel.cpp
    engines/scumm/smush/smush_mixer.cpp
    engines/scumm/sound.cpp
    engines/scumm/string.cpp
    engines/scumm/verbs.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 2478250641..600d6ebd9b 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -106,7 +106,7 @@ static const byte v0WalkboxSlantedModifier[0x16] = {
 
 Actor::Actor(ScummEngine *scumm, int id) :
 	_vm(scumm), _number(id) {
-	assert(_vm != 0);
+	assert(_vm != nullptr);
 }
 
 void ActorHE::initActor(int mode) {
@@ -2118,7 +2118,7 @@ Actor *ScummEngine::derefActorSafe(int id, const char *errmsg) const {
 	if (!isValidActor(id)) {
 		debugC(DEBUG_ACTORS, "Invalid actor %d in %s (script %d, opcode 0x%x)",
 			 id, errmsg, vm.slot[_currentScript].number, _opcode);
-		return NULL;
+		return nullptr;
 	}
 	return _actors[id];
 }
@@ -3209,7 +3209,7 @@ static const char *const v0ActorNames_German[25] = {
 };
 
 const byte *Actor::getActorName() {
-	const byte *ptr = NULL;
+	const byte *ptr = nullptr;
 
 	if (_vm->_game.version == 0) {
 		if (_number) {
@@ -3225,7 +3225,7 @@ const byte *Actor::getActorName() {
 		ptr = _vm->getResourceAddress(rtActorName, _number);
 	}
 
-	if (ptr == NULL) {
+	if (ptr == nullptr) {
 		debugC(DEBUG_ACTORS, "Failed to find name of actor %d", _number);
 	}
 	return ptr;
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index 86e661969b..9648dd11ac 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -349,7 +349,7 @@ void AkosRenderer::setCostume(int costume, int shadow) {
 	akct = _vm->findResourceData(MKTAG('A','K','C','T'), akos);
 	rgbs = _vm->findResourceData(MKTAG('R','G','B','S'), akos);
 
-	xmap = 0;
+	xmap = nullptr;
 	if (shadow) {
 		const uint8 *xmapPtr = _vm->getResourceAddress(rtImage, shadow);
 		assert(xmapPtr);
@@ -1084,7 +1084,7 @@ byte AkosRenderer::codec5(int xmoveCur, int ymoveCur) {
 	bdd.shadowMode = _shadow_mode;
 	bdd.shadowPalette = _vm->_shadowPalette;
 
-	bdd.actorPalette = _useBompPalette ? _palette : 0;
+	bdd.actorPalette = _useBompPalette ? _palette : nullptr;
 
 	bdd.mirror = !_mirror;
 
@@ -1117,7 +1117,7 @@ void AkosRenderer::akos16SetupBitReader(const byte *src) {
 
 
 void AkosRenderer::akos16SkipData(int32 numbytes) {
-	akos16DecodeLine(0, numbytes, 0);
+	akos16DecodeLine(nullptr, numbytes, 0);
 }
 
 void AkosRenderer::akos16DecodeLine(byte *buf, int32 numbytes, int32 dir) {
@@ -1629,7 +1629,7 @@ bool ScummEngine_v6::akos_increaseAnim(Actor *a, int chan, const byte *aksq, con
 			akos_queCommand(6, a, GW(2), GW(4));
 			continue;
 		case AKC_JumpTable:
-			if (akfo == NULL)
+			if (akfo == nullptr)
 				error("akos_increaseAnim: no AKFO table");
 			tmp = a->getAnimVar(GB(2)) - 1;
 			if (_game.heversion >= 80) {
diff --git a/engines/scumm/bomp.cpp b/engines/scumm/bomp.cpp
index a0c4e67e4b..07400ab813 100644
--- a/engines/scumm/bomp.cpp
+++ b/engines/scumm/bomp.cpp
@@ -200,9 +200,9 @@ void bompScaleFuncX(byte *line_buffer, byte *scaling_x_ptr, byte skip, int32 siz
 void drawBomp(const BompDrawData &bd) {
 	const byte *src;
 	byte *dst;
-	byte *mask = 0;
+	byte *mask = nullptr;
 	Common::Rect clip;
-	byte *scalingYPtr = 0;
+	byte *scalingYPtr = nullptr;
 	byte skip_y_bits = 0x80;
 	byte skip_y_new = 0;
 	byte tmp;
diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp
index fcc5941b91..9212e17b24 100644
--- a/engines/scumm/boxes.cpp
+++ b/engines/scumm/boxes.cpp
@@ -339,7 +339,7 @@ void ScummEngine::convertScaleTableToScaleSlot(int slot) {
 	float m, oldM;
 
 	// Do nothing if the given scale table doesn't exist
-	if (resptr == 0)
+	if (resptr == nullptr)
 		return;
 
 	if (resptr[0] == resptr[199]) {
@@ -453,12 +453,12 @@ byte ScummEngine::getNumBoxes() {
 Box *ScummEngine::getBoxBaseAddr(int box) {
 	byte *ptr = getResourceAddress(rtMatrix, 2);
 	if (!ptr || box == 255)
-		return NULL;
+		return nullptr;
 
 	// WORKAROUND: The NES version of Maniac Mansion attempts to set flags for boxes 2-4
 	// when there are only three boxes (0-2) when walking out to the garage.
 	if ((_game.id == GID_MANIAC) && (_game.platform == Common::kPlatformNES) && (box >= ptr[0]))
-		return NULL;
+		return nullptr;
 
 	// WORKAROUND: In "pass to adventure", the loom demo, when bobbin enters
 	// the tent to the elders, box = 2, but ptr[0] = 2 -> errors out.
diff --git a/engines/scumm/camera.cpp b/engines/scumm/camera.cpp
index 815d6f9ca2..9dc7d9eafd 100644
--- a/engines/scumm/camera.cpp
+++ b/engines/scumm/camera.cpp
@@ -52,7 +52,7 @@ void ScummEngine::setCameraAt(int pos_x, int pos_y) {
 
 	if (VAR_SCROLL_SCRIPT != 0xFF && VAR(VAR_SCROLL_SCRIPT)) {
 		VAR(VAR_CAMERA_POS_X) = camera._cur.x;
-		runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, 0);
+		runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, nullptr);
 	}
 
 	// If the camera moved and text is visible, remove it
@@ -68,7 +68,7 @@ void ScummEngine::setCameraFollows(Actor *a, bool setCamera) {
 	camera._follows = a->_number;
 
 	if (!a->isInCurrentRoom()) {
-		startScene(a->getRoom(), 0, 0);
+		startScene(a->getRoom(), nullptr, 0);
 		camera._mode = kFollowActorCameraMode;
 		camera._cur.x = a->getPos().x;
 		setCameraAt(camera._cur.x, 0);
@@ -94,7 +94,7 @@ void ScummEngine::clampCameraPos(Common::Point *pt) {
 void ScummEngine::moveCamera() {
 	int pos = camera._cur.x;
 	int t;
-	Actor *a = NULL;
+	Actor *a = nullptr;
 	const bool snapToX = (_snapScroll || (VAR_CAMERA_FAST_X != 0xFF && VAR(VAR_CAMERA_FAST_X)));
 
 	camera._cur.x &= 0xFFF8;
@@ -163,7 +163,7 @@ void ScummEngine::moveCamera() {
 
 	if (VAR_SCROLL_SCRIPT != 0xFF && VAR(VAR_SCROLL_SCRIPT) && pos != camera._cur.x) {
 		VAR(VAR_CAMERA_POS_X) = camera._cur.x;
-		runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, 0);
+		runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, nullptr);
 	}
 }
 
diff --git a/engines/scumm/cdda.cpp b/engines/scumm/cdda.cpp
index 2e380d02d8..70420c2944 100644
--- a/engines/scumm/cdda.cpp
+++ b/engines/scumm/cdda.cpp
@@ -110,11 +110,11 @@ Audio::SeekableAudioStream *makeCDDAStream(
 	Audio::SeekableAudioStream *s = new CDDAStream(stream, disposeAfterUse);
 	if (s && s->endOfData()) {
 		delete s;
-		return 0;
+		return nullptr;
 	} else {
 		return s;
 	}
-	return 0;
+	return nullptr;
 }
 
 } // End of namespace Scumm
diff --git a/engines/scumm/charset-fontdata.cpp b/engines/scumm/charset-fontdata.cpp
index a1e92a9950..a6d0e9a8d9 100644
--- a/engines/scumm/charset-fontdata.cpp
+++ b/engines/scumm/charset-fontdata.cpp
@@ -591,7 +591,7 @@ CharsetRendererV2::CharsetRendererV2(ScummEngine *vm, Common::Language language)
 	_fontHeight = 8;
 	_curId = 0;
 
-	const byte *replacementMap = NULL, *replacementData = NULL;
+	const byte *replacementMap = nullptr, *replacementData = nullptr;
 	int replacementChars = 0;
 
 	switch (language) {
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 471f9799cd..7ae0097ca1 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -104,7 +104,7 @@ void ScummEngine::loadCJKFont() {
 			   (_game.version >= 7 && (_language == Common::JA_JPN || _language == Common::ZH_TWN)) ||
 			   (_game.version >= 3 && _language == Common::ZH_CHN)) {
 		int numChar = 0;
-		const char *fontFile = NULL;
+		const char *fontFile = nullptr;
 
 		switch (_language) {
 		case Common::KO_KOR:
@@ -185,13 +185,13 @@ void ScummEngine::loadKorFont() {
 	if (_useMultiFont) {
 		debug("Loading Korean Multi Font System");
 		_numLoadedFont = 0;
-		_2byteFontPtr = NULL;
+		_2byteFontPtr = nullptr;
 		_2byteWidth = 0;
 		_2byteHeight = 0;
 		for (int i = 0; i < 20; i++) {
 			char fontFile[256];
 			snprintf(fontFile, sizeof(fontFile), "korean%02d.fnt", i);
-			_2byteMultiFontPtr[i] = NULL;
+			_2byteMultiFontPtr[i] = nullptr;
 			if (fp.open(fontFile)) {
 				_numLoadedFont++;
 				fp.readByte();
@@ -204,7 +204,7 @@ void ScummEngine::loadKorFont() {
 				warning("#%d, size %d, height =%d", i, fontSize, _2byteMultiHeight[i]);
 				fp.read(_2byteMultiFontPtr[i], fontSize);
 				fp.close();
-				if (_2byteFontPtr == NULL) {	// for non-initialized Smushplayer drawChar
+				if (_2byteFontPtr == nullptr) {	// for non-initialized Smushplayer drawChar
 					_2byteFontPtr = _2byteMultiFontPtr[i];
 					_2byteWidth = _2byteMultiWidth[i];
 					_2byteHeight = _2byteMultiHeight[i];
@@ -238,7 +238,7 @@ void ScummEngine::loadKorFont() {
 
 byte *ScummEngine::get2byteCharPtr(int idx) {
 	if (_game.platform == Common::kPlatformFMTowns || _game.platform == Common::kPlatformPCEngine)
-		return 0;
+		return nullptr;
 
 	switch (_language) {
 	case Common::KO_KOR:
@@ -251,7 +251,7 @@ byte *ScummEngine::get2byteCharPtr(int idx) {
 				int charsetId = 5;
 				int numChar = 1413;
 				byte *charsetPtr = getResourceAddress(rtCharset, charsetId);
-				if (charsetPtr == 0)
+				if (charsetPtr == nullptr)
 					error("ScummEngine::get2byteCharPtr: charset %d not found", charsetId);
 				memcpy(_2byteFontPtr, charsetPtr + 46, _2byteWidth * _2byteHeight * numChar / 8);
 			}
@@ -349,7 +349,7 @@ void CharsetRendererCommon::setCurID(int32 id) {
 	_curId = id;
 
 	_fontPtr = _vm->getResourceAddress(rtCharset, id);
-	if (_fontPtr == 0)
+	if (_fontPtr == nullptr)
 		error("CharsetRendererCommon::setCurID: charset %d not found", id);
 
 	if (_vm->_game.version == 4)
@@ -398,7 +398,7 @@ void CharsetRendererV3::setCurID(int32 id) {
 	_curId = id;
 
 	_fontPtr = _vm->getResourceAddress(rtCharset, id);
-	if (_fontPtr == 0)
+	if (_fontPtr == nullptr)
 		error("CharsetRendererCommon::setCurID: charset %d not found", id);
 
 	_bytesPerPixel = 1;
@@ -841,7 +841,7 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) {
 
 	assertRange(0, _curId, _vm->_numCharsets - 1, "charset");
 
-	if ((vs = _vm->findVirtScreen(_top)) == NULL) {
+	if ((vs = _vm->findVirtScreen(_top)) == nullptr) {
 		warning("findVirtScreen(%d) failed, therefore printChar cannot print '%c'", _top, chr);
 		return;
 	}
@@ -981,7 +981,7 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
 
 	assertRange(1, _curId, _vm->_numCharsets - 1, "charset");
 
-	if ((vs = _vm->findVirtScreen(_top)) == NULL && (vs = _vm->findVirtScreen(_top + getFontHeight())) == NULL)
+	if ((vs = _vm->findVirtScreen(_top)) == nullptr && (vs = _vm->findVirtScreen(_top + getFontHeight())) == nullptr)
 		return;
 
 	if (chr == '@')
@@ -1078,7 +1078,7 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
 
 void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr, int origWidth, int origHeight, int width, int height, VirtScreen *vs, bool ignoreCharsetMask) {
 	byte *dstPtr;
-	byte *back = NULL;
+	byte *back = nullptr;
 	int drawTop = _top - vs->topline;
 
 	if ((_vm->_game.heversion >= 71 && _bytesPerPixel >= 8) || (_vm->_game.heversion >= 90 && _bytesPerPixel == 0)) {
@@ -1242,7 +1242,7 @@ void CharsetRendererClassic::drawBitsN(const Graphics::Surface &s, byte *dst, co
 	// Indy4 Amiga always uses the room or verb palette map to match colors to
 	// the currently setup palette, thus we need to select it over here too.
 	// Done like the original interpreter.
-	byte *amigaMap = 0;
+	byte *amigaMap = nullptr;
 	if (_vm->_game.platform == Common::kPlatformAmiga && _vm->_game.id == GID_INDY4) {
 		if (_drawScreen == kVerbVirtScreen)
 			amigaMap = _vm->_verbPalette;
@@ -1507,7 +1507,7 @@ CharsetRendererMac::CharsetRendererMac(ScummEngine *vm, const Common::String &fo
 
 	_correctFontSpacing = correctFontSpacing;
 	_pad = false;
-	_glyphSurface = NULL;
+	_glyphSurface = nullptr;
 
 	// Indy 3 provides an "Indy" font in two sizes, 9 and 12, which are
 	// used for the text boxes. The smaller font can be used for a
@@ -1685,7 +1685,7 @@ void CharsetRendererMac::printChar(int chr, bool ignoreCharsetMask) {
 
 	VirtScreen *vs;
 
-	if ((vs = _vm->findVirtScreen(_top)) == NULL) {
+	if ((vs = _vm->findVirtScreen(_top)) == nullptr) {
 		warning("findVirtScreen(%d) failed, therefore printChar cannot print '%c'", _top, chr);
 		return;
 	}
@@ -2134,7 +2134,7 @@ void CharsetRendererNES::printChar(int chr, bool ignoreCharsetMask) {
 	if (_top == 0)
 		_top = 16;
 
-	if ((vs = _vm->findVirtScreen(_top)) == NULL)
+	if ((vs = _vm->findVirtScreen(_top)) == nullptr)
 		return;
 
 	if (chr == '@')
@@ -2313,7 +2313,7 @@ bool CharsetRendererTownsClassic::prepareDraw(uint16 chr) {
 
 	if (useFontRomCharacter(chr) && !noSjis) {
 		setupShadowMode();
-		_charPtr = 0;
+		_charPtr = nullptr;
 		_sjisCurChar = chr;
 
 		_width = getCharWidth(chr);
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index 7ba7c477f1..b878615542 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -549,7 +549,7 @@ void ClassicCostumeRenderer::proc3_ami(Codec1 &v1) {
 	// Indy4 Amiga always uses the room map to match colors to the currently
 	// setup palette in the actor code in the original, thus we need to do this
 	// mapping over here too.
-	byte *amigaMap = 0;
+	byte *amigaMap = nullptr;
 	if (_vm->_game.platform == Common::kPlatformAmiga && _vm->_game.id == GID_INDY4)
 		amigaMap = _vm->_roomPalette;
 
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index d730f973ef..36740b3368 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -136,7 +136,7 @@ void ScummEngine::updateCursor() {
 void ScummEngine_v6::grabCursor(int x, int y, int w, int h) {
 	VirtScreen *vs = findVirtScreen(y);
 
-	if (vs == NULL) {
+	if (vs == nullptr) {
 		debug(0, "grabCursor: invalid Y %d", y);
 		return;
 	}
@@ -315,7 +315,7 @@ void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) {
 		bomp = findResource(MKTAG('B','O','M','P'), dataptr);
 	}
 
-	if (bomp != NULL)
+	if (bomp != nullptr)
 		useBompCursor(bomp, w, h);
 	else
 		useIm01Cursor(dataptr, w, h);
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index 1a16a4cc6d..45feb91733 100644
--- a/engines/scumm/debugger.cpp
+++ b/engines/scumm/debugger.cpp
@@ -181,7 +181,7 @@ bool ScummDebugger::Cmd_Room(int argc, const char **argv) {
 		int room = atoi(argv[1]);
 		_vm->_actors[_vm->VAR(_vm->VAR_EGO)]->_room = room;
 		_vm->_sound->stopAllSounds();
-		_vm->startScene(room, 0, 0);
+		_vm->startScene(room, nullptr, 0);
 		_vm->_fullRedraw = true;
 		return false;
 	} else {
@@ -272,7 +272,7 @@ bool ScummDebugger::Cmd_Script(int argc, const char** argv) {
 	if ((!strcmp(argv[2], "kill")) || (!strcmp(argv[2], "stop"))) {
 		_vm->stopScript(scriptnum);
 	} else if ((!strcmp(argv[2], "run")) || (!strcmp(argv[2], "start"))) {
-		_vm->runScript(scriptnum, 0, 0, 0);
+		_vm->runScript(scriptnum, 0, 0, nullptr);
 		return false;
 	} else {
 		debugPrintf("Unknown script command '%s'\nUse <kill/stop | run/start> as command\n", argv[2]);
@@ -721,7 +721,7 @@ void ScummDebugger::drawBox(int box) {
 	fillQuad(_vm, r, 13);
 
 	VirtScreen *vs = _vm->findVirtScreen(coords.ul.y);
-	if (vs != NULL)
+	if (vs != nullptr)
 		_vm->markRectAsDirty(vs->number, 0, vs->w, 0, vs->h);
 	_vm->drawDirtyScreenParts();
 	_vm->_system->updateScreen();
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index d60be3d963..d595d660f8 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -125,7 +125,7 @@ static Common::String generatePreferredTarget(const DetectorResult &x) {
 DetectedGames ScummMetaEngineDetection::detectGames(const Common::FSList &fslist) const {
 	DetectedGames detectedGames;
 	Common::List<DetectorResult> results;
-	::detectGames(fslist, results, 0);
+	::detectGames(fslist, results, nullptr);
 
 	for (Common::List<DetectorResult>::iterator
 	          x = results.begin(); x != results.end(); ++x) {
diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp
index e8db237f26..1c8341a51e 100644
--- a/engines/scumm/file.cpp
+++ b/engines/scumm/file.cpp
@@ -241,20 +241,20 @@ static const int zakResourcesPerFile[59] = {
 
 static uint16 write_byte(Common::WriteStream *out, byte val) {
 	val ^= 0xFF;
-	if (out != 0)
+	if (out != nullptr)
 		out->writeByte(val);
 	return 1;
 }
 
 static uint16 write_word(Common::WriteStream *out, uint16 val) {
 	val ^= 0xFFFF;
-	if (out != 0)
+	if (out != nullptr)
 		out->writeUint16LE(val);
 	return 2;
 }
 
 ScummDiskImage::ScummDiskImage(const char *disk1, const char *disk2, GameSettings game)
-	: _stream(0), _buf(0), _game(game),
+	: _stream(nullptr), _buf(nullptr), _game(game),
 	_disk1(disk1), _disk2(disk2), _openedDisk(0) {
 
 	if (_game.id == GID_MANIAC) {
@@ -341,7 +341,7 @@ bool ScummDiskImage::open(const Common::Path &filename) {
 		return false;
 	}
 
-	extractIndex(0); // Fill in resource arrays
+	extractIndex(nullptr); // Fill in resource arrays
 
 	if (_game.features & GF_DEMO)
 		return true;
@@ -423,7 +423,7 @@ uint16 ScummDiskImage::extractIndex(Common::WriteStream *out) {
 bool ScummDiskImage::generateIndex() {
 	int bufsize;
 
-	bufsize = extractIndex(0);
+	bufsize = extractIndex(nullptr);
 
 	free(_buf);
 	_buf = (byte *)calloc(1, bufsize);
@@ -484,7 +484,7 @@ bool ScummDiskImage::generateResource(int res) {
 	if (res >= _numRooms)
 		return false;
 
-	bufsize = extractResource(0, res);
+	bufsize = extractResource(nullptr, res);
 
 	free(_buf);
 	_buf = (byte *)calloc(1, bufsize);
@@ -501,10 +501,10 @@ bool ScummDiskImage::generateResource(int res) {
 
 void ScummDiskImage::close() {
 	delete _stream;
-	_stream = 0;
+	_stream = nullptr;
 
 	free(_buf);
-	_buf = 0;
+	_buf = nullptr;
 
 	File::close();
 }
diff --git a/engines/scumm/file_nes.cpp b/engines/scumm/file_nes.cpp
index 02654e0bf3..4e40da944d 100644
--- a/engines/scumm/file_nes.cpp
+++ b/engines/scumm/file_nes.cpp
@@ -43,7 +43,7 @@ struct ScummNESFile::ResourceGroup {
 	const Resource *langs[ScummNESFile::kROMsetNum];
 };
 
-ScummNESFile::ScummNESFile() : _stream(0), _buf(0), _ROMset(kROMsetNum) {
+ScummNESFile::ScummNESFile() : _stream(nullptr), _buf(nullptr), _ROMset(kROMsetNum) {
 }
 
 static const ScummNESFile::Resource res_roomgfx_usa[40] = {
@@ -921,14 +921,14 @@ const ScummNESFile::ResourceGroup res_preplist = {
 
 static uint16 write_byte(Common::WriteStream *out, byte val) {
 	val ^= 0xFF;
-	if (out != 0)
+	if (out != nullptr)
 		out->writeByte(val);
 	return 1;
 }
 
 static uint16 write_word(Common::WriteStream *out, uint16 val) {
 	val ^= 0xFFFF;
-	if (out != 0)
+	if (out != nullptr)
 		out->writeUint16LE(val);
 	return 2;
 }
@@ -951,7 +951,7 @@ uint16 ScummNESFile::extractResource(Common::WriteStream *output, const Resource
 	byte cnt;
 	uint16 reslen = 0;
 
-	if (res == NULL)
+	if (res == nullptr)
 		error("extract_resource - no resource specified");
 
 	if ((res->offset == 0) && (res->length == 0))
@@ -1100,62 +1100,62 @@ struct ScummNESFile::LFLEntry {
 // based on structure of Classic PC Maniac Mansion LFL files
 // (roomgfx resources are arranged in order, one per file,
 // after the room blocks)
-static const ScummNESFile::LFLEntry lfl_01[] = { {&res_rooms, 1}, {&res_roomgfx, 1}, {&res_scripts, 57}, {&res_scripts, 61}, {&res_scripts, 76}, {&res_scripts, 105}, {&res_scripts, 111}, {&res_sounds, 5}, {&res_scripts, 132}, {&res_scripts, 148}, {&res_scripts, 155}, {&res_scripts, 156}, {&res_sounds, 39}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_02[] = { {&res_rooms, 2}, {&res_roomgfx, 2}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_03[] = { {&res_rooms, 3}, {&res_roomgfx, 3}, {&res_scripts, 21}, {&res_sounds, 26}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_04[] = { {&res_rooms, 4}, {&res_roomgfx, 4}, {&res_scripts, 46}, {&res_scripts, 56}, {&res_scripts, 137}, {&res_scripts, 146}, {&res_sounds, 12}, {&res_sounds, 11}, {&res_sounds, 13}, {&res_sounds, 42}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_05[] = { {&res_rooms, 5}, {&res_roomgfx, 5}, {&res_scripts, 30}, {&res_scripts, 31}, {&res_scripts, 32}, {&res_scripts, 33}, {&res_scripts, 34}, {&res_scripts, 35}, {&res_sounds, 22}, {&res_sounds, 23}, {&res_sounds, 24}, {&res_sounds, 21}, {&res_sounds, 46}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_06[] = { {&res_rooms, 6}, {&res_roomgfx, 6}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_07[] = { {&res_rooms, 7}, {&res_roomgfx, 7}, {&res_scripts, 17}, {&res_scripts, 58}, {&res_scripts, 59}, {&res_scripts, 60}, {&res_scripts, 74}, {&res_scripts, 81}, {&res_scripts, 82}, {&res_scripts, 150}, {&res_sounds, 14}, {&res_sounds, 15}, {&res_sounds, 16}, {&res_sounds, 17}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_08[] = { {&res_rooms, 8}, {&res_roomgfx, 8}, {&res_scripts, 7}, {&res_scripts, 12}, {&res_scripts, 13}, {&res_scripts, 47}, {&res_scripts, 48}, {&res_scripts, 49}, {&res_scripts, 154}, {&res_sounds, 32}, {&res_sounds, 33}, {&res_sounds, 36}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_09[] = { {&res_rooms, 9}, {&res_roomgfx, 9}, {&res_scripts, 10}, {&res_scripts, 11}, {&res_scripts, 45}, {&res_scripts, 55}, {&res_scripts, 84}, {&res_scripts, 85}, {&res_scripts, 86}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_10[] = { {&res_rooms, 10}, {&res_roomgfx, 10}, {&res_scripts, 24}, {&res_scripts, 149}, {&res_sounds, 28}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_11[] = { {&res_rooms, 11}, {&res_roomgfx, 11}, {&res_scripts, 166}, {&res_scripts, 167}, {&res_scripts, 168}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_12[] = { {&res_rooms, 12}, {&res_roomgfx, 12}, {&res_scripts, 51}, {&res_scripts, 103}, {&res_scripts, 104}, {&res_scripts, 161}, {&res_sounds, 63}, {&res_costumes, 14}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_13[] = { {&res_rooms, 13}, {&res_roomgfx, 13}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_14[] = { {&res_rooms, 14}, {&res_roomgfx, 14}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_15[] = { {&res_rooms, 15}, {&res_roomgfx, 15}, {&res_sounds, 27}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_16[] = { {&res_rooms, 16}, {&res_roomgfx, 16}, {&res_scripts, 14}, {&res_scripts, 121}, {&res_scripts, 122}, {&res_sounds, 40}, {&res_sounds, 64}, {&res_sounds, 68}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_17[] = { {&res_rooms, 17}, {&res_roomgfx, 17}, {&res_scripts, 20}, {&res_scripts, 100}, {&res_sounds, 25}, {&res_sounds, 44}, {&res_sounds, 2}, {&res_sounds, 50}, {&res_sounds, 52}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_18[] = { {&res_rooms, 18}, {&res_roomgfx, 18}, {&res_scripts, 25}, {&res_scripts, 26}, {&res_scripts, 27}, {&res_scripts, 28}, {&res_scripts, 64}, {&res_scripts, 65}, {&res_scripts, 66}, {&res_scripts, 67}, {&res_scripts, 68}, {&res_scripts, 69}, {&res_scripts, 70}, {&res_scripts, 71}, {&res_scripts, 73}, {&res_scripts, 101}, {&res_sounds, 35}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_19[] = { {&res_rooms, 19}, {&res_roomgfx, 19}, {&res_scripts, 36}, {&res_scripts, 37}, {&res_scripts, 38}, {&res_scripts, 39}, {&res_scripts, 40}, {&res_scripts, 152}, {&res_scripts, 153}, {&res_costumes, 10}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_20[] = { {&res_rooms, 20}, {&res_roomgfx, 20}, {&res_scripts, 107}, {&res_scripts, 108}, {&res_scripts, 109}, {&res_scripts, 110}, {&res_scripts, 159}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_21[] = { {&res_rooms, 21}, {&res_roomgfx, 21}, {&res_scripts, 41}, {&res_scripts, 42}, {&res_scripts, 43}, {&res_scripts, 53}, {&res_scripts, 136}, {&res_sounds, 29}, {&res_sounds, 20}, {&res_sounds, 37}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_22[] = { {&res_rooms, 22}, {&res_roomgfx, 22}, {&res_scripts, 15}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_23[] = { {&res_rooms, 23}, {&res_roomgfx, 23}, {&res_scripts, 77}, {&res_scripts, 79}, {&res_scripts, 80}, {&res_scripts, 83}, {&res_sounds, 41}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_24[] = { {&res_rooms, 24}, {&res_roomgfx, 24}, {&res_scripts, 18}, {&res_scripts, 19}, {&res_scripts, 78}, {&res_sounds, 7}, {&res_sounds, 3}, {&res_sounds, 18}, {&res_sounds, 34}, {&res_costumes, 12}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_25[] = { {&res_rooms, 25}, {&res_roomgfx, 25}, {&res_scripts, 29}, {&res_sounds, 30}, {&res_sounds, 31}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_26[] = { {&res_rooms, 26}, {&res_roomgfx, 26}, {&res_scripts, 87}, {&res_scripts, 88}, {&res_scripts, 89}, {&res_scripts, 90}, {&res_scripts, 91}, {&res_scripts, 92}, {&res_scripts, 93}, {&res_scripts, 94}, {&res_scripts, 95}, {&res_scripts, 96}, {&res_scripts, 97}, {&res_scripts, 98}, {&res_scripts, 116}, {&res_scripts, 151}, {&res_scripts, 174}, {&res_costumes, 11}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_27[] = { {&res_rooms, 27}, {&res_roomgfx, 27}, {&res_scripts, 16}, {&res_scripts, 52}, {&res_scripts, 54}, {&res_scripts, 113}, {&res_sounds, 45}, {&res_costumes, 19}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_28[] = { {&res_rooms, 28}, {&res_roomgfx, 28}, {&res_scripts, 22}, {&res_scripts, 23}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_29[] = { {&res_rooms, 29}, {&res_roomgfx, 29}, {&res_scripts, 75}, {&res_sounds, 43}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_30[] = { {&res_rooms, 30}, {&res_roomgfx, 30}, {&res_scripts, 63}, {&res_sounds, 0}, {&res_scripts, 123}, {&res_scripts, 125}, {&res_scripts, 126}, {&res_scripts, 127}, {&res_scripts, 129}, {&res_sounds, 55}, {&res_sounds, 59}, {&res_sounds, 60}, {&res_costumes, 8}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_31[] = { {&res_rooms, 31}, {&res_roomgfx, 31}, {&res_scripts, 99}, {&res_scripts, 115}, {&res_scripts, 117}, {&res_scripts, 119}, {&res_scripts, 147}, {&res_scripts, 157}, {&res_scripts, 158}, {&res_scripts, 160}, {&res_costumes, 13}, {&res_costumes, 9}, {&res_costumes, 23}, {&res_costumes, 24}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_32[] = { {&res_rooms, 32}, {&res_roomgfx, 32}, {&res_costumes, 15}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_33[] = { {&res_rooms, 33}, {&res_roomgfx, 33}, {&res_scripts, 120}, {&res_scripts, 135}, {&res_sounds, 56}, {&res_sounds, 57}, {&res_sounds, 58}, {&res_sounds, 1}, {&res_costumes, 22}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_34[] = { {&res_rooms, 34}, {&res_roomgfx, 34}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_35[] = { {&res_rooms, 35}, {&res_roomgfx, 35}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_36[] = { {&res_rooms, 36}, {&res_roomgfx, 36}, {&res_sounds, 10}, {&res_sounds, 4}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_37[] = { {&res_rooms, 37}, {&res_roomgfx, 37}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_38[] = { {&res_rooms, 38}, {&res_roomgfx, 38}, {&res_scripts, 138}, {&res_scripts, 139}, {&res_scripts, 140}, {&res_scripts, 141}, {&res_scripts, 142}, {&res_scripts, 143}, {&res_scripts, 144}, {&res_scripts, 145}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_39[] = { {&res_rooms, 39}, {&res_roomgfx, 39}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_40[] = { {&res_rooms, 40}, {&res_roomgfx, 0}, {&res_scripts, 112}, {&res_costumes, 17}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_41[] = { {&res_rooms, 41}, {&res_scripts, 106}, {&res_sounds, 47}, {&res_sounds, 48}, {&res_sounds, 53}, {&res_sounds, 49}, {&res_sounds, 51}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_42[] = { {&res_rooms, 42}, {&res_scripts, 124}, {&res_costumes, 18}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_43[] = { {&res_rooms, 43}, {&res_scripts, 44}, {&res_sounds, 19}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_44[] = { {&res_rooms, 44}, {&res_scripts, 102}, {&res_sounds, 6}, {&res_sounds, 38}, {&res_sounds, 8}, {&res_sounds, 9}, {&res_costumes, 1}, {&res_costumes, 2}, {&res_costumes, 5}, {&res_costumes, 6}, {&res_costumes, 3}, {&res_costumes, 4}, {&res_costumes, 7}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_45[] = { {&res_rooms, 45}, {&res_scripts, 1}, {&res_scripts, 2}, {&res_scripts, 3}, {&res_scripts, 4}, {&res_scripts, 5}, {&res_scripts, 9}, {&res_scripts, 114}, {&res_scripts, 131}, {&res_scripts, 164}, {&res_scripts, 165}, {&res_scripts, 169}, {&res_scripts, 170}, {&res_scripts, 171}, {&res_scripts, 172}, {&res_scripts, 173}, {&res_scripts, 175}, {&res_sounds, 54}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_46[] = { {&res_rooms, 46}, {&res_scripts, 130}, {&res_sounds, 65}, {&res_costumes, 0}, {&res_costumes, 21}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_47[] = { {&res_rooms, 47}, {&res_scripts, 62}, {&res_sounds, 69}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_48[] = { {&res_rooms, 48}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_49[] = { {&res_rooms, 49}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_50[] = { {&res_rooms, 50}, {&res_scripts, 133}, {&res_scripts, 163}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_51[] = { {&res_rooms, 51}, {&res_scripts, 118}, {&res_scripts, 128}, {&res_sounds, 61}, {&res_sounds, 62}, {&res_sounds, 67}, {&res_sounds, 66}, {&res_costumes, 16}, {&res_costumes, 20}, {NULL, 0} };
-static const ScummNESFile::LFLEntry lfl_52[] = { {&res_rooms, 52}, {NULL, 0} };
+static const ScummNESFile::LFLEntry lfl_01[] = { {&res_rooms, 1}, {&res_roomgfx, 1}, {&res_scripts, 57}, {&res_scripts, 61}, {&res_scripts, 76}, {&res_scripts, 105}, {&res_scripts, 111}, {&res_sounds, 5}, {&res_scripts, 132}, {&res_scripts, 148}, {&res_scripts, 155}, {&res_scripts, 156}, {&res_sounds, 39}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_02[] = { {&res_rooms, 2}, {&res_roomgfx, 2}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_03[] = { {&res_rooms, 3}, {&res_roomgfx, 3}, {&res_scripts, 21}, {&res_sounds, 26}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_04[] = { {&res_rooms, 4}, {&res_roomgfx, 4}, {&res_scripts, 46}, {&res_scripts, 56}, {&res_scripts, 137}, {&res_scripts, 146}, {&res_sounds, 12}, {&res_sounds, 11}, {&res_sounds, 13}, {&res_sounds, 42}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_05[] = { {&res_rooms, 5}, {&res_roomgfx, 5}, {&res_scripts, 30}, {&res_scripts, 31}, {&res_scripts, 32}, {&res_scripts, 33}, {&res_scripts, 34}, {&res_scripts, 35}, {&res_sounds, 22}, {&res_sounds, 23}, {&res_sounds, 24}, {&res_sounds, 21}, {&res_sounds, 46}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_06[] = { {&res_rooms, 6}, {&res_roomgfx, 6}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_07[] = { {&res_rooms, 7}, {&res_roomgfx, 7}, {&res_scripts, 17}, {&res_scripts, 58}, {&res_scripts, 59}, {&res_scripts, 60}, {&res_scripts, 74}, {&res_scripts, 81}, {&res_scripts, 82}, {&res_scripts, 150}, {&res_sounds, 14}, {&res_sounds, 15}, {&res_sounds, 16}, {&res_sounds, 17}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_08[] = { {&res_rooms, 8}, {&res_roomgfx, 8}, {&res_scripts, 7}, {&res_scripts, 12}, {&res_scripts, 13}, {&res_scripts, 47}, {&res_scripts, 48}, {&res_scripts, 49}, {&res_scripts, 154}, {&res_sounds, 32}, {&res_sounds, 33}, {&res_sounds, 36}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_09[] = { {&res_rooms, 9}, {&res_roomgfx, 9}, {&res_scripts, 10}, {&res_scripts, 11}, {&res_scripts, 45}, {&res_scripts, 55}, {&res_scripts, 84}, {&res_scripts, 85}, {&res_scripts, 86}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_10[] = { {&res_rooms, 10}, {&res_roomgfx, 10}, {&res_scripts, 24}, {&res_scripts, 149}, {&res_sounds, 28}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_11[] = { {&res_rooms, 11}, {&res_roomgfx, 11}, {&res_scripts, 166}, {&res_scripts, 167}, {&res_scripts, 168}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_12[] = { {&res_rooms, 12}, {&res_roomgfx, 12}, {&res_scripts, 51}, {&res_scripts, 103}, {&res_scripts, 104}, {&res_scripts, 161}, {&res_sounds, 63}, {&res_costumes, 14}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_13[] = { {&res_rooms, 13}, {&res_roomgfx, 13}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_14[] = { {&res_rooms, 14}, {&res_roomgfx, 14}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_15[] = { {&res_rooms, 15}, {&res_roomgfx, 15}, {&res_sounds, 27}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_16[] = { {&res_rooms, 16}, {&res_roomgfx, 16}, {&res_scripts, 14}, {&res_scripts, 121}, {&res_scripts, 122}, {&res_sounds, 40}, {&res_sounds, 64}, {&res_sounds, 68}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_17[] = { {&res_rooms, 17}, {&res_roomgfx, 17}, {&res_scripts, 20}, {&res_scripts, 100}, {&res_sounds, 25}, {&res_sounds, 44}, {&res_sounds, 2}, {&res_sounds, 50}, {&res_sounds, 52}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_18[] = { {&res_rooms, 18}, {&res_roomgfx, 18}, {&res_scripts, 25}, {&res_scripts, 26}, {&res_scripts, 27}, {&res_scripts, 28}, {&res_scripts, 64}, {&res_scripts, 65}, {&res_scripts, 66}, {&res_scripts, 67}, {&res_scripts, 68}, {&res_scripts, 69}, {&res_scripts, 70}, {&res_scripts, 71}, {&res_scripts, 73}, {&res_scripts, 101}, {&res_sounds, 35}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_19[] = { {&res_rooms, 19}, {&res_roomgfx, 19}, {&res_scripts, 36}, {&res_scripts, 37}, {&res_scripts, 38}, {&res_scripts, 39}, {&res_scripts, 40}, {&res_scripts, 152}, {&res_scripts, 153}, {&res_costumes, 10}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_20[] = { {&res_rooms, 20}, {&res_roomgfx, 20}, {&res_scripts, 107}, {&res_scripts, 108}, {&res_scripts, 109}, {&res_scripts, 110}, {&res_scripts, 159}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_21[] = { {&res_rooms, 21}, {&res_roomgfx, 21}, {&res_scripts, 41}, {&res_scripts, 42}, {&res_scripts, 43}, {&res_scripts, 53}, {&res_scripts, 136}, {&res_sounds, 29}, {&res_sounds, 20}, {&res_sounds, 37}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_22[] = { {&res_rooms, 22}, {&res_roomgfx, 22}, {&res_scripts, 15}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_23[] = { {&res_rooms, 23}, {&res_roomgfx, 23}, {&res_scripts, 77}, {&res_scripts, 79}, {&res_scripts, 80}, {&res_scripts, 83}, {&res_sounds, 41}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_24[] = { {&res_rooms, 24}, {&res_roomgfx, 24}, {&res_scripts, 18}, {&res_scripts, 19}, {&res_scripts, 78}, {&res_sounds, 7}, {&res_sounds, 3}, {&res_sounds, 18}, {&res_sounds, 34}, {&res_costumes, 12}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_25[] = { {&res_rooms, 25}, {&res_roomgfx, 25}, {&res_scripts, 29}, {&res_sounds, 30}, {&res_sounds, 31}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_26[] = { {&res_rooms, 26}, {&res_roomgfx, 26}, {&res_scripts, 87}, {&res_scripts, 88}, {&res_scripts, 89}, {&res_scripts, 90}, {&res_scripts, 91}, {&res_scripts, 92}, {&res_scripts, 93}, {&res_scripts, 94}, {&res_scripts, 95}, {&res_scripts, 96}, {&res_scripts, 97}, {&res_scripts, 98}, {&res_scripts, 116}, {&res_scripts, 151}, {&res_scripts, 174}, {&res_costumes, 11}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_27[] = { {&res_rooms, 27}, {&res_roomgfx, 27}, {&res_scripts, 16}, {&res_scripts, 52}, {&res_scripts, 54}, {&res_scripts, 113}, {&res_sounds, 45}, {&res_costumes, 19}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_28[] = { {&res_rooms, 28}, {&res_roomgfx, 28}, {&res_scripts, 22}, {&res_scripts, 23}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_29[] = { {&res_rooms, 29}, {&res_roomgfx, 29}, {&res_scripts, 75}, {&res_sounds, 43}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_30[] = { {&res_rooms, 30}, {&res_roomgfx, 30}, {&res_scripts, 63}, {&res_sounds, 0}, {&res_scripts, 123}, {&res_scripts, 125}, {&res_scripts, 126}, {&res_scripts, 127}, {&res_scripts, 129}, {&res_sounds, 55}, {&res_sounds, 59}, {&res_sounds, 60}, {&res_costumes, 8}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_31[] = { {&res_rooms, 31}, {&res_roomgfx, 31}, {&res_scripts, 99}, {&res_scripts, 115}, {&res_scripts, 117}, {&res_scripts, 119}, {&res_scripts, 147}, {&res_scripts, 157}, {&res_scripts, 158}, {&res_scripts, 160}, {&res_costumes, 13}, {&res_costumes, 9}, {&res_costumes, 23}, {&res_costumes, 24}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_32[] = { {&res_rooms, 32}, {&res_roomgfx, 32}, {&res_costumes, 15}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_33[] = { {&res_rooms, 33}, {&res_roomgfx, 33}, {&res_scripts, 120}, {&res_scripts, 135}, {&res_sounds, 56}, {&res_sounds, 57}, {&res_sounds, 58}, {&res_sounds, 1}, {&res_costumes, 22}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_34[] = { {&res_rooms, 34}, {&res_roomgfx, 34}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_35[] = { {&res_rooms, 35}, {&res_roomgfx, 35}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_36[] = { {&res_rooms, 36}, {&res_roomgfx, 36}, {&res_sounds, 10}, {&res_sounds, 4}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_37[] = { {&res_rooms, 37}, {&res_roomgfx, 37}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_38[] = { {&res_rooms, 38}, {&res_roomgfx, 38}, {&res_scripts, 138}, {&res_scripts, 139}, {&res_scripts, 140}, {&res_scripts, 141}, {&res_scripts, 142}, {&res_scripts, 143}, {&res_scripts, 144}, {&res_scripts, 145}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_39[] = { {&res_rooms, 39}, {&res_roomgfx, 39}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_40[] = { {&res_rooms, 40}, {&res_roomgfx, 0}, {&res_scripts, 112}, {&res_costumes, 17}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_41[] = { {&res_rooms, 41}, {&res_scripts, 106}, {&res_sounds, 47}, {&res_sounds, 48}, {&res_sounds, 53}, {&res_sounds, 49}, {&res_sounds, 51}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_42[] = { {&res_rooms, 42}, {&res_scripts, 124}, {&res_costumes, 18}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_43[] = { {&res_rooms, 43}, {&res_scripts, 44}, {&res_sounds, 19}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_44[] = { {&res_rooms, 44}, {&res_scripts, 102}, {&res_sounds, 6}, {&res_sounds, 38}, {&res_sounds, 8}, {&res_sounds, 9}, {&res_costumes, 1}, {&res_costumes, 2}, {&res_costumes, 5}, {&res_costumes, 6}, {&res_costumes, 3}, {&res_costumes, 4}, {&res_costumes, 7}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_45[] = { {&res_rooms, 45}, {&res_scripts, 1}, {&res_scripts, 2}, {&res_scripts, 3}, {&res_scripts, 4}, {&res_scripts, 5}, {&res_scripts, 9}, {&res_scripts, 114}, {&res_scripts, 131}, {&res_scripts, 164}, {&res_scripts, 165}, {&res_scripts, 169}, {&res_scripts, 170}, {&res_scripts, 171}, {&res_scripts, 172}, {&res_scripts, 173}, {&res_scripts, 175}, {&res_sounds, 54}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_46[] = { {&res_rooms, 46}, {&res_scripts, 130}, {&res_sounds, 65}, {&res_costumes, 0}, {&res_costumes, 21}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_47[] = { {&res_rooms, 47}, {&res_scripts, 62}, {&res_sounds, 69}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_48[] = { {&res_rooms, 48}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_49[] = { {&res_rooms, 49}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_50[] = { {&res_rooms, 50}, {&res_scripts, 133}, {&res_scripts, 163}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_51[] = { {&res_rooms, 51}, {&res_scripts, 118}, {&res_scripts, 128}, {&res_sounds, 61}, {&res_sounds, 62}, {&res_sounds, 67}, {&res_sounds, 66}, {&res_costumes, 16}, {&res_costumes, 20}, {nullptr, 0} };
+static const ScummNESFile::LFLEntry lfl_52[] = { {&res_rooms, 52}, {nullptr, 0} };
 // remaining 'standard' resources (not used by any of the original LFL files)
-static const ScummNESFile::LFLEntry lfl_53[] = { {&res_rooms, 53}, {&res_scripts, 177}, {&res_scripts, 178}, {&res_sounds, 70}, {&res_sounds, 71}, {&res_sounds, 72}, {&res_sounds, 73}, {&res_sounds, 74}, {&res_sounds, 75}, {&res_sounds, 76}, {&res_sounds, 77}, {&res_sounds, 78}, {&res_sounds, 79}, {&res_sounds, 80}, {&res_sounds, 81}, {NULL, 0} };
+static const ScummNESFile::LFLEntry lfl_53[] = { {&res_rooms, 53}, {&res_scripts, 177}, {&res_scripts, 178}, {&res_sounds, 70}, {&res_sounds, 71}, {&res_sounds, 72}, {&res_sounds, 73}, {&res_sounds, 74}, {&res_sounds, 75}, {&res_sounds, 76}, {&res_sounds, 77}, {&res_sounds, 78}, {&res_sounds, 79}, {&res_sounds, 80}, {&res_sounds, 81}, {nullptr, 0} };
 // all 'non-standard' resources (the costume-related stuff)
-static const ScummNESFile::LFLEntry lfl_54[] = { {&res_rooms, 54}, {&res_sprdesc, 0}, {&res_sprdesc, 1}, {&res_sprlens, 0}, {&res_sprlens, 1}, {&res_sproffs, 0}, {&res_sproffs, 1}, {&res_sprdata, 0}, {&res_sprdata, 1}, {&res_costumegfx, 0}, {&res_costumegfx, 1}, {&res_sprpals, 0}, {&res_sprpals, 1}, {&res_charset, 0}, {&res_preplist, 0}, {NULL, 0} };
+static const ScummNESFile::LFLEntry lfl_54[] = { {&res_rooms, 54}, {&res_sprdesc, 0}, {&res_sprdesc, 1}, {&res_sprlens, 0}, {&res_sprlens, 1}, {&res_sproffs, 0}, {&res_sproffs, 1}, {&res_sprdata, 0}, {&res_sprdata, 1}, {&res_costumegfx, 0}, {&res_costumegfx, 1}, {&res_sprpals, 0}, {&res_sprpals, 1}, {&res_charset, 0}, {&res_preplist, 0}, {nullptr, 0} };
 
 struct ScummNESFile::LFL {
 	int num;
@@ -1217,7 +1217,7 @@ static const ScummNESFile::LFL lfls[] = {
 	{ 52, lfl_52 },
 	{ 53, lfl_53 },
 	{ 54, lfl_54 },
-	{ -1, NULL }
+	{ -1, nullptr }
 };
 
 #include "common/pack-start.h"	// START STRUCT PACKING
@@ -1240,15 +1240,15 @@ bool ScummNESFile::generateResource(int res) {
 	int j;
 	int bufsize = 2;
 
-	for (j = 0; lfl->entries[j].type != NULL; j++)
-		bufsize += extractResource(0, &lfl->entries[j].type->langs[_ROMset][lfl->entries[j].index], lfl->entries[j].type->type);
+	for (j = 0; lfl->entries[j].type != nullptr; j++)
+		bufsize += extractResource(nullptr, &lfl->entries[j].type->langs[_ROMset][lfl->entries[j].index], lfl->entries[j].type->type);
 
 	free(_buf);
 	_buf = (byte *)calloc(1, bufsize);
 
 	Common::MemoryWriteStream out(_buf, bufsize);
 
-	for (j = 0; lfl->entries[j].type != NULL; j++) {
+	for (j = 0; lfl->entries[j].type != nullptr; j++) {
 		const Resource *entry = &lfl->entries[j].type->langs[_ROMset][lfl->entries[j].index];
 		extractResource(&out, entry, lfl->entries[j].type->type);
 	}
@@ -1272,7 +1272,7 @@ bool ScummNESFile::generateIndex() {
 		const LFL *lfl = &lfls[i];
 		uint16 respos = 0;
 
-		for (j = 0; lfl->entries[j].type != NULL; j++) {
+		for (j = 0; lfl->entries[j].type != nullptr; j++) {
 			const LFLEntry *entry = &lfl->entries[j];
 
 			switch (entry->type->type) {
@@ -1332,7 +1332,7 @@ bool ScummNESFile::generateIndex() {
 				error("Unindexed entry found");
 				break;
 			}
-			respos += extractResource(0, &entry->type->langs[_ROMset][entry->index], entry->type->type);
+			respos += extractResource(nullptr, &entry->type->langs[_ROMset][entry->index], entry->type->type);
 		}
 	}
 
@@ -1403,10 +1403,10 @@ bool ScummNESFile::open(const Common::Path &filename) {
 
 	if (File::open(filename)) {
 		delete _stream;
-		_stream = 0;
+		_stream = nullptr;
 
 		free(_buf);
-		_buf = 0;
+		_buf = nullptr;
 
 		return true;
 	} else {
@@ -1416,10 +1416,10 @@ bool ScummNESFile::open(const Common::Path &filename) {
 
 void ScummNESFile::close() {
 	delete _stream;
-	_stream = 0;
+	_stream = nullptr;
 
 	free(_buf);
-	_buf = 0;
+	_buf = nullptr;
 
 	File::close();
 }
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 0f47f4cfcc..3c563d0db7 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -220,7 +220,7 @@ Gdi::Gdi(ScummEngine *vm) : _vm(vm) {
 Gdi::~Gdi() {
 }
 
-GdiHE::GdiHE(ScummEngine *vm) : Gdi(vm), _tmskPtr(0) {
+GdiHE::GdiHE(ScummEngine *vm) : Gdi(vm), _tmskPtr(nullptr) {
 }
 
 
@@ -245,7 +245,7 @@ GdiV1::GdiV1(ScummEngine *vm) : Gdi(vm) {
 }
 
 GdiV2::GdiV2(ScummEngine *vm) : Gdi(vm) {
-	_roomStrips = 0;
+	_roomStrips = nullptr;
 }
 
 GdiV2::~GdiV2() {
@@ -403,7 +403,7 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int
 	vs->h = height;
 	vs->hasTwoBuffers = twobufs;
 	vs->xstart = 0;
-	vs->backBuf = NULL;
+	vs->backBuf = nullptr;
 	if (_game.features & GF_16BIT_COLOR)
 		vs->format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
 	else
@@ -456,7 +456,7 @@ VirtScreen *ScummEngine::findVirtScreen(int y) {
 			return vs;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 void ScummEngine::markRectAsDirty(VirtScreenNumber virt, int left, int right, int top, int bottom, int dirtybit) {
@@ -1043,7 +1043,7 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
 	if (rect.left >= rect.right || rect.top >= rect.bottom)
 		return;
 
-	if ((vs = findVirtScreen(rect.top)) == NULL)
+	if ((vs = findVirtScreen(rect.top)) == nullptr)
 		return;
 
 	if (rect.left > vs->w)
@@ -1201,8 +1201,8 @@ byte *Gdi::getMaskBuffer(int x, int y, int z) {
 static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h, uint8 bitDepth) {
 	assert(w > 0);
 	assert(h > 0);
-	assert(src != NULL);
-	assert(dst != NULL);
+	assert(src != nullptr);
+	assert(dst != nullptr);
 
 	if ((w * bitDepth == srcPitch) && (w * bitDepth == dstPitch)) {
 		memcpy(dst, src, w * h * bitDepth);
@@ -1217,7 +1217,7 @@ static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w,
 
 static void fill(byte *dst, int dstPitch, uint16 color, int w, int h, uint8 bitDepth) {
 	assert(h > 0);
-	assert(dst != NULL);
+	assert(dst != nullptr);
 
 	if (bitDepth == 2) {
 		do {
@@ -1288,7 +1288,7 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
 	VirtScreen *vs;
 	byte *backbuff, *bgbuff;
 
-	if ((vs = findVirtScreen(y)) == NULL)
+	if ((vs = findVirtScreen(y)) == nullptr)
 		return;
 
 	// Indy4 Amiga always uses the room or verb palette map to match colors to
@@ -1448,7 +1448,7 @@ void ScummEngine::moveScreen(int dx, int dy, int height) {
 
 void ScummEngine_v5::clearFlashlight() {
 	_flashlight.isDrawn = false;
-	_flashlight.buffer = NULL;
+	_flashlight.buffer = nullptr;
 }
 
 void ScummEngine_v5::drawFlashlight() {
@@ -1593,7 +1593,7 @@ void GdiHE::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
 	if (_vm->_game.heversion >= 72) {
 		_tmskPtr = _vm->findResource(MKTAG('T','M','S','K'), ptr);
 	} else
-		_tmskPtr = 0;
+		_tmskPtr = nullptr;
 }
 
 void GdiV1::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
@@ -1632,7 +1632,7 @@ void GdiV2::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
 	// difficult to draw only parts of a room/object. We handle the V2 graphics
 	// differently from all other (newer) graphic formats for this reason.
 	//
-	StripTable *table = (_objectMode ? 0 : _roomStrips);
+	StripTable *table = (_objectMode ? nullptr : _roomStrips);
 	const int left = (stripnr * 8);
 	const int right = left + (numstrip * 8);
 	byte *dst;
@@ -1762,7 +1762,7 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
 		assert(numzbuf <= 9);
 
 		if (_vm->_game.id == GID_LOOM && _vm->_game.platform == Common::kPlatformPCEngine) {
-			zplane_list[1] = 0;
+			zplane_list[1] = nullptr;
 		} else if (_vm->_game.features & GF_SMALL_HEADER) {
 			if (_vm->_game.features & GF_16COLOR)
 				zplane_list[1] = ptr + READ_LE_UINT16(ptr);
@@ -1770,7 +1770,7 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
 				zplane_list[1] = ptr + READ_LE_UINT32(ptr);
 				if (_vm->_game.features & GF_OLD256) {
 					if (0 == READ_LE_UINT32(zplane_list[1]))
-						zplane_list[1] = 0;
+						zplane_list[1] = nullptr;
 				}
 			}
 			for (i = 2; i < numzbuf; i++) {
@@ -3250,7 +3250,7 @@ void GdiV1::decodeV1Gfx(const byte *src, byte *dst, int size) const {
 StripTable *GdiV2::generateStripTable(const byte *src, int width, int height, StripTable *table) const {
 
 	// If no strip table was given to use, allocate a new one
-	if (table == 0)
+	if (table == nullptr)
 		table = (StripTable *)calloc(1, sizeof(StripTable));
 
 	const byte *bitmapStart = src;
@@ -4008,7 +4008,7 @@ void ScummEngine::dissolveEffect(int width, int height) {
 		h++;
 
 	offsets = (int *) malloc(w * h * sizeof(int));
-	if (offsets == NULL)
+	if (offsets == nullptr)
 		error("dissolveEffect: out of memory");
 
 	// Create a permutation of offsets into the frame buffer
@@ -4034,7 +4034,7 @@ void ScummEngine::dissolveEffect(int width, int height) {
 				offsets[i++] = y * vs->pitch + x;
 
 		offsets2 = (int *) malloc(w * h * sizeof(int));
-		if (offsets2 == NULL)
+		if (offsets2 == nullptr)
 			error("dissolveEffect: out of memory");
 
 		memcpy(offsets2, offsets, w * h * sizeof(int));
diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp
index 96dc11f476..1a418af992 100644
--- a/engines/scumm/gfx_towns.cpp
+++ b/engines/scumm/gfx_towns.cpp
@@ -382,7 +382,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int scaleW, int s
 	assert(l->pixels);
 
 	delete[] l->bltTmpPal;
-	l->bltTmpPal = (l->bpp == 1 && _pixelFormat.bytesPerPixel == 2) ? new uint16[l->numCol] : 0;
+	l->bltTmpPal = (l->bpp == 1 && _pixelFormat.bytesPerPixel == 2) ? new uint16[l->numCol] : nullptr;
 
 	l->enabled = true;
 	_layers[0].onBottom = true;
@@ -433,11 +433,11 @@ void TownsScreen::fillLayerRect(int layer, int x, int y, int w, int h, int col)
 
 uint8 *TownsScreen::getLayerPixels(int layer, int x, int y) const {
 	if (layer < 0 || layer > 1)
-		return 0;
+		return nullptr;
 
 	const TownsScreenLayer *l = &_layers[layer];
 	if (!l->ready)
-		return 0;
+		return nullptr;
 
 	return l->pixels + y * l->pitch + (x % l->width) * l->bpp;
 }
@@ -579,7 +579,7 @@ uint16 TownsScreen::calc16BitColor(const uint8 *palEntry) {
 
 template<typename dstPixelType, typename srcPixelType, int scaleW, int scaleH, bool srcCol4bit> void TownsScreen::transferRect(uint8 *dst, TownsScreenLayer *l, int x, int y, int w, int h) {
 	uint8 *dst10 = dst + y * _pitch * scaleH + x * sizeof(dstPixelType) * scaleW;
-	uint8 *dst20 = (scaleH == 2) ? dst10 + _pitch : 0;
+	uint8 *dst20 = (scaleH == 2) ? dst10 + _pitch : nullptr;
 	int pitch = _pitch * scaleH;
 
 	int x0 = (x + l->hScroll) % l->width;
diff --git a/engines/scumm/he/moonbase/ai_node.cpp b/engines/scumm/he/moonbase/ai_node.cpp
index 083a156a31..e23b0e51c8 100644
--- a/engines/scumm/he/moonbase/ai_node.cpp
+++ b/engines/scumm/he/moonbase/ai_node.cpp
@@ -32,14 +32,14 @@ IContainedObject::IContainedObject(IContainedObject &sourceContainedObject) {
 int Node::_nodeCount = 0;
 
 Node::Node() {
-	_parent = NULL;
+	_parent = nullptr;
 	_depth = 0;
 	_nodeCount++;
-	_contents = NULL;
+	_contents = nullptr;
 }
 
 Node::Node(Node *sourceNode) {
-	_parent = NULL;
+	_parent = nullptr;
 	_children = sourceNode->getChildren();
 
 	_depth = sourceNode->getDepth();
@@ -48,9 +48,9 @@ Node::Node(Node *sourceNode) {
 }
 
 Node::~Node() {
-	if (_contents != NULL) {
+	if (_contents != nullptr) {
 		delete _contents;
-		_contents = NULL;
+		_contents = nullptr;
 	}
 
 	_nodeCount--;
@@ -72,7 +72,7 @@ int Node::generateChildren() {
 		int completionFlag;
 
 		IContainedObject *thisContObj = _contents->createChildObj(i, completionFlag);
-		assert(!(thisContObj != NULL && completionFlag == 0));
+		assert(!(thisContObj != nullptr && completionFlag == 0));
 
 		if (!completionFlag) {
 			_children.pop_back();
@@ -82,7 +82,7 @@ int Node::generateChildren() {
 
 		i++;
 
-		if (thisContObj != NULL) {
+		if (thisContObj != nullptr) {
 			tempNode->setContainedObject(thisContObj);
 		} else {
 			_children.pop_back();
@@ -113,7 +113,7 @@ int Node::generateNextChild() {
 	int compFlag;
 	IContainedObject *thisContObj = _contents->createChildObj(i, compFlag);
 
-	if (thisContObj != NULL) {
+	if (thisContObj != nullptr) {
 		tempNode->setContainedObject(thisContObj);
 	} else {
 		_children.pop_back();
@@ -139,10 +139,10 @@ Node *Node::popChild() {
 Node *Node::getFirstStep() {
 	Node *currentNode = this;
 
-	if (currentNode->getParent() == NULL)
+	if (currentNode->getParent() == nullptr)
 		return currentNode;
 
-	while (currentNode->getParent()->getParent() != NULL)
+	while (currentNode->getParent()->getParent() != nullptr)
 		currentNode = currentNode->getParent();
 
 	assert(currentNode->getDepth() == 1);
diff --git a/engines/scumm/he/moonbase/ai_tree.cpp b/engines/scumm/he/moonbase/ai_tree.cpp
index d18536812b..a5400473f7 100644
--- a/engines/scumm/he/moonbase/ai_tree.cpp
+++ b/engines/scumm/he/moonbase/ai_tree.cpp
@@ -41,7 +41,7 @@ Tree::Tree(AI *ai) : _ai(ai) {
 	pBaseNode = new Node;
 	_maxDepth = MAX_DEPTH;
 	_maxNodes = MAX_NODES;
-	_currentNode = 0;
+	_currentNode = nullptr;
 	_currentChildIndex = 0;
 
 	_currentMap = new Common::SortedArray<TreeNode *>(compareTreeNodes);
@@ -52,7 +52,7 @@ Tree::Tree(IContainedObject *contents, AI *ai) : _ai(ai) {
 	pBaseNode->setContainedObject(contents);
 	_maxDepth = MAX_DEPTH;
 	_maxNodes = MAX_NODES;
-	_currentNode = 0;
+	_currentNode = nullptr;
 	_currentChildIndex = 0;
 
 	_currentMap = new Common::SortedArray<TreeNode *>(compareTreeNodes);
@@ -63,7 +63,7 @@ Tree::Tree(IContainedObject *contents, int maxDepth, AI *ai) : _ai(ai) {
 	pBaseNode->setContainedObject(contents);
 	_maxDepth = maxDepth;
 	_maxNodes = MAX_NODES;
-	_currentNode = 0;
+	_currentNode = nullptr;
 	_currentChildIndex = 0;
 
 	_currentMap = new Common::SortedArray<TreeNode *>(compareTreeNodes);
@@ -74,7 +74,7 @@ Tree::Tree(IContainedObject *contents, int maxDepth, int maxNodes, AI *ai) : _ai
 	pBaseNode->setContainedObject(contents);
 	_maxDepth = maxDepth;
 	_maxNodes = maxNodes;
-	_currentNode = 0;
+	_currentNode = nullptr;
 	_currentChildIndex = 0;
 
 	_currentMap = new Common::SortedArray<TreeNode *>(compareTreeNodes);
@@ -97,7 +97,7 @@ Tree::Tree(const Tree *sourceTree, AI *ai) : _ai(ai) {
 	_maxDepth = sourceTree->getMaxDepth();
 	_maxNodes = sourceTree->getMaxNodes();
 	_currentMap = new Common::SortedArray<TreeNode *>(compareTreeNodes);
-	_currentNode = 0;
+	_currentNode = nullptr;
 	_currentChildIndex = 0;
 
 	duplicateTree(sourceTree->getBaseNode(), pBaseNode);
@@ -108,7 +108,7 @@ Tree::~Tree() {
 	Node *pNodeItr = pBaseNode;
 
 	// Depth first traversal of nodes to delete them
-	while (pNodeItr != NULL) {
+	while (pNodeItr != nullptr) {
 		// If any children are left, move to one of them
 		if (!(pNodeItr->getChildren().empty())) {
 			pNodeItr = pNodeItr->popChild();
@@ -117,7 +117,7 @@ Tree::~Tree() {
 			Node *pTemp = pNodeItr;
 			pNodeItr = pNodeItr->getParent();
 			delete pTemp;
-			pTemp = NULL;
+			pTemp = nullptr;
 		}
 	}
 
@@ -127,17 +127,17 @@ Tree::~Tree() {
 Node *Tree::aStarSearch() {
 	Common::SortedArray<TreeNode *> mmfpOpen(compareTreeNodes);
 
-	Node *currentNode = NULL;
+	Node *currentNode = nullptr;
 	float currentT;
 
-	Node *retNode = NULL;
+	Node *retNode = nullptr;
 
 	float temp = pBaseNode->getContainedObject()->calcT();
 
 	if (static_cast<int>(temp) != SUCCESS) {
 		mmfpOpen.insert(new TreeNode(pBaseNode->getObjectT(), pBaseNode));
 
-		while (mmfpOpen.size() && (retNode == NULL)) {
+		while (mmfpOpen.size() && (retNode == nullptr)) {
 			currentNode = mmfpOpen.front()->node;
 			mmfpOpen.erase(mmfpOpen.begin());
 
@@ -167,7 +167,7 @@ Node *Tree::aStarSearch() {
 
 
 Node *Tree::aStarSearch_singlePassInit() {
-	Node *retNode = NULL;
+	Node *retNode = nullptr;
 
 	_currentChildIndex = 1;
 
@@ -184,7 +184,7 @@ Node *Tree::aStarSearch_singlePassInit() {
 
 Node *Tree::aStarSearch_singlePass() {
 	float currentT = 0.0;
-	Node *retNode = NULL;
+	Node *retNode = nullptr;
 
 	static int maxTime = 0;
 
@@ -227,7 +227,7 @@ Node *Tree::aStarSearch_singlePass() {
 			}
 
 			if (!(_currentMap->size()) && (currentT != SUCCESS)) {
-				assert(_currentNode != NULL);
+				assert(_currentNode != nullptr);
 				retNode = _currentNode;
 			}
 		}
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index 0d2c6f5365..ebabf8c469 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -62,12 +62,12 @@ ResExtractor::CachedCursor *ResExtractor::findCachedCursor(int id) {
 		if (_cursorCache[i].valid && _cursorCache[i].id == id)
 			return &_cursorCache[i];
 
-	return NULL;
+	return nullptr;
 }
 
 ResExtractor::CachedCursor *ResExtractor::getCachedCursorSlot() {
 	uint32 minLastUsed = 0;
-	CachedCursor *r = NULL;
+	CachedCursor *r = nullptr;
 
 	for (int i = 0; i < MAX_CACHED_CURSORS; ++i) {
 		CachedCursor *cc = &_cursorCache[i];
@@ -90,7 +90,7 @@ ResExtractor::CachedCursor *ResExtractor::getCachedCursorSlot() {
 void ResExtractor::setCursor(int id) {
 	CachedCursor *cc = findCachedCursor(id);
 
-	if (cc != NULL) {
+	if (cc != nullptr) {
 		debug(7, "Found cursor %d in cache slot %lu", id, (long)(cc - _cursorCache));
 	} else {
 		cc = getCachedCursorSlot();
@@ -160,12 +160,12 @@ bool Win32ResExtractor::extractResource(int id, CachedCursor *cc) {
 }
 
 MacResExtractor::MacResExtractor(ScummEngine_v70he *scumm) : ResExtractor(scumm) {
-	_resMgr = NULL;
+	_resMgr = nullptr;
 }
 
 bool MacResExtractor::extractResource(int id, CachedCursor *cc) {
 	// Create the MacResManager if not created already
-	if (_resMgr == NULL) {
+	if (_resMgr == nullptr) {
 		_resMgr = new Common::MacResManager();
 		if (!_resMgr->open(_vm->generateFilename(-3)))
 			error("Cannot open file %s", _fileName.c_str());
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index c7c111d3ab..ae4d4d2980 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -65,13 +65,13 @@ static int virtScreenSavePack(byte *dst, byte *src, int len, int unk);
 void ScummEngine_v60he::setupOpcodes() {
 	ScummEngine_v6::setupOpcodes();
 
-	_opcodes[0x63].setProc(0, 0);
-	_opcodes[0x64].setProc(0, 0);
+	_opcodes[0x63].setProc(nullptr, nullptr);
+	_opcodes[0x64].setProc(nullptr, nullptr);
 	OPCODE(0x70, o60_setState);
-	_opcodes[0x9a].setProc(0, 0);
+	_opcodes[0x9a].setProc(nullptr, nullptr);
 	OPCODE(0x9c, o60_roomOps);
 	OPCODE(0x9d, o60_actorOps);
-	_opcodes[0xac].setProc(0, 0);
+	_opcodes[0xac].setProc(nullptr, nullptr);
 	OPCODE(0xbd, o6_stopObjectCode);
 	OPCODE(0xc8, o60_kernelGetFunctions);
 	OPCODE(0xc9, o60_kernelSetFunctions);
@@ -86,8 +86,8 @@ void ScummEngine_v60he::setupOpcodes() {
 	OPCODE(0xe9, o60_seekFilePos);
 	OPCODE(0xea, o60_redimArray);
 	OPCODE(0xeb, o60_readFilePos);
-	_opcodes[0xec].setProc(0, 0);
-	_opcodes[0xed].setProc(0, 0);
+	_opcodes[0xec].setProc(nullptr, nullptr);
+	_opcodes[0xed].setProc(nullptr, nullptr);
 }
 
 Common::String ScummEngine_v60he::convertFilePath(const byte *src) {
@@ -238,7 +238,7 @@ void ScummEngine_v60he::renameSaveFile(const byte *from, const byte *to) {
 
 Common::WriteStream *ScummEngine_v60he::openSaveFileForAppending(const byte *fileName) {
 	Common::SeekableReadStream *initialFile = openSaveFileForReading(fileName);
-	byte *initialData = 0;
+	byte *initialData = nullptr;
 	uint32 initialDataSize = 0;
 
 	if (initialFile) {
@@ -284,7 +284,7 @@ Common::SeekableReadStream *ScummEngine_v60he::openSaveFileForReading(int slot,
 			return stream;
 		}
 
-		return 0;
+		return nullptr;
 	}
 
 	return ScummEngine::openSaveFileForReading(slot, compat, fileName);
@@ -572,7 +572,7 @@ void ScummEngine_v60he::o60_actorOps() {
 		a->_talkColor = pop();
 		break;
 	case 88:		// SO_ACTOR_NAME
-		loadPtrToResource(rtActorName, a->_number, NULL);
+		loadPtrToResource(rtActorName, a->_number, nullptr);
 		break;
 	case 89:		// SO_INIT_ANIMATION
 		a->_initFrame = pop();
@@ -690,7 +690,7 @@ void ScummEngine_v60he::virtScreenLoad(int resIdx, int x1, int y1, int x2, int y
 		if (x2 >= x1) {
 			uint32 w = x2 - x1 + 1;
 			while (w--) {
-				uint8 decByte = virtScreenLoadUnpack(&ctx, 0);
+				uint8 decByte = virtScreenLoadUnpack(&ctx, nullptr);
 				*p1++ = decByte;
 				*p2++ = decByte;
 			}
@@ -701,7 +701,7 @@ void ScummEngine_v60he::virtScreenLoad(int resIdx, int x1, int y1, int x2, int y
 
 uint8 virtScreenLoadUnpack(vsUnpackCtx *ctx, byte *data) {
 	uint8 decByte;
-	if (data != 0) {
+	if (data != nullptr) {
 		ctx->type = 0;
 		ctx->ptr = data;
 		decByte = 0;
@@ -743,7 +743,7 @@ void ScummEngine_v60he::o60_kernelGetFunctions() {
 		// Used to store images when decorating cake in
 		// Fatty Bear's Birthday Surprise
 		writeVar(0, 0);
-		data = defineArray(0, kByteArray, 0, virtScreenSave(0, args[1], args[2], args[3], args[4]));
+		data = defineArray(0, kByteArray, 0, virtScreenSave(nullptr, args[1], args[2], args[3], args[4]));
 		virtScreenSave(data, args[1], args[2], args[3], args[4]);
 		push(readVar(0));
 		break;
@@ -760,7 +760,7 @@ int ScummEngine_v60he::virtScreenSave(byte *dst, int x1, int y1, int x2, int y2)
 		uint8 *p = vs.getBackPixels(x1, j - vs.topline);
 
 		int size = virtScreenSavePack(dst, p, x2 - x1 + 1, 0);
-		if (dst != 0) {
+		if (dst != nullptr) {
 			dst += size;
 		}
 		packedSize += size;
@@ -868,7 +868,7 @@ void ScummEngine_v60he::o60_openFile() {
 	mode = pop();
 	slot = -1;
 	for (i = 0; i < 17; i++) {
-		if (_hInFileTable[i] == 0 && _hOutFileTable[i] == 0) {
+		if (_hInFileTable[i] == nullptr && _hOutFileTable[i] == nullptr) {
 			slot = i;
 			break;
 		}
@@ -886,7 +886,7 @@ void ScummEngine_v60he::o60_openFile() {
 			error("o60_openFile(): wrong open file mode %d", mode);
 		}
 
-		if (_hInFileTable[slot] == 0 && _hOutFileTable[slot] == 0)
+		if (_hInFileTable[slot] == nullptr && _hOutFileTable[slot] == nullptr)
 			slot = -1;
 
 	}
@@ -899,11 +899,11 @@ void ScummEngine_v60he::o60_closeFile() {
 		if (_hOutFileTable[slot]) {
 			_hOutFileTable[slot]->finalize();
 			delete _hOutFileTable[slot];
-			_hOutFileTable[slot] = 0;
+			_hOutFileTable[slot] = nullptr;
 		}
 
 		delete _hInFileTable[slot];
-		_hInFileTable[slot] = 0;
+		_hInFileTable[slot] = nullptr;
 	}
 }
 
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index c75b59129a..e792dfa19c 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -50,7 +50,7 @@ SoundHE::SoundHE(ScummEngine *parent, Audio::Mixer *mixer)
 	Sound(parent, mixer),
 	_vm((ScummEngine_v60he *)parent),
 	_overrideFreq(0),
-	_heMusic(0),
+	_heMusic(nullptr),
 	_heMusicTracks(0) {
 
 	memset(_heChannel, 0, sizeof(_heChannel));
@@ -511,7 +511,7 @@ byte *findSoundTag(uint32 tag, byte *ptr) {
 	}
 
 	if (READ_BE_UINT32(ptr) != MKTAG('R','I','F','F'))
-		return NULL;
+		return nullptr;
 
 	endPtr = (ptr + 12);
 	size = READ_LE_UINT32(ptr + 4);
@@ -531,11 +531,11 @@ byte *findSoundTag(uint32 tag, byte *ptr) {
 		endPtr = endPtr + offset + 8;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags, int heFreq, int hePan, int heVol) {
-	Audio::RewindableAudioStream *stream = 0;
+	Audio::RewindableAudioStream *stream = nullptr;
 	byte *ptr, *spoolPtr;
 	int size = -1;
 	int priority, rate;
@@ -606,7 +606,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags,
 		priority = (soundID > _vm->_numSounds) ? 255 : *(ptr + 18);
 
 		byte *sbngPtr = findSoundTag(MKTAG('S','B','N','G'), ptr);
-		if (sbngPtr != NULL) {
+		if (sbngPtr != nullptr) {
 			codeOffs = sbngPtr - ptr + 8;
 		}
 
@@ -762,7 +762,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags,
 		_currentMusic = soundID;
 
 		stream = Audio::makeRawStream(sound, size, rate, 0);
-		_mixer->playStream(Audio::Mixer::kMusicSoundType, NULL, stream, soundID);
+		_mixer->playStream(Audio::Mixer::kMusicSoundType, nullptr, stream, soundID);
 	}
 	else if (READ_BE_UINT32(ptr) == MKTAG('M','I','D','I')) {
 		if (_vm->_imuse) {
diff --git a/engines/scumm/imuse/drivers/amiga.cpp b/engines/scumm/imuse/drivers/amiga.cpp
index 9b8c99533a..9699de397b 100644
--- a/engines/scumm/imuse/drivers/amiga.cpp
+++ b/engines/scumm/imuse/drivers/amiga.cpp
@@ -102,7 +102,7 @@ private:
 
 	struct IOUnit {
 		IOUnit() : program(0), block(0), volume(63), currentLevel(0), fadeTargetLevel(0), fadeLevelDelta(0), fadeLevelMod(0), levelFadeTriggerDC(0), fadeLevelTicks(0),
-			fadeLevelTicker(0), fadeLevelDuration(0), releaseData(0), releaseDataSize(0), repeatData(0), repeatDataSize(0), envelopeState(kReady) {}
+			fadeLevelTicker(0), fadeLevelDuration(0), releaseData(nullptr), releaseDataSize(0), repeatData(nullptr), repeatDataSize(0), envelopeState(kReady) {}
 		uint8 program;
 		uint8 block;
 		uint8 volume;
@@ -176,14 +176,14 @@ private:
 };
 
 SoundChannel_Amiga::SoundChannel_Amiga(IMuseDriver_Amiga *driver, int id, Instrument_Amiga *instruments) : _driver(driver), _id(id), _instruments(instruments),
-	_assign(0), _next(0), _prev(0), _sustain(false), _note(0) {
+	_assign(nullptr), _next(nullptr), _prev(nullptr), _sustain(false), _note(0) {
 	assert(id > -1 && id < 4);
 	_channels[id] = this;
 	createVolumeTable();
 }
 
 SoundChannel_Amiga::~SoundChannel_Amiga() {
-	_channels[_id] = 0;
+	_channels[_id] = nullptr;
 
 	// delete volume table only if this is the last remaining SoundChannel_Amiga object
 	for (int i = 0; i < 4; ++i) {
@@ -192,11 +192,11 @@ SoundChannel_Amiga::~SoundChannel_Amiga() {
 	}
 
 	delete[] _volTable;
-	_volTable = 0;
+	_volTable = nullptr;
 }
 
 SoundChannel_Amiga *SoundChannel_Amiga::allocate(int prio) {
-	SoundChannel_Amiga *res = 0;
+	SoundChannel_Amiga *res = nullptr;
 
 	for (int i = 0; i < 4; i++) {
 		if (++_allocCurPos == 4)
@@ -227,7 +227,7 @@ void SoundChannel_Amiga::connect(IMusePart_Amiga *part) {
 
 	_assign = part;
 	_next = part->getChannel();
-	_prev = 0;
+	_prev = nullptr;
 	part->setChannel(this);
 	if (_next)
 		_next->_prev = this;
@@ -245,7 +245,7 @@ void SoundChannel_Amiga::disconnect() {
 		p->_next = n;
 	else
 		_assign->setChannel(n);
-	_assign = 0;
+	_assign = nullptr;
 }
 
 void SoundChannel_Amiga::noteOn(byte note, byte volume, byte program, int8 transpose, int16 pitchBend) {
@@ -283,15 +283,15 @@ void SoundChannel_Amiga::noteOn(byte note, byte volume, byte program, int8 trans
 	uint16 period = calculatePeriod(pitchBend + ((_note + transpose) << 7), s->baseNote, s->rate);
 
 	if (s->type == 1) {
-		keyOn(s->data, s->numSamples, 0, 0, period);
-		setRepeatData(0, 0);
+		keyOn(s->data, s->numSamples, nullptr, 0, period);
+		setRepeatData(nullptr, 0);
 	} else {
 		if (s->dr_numSamples) {
 			keyOn(s->data, s->dr_numSamples, s->data + s->dr_offset, s->dr_numSamples - s->dr_offset, period);
 			setRepeatData(s->data + s->dr_numSamples, s->numSamples - s->dr_numSamples);
 		} else {
 			keyOn(s->data, s->numSamples, s->data + s->dr_offset, s->numSamples - s->dr_offset, period);
-			setRepeatData(0, 0);
+			setRepeatData(nullptr, 0);
 		}
 	}
 }
@@ -469,13 +469,13 @@ void SoundChannel_Amiga::createVolumeTable() {
 
 uint8 SoundChannel_Amiga::_allocCurPos = 0;
 
-const uint8 *SoundChannel_Amiga::_volTable = 0;
+const uint8 *SoundChannel_Amiga::_volTable = nullptr;
 
-SoundChannel_Amiga *SoundChannel_Amiga::_channels[4] = { 0, 0, 0, 0 };
+SoundChannel_Amiga *SoundChannel_Amiga::_channels[4] = { nullptr, nullptr, nullptr, nullptr };
 
 const int8 SoundChannel_Amiga::_muteData[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
-IMusePart_Amiga::IMusePart_Amiga(IMuseDriver_Amiga *driver, int id) : _driver(driver), _id(id), _allocated(false), _out(0), _priority(0), _program(0),
+IMusePart_Amiga::IMusePart_Amiga(IMuseDriver_Amiga *driver, int id) : _driver(driver), _id(id), _allocated(false), _out(nullptr), _priority(0), _program(0),
 	_pitchBend(0), _pitchBendSensitivity(2), _volume(0), _modulation(0), _transpose(0), _sustain(false) {
 }
 
@@ -596,7 +596,7 @@ void IMusePart_Amiga::controlSustain(byte value) {
 }
 
 IMuseDriver_Amiga::IMuseDriver_Amiga(Audio::Mixer *mixer) : Paula(true, mixer->getOutputRate(), (mixer->getOutputRate() * 1000) / 181818), _mixer(mixer), _isOpen(false), _soundHandle(),
-	_numParts(24), _baseTempo(5500), _internalTempo(5500), _timerProc(0), _timerProcPara(0), _parts(0), _chan(0), _instruments(0), _missingFiles(0), _ticker(0) {
+	_numParts(24), _baseTempo(5500), _internalTempo(5500), _timerProc(nullptr), _timerProcPara(nullptr), _parts(nullptr), _chan(nullptr), _instruments(nullptr), _missingFiles(0), _ticker(0) {
 	setAudioFilter(true);
 
 	_instruments = new Instrument_Amiga[129]();
@@ -621,14 +621,14 @@ IMuseDriver_Amiga::~IMuseDriver_Amiga() {
 			delete _chan[i];
 		delete[] _chan;
 	}
-	_chan = 0;
+	_chan = nullptr;
 
 	if (_parts) {
 		for (int i = 0; i < _numParts; i++)
 			delete _parts[i];
 		delete[] _parts;
 	}
-	_parts = 0;
+	_parts = nullptr;
 
 	delete[] _instruments;
 }
@@ -676,7 +676,7 @@ void IMuseDriver_Amiga::close() {
 	_isOpen = false;
 
 	stopPaula();
-	setTimerCallback(0, 0);
+	setTimerCallback(nullptr, nullptr);
 	_mixer->stopHandle(_soundHandle);
 
 	Common::StackLock lock(_mutex);
@@ -732,18 +732,18 @@ uint32 IMuseDriver_Amiga::getBaseTempo() {
 
 MidiChannel *IMuseDriver_Amiga::allocateChannel() {
 	if (!_isOpen)
-		return 0;
+		return nullptr;
 
 	for (int i = 0; i < _numParts; ++i) {
 		if (_parts[i]->allocate())
 			return _parts[i];
 	}
 
-	return 0;
+	return nullptr;
 }
 
 MidiChannel *IMuseDriver_Amiga::getPercussionChannel() {
-	return 0;
+	return nullptr;
 }
 
 void IMuseDriver_Amiga::interrupt() {
@@ -790,7 +790,7 @@ void IMuseDriver_Amiga::loadInstrument(int program) {
 	for (int i = 0; i < 8; ++i) {
 		if (_instruments[program].samples[i].data) {
 			delete[] _instruments[program].samples[i].data;
-			_instruments[program].samples[i].data = 0;
+			_instruments[program].samples[i].data = nullptr;
 		}
 	}
 
diff --git a/engines/scumm/imuse/drivers/fmtowns.cpp b/engines/scumm/imuse/drivers/fmtowns.cpp
index 628f3c9a5d..9489570324 100644
--- a/engines/scumm/imuse/drivers/fmtowns.cpp
+++ b/engines/scumm/imuse/drivers/fmtowns.cpp
@@ -207,7 +207,7 @@ uint8 TownsMidiChanState::get(uint8 type) {
 }
 
 TownsMidiOutputChannel::TownsMidiOutputChannel(MidiDriver_TOWNS *driver, int chanIndex) : _driver(driver), _chan(chanIndex),
-	_in(0), _prev(0), _next(0), _adjustModTl(0), _operator2Tl(0), _note(0), _operator1Tl(0), _sustainNoteOff(0), _duration(0), _freq(0), _freqAdjust(0) {
+	_in(nullptr), _prev(nullptr), _next(nullptr), _adjustModTl(0), _operator2Tl(0), _note(0), _operator1Tl(0), _sustainNoteOff(0), _duration(0), _freq(0), _freqAdjust(0) {
 	_effectEnvelopes = new EffectEnvelope[2]();
 	_effectDefs = new EffectDef[2]();
 
@@ -337,7 +337,7 @@ void TownsMidiOutputChannel::connect(TownsMidiInputChannel *chan) {
 
 	_in = chan;
 	_next = chan->_out;
-	_prev = 0;
+	_prev = nullptr;
 	chan->_out = this;
 	if (_next)
 		_next->_prev = this;
@@ -355,7 +355,7 @@ void TownsMidiOutputChannel::disconnect() {
 		p->_next = n;
 	else
 		_in->_out = n;
-	_in = 0;
+	_in = nullptr;
 }
 
 bool TownsMidiOutputChannel::update() {
@@ -650,7 +650,7 @@ const uint16 TownsMidiOutputChannel::_freqLSB[] = {
 	0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B, 0x055B
 };
 
-TownsMidiInputChannel::TownsMidiInputChannel(MidiDriver_TOWNS *driver, int chanIndex) : MidiChannel(), _driver(driver), _out(0), _chanIndex(chanIndex),
+TownsMidiInputChannel::TownsMidiInputChannel(MidiDriver_TOWNS *driver, int chanIndex) : MidiChannel(), _driver(driver), _out(nullptr), _chanIndex(chanIndex),
 	_priority(0), _tl(0), _transpose(0), _pitchBendFactor(0), _pitchBend(0), _sustain(0), _freqLSB(0), _detune(0), _modWheel(0), _allocated(false) {
 	_instrument = new uint8[30]();
 }
@@ -822,8 +822,8 @@ const uint8 TownsMidiInputChannel::_programAdjustLevel[] = {
 	0x3D, 0x3D, 0x3E, 0x3E, 0x3E, 0x3F, 0x3F, 0x3F
 };
 
-MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(0), _timerProcPara(0), _channels(0), _out(0),
-	_baseTempo(10080), _chanState(0), _operatorLevelTable(0), _tickCounter(0), _rand(1), _allocCurPos(0), _isOpen(false) {
+MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(nullptr), _timerProcPara(nullptr), _channels(nullptr), _out(nullptr),
+	_baseTempo(10080), _chanState(nullptr), _operatorLevelTable(nullptr), _tickCounter(0), _rand(1), _allocCurPos(0), _isOpen(false) {
 	_intf = new TownsAudioInterface(mixer, this, true);
 
 	_channels = new TownsMidiInputChannel*[32];
@@ -854,19 +854,19 @@ MidiDriver_TOWNS::~MidiDriver_TOWNS() {
 			delete _channels[i];
 		delete[] _channels;
 	}
-	_channels = 0;
+	_channels = nullptr;
 
 	if (_out) {
 		for (int i = 0; i < 6; i++)
 			delete _out[i];
 		delete[] _out;
 	}
-	_out = 0;
+	_out = nullptr;
 
 	delete[] _chanState;
-	_chanState = 0;
+	_chanState = nullptr;
 	delete[] _operatorLevelTable;
-	_operatorLevelTable = 0;
+	_operatorLevelTable = nullptr;
 }
 
 int MidiDriver_TOWNS::open() {
@@ -898,7 +898,7 @@ void MidiDriver_TOWNS::close() {
 
 	_isOpen = false;
 
-	setTimerCallback(0, 0);
+	setTimerCallback(nullptr, nullptr);
 	g_system->delayMillis(20);
 }
 
@@ -951,7 +951,7 @@ uint32 MidiDriver_TOWNS::getBaseTempo() {
 
 MidiChannel *MidiDriver_TOWNS::allocateChannel() {
 	if (!_isOpen)
-		return 0;
+		return nullptr;
 
 	for (int i = 0; i < 32; ++i) {
 		TownsMidiInputChannel *chan = _channels[i];
@@ -959,11 +959,11 @@ MidiChannel *MidiDriver_TOWNS::allocateChannel() {
 			return chan;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 MidiChannel *MidiDriver_TOWNS::getPercussionChannel() {
-	return 0;
+	return nullptr;
 }
 
 void MidiDriver_TOWNS::timerCallback(int timerId) {
@@ -997,7 +997,7 @@ void MidiDriver_TOWNS::updateOutputChannels() {
 }
 
 TownsMidiOutputChannel *MidiDriver_TOWNS::allocateOutputChannel(uint8 pri) {
-	TownsMidiOutputChannel *res = 0;
+	TownsMidiOutputChannel *res = nullptr;
 
 	for (int i = 0; i < 6; i++) {
 		if (++_allocCurPos == 6)
diff --git a/engines/scumm/imuse/drivers/mac_m68k.cpp b/engines/scumm/imuse/drivers/mac_m68k.cpp
index 1bcef44222..2b1c9479ad 100644
--- a/engines/scumm/imuse/drivers/mac_m68k.cpp
+++ b/engines/scumm/imuse/drivers/mac_m68k.cpp
@@ -77,7 +77,7 @@ int MacM68kDriver::open() {
 		}
 	}
 
-	_mixBuffer = 0;
+	_mixBuffer = nullptr;
 	_mixBufferLength = 0;
 
 	// We set the output sound type to music here to allow sound volume
@@ -101,9 +101,9 @@ void MacM68kDriver::close() {
 	}
 	_instruments.clear();
 	delete[] _volumeTable;
-	_volumeTable = 0;
+	_volumeTable = nullptr;
 	delete[] _mixBuffer;
-	_mixBuffer = 0;
+	_mixBuffer = nullptr;
 	_mixBufferLength = 0;
 }
 
@@ -122,7 +122,7 @@ MidiChannel *MacM68kDriver::allocateChannel() {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 MacM68kDriver::Instrument MacM68kDriver::getInstrument(int idx) const {
@@ -273,7 +273,7 @@ void MacM68kDriver::VoiceChannel::off() {
 	}
 
 	part->removeVoice(this);
-	part = 0;
+	part = nullptr;
 }
 
 void MacM68kDriver::MidiChannel_MacM68k::release() {
@@ -352,7 +352,7 @@ void MacM68kDriver::MidiChannel_MacM68k::noteOn(byte note, byte velocity) {
 		voice->out.loopStart = _instrument.data + _instrument.loopStart;
 		voice->out.loopEnd   = _instrument.data + _instrument.loopEnd;
 	} else {
-		voice->out.loopStart = 0;
+		voice->out.loopStart = nullptr;
 		voice->out.loopEnd   = voice->out.soundEnd;
 	}
 
@@ -440,7 +440,7 @@ bool MacM68kDriver::MidiChannel_MacM68k::allocate() {
 	}
 
 	_allocated = true;
-	_voice = 0;
+	_voice = nullptr;
 	_priority = 0;
 	memset(&_instrument, 0, sizeof(_instrument));
 	_pitchBend = 0;
@@ -451,7 +451,7 @@ bool MacM68kDriver::MidiChannel_MacM68k::allocate() {
 
 void MacM68kDriver::MidiChannel_MacM68k::addVoice(VoiceChannel *voice) {
 	voice->next = _voice;
-	voice->prev = 0;
+	voice->prev = nullptr;
 	voice->part = this;
 	if (_voice) {
 		_voice->prev = voice;
@@ -479,7 +479,7 @@ void MacM68kDriver::MidiChannel_MacM68k::removeVoice(VoiceChannel *voice) {
 }
 
 MacM68kDriver::VoiceChannel *MacM68kDriver::allocateVoice(int priority) {
-	VoiceChannel *channel = 0;
+	VoiceChannel *channel = nullptr;
 	for (int i = 0; i < kChannelCount; ++i) {
 		if (++_lastUsedVoiceChannel == kChannelCount) {
 			_lastUsedVoiceChannel = 0;
diff --git a/engines/scumm/imuse/drivers/pcspk.cpp b/engines/scumm/imuse/drivers/pcspk.cpp
index 0e516c27aa..b1579e7d1e 100644
--- a/engines/scumm/imuse/drivers/pcspk.cpp
+++ b/engines/scumm/imuse/drivers/pcspk.cpp
@@ -42,14 +42,14 @@ int PcSpkDriver::open() {
 
 	for (uint i = 0; i < 6; ++i)
 		_channels[i].init(this, i);
-	_activeChannel = 0;
+	_activeChannel = nullptr;
 	_effectTimer = 0;
 	_randBase = 1;
 
 	// We need to take care we only send note frequencies, when the internal
 	// settings actually changed, thus we need some extra state to keep track
 	// of that.
-	_lastActiveChannel = 0;
+	_lastActiveChannel = nullptr;
 	_lastActiveOut = 0;
 
 	// We set the output sound type to music here to allow sound volume
@@ -85,7 +85,7 @@ MidiChannel *PcSpkDriver::allocateChannel() {
 			return &_channels[i];
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void PcSpkDriver::generateSamples(int16 *buf, int len) {
@@ -129,14 +129,14 @@ void PcSpkDriver::onTimer() {
 		output((_activeChannel->_out.note << 7) + _activeChannel->_pitchBend + _activeChannel->_out.unk60 + _activeChannel->_out.unkE);
 	} else {
 		_pcSpk.stop();
-		_lastActiveChannel = 0;
+		_lastActiveChannel = nullptr;
 		_lastActiveOut = 0;
 	}
 }
 
 void PcSpkDriver::updateNote() {
 	uint8 priority = 0;
-	_activeChannel = 0;
+	_activeChannel = nullptr;
 	for (uint i = 0; i < 6; ++i) {
 		if (_channels[i]._allocated && _channels[i]._out.active && _channels[i]._priority >= priority) {
 			priority = _channels[i]._priority;
@@ -144,9 +144,9 @@ void PcSpkDriver::updateNote() {
 		}
 	}
 
-	if (_activeChannel == 0 || _activeChannel->_tl == 0) {
+	if (_activeChannel == nullptr || _activeChannel->_tl == 0) {
 		_pcSpk.stop();
-		_lastActiveChannel = 0;
+		_lastActiveChannel = nullptr;
 		_lastActiveOut = 0;
 	} else {
 		output(_activeChannel->_pitchBend + (_activeChannel->_out.note << 7));
@@ -261,7 +261,7 @@ void PcSpkDriver::MidiChannel_PcSpk::noteOn(byte note, byte velocity) {
 	if (_instrument[4] * 256 < ARRAYSIZE(PcSpkDriver::_outInstrumentData))
 		_out.instrument = _owner->_outInstrumentData + _instrument[4] * 256;
 	else
-		_out.instrument = 0;
+		_out.instrument = nullptr;
 
 	_out.unkA = 0;
 	_out.unkB = _instrument[1];
@@ -274,7 +274,7 @@ void PcSpkDriver::MidiChannel_PcSpk::noteOn(byte note, byte velocity) {
 	// last active channel, thus we assure the frequency is correctly set, even
 	// when the same note was sent.
 	if (_owner->_lastActiveChannel == this) {
-		_owner->_lastActiveChannel = 0;
+		_owner->_lastActiveChannel = nullptr;
 		_owner->_lastActiveOut = 0;
 	}
 	_owner->updateNote();
@@ -312,7 +312,7 @@ void PcSpkDriver::MidiChannel_PcSpk::controlChange(byte control, byte value) {
 		_tl = value;
 		if (_owner->_activeChannel == this) {
 			if (_tl == 0) {
-				_owner->_lastActiveChannel = 0;
+				_owner->_lastActiveChannel = nullptr;
 				_owner->_lastActiveOut = 0;
 				_owner->_pcSpk.stop();
 			} else {
@@ -521,7 +521,7 @@ void PcSpkDriver::updateEffectGenerator(MidiChannel_PcSpk &chan, EffectEnvelope
 			if ((chan._instrument[4] + (def.phase & 0xFF)) * 256 < ARRAYSIZE(_outInstrumentData))
 				chan._out.instrument = _outInstrumentData + (chan._instrument[4] + (def.phase & 0xFF)) * 256;
 			else
-				chan._out.instrument = 0;
+				chan._out.instrument = nullptr;
 			break;
 
 		case 5:
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index 369a2752c3..aa97ca6b6c 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -46,9 +46,9 @@ IMuseInternal::IMuseInternal() :
 	_native_mt32(false),
 	_enable_gs(false),
 	_isAmiga(false),
-	_midi_adlib(NULL),
-	_midi_native(NULL),
-	_sysex(NULL),
+	_midi_adlib(nullptr),
+	_midi_native(nullptr),
+	_sysex(nullptr),
 	_paused(false),
 	_initialized(false),
 	_tempoFactor(0),
@@ -84,7 +84,7 @@ IMuseInternal::~IMuseInternal() {
 	if (_midi_adlib) {
 		_midi_adlib->close();
 		delete _midi_adlib;
-		_midi_adlib = 0;
+		_midi_adlib = nullptr;
 	}
 
 	if (_midi_native) {
@@ -96,7 +96,7 @@ IMuseInternal::~IMuseInternal() {
 
 		_midi_native->close();
 		delete _midi_native;
-		_midi_native = 0;
+		_midi_native = nullptr;
 	}
 }
 
@@ -112,17 +112,17 @@ byte *IMuseInternal::findStartOfSound(int sound, int ct) {
 
 	byte *ptr = g_scumm->_res->_types[rtSound][sound]._address;
 
-	if (ptr == NULL) {
+	if (ptr == nullptr) {
 		debug(1, "IMuseInternal::findStartOfSound(): Sound %d doesn't exist", sound);
-		return NULL;
+		return nullptr;
 	}
 
 	// Check for old-style headers first, like 'RO'
 	int trFlag = (kMThd | kFORM);
 	if (ptr[0] == 'R' && ptr[1] == 'O' && ptr[2] != 'L')
-		return ct == trFlag ? ptr : 0;
+		return ct == trFlag ? ptr : nullptr;
 	if (ptr[4] == 'S' && ptr[5] == 'O')
-		return ct == trFlag ? ptr + 4 : 0;
+		return ct == trFlag ? ptr + 4 : nullptr;
 
 	ptr += 4;
 	size = READ_BE_UINT32(ptr);
@@ -143,12 +143,12 @@ byte *IMuseInternal::findStartOfSound(int sound, int ct) {
 	if (ct == (kMThd | kFORM))
 		debug(3, "IMuseInternal::findStartOfSound(): Failed to align on sound %d", sound);
 
-	return 0;
+	return nullptr;
 }
 
 bool IMuseInternal::isMT32(int sound) {
 	byte *ptr = g_scumm->_res->_types[rtSound][sound]._address;
-	if (ptr == NULL)
+	if (ptr == nullptr)
 		return false;
 
 	uint32 tag = READ_BE_UINT32(ptr);
@@ -195,7 +195,7 @@ bool IMuseInternal::isMT32(int sound) {
 
 bool IMuseInternal::isMIDI(int sound) {
 	byte *ptr = g_scumm->_res->_types[rtSound][sound]._address;
-	if (ptr == NULL)
+	if (ptr == nullptr)
 		return false;
 
 	uint32 tag = READ_BE_UINT32(ptr);
@@ -237,7 +237,7 @@ bool IMuseInternal::isMIDI(int sound) {
 
 bool IMuseInternal::supportsPercussion(int sound) {
 	byte *ptr = g_scumm->_res->_types[rtSound][sound]._address;
-	if (ptr == NULL)
+	if (ptr == nullptr)
 		return false;
 
 	uint32 tag = READ_BE_UINT32(ptr);
@@ -280,7 +280,7 @@ bool IMuseInternal::supportsPercussion(int sound) {
 }
 
 MidiDriver *IMuseInternal::getBestMidiDriver(int sound) {
-	MidiDriver *driver = NULL;
+	MidiDriver *driver = nullptr;
 
 	if (isMIDI(sound)) {
 		if (_midi_native) {
@@ -296,7 +296,7 @@ MidiDriver *IMuseInternal::getBestMidiDriver(int sound) {
 }
 
 Player *IMuseInternal::allocate_player(byte priority) {
-	Player *player = _players, *best = NULL;
+	Player *player = _players, *best = nullptr;
 	int i;
 	byte bestpri = 255;
 
@@ -313,7 +313,7 @@ Player *IMuseInternal::allocate_player(byte priority) {
 		return best;
 
 	debug(1, "Denying player request");
-	return NULL;
+	return nullptr;
 }
 
 void IMuseInternal::init_players() {
@@ -768,7 +768,7 @@ int32 IMuseInternal::doCommand_internal(int numargs, int a[]) {
 	int i;
 	byte cmd = a[0] & 0xFF;
 	byte param = a[0] >> 8;
-	Player *player = NULL;
+	Player *player = nullptr;
 
 	if (!_initialized && (cmd || param))
 		return -1;
@@ -804,7 +804,7 @@ int32 IMuseInternal::doCommand_internal(int numargs, int a[]) {
 		case 12:
 			// Sam & Max: Player-scope commands
 			player = findActivePlayer(a[1]);
-			if (player == NULL)
+			if (player == nullptr)
 				return -1;
 
 			switch (a[3]) {
@@ -1049,7 +1049,7 @@ int IMuseInternal::get_channel_volume(uint a) {
 }
 
 Part *IMuseInternal::allocate_part(byte pri, MidiDriver *midi) {
-	Part *part, *best = NULL;
+	Part *part, *best = nullptr;
 	int i;
 
 	for (i = ARRAYSIZE(_parts), part = _parts; i != 0; i--, part++) {
@@ -1113,9 +1113,9 @@ int IMuseInternal::set_volchan(int sound, int volchan) {
 		}
 		return -1;
 	} else {
-		best = NULL;
+		best = nullptr;
 		num = 0;
-		sameid = NULL;
+		sameid = nullptr;
 		for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
 			if (player->isActive()) {
 				if (player->_vol_chan == (uint16)volchan) {
@@ -1127,7 +1127,7 @@ int IMuseInternal::set_volchan(int sound, int volchan) {
 				}
 			}
 		}
-		if (sameid == NULL)
+		if (sameid == nullptr)
 			return -1;
 		if (num >= r)
 			best->clear();
@@ -1246,7 +1246,7 @@ int32 IMuseInternal::ImSetTrigger(int sound, int id, int a, int b, int c, int d,
 	// represented by MIDI SysEx block 00 xx(F7)
 	// where "xx" is the marker ID.
 	uint16 oldest_trigger = 0;
-	ImTrigger *oldest_ptr = NULL;
+	ImTrigger *oldest_ptr = nullptr;
 
 	int i;
 	ImTrigger *trig = _snm_triggers;
@@ -1420,7 +1420,7 @@ Player *IMuseInternal::findActivePlayer(int id) {
 		if (player->isActive() && player->getID() == (uint16)id)
 			return player;
 	}
-	return NULL;
+	return nullptr;
 }
 
 int IMuseInternal::get_volchan_entry(uint a) {
@@ -1441,12 +1441,12 @@ int IMuseInternal::initialize(OSystem *syst, MidiDriver *native_midi, MidiDriver
 	_system = syst;
 	_midi_native = native_midi;
 	_midi_adlib = adlib_midi;
-	if (native_midi != NULL) {
+	if (native_midi != nullptr) {
 		_timer_info_native.imuse = this;
 		_timer_info_native.driver = native_midi;
 		initMidiDriver(&_timer_info_native);
 	}
-	if (adlib_midi != NULL) {
+	if (adlib_midi != nullptr) {
 		_timer_info_adlib.imuse = this;
 		_timer_info_adlib.driver = adlib_midi;
 		initMidiDriver(&_timer_info_adlib);
@@ -1709,7 +1709,7 @@ void IMuseInternal::reallocateMidiChannels(MidiDriver *midi) {
 
 	while (true) {
 		hipri = 0;
-		hipart = NULL;
+		hipart = nullptr;
 		for (i = 32, part = _parts; i; i--, part++) {
 			if (part->_player && part->_player->getMidiDriver() == midi &&
 			        !part->_percussion && part->_on &&
@@ -1722,9 +1722,9 @@ void IMuseInternal::reallocateMidiChannels(MidiDriver *midi) {
 		if (!hipart)
 			return;
 
-		if ((hipart->_mc = midi->allocateChannel()) == NULL) {
+		if ((hipart->_mc = midi->allocateChannel()) == nullptr) {
 			lopri = 255;
-			lopart = NULL;
+			lopart = nullptr;
 			for (i = 32, part = _parts; i; i--, part++) {
 				if (part->_mc && part->_mc->device() == midi && part->_pri_eff <= lopri) {
 					lopri = part->_pri_eff;
@@ -1732,11 +1732,11 @@ void IMuseInternal::reallocateMidiChannels(MidiDriver *midi) {
 				}
 			}
 
-			if (lopart == NULL || lopri >= hipri)
+			if (lopart == nullptr || lopri >= hipri)
 				return;
 			lopart->off();
 
-			if ((hipart->_mc = midi->allocateChannel()) == NULL)
+			if ((hipart->_mc = midi->allocateChannel()) == nullptr)
 				return;
 		}
 		hipart->sendAll();
diff --git a/engines/scumm/imuse/imuse_part.cpp b/engines/scumm/imuse/imuse_part.cpp
index c3c37dbcb7..04ef66ca2f 100644
--- a/engines/scumm/imuse/imuse_part.cpp
+++ b/engines/scumm/imuse/imuse_part.cpp
@@ -38,10 +38,10 @@ namespace Scumm {
 
 Part::Part() {
 	_slot = 0;
-	_next = 0;
-	_prev = 0;
-	_mc = 0;
-	_player = 0;
+	_next = nullptr;
+	_prev = nullptr;
+	_mc = nullptr;
+	_player = nullptr;
 	_pitchbend = 0;
 	_pitchbend_factor = 0;
 	_transpose = 0;
@@ -78,13 +78,13 @@ void Part::saveLoadWithSerializer(Common::Serializer &ser) {
 		ser.syncAsUint16LE(num);
 	} else {
 		ser.syncAsUint16LE(num);
-		_next = (num ? &_se->_parts[num - 1] : 0);
+		_next = (num ? &_se->_parts[num - 1] : nullptr);
 
 		ser.syncAsUint16LE(num);
-		_prev = (num ? &_se->_parts[num - 1] : 0);
+		_prev = (num ? &_se->_parts[num - 1] : nullptr);
 
 		ser.syncAsUint16LE(num);
-		_player = (num ? &_se->_players[num - 1] : 0);
+		_player = (num ? &_se->_players[num - 1] : nullptr);
 	}
 
 	ser.syncAsSint16LE(_pitchbend, VER(8));
@@ -280,10 +280,10 @@ void Part::noteOff(byte note) {
 }
 
 void Part::init() {
-	_player = NULL;
-	_next = NULL;
-	_prev = NULL;
-	_mc = NULL;
+	_player = nullptr;
+	_next = nullptr;
+	_prev = nullptr;
+	_mc = nullptr;
 }
 
 void Part::setup(Player *player) {
@@ -309,7 +309,7 @@ void Part::setup(Player *player) {
 	_modwheel = 0;
 	_bank = 0;
 	_pedal = false;
-	_mc = NULL;
+	_mc = nullptr;
 }
 
 void Part::uninit() {
@@ -317,14 +317,14 @@ void Part::uninit() {
 		return;
 	off();
 	_player->removePart(this);
-	_player = NULL;
+	_player = nullptr;
 }
 
 void Part::off() {
 	if (_mc) {
 		_mc->allNotesOff();
 		_mc->release();
-		_mc = NULL;
+		_mc = nullptr;
 	}
 }
 
diff --git a/engines/scumm/imuse/imuse_player.cpp b/engines/scumm/imuse/imuse_player.cpp
index 64462ac235..bd7f69fee2 100644
--- a/engines/scumm/imuse/imuse_player.cpp
+++ b/engines/scumm/imuse/imuse_player.cpp
@@ -56,9 +56,9 @@ uint16 Player::_active_notes[128];
 //////////////////////////////////////////////////
 
 Player::Player() :
-	_midi(NULL),
-	_parser(NULL),
-	_parts(NULL),
+	_midi(nullptr),
+	_parser(nullptr),
+	_parts(nullptr),
 	_active(false),
 	_scanning(false),
 	_id(0),
@@ -79,7 +79,7 @@ Player::Player() :
 	_isMT32(false),
 	_isMIDI(false),
 	_supportsPercussion(false),
-	_se(0),
+	_se(nullptr),
 	_vol_chan(0),
 	_abort(false),
 	_music_tick(0),
@@ -89,7 +89,7 @@ Player::Player() :
 Player::~Player() {
 	if (_parser) {
 		delete _parser;
-		_parser = 0;
+		_parser = nullptr;
 	}
 }
 
@@ -109,7 +109,7 @@ bool Player::startSound(int sound, MidiDriver *midi) {
 	_isMIDI = _se->isMIDI(sound);
 	_supportsPercussion = _se->supportsPercussion(sound);
 
-	_parts = NULL;
+	_parts = nullptr;
 	_active = true;
 	_midi = midi;
 	_id = sound;
@@ -122,7 +122,7 @@ bool Player::startSound(int sound, MidiDriver *midi) {
 
 	if (start_seq_sound(sound) != 0) {
 		_active = false;
-		_midi = NULL;
+		_midi = nullptr;
 		return false;
 	}
 
@@ -152,13 +152,13 @@ void Player::clear() {
 
 	if (_parser) {
 		_parser->unloadMusic();
-		_parser->setMidiDriver(NULL);
+		_parser->setMidiDriver(nullptr);
 	}
 
 	uninit_parts();
 	_se->ImFireAllTriggers(_id);
 	_active = false;
-	_midi = NULL;
+	_midi = nullptr;
 	_id = 0;
 	_note_offset = 0;
 }
@@ -180,7 +180,7 @@ int Player::start_seq_sound(int sound, bool reset_vars) {
 	}
 
 	ptr = _se->findStartOfSound(sound);
-	if (ptr == NULL)
+	if (ptr == nullptr)
 		return -1;
 
 	if (!memcmp(ptr, "RO", 2)) {
@@ -274,7 +274,7 @@ void Player::send(uint32 b) {
 	switch (cmd >> 4) {
 	case 0x8: // Key Off
 		if (!_scanning) {
-			if ((part = getPart(chan)) != 0)
+			if ((part = getPart(chan)) != nullptr)
 				part->noteOff(param1);
 		} else {
 			_active_notes[param1] &= ~(1 << chan);
@@ -286,7 +286,7 @@ void Player::send(uint32 b) {
 		if (!_scanning) {
 			if (_isMT32 && !_se->isNativeMT32())
 				param2 = (((param2 * 3) >> 2) + 32) & 0x7F;
-			if ((part = getPart(chan)) != 0)
+			if ((part = getPart(chan)) != nullptr)
 				part->noteOn(param1, param2);
 		} else {
 			_active_notes[param1] |= (1 << chan);
@@ -642,7 +642,7 @@ Part *Player::getActivePart(uint8 chan) {
 			return part;
 		part = part->_next;
 	}
-	return 0;
+	return nullptr;
 }
 
 Part *Player::getPart(uint8 chan) {
@@ -653,11 +653,11 @@ Part *Player::getPart(uint8 chan) {
 	part = _se->allocate_part(_priority, _midi);
 	if (!part) {
 		debug(1, "No parts available");
-		return NULL;
+		return nullptr;
 	}
 
 	// Insert part into front of parts list
-	part->_prev = NULL;
+	part->_prev = nullptr;
 	part->_next = _parts;
 	if (_parts)
 		_parts->_prev = part;
@@ -928,7 +928,7 @@ int Player::addParameterFader(int param, int target, int time) {
 	}
 
 	ParameterFader *ptr = &_parameterFaders[0];
-	ParameterFader *best = 0;
+	ParameterFader *best = nullptr;
 	int i;
 	for (i = ARRAYSIZE(_parameterFaders); i; --i, ++ptr) {
 		if (ptr->param == param) {
@@ -1014,7 +1014,7 @@ void Player::removePart(Part *part) {
 		part->_prev->_next = part->_next;
 	else
 		_parts = part->_next;
-	part->_next = part->_prev = 0;
+	part->_next = part->_prev = nullptr;
 }
 
 void Player::fixAfterLoad() {
@@ -1056,7 +1056,7 @@ static void syncWithSerializer(Common::Serializer &s, ParameterFader &pf) {
 void Player::saveLoadWithSerializer(Common::Serializer &s) {
 	if (!s.isSaving() && _parser) {
 		delete _parser;
-		_parser = 0;
+		_parser = nullptr;
 		_parserType = kParserTypeNone;
 	}
 	_music_tick = _parser ? _parser->getTick() : 0;
@@ -1067,7 +1067,7 @@ void Player::saveLoadWithSerializer(Common::Serializer &s) {
 		s.syncAsUint16LE(num);
 	} else {
 		s.syncAsUint16LE(num);
-		_parts = (num ? &_se->_parts[num - 1] : 0);
+		_parts = (num ? &_se->_parts[num - 1] : nullptr);
 	}
 
 	s.syncAsByte(_active, VER(8));
diff --git a/engines/scumm/imuse/instrument.cpp b/engines/scumm/imuse/instrument.cpp
index c2fec7cd8e..dbec397704 100644
--- a/engines/scumm/imuse/instrument.cpp
+++ b/engines/scumm/imuse/instrument.cpp
@@ -304,7 +304,7 @@ void Instrument::nativeMT32(bool native) {
 
 void Instrument::clear() {
 	delete _instrument;
-	_instrument = NULL;
+	_instrument = nullptr;
 	_type = itNone;
 }
 
diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp
index 5c8cea67e9..cb9e93ec68 100644
--- a/engines/scumm/imuse/sysex_scumm.cpp
+++ b/engines/scumm/imuse/sysex_scumm.cpp
@@ -104,7 +104,7 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
 	case 1:
 		// Shut down a part. [Bug #1849, comments]
 		part = player->getPart(p[0]);
-		if (part != NULL)
+		if (part != nullptr)
 			part->uninit();
 		break;
 
diff --git a/engines/scumm/imuse_digi/dimuse_bndmgr.cpp b/engines/scumm/imuse_digi/dimuse_bndmgr.cpp
index 53169d9c35..e7602528ad 100644
--- a/engines/scumm/imuse_digi/dimuse_bndmgr.cpp
+++ b/engines/scumm/imuse_digi/dimuse_bndmgr.cpp
@@ -32,11 +32,11 @@ namespace Scumm {
 
 BundleDirCache::BundleDirCache() {
 	for (int fileId = 0; fileId < ARRAYSIZE(_budleDirCache); fileId++) {
-		_budleDirCache[fileId].bundleTable = NULL;
+		_budleDirCache[fileId].bundleTable = nullptr;
 		_budleDirCache[fileId].fileName[0] = 0;
 		_budleDirCache[fileId].numFiles = 0;
 		_budleDirCache[fileId].isCompressed = false;
-		_budleDirCache[fileId].indexTable = NULL;
+		_budleDirCache[fileId].indexTable = nullptr;
 	}
 }
 
@@ -70,7 +70,7 @@ int BundleDirCache::matchFile(const char *filename) {
 	int fileId;
 
 	for (fileId = 0; fileId < ARRAYSIZE(_budleDirCache); fileId++) {
-		if ((_budleDirCache[fileId].bundleTable == NULL) && (freeSlot == -1)) {
+		if ((_budleDirCache[fileId].bundleTable == nullptr) && (freeSlot == -1)) {
 			freeSlot = fileId;
 		}
 		if (scumm_stricmp(filename, _budleDirCache[fileId].fileName) == 0) {
@@ -141,14 +141,14 @@ int BundleDirCache::matchFile(const char *filename) {
 
 BundleMgr::BundleMgr(BundleDirCache *cache) {
 	_cache = cache;
-	_bundleTable = NULL;
-	_compTable = NULL;
+	_bundleTable = nullptr;
+	_compTable = nullptr;
 	_numFiles = 0;
 	_numCompItems = 0;
 	_curSampleId = -1;
 	_fileBundleId = -1;
 	_file = new ScummFile();
-	_compInputBuff = NULL;
+	_compInputBuff = nullptr;
 }
 
 BundleMgr::~BundleMgr() {
@@ -168,7 +168,7 @@ Common::SeekableReadStream *BundleMgr::getFile(const char *filename, int32 &offs
 		return _file;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 bool BundleMgr::open(const char *filename, bool &compressed, bool errorFlag) {
@@ -203,7 +203,7 @@ bool BundleMgr::open(const char *filename, bool &compressed, bool errorFlag) {
 void BundleMgr::close() {
 	if (_file->isOpen()) {
 		_file->close();
-		_bundleTable = NULL;
+		_bundleTable = nullptr;
 		_numFiles = 0;
 		_numCompItems = 0;
 		_compTableLoaded = false;
@@ -212,9 +212,9 @@ void BundleMgr::close() {
 		_outputSize = 0;
 		_curSampleId = -1;
 		free(_compTable);
-		_compTable = NULL;
+		_compTable = nullptr;
 		free(_compInputBuff);
-		_compInputBuff = NULL;
+		_compInputBuff = nullptr;
 	}
 }
 
diff --git a/engines/scumm/imuse_digi/dimuse_codecs.cpp b/engines/scumm/imuse_digi/dimuse_codecs.cpp
index 65141534b2..44c57a6bb7 100644
--- a/engines/scumm/imuse_digi/dimuse_codecs.cpp
+++ b/engines/scumm/imuse_digi/dimuse_codecs.cpp
@@ -60,8 +60,8 @@ uint32 decode12BitsSample(const byte *src, byte **dst, uint32 size) {
  * varies the size of each "packet" between 2 and 7 bits.
  */
 
-static byte *_destImcTable = NULL;
-static uint32 *_destImcTable2 = NULL;
+static byte *_destImcTable = nullptr;
+static uint32 *_destImcTable2 = nullptr;
 
 // This table is the "big brother" of Audio::ADPCMStream::_stepAdjustTable.
 static const byte imxOtherTable[6][64] = {
@@ -106,9 +106,9 @@ static const byte imxOtherTable[6][64] = {
 
 void releaseImcTables() {
 	free(_destImcTable);
-	_destImcTable = NULL;
+	_destImcTable = nullptr;
 	free(_destImcTable2);
-	_destImcTable2 = NULL;
+	_destImcTable2 = nullptr;
 }
 
 void initializeImcTables() {
diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
index 80be6000b2..d3f00e01ee 100644
--- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -315,7 +315,7 @@ ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::allocSlot() {
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 bool ImuseDigiSndMgr::openMusicBundle(SoundDesc *sound, int &disk) {
@@ -400,7 +400,7 @@ ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::openSound(int32 soundId, const char
 
 	const bool header_outside = ((_vm->_game.id == GID_CMI) && !(_vm->_game.features & GF_DEMO));
 	bool result = false;
-	byte *ptr = NULL;
+	byte *ptr = nullptr;
 
 	switch (soundType) {
 	case IMUSE_RESOURCE:
@@ -409,9 +409,9 @@ ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::openSound(int32 soundId, const char
 		_vm->ensureResourceLoaded(rtSound, soundId);
 		_vm->_res->lock(rtSound, soundId);
 		ptr = _vm->getResourceAddress(rtSound, soundId);
-		if (ptr == NULL) {
+		if (ptr == nullptr) {
 			closeSound(sound);
-			return NULL;
+			return nullptr;
 		}
 		sound->resPtr = ptr;
 		break;
@@ -424,7 +424,7 @@ ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::openSound(int32 soundId, const char
 			error("ImuseDigiSndMgr::openSound() Don't know how load sound: %d", soundId);
 		if (!result) {
 			closeSound(sound);
-			return NULL;
+			return nullptr;
 		}
 		if (sound->compressed) {
 			char fileName[24];
@@ -433,7 +433,7 @@ ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::openSound(int32 soundId, const char
 			Common::SeekableReadStream *rmapFile = sound->bundle->getFile(fileName, offset, size);
 			if (!rmapFile) {
 				closeSound(sound);
-				return NULL;
+				return nullptr;
 			}
 			prepareSoundFromRMAP(rmapFile, sound, offset, size);
 			strcpy(sound->name, soundName);
@@ -443,19 +443,19 @@ ImuseDigiSndMgr::SoundDesc *ImuseDigiSndMgr::openSound(int32 soundId, const char
 			sound->disk = disk;
 			return sound;
 		} else if (soundName[0] == 0) {
-			if (sound->bundle->decompressSampleByIndex(soundId, 0, 0x2000, &ptr, 0, header_outside, rawBundle) == 0 || ptr == NULL) {
+			if (sound->bundle->decompressSampleByIndex(soundId, 0, 0x2000, &ptr, 0, header_outside, rawBundle) == 0 || ptr == nullptr) {
 				closeSound(sound);
 				free(ptr);
-				return NULL;
+				return nullptr;
 			}
 		} else {
-			if (sound->bundle->decompressSampleByName(soundName, 0, 0x2000, &ptr, header_outside, rawBundle) == 0 || ptr == NULL) {
+			if (sound->bundle->decompressSampleByName(soundName, 0, 0x2000, &ptr, header_outside, rawBundle) == 0 || ptr == nullptr) {
 				closeSound(sound);
 				free(ptr);
-				return NULL;
+				return nullptr;
 			}
 		}
-		sound->resPtr = 0;
+		sound->resPtr = nullptr;
 		break;
 	default:
 		error("ImuseDigiSndMgr::openSound() Unknown soundType %d (trying to load sound %d)", soundType, soundId);
@@ -618,7 +618,7 @@ void ImuseDigiSndMgr::getSyncSizeAndPtrById(SoundDesc *soundDesc, int number, in
 		*sync_ptr = soundDesc->sync[number].ptr;
 	} else {
 		sync_size = 0;
-		*sync_ptr = NULL;
+		*sync_ptr = nullptr;
 	}
 }
 
@@ -751,7 +751,7 @@ int32 ImuseDigiSndMgr::getDataFromRegion(SoundDesc *soundDesc, int region, byte
 		size = soundDesc->compressedStream->readBuffer((int16 *)*buf, size / 2) * 2;
 		if (soundDesc->compressedStream->endOfData() || soundDesc->endFlag) {
 			delete soundDesc->compressedStream;
-			soundDesc->compressedStream = NULL;
+			soundDesc->compressedStream = nullptr;
 			soundDesc->lastFileName[0] = 0;
 			soundDesc->endFlag = true;
 		}
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 8ab7202a95..84e2c827a8 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -483,10 +483,10 @@ void ScummEngine_v2::processKeyboard(Common::KeyState lastKeyHit) {
 	if (lastKeyHit.keycode == Common::KEYCODE_F5 && lastKeyHit.hasFlags(Common::KBD_ALT)) {
 		prepareSavegame();
 		if (_game.id == GID_MANIAC && _game.version == 0) {
-			runScript(2, 0, 0, 0);
+			runScript(2, 0, 0, nullptr);
 		}
 		if (_game.id == GID_MANIAC &&_game.platform == Common::kPlatformNES) {
-			runScript(163, 0, 0, 0);
+			runScript(163, 0, 0, nullptr);
 		}
 	}
 
@@ -544,12 +544,12 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 
 	if (mainmenuKeyEnabled && (lastKeyHit.keycode == Common::KEYCODE_F5 && lastKeyHit.hasFlags(0))) {
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
-			runScript(VAR(VAR_SAVELOAD_SCRIPT), 0, 0, 0);
+			runScript(VAR(VAR_SAVELOAD_SCRIPT), 0, 0, nullptr);
 
 		openMainMenuDialog();		// Display global main menu
 
 		if (VAR_SAVELOAD_SCRIPT2 != 0xFF && _currentRoom != 0)
-			runScript(VAR(VAR_SAVELOAD_SCRIPT2), 0, 0, 0);
+			runScript(VAR(VAR_SAVELOAD_SCRIPT2), 0, 0, nullptr);
 
 	} else if (restartKeyEnabled && (lastKeyHit.keycode == Common::KEYCODE_F8 && lastKeyHit.hasFlags(0))) {
 		confirmRestartDialog();
diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp
index 600b2ea7b4..16360abf2f 100644
--- a/engines/scumm/midiparser_ro.cpp
+++ b/engines/scumm/midiparser_ro.cpp
@@ -86,7 +86,7 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) {
 		info.event = 0xFF;
 		info.ext.type = 0x2F;
 		info.length = 0;
-		info.ext.data = 0;
+		info.ext.data = nullptr;
 		return;
 	}
 
@@ -110,7 +110,7 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) {
 
 	case 0xF: // Marker and EOT messages
 		info.length = 0;
-		info.ext.data = 0;
+		info.ext.data = nullptr;
 		if (info.event == 0xFF) {
 			_autoLoop = true;
 			info.ext.type = 0x2F;
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index e094595f01..0412756b08 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -203,7 +203,7 @@ void ScummEngine::clearOwnerOf(int obj) {
 						// FIXME FIXME FIXME: This is incomplete, as we do not touch flags, status... BUG
 						_res->_types[rtInventory][i]._address = _res->_types[rtInventory][i + 1]._address;
 						_res->_types[rtInventory][i]._size = _res->_types[rtInventory][i + 1]._size;
-						_res->_types[rtInventory][i + 1]._address = NULL;
+						_res->_types[rtInventory][i + 1]._address = nullptr;
 						_res->_types[rtInventory][i + 1]._size = 0;
 					}
 				}
@@ -481,8 +481,8 @@ int ScummEngine::getDist(int x, int y, int x2, int y2) {
 
 int ScummEngine::getObjActToObjActDist(int a, int b) {
 	int x, y, x2, y2;
-	Actor *acta = NULL;
-	Actor *actb = NULL;
+	Actor *acta = nullptr;
+	Actor *actb = nullptr;
 
 	if (objIsActor(a))
 		acta = derefActorSafe(objToActor(a), "getObjActToObjActDist");
@@ -775,7 +775,7 @@ void ScummEngine::resetRoomObjects() {
 		od = &_objs[findLocalObjectSlot()];
 
 		ptr = obcds.findNext(MKTAG('O','B','C','D'));
-		if (ptr == NULL)
+		if (ptr == nullptr)
 			error("Room %d missing object code block(s)", _roomResource);
 
 		od->OBCDoffset = ptr - rootptr;
@@ -801,7 +801,7 @@ void ScummEngine::resetRoomObjects() {
 	ResourceIterator obims(room, false);
 	for (i = 0; i < _numObjectsInRoom; i++) {
 		ptr = obims.findNext(MKTAG('O','B','I','M'));
-		if (ptr == NULL)
+		if (ptr == nullptr)
 			error("Room %d missing image blocks(s)", _roomResource);
 
 		obim_id = getObjectIdFromOBIM(ptr);
@@ -882,7 +882,7 @@ void ScummEngine_v4::resetRoomObjects() {
 		od = &_objs[findLocalObjectSlot()];
 
 		ptr = obcds.findNext(MKTAG('O','B','C','D'));
-		if (ptr == NULL)
+		if (ptr == nullptr)
 			error("Room %d missing object code block(s)", _roomResource);
 
 		od->OBCDoffset = ptr - room;
@@ -899,7 +899,7 @@ void ScummEngine_v4::resetRoomObjects() {
 		// In the PC Engine version of Loom, there aren't image blocks
 		// for all objects.
 		ptr = obims.findNext(MKTAG('O','B','I','M'));
-		if (ptr == NULL)
+		if (ptr == nullptr)
 			break;
 
 		obim_id = READ_LE_UINT16(ptr + 6);
@@ -989,12 +989,12 @@ void ScummEngine_v4::resetRoomObject(ObjectData *od, const byte *room, const byt
 }
 
 void ScummEngine::resetRoomObject(ObjectData *od, const byte *room, const byte *searchptr) {
-	const CodeHeader *cdhd = NULL;
-	const ImageHeader *imhd = NULL;
+	const CodeHeader *cdhd = nullptr;
+	const ImageHeader *imhd = nullptr;
 
 	assert(room);
 
-	if (searchptr == NULL) {
+	if (searchptr == nullptr) {
 		if (_game.version == 8) {
 			searchptr = getResourceAddress(rtRoomScripts, _roomResource);
 			assert(searchptr);
@@ -1004,7 +1004,7 @@ void ScummEngine::resetRoomObject(ObjectData *od, const byte *room, const byte *
 	}
 
 	cdhd = (const CodeHeader *)findResourceData(MKTAG('C','D','H','D'), searchptr + od->OBCDoffset);
-	if (cdhd == NULL)
+	if (cdhd == nullptr)
 		error("Room %d missing CDHD blocks(s)", _roomResource);
 	if (od->OBIMoffset)
 		imhd = (const ImageHeader *)findResourceData(MKTAG('I','M','H','D'), room + od->OBIMoffset);
@@ -1187,8 +1187,8 @@ const byte *ScummEngine::getObjOrActorName(int obj) {
 	}
 
 	objptr = getOBCDFromObject(obj, true);
-	if (objptr == NULL)
-		return NULL;
+	if (objptr == nullptr)
+		return nullptr;
 
 	if (_game.features & GF_SMALL_HEADER) {
 		byte offset = 0;
@@ -1226,7 +1226,7 @@ void ScummEngine::setObjectName(int obj) {
 
 	for (i = 0; i < _numNewNames; i++) {
 		if (_newNames[i] == 0) {
-			loadPtrToResource(rtObjectName, i, NULL);
+			loadPtrToResource(rtObjectName, i, nullptr);
 			_newNames[i] = obj;
 			runInventoryScript(0);
 			return;
@@ -1261,7 +1261,7 @@ byte *ScummEngine::getOBCDFromObject(int obj, bool v0CheckInventory) {
 		_objectOwnerTable[obj] != OF_OWNER_ROOM)
 	{
 		if (_game.version == 0 && !v0CheckInventory)
-			return 0;
+			return nullptr;
 		for (i = 0; i < _numInventory; i++) {
 			if (_inventory[i] == obj)
 				return getResourceAddress(rtInventory, i);
@@ -1281,7 +1281,7 @@ byte *ScummEngine::getOBCDFromObject(int obj, bool v0CheckInventory) {
 			}
 		}
 	}
-	return 0;
+	return nullptr;
 }
 
 const byte *ScummEngine::getOBIMFromObjectData(const ObjectData &od) {
@@ -1330,15 +1330,15 @@ const byte *ScummEngine::getObjectImage(const byte *ptr, int state) {
 		// we use the offsets in the OFFS chunk,
 		ptr = findResource(MKTAG('I','M','A','G'), ptr);
 		if (!ptr)
-			return 0;
+			return nullptr;
 
 		ptr = findResource(MKTAG('W','R','A','P'), ptr);
 		if (!ptr)
-			return 0;
+			return nullptr;
 
 		ptr = findResource(MKTAG('O','F','F','S'), ptr);
 		if (!ptr)
-			return 0;
+			return nullptr;
 
 		// Get the address of the specified SMAP (corresponding to IMxx)
 		ptr += READ_LE_UINT32(ptr + 4 + 4*state);
@@ -1479,7 +1479,7 @@ void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id,
 		ResourceIterator	obcds(searchptr, (_game.features & GF_SMALL_HEADER) != 0);
 		for (i = 0; i < numobj; i++) {
 			obcdptr = obcds.findNext(MKTAG('O','B','C','D'));
-			if (obcdptr == NULL)
+			if (obcdptr == nullptr)
 				error("findObjectInRoom: Not enough code blocks in room %d", room);
 			cdhd = (const CodeHeader *)findResourceData(MKTAG('C','D','H','D'), obcdptr);
 
@@ -1507,7 +1507,7 @@ void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id,
 		ResourceIterator	obims(roomptr, (_game.features & GF_SMALL_HEADER) != 0);
 		for (i = 0; i < numobj; i++) {
 			obimptr = obims.findNext(MKTAG('O','B','I','M'));
-			if (obimptr == NULL)
+			if (obimptr == nullptr)
 				error("findObjectInRoom: Not enough image blocks in room %d", room);
 			obim_id = getObjectIdFromOBIM(obimptr);
 
@@ -1767,7 +1767,7 @@ void ScummEngine_v6::drawBlastObject(BlastObject *eo) {
 	bdd.scale_x = (byte)eo->scaleX;
 	bdd.scale_y = (byte)eo->scaleY;
 
-	bdd.maskPtr = NULL;
+	bdd.maskPtr = nullptr;
 	bdd.numStrips = _gdi->_numStrips;
 
 	if ((bdd.scale_x != 255) || (bdd.scale_y != 255)) {
@@ -1777,7 +1777,7 @@ void ScummEngine_v6::drawBlastObject(BlastObject *eo) {
 	}
 	bdd.shadowPalette = _shadowPalette;
 
-	bdd.actorPalette = 0;
+	bdd.actorPalette = nullptr;
 	bdd.mirror = false;
 
 	drawBomp(bdd);
@@ -1839,7 +1839,7 @@ int ScummEngine::findLocalObjectSlot() {
 int ScummEngine::findFlObjectSlot() {
 	int i;
 	for (i = 1; i < _numFlObject; i++) {
-		if (_res->_types[rtFlObject][i]._address == NULL)
+		if (_res->_types[rtFlObject][i]._address == nullptr)
 			return i;
 	}
 	error("findFlObjectSlot: Out of FLObject slots");
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 084f0c0c93..0357082579 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -47,7 +47,7 @@ uint8 *ScummEngine::getHEPaletteSlot(uint16 palSlot) {
 			return _hePalettes + _hePaletteSlot + 768;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) {
@@ -1346,16 +1346,16 @@ const byte *ScummEngine::findPalInPals(const byte *pal, int idx) {
 	uint32 size;
 
 	pal = findResource(MKTAG('W','R','A','P'), pal);
-	if (pal == NULL)
-		return NULL;
+	if (pal == nullptr)
+		return nullptr;
 
 	offs = findResourceData(MKTAG('O','F','F','S'), pal);
-	if (offs == NULL)
-		return NULL;
+	if (offs == nullptr)
+		return nullptr;
 
 	size = getResourceDataSize(offs) / 4;
 	if ((uint32)idx >= (uint32)size)
-		return NULL;
+		return nullptr;
 
 	return offs + READ_LE_UINT32(offs + idx * sizeof(uint32));
 }
diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp
index f0ee921fd8..70b0e50404 100644
--- a/engines/scumm/players/player_ad.cpp
+++ b/engines/scumm/players/player_ad.cpp
@@ -79,7 +79,7 @@ Player_AD::~Player_AD() {
 	stopAllSounds();
 	Common::StackLock lock(_mutex);
 	delete _opl2;
-	_opl2 = 0;
+	_opl2 = nullptr;
 }
 
 void Player_AD::setMusicVolume(int vol) {
@@ -195,7 +195,7 @@ void Player_AD::saveLoadWithSerializer(Common::Serializer &s) {
 	Common::StackLock lock(_mutex);
 
 	if (s.getVersion() < VER(95)) {
-		IMuse *dummyImuse = IMuse::create(_vm->_system, NULL, NULL);
+		IMuse *dummyImuse = IMuse::create(_vm->_system, nullptr, nullptr);
 		dummyImuse->saveLoadIMuse(s, _vm, false);
 		delete dummyImuse;
 		return;
diff --git a/engines/scumm/players/player_apple2.cpp b/engines/scumm/players/player_apple2.cpp
index 91cdebba18..11a93dee45 100644
--- a/engines/scumm/players/player_apple2.cpp
+++ b/engines/scumm/players/player_apple2.cpp
@@ -355,7 +355,7 @@ const byte AppleII_SoundFunction5_Noise::_noiseTable[256] = {
  ************************************/
 
 Player_AppleII::Player_AppleII(ScummEngine *scumm, Audio::Mixer *mixer)
-	: _mixer(mixer), _vm(scumm), _soundFunc(0) {
+	: _mixer(mixer), _vm(scumm), _soundFunc(nullptr) {
 	resetState();
 	setSampleRate(_mixer->getOutputRate());
 	_mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
@@ -370,10 +370,10 @@ void Player_AppleII::resetState() {
 	_soundNr = 0;
 	_type = 0;
 	_loop = 0;
-	_params = NULL;
+	_params = nullptr;
 	_speakerState = 0;
 	delete _soundFunc;
-	_soundFunc = 0;
+	_soundFunc = nullptr;
 	_sampleConverter.reset();
 }
 
@@ -428,7 +428,7 @@ bool Player_AppleII::updateSound() {
 		--_loop;
 		if (_loop <= 0) {
 			delete _soundFunc;
-			_soundFunc = 0;
+			_soundFunc = nullptr;
 		} else {
 			// reset function state on each loop
 			_soundFunc->init(this, _params);
diff --git a/engines/scumm/players/player_mac.cpp b/engines/scumm/players/player_mac.cpp
index b9c9279471..8906e3262e 100644
--- a/engines/scumm/players/player_mac.cpp
+++ b/engines/scumm/players/player_mac.cpp
@@ -30,7 +30,7 @@ namespace Scumm {
 
 Player_Mac::Player_Mac(ScummEngine *scumm, Audio::Mixer *mixer, int numberOfChannels, int channelMask, bool fadeNoteEnds)
 	: _vm(scumm),
-	  _channel(NULL),
+	  _channel(nullptr),
 	  _mixer(mixer),
 	  _sampleRate(_mixer->getOutputRate()),
 	  _soundPlaying(-1),
@@ -48,13 +48,13 @@ void Player_Mac::init(const Common::String &instrumentFile) {
 	for (int i = 0; i < _numberOfChannels; i++) {
 		_channel[i]._looped = false;
 		_channel[i]._length = 0;
-		_channel[i]._data = NULL;
+		_channel[i]._data = nullptr;
 		_channel[i]._pos = 0;
 		_channel[i]._pitchModifier = 0;
 		_channel[i]._velocity = 0;
 		_channel[i]._remaining = 0;
 		_channel[i]._notesLeft = false;
-		_channel[i]._instrument._data = NULL;
+		_channel[i]._instrument._data = nullptr;
 		_channel[i]._instrument._size = 0;
 		_channel[i]._instrument._rate = 0;
 		_channel[i]._instrument._loopStart = 0;
@@ -112,7 +112,7 @@ void Player_Mac::saveLoadWithSerializer(Common::Serializer &s) {
 	Common::StackLock lock(_mutex);
 	if (s.getVersion() < VER(94)) {
 		if (_vm->_game.id == GID_MONKEY && s.isLoading()) {
-			IMuse *dummyImuse = IMuse::create(_vm->_system, NULL, NULL);
+			IMuse *dummyImuse = IMuse::create(_vm->_system, nullptr, nullptr);
 			dummyImuse->saveLoadIMuse(s, _vm, false);
 			delete dummyImuse;
 		}
@@ -162,7 +162,7 @@ void Player_Mac::stopAllSounds_Internal() {
 		// The channel data is managed by the resource manager, so
 		// don't delete that.
 		delete[] _channel[i]._instrument._data;
-		_channel[i]._instrument._data = NULL;
+		_channel[i]._instrument._data = nullptr;
 
 		_channel[i]._remaining = 0;
 		_channel[i]._notesLeft = false;
diff --git a/engines/scumm/players/player_mod.cpp b/engines/scumm/players/player_mod.cpp
index d780df94a5..0c8f05c8d2 100644
--- a/engines/scumm/players/player_mod.cpp
+++ b/engines/scumm/players/player_mod.cpp
@@ -38,13 +38,13 @@ Player_MOD::Player_MOD(Audio::Mixer *mixer)
 		_channels[i].id = 0;
 		_channels[i].vol = 0;
 		_channels[i].freq = 0;
-		_channels[i].input = NULL;
+		_channels[i].input = nullptr;
 		_channels[i].ctr = 0;
 		_channels[i].pos = 0;
 	}
 
-	_playproc = NULL;
-	_playparam = NULL;
+	_playproc = nullptr;
+	_playparam = nullptr;
 
 	_mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
 }
@@ -70,8 +70,8 @@ void Player_MOD::setUpdateProc(ModUpdateProc *proc, void *param, int freq) {
 }
 void Player_MOD::clearUpdateProc() {
 	Common::StackLock lock(_mutex);
-	_playproc = NULL;
-	_playparam = NULL;
+	_playproc = nullptr;
+	_playparam = nullptr;
 	_mixamt = 0;
 }
 
@@ -114,7 +114,7 @@ void Player_MOD::stopChannel(int id) {
 	for (int i = 0; i < MOD_MAXCHANS; i++) {
 		if (_channels[i].id == id) {
 			delete _channels[i].input;
-			_channels[i].input = NULL;
+			_channels[i].input = nullptr;
 			_channels[i].id = 0;
 			_channels[i].vol = 0;
 			_channels[i].freq = 0;
diff --git a/engines/scumm/players/player_nes.cpp b/engines/scumm/players/player_nes.cpp
index 02b999dc7c..a929da9cc3 100644
--- a/engines/scumm/players/player_nes.cpp
+++ b/engines/scumm/players/player_nes.cpp
@@ -611,7 +611,7 @@ Player_NES::Player_NES(ScummEngine *scumm, Audio::Mixer *mixer) {
 		_slot[i].framesleft = 0;
 		_slot[i].type = 0;
 		_slot[i].offset = 0;
-		_slot[i].data = NULL;
+		_slot[i].data = nullptr;
 	}
 
 	for (i = 0; i < NUMCHANS; i++) {
@@ -625,7 +625,7 @@ Player_NES::Player_NES(ScummEngine *scumm, Audio::Mixer *mixer) {
 	}
 	isSFXplaying = wasSFXplaying = false;
 
-	auxData1 = auxData2 = NULL;
+	auxData1 = auxData2 = nullptr;
 	numNotes = 0;
 
 	APU_writeControl(0);
diff --git a/engines/scumm/players/player_pce.cpp b/engines/scumm/players/player_pce.cpp
index 8efa3c6510..941044513a 100644
--- a/engines/scumm/players/player_pce.cpp
+++ b/engines/scumm/players/player_pce.cpp
@@ -448,7 +448,7 @@ void Player_PCE::setupWaveform(byte bank) {
 
 // A541
 void Player_PCE::procA541(channel_t *channel) {
-	channel->soundDataPtr = NULL;
+	channel->soundDataPtr = nullptr;
 	channel->controlVecShort10 = 0;
 
 	channel->controlVecShort03 = 0;
diff --git a/engines/scumm/players/player_sid.cpp b/engines/scumm/players/player_sid.cpp
index c7be112449..ce82396a2e 100644
--- a/engines/scumm/players/player_sid.cpp
+++ b/engines/scumm/players/player_sid.cpp
@@ -193,7 +193,7 @@ void Player_SID::handleMusicBuffer() { // $33cd
 int Player_SID::setupSongFileData() { // $36cb
 	// no song playing
 	// TODO: remove (never NULL)
-	if (_music == NULL) {
+	if (_music == nullptr) {
 		for (int i = 2; i >= 0; --i) {
 			if (songChannelBits & BITMASK[i]) {
 				func_3674(i);
@@ -334,7 +334,7 @@ void Player_SID::processSongData(int channel) { // $4939
 
 	//vec5[channel] = songFileOrChanBufData; // not used
 
-	if (songFileOrChanBufData == NULL) { // chanBuf (4C1C)
+	if (songFileOrChanBufData == nullptr) { // chanBuf (4C1C)
 		/*
 		// TODO: do we need this?
 		LOBYTE_(vec20[channel]) = 0;
@@ -569,7 +569,7 @@ int Player_SID::setupSongPtr(int channel) { // $4C1C
 	int resID = channelMap[channel];
 
 	// TODO: when does this happen, only if resID == 0?
-	if (getResource(resID) == NULL) {
+	if (getResource(resID) == nullptr) {
 		releaseResourceUnk(resID);
 		if (resID == bgSoundResID) {
 			bgSoundResID = 0;
@@ -776,17 +776,17 @@ void Player_SID::resetSwapVars() { // $52d0
 		swapSustain[i] = 0;
 	}
 	for (int i = 0; i < 3; ++i) {
-		swapVec5[i] = 0;
+		swapVec5[i] = nullptr;
 		swapSongPrio[i] = 0;
 		swapVec479C[i] = 0;
 		swapVec19[i] = 0;
 		swapSongPosUpdateCounter[i] = 0;
 		swapWaveCtrlReg[i] = 0;
-		swapSongPosPtr[i] = 0;
+		swapSongPosPtr[i] = nullptr;
 		swapFreqReg[i] = 0;
 		swapVec11[i] = 0;
 		swapVec10[i] = 0;
-		swapVec20[i] = 0;
+		swapVec20[i] = nullptr;
 		swapVec8[i] = 0;
 	}
 }
@@ -886,7 +886,7 @@ void Player_SID::initMusic(int songResIndex) { // $7de6
 
 	resID_song = songResIndex;
 	_music = getResource(resID_song);
-	if (_music == NULL) {
+	if (_music == nullptr) {
 		return;
 	}
 
@@ -1022,7 +1022,7 @@ int Player_SID::initSound(int soundResID) { // $4D0A
 	}
 
 	uint8 *songFilePtr = getResource(soundResID);
-	if (songFilePtr == NULL) {
+	if (songFilePtr == nullptr) {
 		initializing = false;
 		return 1;
 	}
@@ -1155,9 +1155,9 @@ Player_SID::Player_SID(ScummEngine *scumm, Audio::Mixer *mixer) {
 	minChanPrio = 0;
 	minChanPrioIndex = 0;
 
-	_music = NULL;
-	songFileOrChanBufData = NULL;
-	actSongFileData = NULL;
+	_music = nullptr;
+	songFileOrChanBufData = nullptr;
+	actSongFileData = nullptr;
 
 	initializing = false;
 	_soundInQueue = false;
@@ -1271,7 +1271,7 @@ Player_SID::~Player_SID() {
 uint8 *Player_SID::getResource(int resID) {
 	switch (resID) {
 	case 0:
-		return NULL;
+		return nullptr;
 	case 3:
 	case 4:
 	case 5:
diff --git a/engines/scumm/players/player_towns.cpp b/engines/scumm/players/player_towns.cpp
index e3d0b29d8f..bf01beaa4f 100644
--- a/engines/scumm/players/player_towns.cpp
+++ b/engines/scumm/players/player_towns.cpp
@@ -26,7 +26,7 @@
 
 namespace Scumm {
 
-Player_Towns::Player_Towns(ScummEngine *vm, bool isVersion2) : _vm(vm), _v2(isVersion2), _intf(0), _numSoundMax(isVersion2 ? 256 : 200), _unkFlags(0x33) {
+Player_Towns::Player_Towns(ScummEngine *vm, bool isVersion2) : _vm(vm), _v2(isVersion2), _intf(nullptr), _numSoundMax(isVersion2 ? 256 : 200), _unkFlags(0x33) {
 	memset(_pcmCurrentSound, 0, sizeof(_pcmCurrentSound));
 }
 
@@ -188,7 +188,7 @@ int Player_Towns::allocatePcmChannel(int sound, int sfxChanRelIndex, uint32 prio
 }
 
 Player_Towns_v1::Player_Towns_v1(ScummEngine *vm, Audio::Mixer *mixer) : Player_Towns(vm, false) {
-	_soundOverride = 0;
+	_soundOverride = nullptr;
 	_cdaCurrentSound = _eupCurrentSound = _cdaNumLoops = 0;
 	_cdaForceRestart = 0;
 	_cdaVolLeft = _cdaVolRight = 0;
@@ -201,7 +201,7 @@ Player_Towns_v1::Player_Towns_v1(ScummEngine *vm, Audio::Mixer *mixer) : Player_
 	}
 
 	_player = new EuphonyPlayer(mixer);
-	_intf = new TownsAudioInterface(mixer, 0);
+	_intf = new TownsAudioInterface(mixer, nullptr);
 }
 
 Player_Towns_v1::~Player_Towns_v1() {
@@ -582,14 +582,14 @@ void Player_Towns_v1::playCdaTrack(int sound, const uint8 *data, bool skipTrackV
 	_cdaCurrentSound = sound;
 }
 
-Player_Towns_v2::Player_Towns_v2(ScummEngine *vm, Audio::Mixer *mixer, IMuse *imuse, bool disposeIMuse) : Player_Towns(vm, true), _imuse(imuse), _imuseDispose(disposeIMuse), _sblData(0) {
+Player_Towns_v2::Player_Towns_v2(ScummEngine *vm, Audio::Mixer *mixer, IMuse *imuse, bool disposeIMuse) : Player_Towns(vm, true), _imuse(imuse), _imuseDispose(disposeIMuse), _sblData(nullptr) {
 	_soundOverride = new SoundOvrParameters[_numSoundMax]();
-	_intf = new TownsAudioInterface(mixer, 0, true);
+	_intf = new TownsAudioInterface(mixer, nullptr, true);
 }
 
 Player_Towns_v2::~Player_Towns_v2() {
 	delete _intf;
-	_intf = 0;
+	_intf = nullptr;
 
 	if (_imuseDispose)
 		delete _imuse;
@@ -658,7 +658,7 @@ void Player_Towns_v2::stopAllSounds() {
 
 int32 Player_Towns_v2::doCommand(int numargs, int args[]) {
 	int32 res = -1;
-	uint8 *ptr = 0;
+	uint8 *ptr = nullptr;
 
 	switch (args[0]) {
 	case 8:
diff --git a/engines/scumm/players/player_v1.cpp b/engines/scumm/players/player_v1.cpp
index 7c9ce0b614..41b3d2ff81 100644
--- a/engines/scumm/players/player_v1.cpp
+++ b/engines/scumm/players/player_v1.cpp
@@ -40,7 +40,7 @@ Player_V1::Player_V1(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr)
 		clear_channel(i);
 
 	_mplex_step = (_sampleRate << FIXP_SHIFT) / 1193000;
-	_next_chunk = _repeat_chunk = 0;
+	_next_chunk = _repeat_chunk = nullptr;
 	_forced_level = 0;
 	_random_lsr = 0;
 }
@@ -93,9 +93,9 @@ void Player_V1::stopAllSounds() {
 
 	for (int i = 0; i < 4; i++)
 		clear_channel(i);
-	_repeat_chunk = _next_chunk = 0;
+	_repeat_chunk = _next_chunk = nullptr;
 	_next_nr = _current_nr = 0;
-	_next_data = _current_data = 0;
+	_next_data = _current_data = nullptr;
 }
 
 void Player_V1::stopSound(int nr) {
@@ -103,15 +103,15 @@ void Player_V1::stopSound(int nr) {
 
 	if (_next_nr == nr) {
 		_next_nr = 0;
-		_next_data = 0;
+		_next_data = nullptr;
 	}
 	if (_current_nr == nr) {
 		for (int i = 0; i < 4; i++) {
 			clear_channel(i);
 		}
-		_repeat_chunk = _next_chunk = 0;
+		_repeat_chunk = _next_chunk = nullptr;
 		_current_nr = 0;
-		_current_data = 0;
+		_current_data = nullptr;
 		chainNextSound();
 	}
 }
@@ -139,9 +139,9 @@ void Player_V1::parseSpeakerChunk() {
 	switch (_chunk_type) {
 	case 0xffff:
 		_current_nr = 0;
-		_current_data = 0;
+		_current_data = nullptr;
 		_channels[0].freq = 0;
-		_next_chunk = 0;
+		_next_chunk = nullptr;
 		chainNextSound();
 		break;
 	case 0xfffe:
@@ -279,8 +279,8 @@ parse_again:
 		for (i = 0; i < 4; ++i)
 			clear_channel(i);
 		_current_nr = 0;
-		_current_data = 0;
-		_repeat_chunk = _next_chunk = 0;
+		_current_data = nullptr;
+		_repeat_chunk = _next_chunk = nullptr;
 		chainNextSound();
 		break;
 
@@ -303,7 +303,7 @@ parse_again:
 			tmp = READ_LE_UINT16(_next_chunk);
 			_next_chunk += 2;
 			if (tmp == 0xffff) {
-				_channels[i].cmd_ptr = 0;
+				_channels[i].cmd_ptr = nullptr;
 				continue;
 			}
 			_channels[i].attack    = READ_LE_UINT16(_current_data + tmp);
@@ -320,7 +320,7 @@ parse_again:
 	case 1:
 		set_mplex(READ_LE_UINT16(_next_chunk));
 		tmp = READ_LE_UINT16(_next_chunk + 2);
-		_channels[0].cmd_ptr = tmp != 0xffff ? _current_data + tmp : NULL;
+		_channels[0].cmd_ptr = tmp != 0xffff ? _current_data + tmp : nullptr;
 		tmp = READ_LE_UINT16(_next_chunk + 4);
 		_start = READ_LE_UINT16(_next_chunk + 6);
 		_delta = (int16) READ_LE_UINT16(_next_chunk + 8);
diff --git a/engines/scumm/players/player_v2.cpp b/engines/scumm/players/player_v2.cpp
index b58be8d881..e9aef177d6 100644
--- a/engines/scumm/players/player_v2.cpp
+++ b/engines/scumm/players/player_v2.cpp
@@ -99,7 +99,7 @@ void Player_V2::stopAllSounds() {
 		clear_channel(i);
 	}
 	_next_nr = _current_nr = 0;
-	_next_data = _current_data = 0;
+	_next_data = _current_data = nullptr;
 }
 
 void Player_V2::stopSound(int nr) {
@@ -107,14 +107,14 @@ void Player_V2::stopSound(int nr) {
 
 	if (_next_nr == nr) {
 		_next_nr = 0;
-		_next_data = 0;
+		_next_data = nullptr;
 	}
 	if (_current_nr == nr) {
 		for (int i = 0; i < 4; i++) {
 			clear_channel(i);
 		}
 		_current_nr = 0;
-		_current_data = 0;
+		_current_data = nullptr;
 		chainNextSound();
 	}
 }
@@ -146,7 +146,7 @@ void Player_V2::startSound(int nr) {
 	if (!_current_nr) {
 		nr = 0;
 		_next_nr = 0;
-		_next_data = 0;
+		_next_data = nullptr;
 	}
 
 	if (nr != _current_nr
diff --git a/engines/scumm/players/player_v2a.cpp b/engines/scumm/players/player_v2a.cpp
index 80a978409b..8e1336e120 100644
--- a/engines/scumm/players/player_v2a.cpp
+++ b/engines/scumm/players/player_v2a.cpp
@@ -54,7 +54,7 @@ static uint32 GetCRC(byte *data, int len) {
 
 class V2A_Sound {
 public:
-	V2A_Sound() : _id(0), _mod(NULL) { }
+	V2A_Sound() : _id(0), _mod(nullptr) { }
 	virtual ~V2A_Sound() {}
 	virtual void start(Player_MOD *mod, int id, const byte *data) = 0;
 	virtual bool update() = 0;
@@ -79,15 +79,15 @@ public:
 template<int numChan>
 class V2A_Sound_Base : public V2A_Sound {
 public:
-	V2A_Sound_Base() : _offset(0), _size(0), _data(0) { }
-	V2A_Sound_Base(uint16 offset, uint16 size) : _offset(offset), _size(size), _data(0) { }
+	V2A_Sound_Base() : _offset(0), _size(0), _data(nullptr) { }
+	V2A_Sound_Base(uint16 offset, uint16 size) : _offset(offset), _size(size), _data(nullptr) { }
 	void stop() override {
 		assert(_id);
 		for (int i = 0; i < numChan; i++)
 			_mod->stopChannel(_id | (i << 8));
 		_id = 0;
 		free(_data);
-		_data = 0;
+		_data = nullptr;
 	}
 protected:
 	const uint16 _offset;
@@ -1844,7 +1844,7 @@ static V2A_Sound *findSound(unsigned long crc) {
 	CRCToSound(0x59976529, V2A_Sound_Music(0x088E, 0x092E, 0x048E, 0x05EE, 0x074E, 0x07EE, 0x112E, true)); // Zak 49
 	CRCToSound(0xED1EED02, V2A_Sound_Music(0x08D0, 0x0950, 0x0440, 0x07E0, 0x08B0, 0x08C0, 0x1350, false)); // Zak 112
 	CRCToSound(0x5A16C037, V2A_Sound_Music(0x634A, 0x64CA, 0x049A, 0x18FA, 0x398A, 0x511A, 0x6CCA, false)); // Zak 95
-	return NULL;
+	return nullptr;
 }
 
 Player_V2A::Player_V2A(ScummEngine *scumm, Audio::Mixer *mixer) {
@@ -1855,7 +1855,7 @@ Player_V2A::Player_V2A(ScummEngine *scumm, Audio::Mixer *mixer) {
 
 	for (i = 0; i < V2A_MAXSLOTS; i++) {
 		_slot[i].id = 0;
-		_slot[i].sound = NULL;
+		_slot[i].sound = nullptr;
 	}
 
 	_mod = new Player_MOD(mixer);
@@ -1890,7 +1890,7 @@ void Player_V2A::stopAllSounds() {
 			continue;
 		_slot[i].sound->stop();
 		delete _slot[i].sound;
-		_slot[i].sound = NULL;
+		_slot[i].sound = nullptr;
 		_slot[i].id = 0;
 	}
 }
@@ -1904,7 +1904,7 @@ void Player_V2A::stopSound(int nr) {
 		return;
 	_slot[i].sound->stop();
 	delete _slot[i].sound;
-	_slot[i].sound = NULL;
+	_slot[i].sound = nullptr;
 	_slot[i].id = 0;
 }
 
@@ -1914,7 +1914,7 @@ void Player_V2A::startSound(int nr) {
 	assert(data);
 	uint32 crc = GetCRC(data + 0x0A, READ_BE_UINT16(data + 0x08));
 	V2A_Sound *snd = findSound(crc);
-	if (snd == NULL) {
+	if (snd == nullptr) {
 		warning("player_v2a - sound %i not recognized yet (crc %08X)", nr, crc);
 		return;
 	}
@@ -1939,7 +1939,7 @@ void Player_V2A::updateSound() {
 		if ((_slot[i].id) && (!_slot[i].sound->update())) {
 			_slot[i].sound->stop();
 			delete _slot[i].sound;
-			_slot[i].sound = NULL;
+			_slot[i].sound = nullptr;
 			_slot[i].id = 0;
 		}
 	}
diff --git a/engines/scumm/players/player_v2base.cpp b/engines/scumm/players/player_v2base.cpp
index 7aaeafe090..b991ec46b7 100644
--- a/engines/scumm/players/player_v2base.cpp
+++ b/engines/scumm/players/player_v2base.cpp
@@ -329,9 +329,9 @@ Player_V2Base::Player_V2Base(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr)
 
 	// Initialize sound queue
 	_current_nr = _next_nr = 0;
-	_current_data = _next_data = 0;
+	_current_data = _next_data = nullptr;
 
-	_retaddr = 0;
+	_retaddr = nullptr;
 
 	// Initialize channel code
 	for (int i = 0; i < 4; ++i)
@@ -378,7 +378,7 @@ void Player_V2Base::chainNextSound() {
 	if (_next_nr) {
 		chainSound(_next_nr, _next_data);
 		_next_nr = 0;
-		_next_data = 0;
+		_next_data = nullptr;
 	}
 }
 
@@ -592,7 +592,7 @@ check_stopped:
 	}
 
 	_current_nr = 0;
-	_current_data = 0;
+	_current_data = nullptr;
 	chainNextSound();
 }
 
diff --git a/engines/scumm/players/player_v2cms.cpp b/engines/scumm/players/player_v2cms.cpp
index d42fe5ed00..57e961e56c 100644
--- a/engines/scumm/players/player_v2cms.cpp
+++ b/engines/scumm/players/player_v2cms.cpp
@@ -30,7 +30,7 @@ namespace Scumm {
 Player_V2CMS::Player_V2CMS(ScummEngine *scumm, Audio::Mixer *mixer)
 	: Player_V2Base(scumm, mixer, true), _cmsVoicesBase(), _cmsVoices(),
 	  _cmsChips(), _midiDelay(0), _octaveMask(0), _looping(0), _tempo(0),
-	  _tempoSum(0), _midiData(0), _midiSongBegin(0), _musicTimer(0),
+	  _tempoSum(0), _midiData(nullptr), _midiSongBegin(nullptr), _musicTimer(0),
 	  _musicTimerTicks(0), _voiceTimer(0), _loadedMidiSong(0),
 	  _outputTableReady(0), _midiChannel(), _midiChannelUse(),
 	  _lastMidiCommand(0) {
@@ -98,9 +98,9 @@ void Player_V2CMS::stopAllSounds() {
 		clear_channel(i);
 	}
 	_next_nr = _current_nr = 0;
-	_next_data = _current_data = 0;
-	_midiData = 0;
-	_midiSongBegin = 0;
+	_next_data = _current_data = nullptr;
+	_midiData = nullptr;
+	_midiSongBegin = nullptr;
 	_midiDelay = 0;
 	_musicTimer = _musicTimerTicks = 0;
 	offAllChannels();
@@ -111,19 +111,19 @@ void Player_V2CMS::stopSound(int nr) {
 
 	if (_next_nr == nr) {
 		_next_nr = 0;
-		_next_data = 0;
+		_next_data = nullptr;
 	}
 	if (_current_nr == nr) {
 		for (int i = 0; i < 4; i++) {
 			clear_channel(i);
 		}
 		_current_nr = 0;
-		_current_data = 0;
+		_current_data = nullptr;
 		chainNextSound();
 	}
 	if (_loadedMidiSong == nr) {
-		_midiData = 0;
-		_midiSongBegin = 0;
+		_midiData = nullptr;
+		_midiSongBegin = nullptr;
 		_midiDelay = 0;
 		offAllChannels();
 	}
@@ -160,7 +160,7 @@ void Player_V2CMS::startSound(int nr) {
 		if (!_current_nr) {
 			nr = 0;
 			_next_nr = 0;
-			_next_data = 0;
+			_next_data = nullptr;
 		}
 
 		if (nr != _current_nr
@@ -228,7 +228,7 @@ void Player_V2CMS::loadMidiData(byte *data, int sound) {
 	for (int i = 0; i < 8; ++i) {
 		_cmsVoices[i].chanNumber = 0xFF;
 		_cmsVoices[i].curVolume = 0;
-		_cmsVoices[i].nextVoice = 0;
+		_cmsVoices[i].nextVoice = nullptr;
 	}
 
 	_midiDelay = 0;
@@ -262,7 +262,7 @@ void Player_V2CMS::processMidiData() {
 						currentData = _midiData = _midiSongBegin;
 						continue;
 					}
-					_midiData = _midiSongBegin = 0;
+					_midiData = _midiSongBegin = nullptr;
 					_midiDelay = 0;
 					_loadedMidiSong = 0;
 					offAllChannels();
@@ -350,7 +350,7 @@ void Player_V2CMS::playVoice() {
 	}
 
 	_octaveMask = 0xF0;
-	Voice2 *voice = 0;
+	Voice2 *voice = nullptr;
 	for (int i = 0; i < 8; ++i) {
 		voice = &_cmsVoices[i];
 		_octaveMask = ~_octaveMask;
@@ -479,8 +479,8 @@ void Player_V2CMS::offAllChannels() {
 }
 
 Player_V2CMS::Voice2 *Player_V2CMS::getFreeVoice() {
-	Voice2 *curVoice = 0;
-	Voice2 *selected = 0;
+	Voice2 *curVoice = nullptr;
+	Voice2 *selected = nullptr;
 	uint8 volume = 0xFF;
 
 	for (int i = 0; i < 8; ++i) {
@@ -569,7 +569,7 @@ Player_V2CMS::Voice2 *Player_V2CMS::getPlayVoice(byte param) {
 	Voice2 *curVoice = _midiChannel[channelNum];
 
 	if (curVoice) {
-		Voice2 *prevVoice = 0;
+		Voice2 *prevVoice = nullptr;
 		while (true) {
 			if (curVoice->playingNote == param)
 				break;
@@ -577,7 +577,7 @@ Player_V2CMS::Voice2 *Player_V2CMS::getPlayVoice(byte param) {
 			prevVoice = curVoice;
 			curVoice = curVoice->nextVoice;
 			if (!curVoice)
-				return 0;
+				return nullptr;
 		}
 
 		if (prevVoice)
@@ -593,7 +593,7 @@ void Player_V2CMS::clearNote(byte *&data) {
 	Voice2 *voice = getPlayVoice(*data);
 	if (voice) {
 		voice->chanNumber = 0xFF;
-		voice->nextVoice = 0;
+		voice->nextVoice = nullptr;
 		voice->nextProcessState = Voice2::kEnvelopeRelease;
 	}
 	data += 2;
diff --git a/engines/scumm/players/player_v3a.cpp b/engines/scumm/players/player_v3a.cpp
index e6610a87d3..f15c7ea78d 100644
--- a/engines/scumm/players/player_v3a.cpp
+++ b/engines/scumm/players/player_v3a.cpp
@@ -47,7 +47,7 @@ Player_V3A::Player_V3A(ScummEngine *scumm, Audio::Mixer *mixer) {
 	}
 
 	_curSong = 0;
-	_songData = NULL;
+	_songData = nullptr;
 	_songPtr = 0;
 	_songDelay = 0;
 
@@ -63,7 +63,7 @@ Player_V3A::~Player_V3A() {
 	int i;
 	delete _mod;
 	if (_isinit) {
-		for (i = 0; _wavetable[i] != NULL; i++) {
+		for (i = 0; _wavetable[i] != nullptr; i++) {
 			for (int j = 0; j < 6; j++) {
 				free(_wavetable[i]->_idat[j]);
 				free(_wavetable[i]->_ldat[j]);
@@ -116,7 +116,7 @@ void Player_V3A::stopAllSounds() {
 	_curSong = 0;
 	_songPtr = 0;
 	_songDelay = 0;
-	_songData = NULL;
+	_songData = nullptr;
 	for (i = 0; i < V3A_MAXSFX; i++) {
 		if (_sfx[i].id)
 			_mod->stopChannel(_sfx[i].id | 0x100);
@@ -141,7 +141,7 @@ void Player_V3A::stopSound(int nr) {
 		_curSong = 0;
 		_songPtr = 0;
 		_songDelay = 0;
-		_songData = NULL;
+		_songData = nullptr;
 	} else {
 		i = getSfxChan(nr);
 		if (i != -1) {
@@ -184,13 +184,13 @@ void Player_V3A::startSound(int nr) {
 				if (len) {
 					_wavetable[i]->_idat[j] = (char *)malloc(len);
 					memcpy(_wavetable[i]->_idat[j],ptr + off,len);
-				} else	_wavetable[i]->_idat[j] = NULL;
+				} else	_wavetable[i]->_idat[j] = nullptr;
 				off = READ_BE_UINT16(ptr + offset + 4);
 				_wavetable[i]->_llen[j] = len = READ_BE_UINT16(ptr + offset + 6);
 				if (len) {
 					_wavetable[i]->_ldat[j] = (char *)malloc(len);
 					memcpy(_wavetable[i]->_ldat[j],ptr + off,len);
-				} else	_wavetable[i]->_ldat[j] = NULL;
+				} else	_wavetable[i]->_ldat[j] = nullptr;
 				_wavetable[i]->_oct[j] = READ_BE_UINT16(ptr + offset + 8);
 				offset += 10;
 			}
@@ -202,7 +202,7 @@ void Player_V3A::startSound(int nr) {
 				offset += 4;
 			}
 		}
-		_wavetable[i] = NULL;
+		_wavetable[i] = nullptr;
 		_isinit = true;
 	}
 
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 25d8c174a5..90a50b14f9 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -291,7 +291,7 @@ void ScummEngine::readIndexFile() {
 	}
 
 	if (checkTryMedia(_fileHandle)) {
-		displayMessage(NULL, "You're trying to run game encrypted by ActiveMark. This is not supported.");
+		displayMessage(nullptr, "You're trying to run game encrypted by ActiveMark. This is not supported.");
 		quitGame();
 
 		return;
@@ -749,7 +749,7 @@ byte *ScummEngine::getResourceAddress(ResType type, ResId idx) {
 		idx &= ~0x33539000;
 
 	if (!_res->validateResource("getResourceAddress", type, idx))
-		return NULL;
+		return nullptr;
 
 	// If the resource is missing, but loadable from the game data files, try to do so.
 	if (!_res->_types[type][idx]._address && _res->_types[type]._mode != kDynamicResTypeMode) {
@@ -759,7 +759,7 @@ byte *ScummEngine::getResourceAddress(ResType type, ResId idx) {
 	ptr = (byte *)_res->_types[type][idx]._address;
 	if (!ptr) {
 		debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == NULL", nameOfResType(type), idx);
-		return NULL;
+		return nullptr;
 	}
 
 	_res->setResourceCounter(type, idx, 1);
@@ -775,8 +775,8 @@ byte *ScummEngine::getStringAddress(ResId idx) {
 
 byte *ScummEngine_v6::getStringAddress(ResId idx) {
 	byte *addr = getResourceAddress(rtString, idx);
-	if (addr == NULL)
-		return NULL;
+	if (addr == nullptr)
+		return nullptr;
 	// Skip over the ArrayHeader
 	return addr + 6;
 }
@@ -824,7 +824,7 @@ byte *ResourceManager::createResource(ResType type, ResId idx, uint32 size) {
 	debugC(DEBUG_RESOURCE, "_res->createResource(%s,%d,%d)", nameOfResType(type), idx, size);
 
 	if (!validateResource("allocating", type, idx))
-		return NULL;
+		return nullptr;
 
 	if (_vm->_game.version <= 2) {
 		// Nuking and reloading a resource can be harmful in some
@@ -840,7 +840,7 @@ byte *ResourceManager::createResource(ResType type, ResId idx, uint32 size) {
 	expireResources(size);
 
 	byte *ptr = new byte[size + SAFETY_AREA]();
-	if (ptr == NULL) {
+	if (ptr == nullptr) {
 		error("createResource(%s,%d): Out of memory while allocating %d", nameOfResType(type), idx, size);
 	}
 
@@ -853,7 +853,7 @@ byte *ResourceManager::createResource(ResType type, ResId idx, uint32 size) {
 }
 
 ResourceManager::Resource::Resource() {
-	_address = 0;
+	_address = nullptr;
 	_size = 0;
 	_flags = 0;
 	_status = 0;
@@ -863,12 +863,12 @@ ResourceManager::Resource::Resource() {
 
 ResourceManager::Resource::~Resource() {
 	delete[] _address;
-	_address = 0;
+	_address = nullptr;
 }
 
 void ResourceManager::Resource::nuke() {
 	delete[] _address;
-	_address = 0;
+	_address = nullptr;
 	_size = 0;
 	_flags = 0;
 	_status &= ~RS_MODIFIED;
@@ -910,7 +910,7 @@ bool ResourceManager::validateResource(const char *str, ResType type, ResId idx)
 
 void ResourceManager::nukeResource(ResType type, ResId idx) {
 	byte *ptr = _types[type][idx]._address;
-	if (ptr != NULL) {
+	if (ptr != nullptr) {
 		debugC(DEBUG_RESOURCE, "nukeResource(%s,%d)", nameOfResType(type), idx);
 		_allocatedSize -= _types[type][idx]._size;
 		_types[type][idx].nuke();
@@ -925,13 +925,13 @@ const byte *ScummEngine::findResourceData(uint32 tag, const byte *ptr) {
 	else
 		ptr = findResource(tag, ptr);
 
-	if (ptr == NULL)
-		return NULL;
+	if (ptr == nullptr)
+		return nullptr;
 	return ptr + _resourceHeaderSize;
 }
 
 int ScummEngine::getResourceDataSize(const byte *ptr) const {
-	if (ptr == NULL)
+	if (ptr == nullptr)
 		return 0;
 
 	if (_game.features & GF_OLD_BUNDLE)
@@ -1153,7 +1153,7 @@ void ScummEngine::loadPtrToResource(ResType type, ResId idx, const byte *source)
 bool ResourceManager::isResourceLoaded(ResType type, ResId idx) const {
 	if (!validateResource("isResourceLoaded", type, idx))
 		return false;
-	return _types[type][idx]._address != NULL;
+	return _types[type][idx]._address != nullptr;
 }
 
 void ResourceManager::resourceStats() {
@@ -1183,7 +1183,7 @@ void ScummEngine_v5::readMAXS(int blockSize) {
 	// Used to be 50, which wasn't enough for MI2 and FOA. See bugs
 	// #1591, #1600 and #1607.
 	_numNewNames = 150;
-	_objectRoomTable = NULL;
+	_objectRoomTable = nullptr;
 
 	_fileHandle->readUint16LE();                      // 50
 	_numCharsets = _fileHandle->readUint16LE();       // 9
@@ -1280,7 +1280,7 @@ void ScummEngine_v6::readMAXS(int blockSize) {
 		_numGlobalObjects = _fileHandle->readUint16LE();
 		_numNewNames = 50;
 
-		_objectRoomTable = NULL;
+		_objectRoomTable = nullptr;
 		_numGlobalScripts = 200;
 
 		if (_game.heversion >= 70) {
@@ -1453,18 +1453,18 @@ ResourceIterator::ResourceIterator(const byte *searchin, bool smallHeader)
 
 const byte *ResourceIterator::findNext(uint32 tag) {
 	uint32 size = 0;
-	const byte *result = 0;
+	const byte *result = nullptr;
 
 	if (_smallHeader) {
 		uint16 smallTag = newTag2Old(tag);
 		do {
 			if (_pos >= _size)
-				return 0;
+				return nullptr;
 
 			result = _ptr;
 			size = READ_LE_UINT32(result);
 			if ((int32)size <= 0)
-				return 0;	// Avoid endless loop
+				return nullptr;	// Avoid endless loop
 
 			_pos += size;
 			_ptr += size;
@@ -1472,12 +1472,12 @@ const byte *ResourceIterator::findNext(uint32 tag) {
 	} else {
 		do {
 			if (_pos >= _size)
-				return 0;
+				return nullptr;
 
 			result = _ptr;
 			size = READ_BE_UINT32(result + 4);
 			if ((int32)size <= 0)
-				return 0;	// Avoid endless loop
+				return nullptr;	// Avoid endless loop
 
 			_pos += size;
 			_ptr += size;
@@ -1499,7 +1499,7 @@ const byte *ScummEngine::findResource(uint32 tag, const byte *searchin) {
 			curpos = 0;
 		} else {
 			assert(searchin);
-			return NULL;
+			return nullptr;
 		}
 	} else {
 		searchin += 4;
@@ -1517,14 +1517,14 @@ const byte *ScummEngine::findResource(uint32 tag, const byte *searchin) {
 		size = READ_BE_UINT32(searchin + 4);
 		if ((int32)size <= 0) {
 			error("(%s) Not found in %d... illegal block len %d", tag2str(tag), 0, size);
-			return NULL;
+			return nullptr;
 		}
 
 		curpos += size;
 		searchin += size;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 const byte *findResourceSmall(uint32 tag, const byte *searchin) {
@@ -1533,7 +1533,7 @@ const byte *findResourceSmall(uint32 tag, const byte *searchin) {
 
 	smallTag = newTag2Old(tag);
 	if (smallTag == 0)
-		return NULL;
+		return nullptr;
 
 	assert(searchin);
 
@@ -1549,14 +1549,14 @@ const byte *findResourceSmall(uint32 tag, const byte *searchin) {
 
 		if ((int32)size <= 0) {
 			error("(%s) Not found in %d... illegal block len %d", tag2str(tag), 0, size);
-			return NULL;
+			return nullptr;
 		}
 
 		curpos += size;
 		searchin += size;
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 uint16 newTag2Old(uint32 newTag) {
diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp
index 49a5927530..7322d6d7e3 100644
--- a/engines/scumm/resource_v4.cpp
+++ b/engines/scumm/resource_v4.cpp
@@ -181,7 +181,7 @@ void ScummEngine_v4::readMAXS(int blockSize) {
 	_numArray = 50;
 	_numVerbs = 100;
 	_numNewNames = 50;
-	_objectRoomTable = NULL;
+	_objectRoomTable = nullptr;
 	_numCharsets = 9;					// 9
 	_numInventory = 80;					// 80
 	_numGlobalScripts = 200;
diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp
index ebc4799825..159acfe8d3 100644
--- a/engines/scumm/room.cpp
+++ b/engines/scumm/room.cpp
@@ -198,7 +198,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
 
 	runEntryScript();
 	if (_game.version >= 1 && _game.version <= 2) {
-		runScript(5, 0, 0, 0);
+		runScript(5, 0, 0, nullptr);
 	} else if (_game.version >= 5 && _game.version <= 6) {
 		if (a && !_egoPositioned) {
 			int x, y;
@@ -242,7 +242,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
 void ScummEngine::setupRoomSubBlocks() {
 	int i;
 	const byte *ptr;
-	byte *roomptr, *searchptr, *roomResPtr = 0;
+	byte *roomptr, *searchptr, *roomResPtr = nullptr;
 	const RoomHeader *rmhd;
 
 	_ENCD_offs = 0;
@@ -323,7 +323,7 @@ void ScummEngine::setupRoomSubBlocks() {
 
 	if (_game.features & GF_SMALL_HEADER) {
 		ResourceIterator localScriptIterator(searchptr, true);
-		while ((ptr = localScriptIterator.findNext(MKTAG('L','S','C','R'))) != NULL) {
+		while ((ptr = localScriptIterator.findNext(MKTAG('L','S','C','R'))) != nullptr) {
 			int id = 0;
 			ptr += _resourceHeaderSize;	/* skip tag & size */
 			id = ptr[0];
@@ -338,7 +338,7 @@ void ScummEngine::setupRoomSubBlocks() {
 		}
 	} else if (_game.heversion >= 90) {
 		ResourceIterator localScriptIterator2(searchptr, false);
-		while ((ptr = localScriptIterator2.findNext(MKTAG('L','S','C','2'))) != NULL) {
+		while ((ptr = localScriptIterator2.findNext(MKTAG('L','S','C','2'))) != nullptr) {
 			int id = 0;
 
 			ptr += _resourceHeaderSize;	/* skip tag & size */
@@ -356,7 +356,7 @@ void ScummEngine::setupRoomSubBlocks() {
 		}
 
 		ResourceIterator localScriptIterator(searchptr, false);
-		while ((ptr = localScriptIterator.findNext(MKTAG('L','S','C','R'))) != NULL) {
+		while ((ptr = localScriptIterator.findNext(MKTAG('L','S','C','R'))) != nullptr) {
 			int id = 0;
 
 			ptr += _resourceHeaderSize;	/* skip tag & size */
@@ -373,7 +373,7 @@ void ScummEngine::setupRoomSubBlocks() {
 
 	} else {
 		ResourceIterator localScriptIterator(searchptr, false);
-		while ((ptr = localScriptIterator.findNext(MKTAG('L','S','C','R'))) != NULL) {
+		while ((ptr = localScriptIterator.findNext(MKTAG('L','S','C','R'))) != nullptr) {
 			int id = 0;
 
 			ptr += _resourceHeaderSize;	/* skip tag & size */
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 8ea688393d..5ac41ab676 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -191,7 +191,7 @@ bool ScummEngine::saveState(Common::WriteStream *out, bool writeHeader) {
 #endif
 	saveInfos(out);
 
-	Common::Serializer ser(0, out);
+	Common::Serializer ser(nullptr, out);
 	ser.setVersion(CURRENT_VER);
 	saveLoadWithSerializer(ser);
 	return true;
@@ -230,7 +230,7 @@ void ScummEngine_v4::prepareSavegame() {
 
 	// free memory of the last prepared savegame
 	delete _savePreparedSavegame;
-	_savePreparedSavegame = NULL;
+	_savePreparedSavegame = nullptr;
 
 	// store headerless savegame in a compressed memory stream
 	memStream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::NO);
@@ -257,7 +257,7 @@ bool ScummEngine_v4::savePreparedSavegame(int slot, char *desc) {
 	SaveGameHeader hdr;
 	uint32 nread, nwritten;
 
-	out = 0;
+	out = nullptr;
 	success = true;
 
 	// check if savegame was successfully stored in memory
@@ -447,7 +447,7 @@ bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
 	//
 	// Now do the actual loading
 	//
-	Common::Serializer ser(in, 0);
+	Common::Serializer ser(in, nullptr);
 	ser.setVersion(hdr.ver);
 	saveLoadWithSerializer(ser);
 	delete in;
@@ -564,7 +564,7 @@ bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
 		_macScreen->fillRect(Common::Rect(_macScreen->w, _macScreen->h), 0);
 	clearTextSurface();
 
-	_lastCodePtr = NULL;
+	_lastCodePtr = nullptr;
 	_drawObjectQueNr = 0;
 	_verbMouseOver = 0;
 
@@ -589,7 +589,7 @@ bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
 	//
 	// Fixes bug #3362: MANIACNES: Music Doesn't Start On Load Game
 	if (_game.platform == Common::kPlatformNES) {
-		runScript(5, 0, 0, 0);
+		runScript(5, 0, 0, nullptr);
 
 		if (VAR(224)) {
 			_sound->addSoundToQueue(VAR(224));
@@ -633,7 +633,7 @@ void ScummEngine::listSavegames(bool *marks, int num) {
 bool getSavegameName(Common::InSaveFile *in, Common::String &desc, int heversion);
 
 bool ScummEngine::getSavegameName(int slot, Common::String &desc) {
-	Common::InSaveFile *in = 0;
+	Common::InSaveFile *in = nullptr;
 	bool result = false;
 
 	desc.clear();
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 89d9610914..bfc774ed1f 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -429,7 +429,7 @@ void ScummEngine::getScriptBaseAddress() {
 	}
 
 	// The following fixes bug #2028. Confirmed against disasm.
-	if (_game.version <= 2 && _scriptOrgPointer == NULL) {
+	if (_game.version <= 2 && _scriptOrgPointer == nullptr) {
 		ss->status = ssDead;
 		_currentScript = 0xFF;
 	}
@@ -925,7 +925,7 @@ void ScummEngine::runAllScripts() {
 
 void ScummEngine::runExitScript() {
 	if (VAR_EXIT_SCRIPT != 0xFF && VAR(VAR_EXIT_SCRIPT))
-		runScript(VAR(VAR_EXIT_SCRIPT), 0, 0, 0);
+		runScript(VAR(VAR_EXIT_SCRIPT), 0, 0, nullptr);
 	if (_EXCD_offs) {
 		int slot = getScriptSlot();
 		vm.slot[slot].status = ssRunning;
@@ -950,11 +950,11 @@ void ScummEngine::runExitScript() {
 			}
 		}
 
-		initializeLocals(slot, 0);
+		initializeLocals(slot, nullptr);
 		runScriptNested(slot);
 	}
 	if (VAR_EXIT_SCRIPT2 != 0xFF && VAR(VAR_EXIT_SCRIPT2))
-		runScript(VAR(VAR_EXIT_SCRIPT2), 0, 0, 0);
+		runScript(VAR(VAR_EXIT_SCRIPT2), 0, 0, nullptr);
 
 #ifdef ENABLE_SCUMM_7_8
 	// WORKAROUND: The spider lair (room 44) will optionally play the sound
@@ -970,7 +970,7 @@ void ScummEngine::runExitScript() {
 
 void ScummEngine::runEntryScript() {
 	if (VAR_ENTRY_SCRIPT != 0xFF && VAR(VAR_ENTRY_SCRIPT))
-		runScript(VAR(VAR_ENTRY_SCRIPT), 0, 0, 0);
+		runScript(VAR(VAR_ENTRY_SCRIPT), 0, 0, nullptr);
 	if (_ENCD_offs) {
 		int slot = getScriptSlot();
 		vm.slot[slot].status = ssRunning;
@@ -982,11 +982,11 @@ void ScummEngine::runEntryScript() {
 		vm.slot[slot].freezeCount = 0;
 		vm.slot[slot].delayFrameCount = 0;
 		vm.slot[slot].cycle = 1;
-		initializeLocals(slot, 0);
+		initializeLocals(slot, nullptr);
 		runScriptNested(slot);
 	}
 	if (VAR_ENTRY_SCRIPT2 != 0xFF && VAR(VAR_ENTRY_SCRIPT2))
-		runScript(VAR(VAR_ENTRY_SCRIPT2), 0, 0, 0);
+		runScript(VAR(VAR_ENTRY_SCRIPT2), 0, 0, nullptr);
 }
 
 void ScummEngine::runQuitScript() {
@@ -1320,7 +1320,7 @@ void ScummEngine_v0::runSentenceScript() {
 		// do not read in the dark
 		if (!(_cmdVerb == kVerbRead && _currentLights == 0)) {
 			VAR(VAR_ACTIVE_OBJECT2) = OBJECT_V0_ID(_cmdObject2);
-			runObjectScript(_cmdObject, _cmdVerb, false, false, NULL);
+			runObjectScript(_cmdObject, _cmdVerb, false, false, nullptr);
 			return;
 		}
 	} else {
@@ -1336,7 +1336,7 @@ void ScummEngine_v0::runSentenceScript() {
 	if (_cmdVerb != kVerbWalkTo) {
 		// perform verb's fallback action
 		VAR(VAR_ACTIVE_VERB) = _cmdVerb;
-		runScript(3, 0, 0, 0);
+		runScript(3, 0, 0, nullptr);
 	}
 }
 
@@ -1507,7 +1507,7 @@ void ScummEngine::copyScriptString(byte *dst) {
 int ScummEngine::resStrLen(const byte *src) {
 	int num = 0;
 	byte chr;
-	if (src == NULL) {
+	if (src == nullptr) {
 		refreshScriptPointer();
 		src = _scriptPointer;
 	}
diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp
index 9e6dba18ae..92006c9e06 100644
--- a/engines/scumm/script_v0.cpp
+++ b/engines/scumm/script_v0.cpp
@@ -961,7 +961,7 @@ void ScummEngine_v0::o_endCutscene() {
 	setMode(vm.cutSceneData[0]);
 
 	if (_currentMode == kModeKeypad) {
-		startScene(vm.cutSceneData[2], 0, 0);
+		startScene(vm.cutSceneData[2], nullptr, 0);
 		// in contrast to the normal keypad behavior we unfreeze scripts here
 		unfreezeScripts();
 	} else {
diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp
index ac85f83c54..c8bfb1ebe0 100644
--- a/engines/scumm/script_v2.cpp
+++ b/engines/scumm/script_v2.cpp
@@ -684,7 +684,7 @@ void ScummEngine_v2::o2_actorOps() {
 		a->setPalette(i, arg);
 		break;
 	case 3:		// SO_ACTOR_NAME
-		loadPtrToResource(rtActorName, a->_number, NULL);
+		loadPtrToResource(rtActorName, a->_number, nullptr);
 		break;
 	case 4:		// SO_COSTUME
 		a->setActorCostume(arg);
@@ -856,7 +856,7 @@ void ScummEngine_v2::o2_verbOps() {
 		}
 
 		// It follows the verb name
-		loadPtrToResource(rtVerb, slot, NULL);
+		loadPtrToResource(rtVerb, slot, nullptr);
 		}
 		break;
 	}
@@ -939,7 +939,7 @@ void ScummEngine_v2::o2_doSentence() {
 				}
 			}
 
-			runObjectScript(st->objectA, st->verb, isBackgroundScript, isSpecialVerb, NULL, slot);
+			runObjectScript(st->objectA, st->verb, isBackgroundScript, isSpecialVerb, nullptr, slot);
 		}
 		break;
 	case 2:
@@ -1098,7 +1098,7 @@ void ScummEngine_v2::o2_ifClassOfIs() {
 
 	byte *obcd = getOBCDFromObject(obj);
 
-	if (obcd == 0) {
+	if (obcd == nullptr) {
 		o5_jumpRelative();
 		return;
 	}
@@ -1207,7 +1207,7 @@ void ScummEngine_v2::o2_startScript() {
 		}
 	}
 
-	runScript(script, 0, 0, 0);
+	runScript(script, 0, 0, nullptr);
 }
 
 void ScummEngine_v2::stopScriptCommon(int script) {
@@ -1484,7 +1484,7 @@ void ScummEngine_v2::o2_loadRoomWithEgo() {
 	if (x >= 0 && y >= 0) {
 		a->startWalkActor(x, y, -1);
 	}
-	runScript(5, 0, 0, 0);
+	runScript(5, 0, 0, nullptr);
 }
 
 void ScummEngine_v2::o2_setOwnerOf() {
@@ -1584,7 +1584,7 @@ void ScummEngine_v2::o2_endCutscene() {
 		if (camera._mode == kFollowActorCameraMode) {
 			actorFollowCamera(VAR(VAR_EGO));
 		} else if (vm.cutSceneData[2] != _currentRoom) {
-			startScene(vm.cutSceneData[2], 0, 0);
+			startScene(vm.cutSceneData[2], nullptr, 0);
 		}
 	} else {
 		actorFollowCamera(VAR(VAR_EGO));
@@ -1604,7 +1604,7 @@ void ScummEngine_v2::o2_chainScript() {
 	int script = getVarOrDirectByte(PARAM_1);
 	stopScript(vm.slot[_currentScript].number);
 	_currentScript = 0xFF;
-	runScript(script, 0, 0, 0);
+	runScript(script, 0, 0, nullptr);
 }
 
 void ScummEngine_v2::o2_pickupObject() {
diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp
index 3c482996fc..42423650cf 100644
--- a/engines/scumm/script_v4.cpp
+++ b/engines/scumm/script_v4.cpp
@@ -59,9 +59,9 @@ void ScummEngine_v4::setupOpcodes() {
 	OPCODE(0xa2, o4_saveLoadGame);
 
 	// Disable some opcodes which are unused in v4.
-	_opcodes[0x3b].setProc(0, 0);
-	_opcodes[0x4c].setProc(0, 0);
-	_opcodes[0xbb].setProc(0, 0);
+	_opcodes[0x3b].setProc(nullptr, nullptr);
+	_opcodes[0x4c].setProc(nullptr, nullptr);
+	_opcodes[0xbb].setProc(nullptr, nullptr);
 }
 
 void ScummEngine_v4::o4_ifState() {
@@ -337,7 +337,7 @@ void ScummEngine_v4::saveIQPoints() {
 	Common::String filename = _targetName + ".iq";
 
 	file = _saveFileMan->openForSaving(filename);
-	if (file != NULL) {
+	if (file != nullptr) {
 		byte *ptr = getResourceAddress(rtString, STRINGID_IQ_EPISODE);
 		if (ptr) {
 			int size = getResourceSize(rtString, STRINGID_IQ_EPISODE);
@@ -353,7 +353,7 @@ void ScummEngine_v4::loadIQPoints(byte *ptr, int size) {
 	Common::String filename = _targetName + ".iq";
 
 	file = _saveFileMan->openForLoading(filename);
-	if (file != NULL) {
+	if (file != nullptr) {
 		byte *tmp = (byte *)malloc(size);
 		int nread = file->read(tmp, size);
 		if (nread == size) {
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index ed3fc7e913..59c2d2f547 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -526,7 +526,7 @@ void ScummEngine_v5::o5_actorOps() {
 			a->_talkColor = getVarOrDirectByte(PARAM_1);
 			break;
 		case 13:		// SO_ACTOR_NAME
-			loadPtrToResource(rtActorName, a->_number, NULL);
+			loadPtrToResource(rtActorName, a->_number, nullptr);
 			break;
 		case 14:		// SO_INIT_ANIMATION
 			a->_initFrame = getVarOrDirectByte(PARAM_1);
@@ -1397,7 +1397,7 @@ void ScummEngine_v5::o5_loadRoom() {
 	// actually changed. This avoid unwanted (wrong) fades in Zak256
 	// and others. OTOH, it seems to cause a problem in newer games.
 	if (!(_game.features & GF_SMALL_HEADER) || room != _currentRoom)
-		startScene(room, 0, 0);
+		startScene(room, nullptr, 0);
 
 	_fullRedraw = true;
 }
@@ -1979,7 +1979,7 @@ void ScummEngine_v5::o5_roomOps() {
 			}
 
 			Common::OutSaveFile *file = _saveFileMan->openForSaving(filename);
-			if (file != NULL) {
+			if (file != nullptr) {
 				byte *ptr;
 				ptr = getResourceAddress(rtString, a);
 				file->write(ptr, resStrLen(ptr) + 1);
@@ -2008,7 +2008,7 @@ void ScummEngine_v5::o5_roomOps() {
 			}
 
 			Common::InSaveFile *file = _saveFileMan->openForLoading(filename);
-			if (file != NULL) {
+			if (file != nullptr) {
 				byte *ptr;
 				const int len = file->size();
 				ptr = (byte *)malloc(len + 1);
@@ -2354,7 +2354,7 @@ void ScummEngine_v5::o5_stringOps() {
 	_opcode = fetchScriptByte();
 	switch (_opcode & 0x1F) {
 	case 1:											/* loadstring */
-		loadPtrToResource(rtString, getVarOrDirectByte(PARAM_1), NULL);
+		loadPtrToResource(rtString, getVarOrDirectByte(PARAM_1), nullptr);
 		break;
 
 	case 2:											/* copystring */
@@ -2372,7 +2372,7 @@ void ScummEngine_v5::o5_stringOps() {
 		b = getVarOrDirectByte(PARAM_2);
 		c = getVarOrDirectByte(PARAM_3);
 		ptr = getResourceAddress(rtString, a);
-		if (ptr == NULL)
+		if (ptr == nullptr)
 			error("String %d does not exist", a);
 		ptr[b] = c;
 		break;
@@ -2382,7 +2382,7 @@ void ScummEngine_v5::o5_stringOps() {
 		a = getVarOrDirectByte(PARAM_1);
 		b = getVarOrDirectByte(PARAM_2);
 		ptr = getResourceAddress(rtString, a);
-		if (ptr == NULL)
+		if (ptr == nullptr)
 			error("String %d does not exist", a);
 		setResult(ptr[b]);
 		break;
@@ -2436,7 +2436,7 @@ void ScummEngine_v5::o5_verbOps() {
 			}
 			break;
 		case 2:		// SO_VERB_NAME
-			loadPtrToResource(rtVerb, slot, NULL);
+			loadPtrToResource(rtVerb, slot, nullptr);
 			if (slot == 0)
 				_res->nukeResource(rtVerb, slot);
 			vs->type = kTextVerbType;
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 57d2db4ef7..3a04f8e66f 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -373,7 +373,7 @@ int ScummEngine_v6::findFreeArrayId() {
 ScummEngine_v6::ArrayHeader *ScummEngine_v6::getArray(int array) {
 	ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
 	if (!ah)
-		return 0;
+		return nullptr;
 
 	if (_game.heversion == 0) {
 		// Workaround for a long standing bug where we saved array headers in native
@@ -1116,7 +1116,7 @@ void ScummEngine_v6::o6_setCameraAt() {
 
 void ScummEngine_v6::o6_loadRoom() {
 	int room = pop();
-	startScene(room, 0, 0);
+	startScene(room, nullptr, 0);
 	if (_game.heversion >= 61) {
 		setCameraAt(camera._cur.x, 0);
 	}
@@ -1152,7 +1152,7 @@ void ScummEngine_v6::o6_walkActorToObj() {
 		a->startWalkActor(x, y, dir);
 	} else {
 		a2 = derefActorSafe(obj, "o6_walkActorToObj(2)");
-		if (_game.id == GID_SAMNMAX && a2 == 0) {
+		if (_game.id == GID_SAMNMAX && a2 == nullptr) {
 			// WORKAROUND bug #801 SAM: Fish Farm. Note quite sure why it
 			// happens, whether it's normal or due to a bug in the ScummVM code.
 			debug(0, "o6_walkActorToObj: invalid actor %d", obj);
@@ -1828,7 +1828,7 @@ void ScummEngine_v6::o6_actorOps() {
 		a->_talkColor = pop();
 		break;
 	case 88:		// SO_ACTOR_NAME
-		loadPtrToResource(rtActorName, a->_number, NULL);
+		loadPtrToResource(rtActorName, a->_number, nullptr);
 		break;
 	case 89:		// SO_INIT_ANIMATION
 		a->_initFrame = pop();
@@ -1937,7 +1937,7 @@ void ScummEngine_v6::o6_verbOps() {
 		}
 		break;
 	case 125:		// SO_VERB_NAME
-		loadPtrToResource(rtVerb, slot, NULL);
+		loadPtrToResource(rtVerb, slot, nullptr);
 		vs->type = kTextVerbType;
 		vs->imgindex = 0;
 		break;
@@ -3050,7 +3050,7 @@ void ScummEngine_v6::o6_getPixel() {
 
 	VirtScreen *vs = findVirtScreen(y);
 
-	if (vs == NULL || x > _screenWidth - 1 || x < 0) {
+	if (vs == nullptr || x > _screenWidth - 1 || x < 0) {
 		push(-1);
 		return;
 	}
@@ -3063,7 +3063,7 @@ void ScummEngine_v6::o6_setBoxSet() {
 	int arg = pop() - 1;
 
 	const byte *room = getResourceAddress(rtRoom, _roomResource);
-	const byte *boxd = NULL, *boxm = NULL;
+	const byte *boxd = nullptr, *boxm = nullptr;
 	int32 dboxSize, mboxSize;
 	int i;
 
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index eefc249813..4ec04e4786 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -93,7 +93,7 @@ using Common::File;
 namespace Scumm {
 
 // Use g_scumm from error() ONLY
-ScummEngine *g_scumm = 0;
+ScummEngine *g_scumm = nullptr;
 
 
 struct dbgChannelDesc {
@@ -108,7 +108,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	  _filenamePattern(dr.fp),
 	  _language(dr.language),
 	  _currentScript(0xFF), // Let debug() work on init stage
-	  _messageDialog(0), _pauseDialog(0), _versionDialog(0),
+	  _messageDialog(nullptr), _pauseDialog(nullptr), _versionDialog(nullptr),
 	  _rnd("scumm")
 	  {
 
@@ -146,28 +146,28 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 		_gameMD5[i] = (byte)tmpVal;
 	}
 
-	_fileHandle = 0;
+	_fileHandle = nullptr;
 
 	// Init all vars
-	_imuse = NULL;
-	_imuseDigital = NULL;
-	_musicEngine = NULL;
-	_townsPlayer = NULL;
-	_verbs = NULL;
-	_objs = NULL;
-	_sound = NULL;
+	_imuse = nullptr;
+	_imuseDigital = nullptr;
+	_musicEngine = nullptr;
+	_townsPlayer = nullptr;
+	_verbs = nullptr;
+	_objs = nullptr;
+	_sound = nullptr;
 	memset(&vm, 0, sizeof(vm));
-	_pauseDialog = NULL;
-	_versionDialog = NULL;
+	_pauseDialog = nullptr;
+	_versionDialog = nullptr;
 	_fastMode = 0;
-	_actors = _sortedActors = NULL;
-	_arraySlot = NULL;
-	_inventory = NULL;
-	_newNames = NULL;
-	_scummVars = NULL;
-	_roomVars = NULL;
+	_actors = _sortedActors = nullptr;
+	_arraySlot = nullptr;
+	_inventory = nullptr;
+	_newNames = nullptr;
+	_scummVars = nullptr;
+	_roomVars = nullptr;
 	_varwatch = 0;
-	_bitVars = NULL;
+	_bitVars = nullptr;
 	_numVariables = 0;
 	_numBitVariables = 0;
 	_numRoomVariables = 0;
@@ -200,9 +200,9 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	_bootParam = 0;
 	_dumpScripts = false;
 	_debugMode = false;
-	_objectOwnerTable = NULL;
-	_objectRoomTable = NULL;
-	_objectStateTable = NULL;
+	_objectOwnerTable = nullptr;
+	_objectRoomTable = nullptr;
+	_objectStateTable = nullptr;
 	_numObjectsInRoom = 0;
 	_userPut = 0;
 	_userState = 0;
@@ -212,11 +212,11 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	_lastSaveTime = 0;
 	_saveTemporaryState = false;
 	memset(_localScriptOffsets, 0, sizeof(_localScriptOffsets));
-	_scriptPointer = NULL;
-	_scriptOrgPointer = NULL;
+	_scriptPointer = nullptr;
+	_scriptOrgPointer = nullptr;
 	_opcode = 0;
 	vm.numNestedScripts = 0;
-	_lastCodePtr = NULL;
+	_lastCodePtr = nullptr;
 	_scummStackPos = 0;
 	memset(_vmStack, 0, sizeof(_vmStack));
 	_fileOffset = 0;
@@ -225,7 +225,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	_roomResource = 0;
 	OF_OWNER_ROOM = 0;
 	_verbMouseOver = 0;
-	_classData = NULL;
+	_classData = nullptr;
 	_actorToPrintStrFor = 0;
 	_sentenceNum = 0;
 	memset(_sentence, 0, sizeof(_sentence));
@@ -273,16 +273,16 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	_palManipStart = 0;
 	_palManipEnd = 0;
 	_palManipCounter = 0;
-	_palManipPalette = NULL;
-	_palManipIntermediatePal = NULL;
+	_palManipPalette = nullptr;
+	_palManipIntermediatePal = nullptr;
 	memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
-	_hePalettes = NULL;
+	_hePalettes = nullptr;
 	_hePaletteSlot = 0;
-	_16BitPalette = NULL;
-	_macScreen = NULL;
-	_macIndy3TextBox = NULL;
+	_16BitPalette = nullptr;
+	_macScreen = nullptr;
+	_macIndy3TextBox = nullptr;
 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
-	_townsScreen = 0;
+	_townsScreen = nullptr;
 	_scrollRequest = _scrollDeltaAdjust = 0;
 	_scrollDestOffset = _scrollTimer = 0;
 	_refreshNeedCatchUp = false;
@@ -290,12 +290,12 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	memset(_refreshDuration, 0, sizeof(_refreshDuration));
 	_refreshArrayPos = 0;
 #ifdef USE_RGB_COLOR
-	_cjkFont = 0;
+	_cjkFont = nullptr;
 #endif
 #endif
-	_shadowPalette = NULL;
+	_shadowPalette = nullptr;
 	_shadowPaletteSize = 0;
-	_verbPalette = NULL;
+	_verbPalette = nullptr;
 	memset(_currentPalette, 0, sizeof(_currentPalette));
 	memset(_darkenPalette, 0, sizeof(_darkenPalette));
 	memset(_HEV7ActorPalette, 0, sizeof(_HEV7ActorPalette));
@@ -308,7 +308,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	_saveSound = 0;
 	memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags));
 	memset(_scaleSlots, 0, sizeof(_scaleSlots));
-	_charset = NULL;
+	_charset = nullptr;
 	_charsetColor = 0;
 	memset(_charsetColorMap, 0, sizeof(_charsetColorMap));
 	memset(_charsetData, 0, sizeof(_charsetData));
@@ -321,21 +321,21 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	_NES_talkColor = 0;
 	_keepText = false;
 	_msgCount = 0;
-	_costumeLoader = NULL;
-	_costumeRenderer = NULL;
+	_costumeLoader = nullptr;
+	_costumeRenderer = nullptr;
 	_existLanguageFile = false;
-	_languageBuffer = 0;
+	_languageBuffer = nullptr;
 	_numTranslatedLines = 0;
-	_translatedLines = 0;
-	_languageLineIndex = 0;
-	_2byteFontPtr = 0;
+	_translatedLines = nullptr;
+	_languageLineIndex = nullptr;
+	_2byteFontPtr = nullptr;
 	_2byteWidth = 0;
 	_2byteHeight = 0;
 	_2byteShadow = 0;
 	_krStrPost = 0;
 	_V1TalkingActor = 0;
 	for (int i = 0; i < 20; i++)
-		_2byteMultiFontPtr[i] = NULL;
+		_2byteMultiFontPtr[i] = nullptr;
 	_NESStartStrip = 0;
 
 	_skipDrawObject = 0;
@@ -617,9 +617,9 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	if (_game.version < 7)
 		_compositeBuf = (byte *)malloc(_screenWidth * _screenHeight * sizeMult);
 	else
-		_compositeBuf = 0;
+		_compositeBuf = nullptr;
 
-	_herculesBuf = 0;
+	_herculesBuf = nullptr;
 	if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
 		_herculesBuf = (byte *)malloc(kHercWidth * kHercHeight);
 	}
@@ -728,7 +728,7 @@ ScummEngine_v5::ScummEngine_v5(OSystem *syst, const DetectorResult &dr)
 	memset(&_flashlight, 0, sizeof(_flashlight));
 	_flashlight.xStrips = 7;
 	_flashlight.yStrips = 7;
-	_flashlight.buffer = NULL;
+	_flashlight.buffer = nullptr;
 
 	memset(_saveLoadVarsFilename, 0, sizeof(_saveLoadVarsFilename));
 
@@ -747,7 +747,7 @@ ScummEngine_v3::ScummEngine_v3(OSystem *syst, const DetectorResult &dr)
 	if (!(_game.features & GF_OLD256))
 		_game.features |= GF_16COLOR;
 
-	_savePreparedSavegame = NULL;
+	_savePreparedSavegame = nullptr;
 }
 
 ScummEngine_v3::~ScummEngine_v3() {
@@ -892,9 +892,9 @@ ScummEngine_v70he::ScummEngine_v70he(OSystem *syst, const DetectorResult &dr)
 	else
 		_resExtractor = new Win32ResExtractor(this);
 
-	_heV7DiskOffsets = NULL;
-	_heV7RoomOffsets = NULL;
-	_heV7RoomIntOffsets = NULL;
+	_heV7DiskOffsets = nullptr;
+	_heV7RoomOffsets = nullptr;
+	_heV7RoomIntOffsets = nullptr;
 
 	_heSndSoundId = 0;
 	_heSndOffset = 0;
@@ -1247,7 +1247,7 @@ Common::Error ScummEngine::init() {
 
 			// We now have to determine the correct _filenamePattern. To do this
 			// we simply hardcode the possibilities.
-			const char *p1 = 0, *p2 = 0;
+			const char *p1 = nullptr, *p2 = nullptr;
 			switch (_game.id) {
 			case GID_INDY4:
 				p1 = "atlantis.%03d";
@@ -1944,7 +1944,7 @@ void ScummEngine_v3::resetScumm() {
 	}
 
 	delete _savePreparedSavegame;
-	_savePreparedSavegame = NULL;
+	_savePreparedSavegame = nullptr;
 }
 
 void ScummEngine_v4::resetScumm() {
@@ -2212,8 +2212,8 @@ void ScummEngine::setupMusic(int midi, const Common::String &macInstrumentFile)
 		_musicEngine = new Player_HE(this);
 #endif
 	} else if (_game.version >= 3 && _game.heversion <= 62) {
-		MidiDriver *nativeMidiDriver = 0;
-		MidiDriver *adlibMidiDriver = 0;
+		MidiDriver *nativeMidiDriver = nullptr;
+		MidiDriver *adlibMidiDriver = nullptr;
 		bool multi_midi = ConfMan.getBool("multi_midi") && _sound->_musicType != MDT_NONE && _sound->_musicType != MDT_PCSPK && (midi & MDT_ADLIB);
 		bool useOnlyNative = false;
 
@@ -2233,7 +2233,7 @@ void ScummEngine::setupMusic(int midi, const Common::String &macInstrumentFile)
 			nativeMidiDriver = MidiDriver::createMidi(dev);
 		}
 
-		if (nativeMidiDriver != NULL && _native_mt32)
+		if (nativeMidiDriver != nullptr && _native_mt32)
 			nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
 
 		if (!useOnlyNative) {
@@ -2594,7 +2594,7 @@ load_game:
 		scummLoop_handleEffects();
 
 		if (VAR_MAIN_SCRIPT != 0xFF && VAR(VAR_MAIN_SCRIPT) != 0) {
-			runScript(VAR(VAR_MAIN_SCRIPT), 0, 0, 0);
+			runScript(VAR(VAR_MAIN_SCRIPT), 0, 0, nullptr);
 		}
 
 		// Handle mouse over effects (for verbs).
@@ -2757,7 +2757,7 @@ void ScummEngine_v5::scummLoop_handleSaveLoad() {
 	// update IQ points after loading
 	if (saveLoad == 2) {
 		if (_game.id == GID_INDY4)
-			runScript(145, 0, 0, 0);
+			runScript(145, 0, 0, nullptr);
 	}
 }
 
@@ -2996,7 +2996,7 @@ bool ScummEngine::startManiac() {
 				// While strictly speaking it's too broad, this matchString
 				// ignores the presence or absence of trailing path separators
 				// in either currentPath or path.
-				if (path.matchString("*maniac*", true, NULL)) {
+				if (path.matchString("*maniac*", true, nullptr)) {
 					maniacTarget = iter->_key;
 					break;
 				}
diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp
index 6d86215626..8104a170a2 100644
--- a/engines/scumm/smush/channel.cpp
+++ b/engines/scumm/smush/channel.cpp
@@ -29,9 +29,9 @@ namespace Scumm {
 
 SmushChannel::SmushChannel(int32 track) :
 	_track(track),
-	_tbuffer(0),
+	_tbuffer(nullptr),
 	_tbufferSize(0),
-	_sbuffer(0),
+	_sbuffer(nullptr),
 	_sbufferSize(0),
 	_dataSize(-1),
 	_inData(false),
@@ -45,9 +45,9 @@ SmushChannel::~SmushChannel() {
 }
 
 void SmushChannel::processBuffer() {
-	assert(_tbuffer != 0);
+	assert(_tbuffer != nullptr);
 	assert(_tbufferSize != 0);
-	assert(_sbuffer == 0);
+	assert(_sbuffer == nullptr);
 	assert(_sbufferSize == 0);
 
 	if (_inData) {
@@ -67,18 +67,18 @@ void SmushChannel::processBuffer() {
 				memcpy(_tbuffer, _sbuffer + offset, new_size);
 				_tbufferSize = new_size;
 			} else {
-				_tbuffer = 0;
+				_tbuffer = nullptr;
 				_tbufferSize = 0;
 			}
 			if (_sbufferSize == 0) {
 				free(_sbuffer);
-				_sbuffer = 0;
+				_sbuffer = nullptr;
 			}
 		} else {
 			_sbufferSize = _tbufferSize;
 			_sbuffer = _tbuffer;
 			_tbufferSize = 0;
-			_tbuffer = 0;
+			_tbuffer = nullptr;
 		}
 	} else {
 		int32 offset = 0;
@@ -92,7 +92,7 @@ void SmushChannel::processBuffer() {
 				error("smush channel failed to allocate memory");
 			memcpy(_sbuffer, _tbuffer + offset, _sbufferSize);
 			free(_tbuffer);
-			_tbuffer = 0;
+			_tbuffer = nullptr;
 			_tbufferSize = 0;
 		} else {
 			if (offset) {
diff --git a/engines/scumm/smush/codec37.cpp b/engines/scumm/smush/codec37.cpp
index aab70ab876..82f0044cfc 100644
--- a/engines/scumm/smush/codec37.cpp
+++ b/engines/scumm/smush/codec37.cpp
@@ -35,12 +35,12 @@ Codec37Decoder::Codec37Decoder(int width, int height) {
 	_frameSize = _width * _height;
 	_deltaSize = _frameSize * 3 + 0x13600;
 	_deltaBuf = (byte *)calloc(_deltaSize, sizeof(byte));
-	if (_deltaBuf == 0)
+	if (_deltaBuf == nullptr)
 		error("unable to allocate decoder buffer");
 	_deltaBufs[0] = _deltaBuf + 0x4D80;
 	_deltaBufs[1] = _deltaBuf + 0xE880 + _frameSize;
 	_offsetTable = new int16[255];
-	if (_offsetTable == 0)
+	if (_offsetTable == nullptr)
 		error("unable to allocate decoder offset table");
 	_curtable = 0;
 	_prevSeqNb = 0;
@@ -51,16 +51,16 @@ Codec37Decoder::Codec37Decoder(int width, int height) {
 Codec37Decoder::~Codec37Decoder() {
 	if (_offsetTable) {
 		delete[] _offsetTable;
-		_offsetTable = 0;
+		_offsetTable = nullptr;
 		_tableLastPitch = -1;
 		_tableLastIndex = -1;
 	}
 	if (_deltaBuf) {
 		free(_deltaBuf);
 		_deltaSize = 0;
-		_deltaBuf = 0;
-		_deltaBufs[0] = 0;
-		_deltaBufs[1] = 0;
+		_deltaBuf = nullptr;
+		_deltaBufs[0] = nullptr;
+		_deltaBufs[1] = nullptr;
 	}
 }
 
diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp
index cfd9ad543b..24282ec378 100644
--- a/engines/scumm/smush/codec47.cpp
+++ b/engines/scumm/smush/codec47.cpp
@@ -145,7 +145,7 @@ void Codec47Decoder::makeTablesInterpolation(int param) {
 	int32 b1, b2;
 	int32 value_table47_1_2, value_table47_1_1, value_table47_2_2, value_table47_2_1;
 	int32 tableSmallBig[64], tmp, s;
-	const int8 *table47_1 = 0, *table47_2 = 0;
+	const int8 *table47_1 = nullptr, *table47_2 = nullptr;
 	int32 *ptr_small_big;
 	byte *ptr;
 	int i, x, y;
@@ -529,7 +529,7 @@ Codec47Decoder::Codec47Decoder(int width, int height) {
 	_height = height;
 	_tableBig = (byte *)malloc(256 * 388);
 	_tableSmall = (byte *)malloc(256 * 128);
-	if ((_tableBig != NULL) && (_tableSmall != NULL)) {
+	if ((_tableBig != nullptr) && (_tableSmall != nullptr)) {
 		makeTablesInterpolation(4);
 		makeTablesInterpolation(8);
 	}
@@ -545,24 +545,24 @@ Codec47Decoder::Codec47Decoder(int width, int height) {
 Codec47Decoder::~Codec47Decoder() {
 	if (_tableBig) {
 		free(_tableBig);
-		_tableBig = NULL;
+		_tableBig = nullptr;
 	}
 	if (_tableSmall) {
 		free(_tableSmall);
-		_tableSmall = NULL;
+		_tableSmall = nullptr;
 	}
 	_lastTableWidth = -1;
 	if (_deltaBuf) {
 		free(_deltaBuf);
 		_deltaSize = 0;
-		_deltaBuf = NULL;
-		_deltaBufs[0] = NULL;
-		_deltaBufs[1] = NULL;
+		_deltaBuf = nullptr;
+		_deltaBufs[0] = nullptr;
+		_deltaBufs[1] = nullptr;
 	}
 }
 
 bool Codec47Decoder::decode(byte *dst, const byte *src) {
-	if ((_tableBig == NULL) || (_tableSmall == NULL) || (_deltaBuf == NULL))
+	if ((_tableBig == nullptr) || (_tableSmall == nullptr) || (_deltaBuf == nullptr))
 		return false;
 
 	_offset1 = _deltaBufs[1] - _curBuf;
diff --git a/engines/scumm/smush/imuse_channel.cpp b/engines/scumm/smush/imuse_channel.cpp
index 24cb03fbfb..f5c3c119cd 100644
--- a/engines/scumm/smush/imuse_channel.cpp
+++ b/engines/scumm/smush/imuse_channel.cpp
@@ -34,7 +34,7 @@ ImuseChannel::ImuseChannel(int32 track) : SmushChannel(track) {
 }
 
 bool ImuseChannel::isTerminated() const {
-	return (_dataSize <= 0 && _sbuffer == 0);
+	return (_dataSize <= 0 && _sbuffer == nullptr);
 }
 
 bool ImuseChannel::setParameters(int32 nb, int32 size, int32 flags, int32 unk1, int32) {
@@ -149,7 +149,7 @@ void ImuseChannel::decode() {
 	if (remaining_size) {
 		_srbufferSize -= remaining_size;
 		assert(_inData);
-		if (_tbuffer == 0) {
+		if (_tbuffer == nullptr) {
 			_tbuffer = (byte *)malloc(remaining_size);
 			memcpy(_tbuffer, _sbuffer + _sbufferSize - remaining_size, remaining_size);
 			_tbufferSize = remaining_size;
@@ -223,7 +223,7 @@ byte *ImuseChannel::getSoundData() {
 	assert(_dataSize > 0);
 	_dataSize -= _srbufferSize;
 
-	_sbuffer = 0;
+	_sbuffer = nullptr;
 	_sbufferSize = 0;
 
 	return tmp;
diff --git a/engines/scumm/smush/saud_channel.cpp b/engines/scumm/smush/saud_channel.cpp
index 7c41a8734b..1376f4bcf8 100644
--- a/engines/scumm/smush/saud_channel.cpp
+++ b/engines/scumm/smush/saud_channel.cpp
@@ -39,7 +39,7 @@ SaudChannel::SaudChannel(int32 track) : SmushChannel(track),
 }
 
 bool SaudChannel::isTerminated() const {
-	return (_markReached && _dataSize == 0 && _sbuffer == 0);
+	return (_markReached && _dataSize == 0 && _sbuffer == nullptr);
 }
 
 bool SaudChannel::handleSubTags(int32 &offset) {
@@ -148,7 +148,7 @@ bool SaudChannel::appendData(Common::SeekableReadStream &b, int32 size) {
 		_sbufferSize = _tbufferSize;
 		_sbuffer = _tbuffer;
 		_tbufferSize = 0;
-		_tbuffer = 0;
+		_tbuffer = nullptr;
 	} else {
 		processBuffer();
 	}
@@ -164,7 +164,7 @@ byte *SaudChannel::getSoundData() {
 		_dataSize -= _sbufferSize;
 	}
 
-	_sbuffer = 0;
+	_sbuffer = nullptr;
 	_sbufferSize = 0;
 
 	return tmp;
diff --git a/engines/scumm/smush/smush_mixer.cpp b/engines/scumm/smush/smush_mixer.cpp
index 445186d62b..26d1d5e293 100644
--- a/engines/scumm/smush/smush_mixer.cpp
+++ b/engines/scumm/smush/smush_mixer.cpp
@@ -37,8 +37,8 @@ SmushMixer::SmushMixer(Audio::Mixer *m) :
 	_soundFrequency(22050) {
 	for (int32 i = 0; i < NUM_CHANNELS; i++) {
 		_channels[i].id = -1;
-		_channels[i].chan = NULL;
-		_channels[i].stream = NULL;
+		_channels[i].chan = nullptr;
+		_channels[i].stream = nullptr;
 	}
 }
 
@@ -54,7 +54,7 @@ SmushChannel *SmushMixer::findChannel(int32 track) {
 		if (_channels[i].id == track)
 			return _channels[i].chan;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void SmushMixer::addChannel(SmushChannel *c) {
@@ -69,7 +69,7 @@ void SmushMixer::addChannel(SmushChannel *c) {
 	}
 
 	for (i = 0; i < NUM_CHANNELS; i++) {
-		if ((_channels[i].chan == NULL || _channels[i].id == -1) && !_mixer->isSoundHandleActive(_channels[i].handle)) {
+		if ((_channels[i].chan == nullptr || _channels[i].id == -1) && !_mixer->isSoundHandleActive(_channels[i].handle)) {
 			_channels[i].chan = c;
 			_channels[i].id = track;
 			return;
@@ -92,10 +92,10 @@ bool SmushMixer::handleFrame() {
 			if (_channels[i].chan->isTerminated()) {
 				delete _channels[i].chan;
 				_channels[i].id = -1;
-				_channels[i].chan = NULL;
+				_channels[i].chan = nullptr;
 				if (_channels[i].stream) {
 					_channels[i].stream->finish();
-					_channels[i].stream = 0;
+					_channels[i].stream = nullptr;
 				}
 			} else {
 				int32 vol, pan;
@@ -137,10 +137,10 @@ bool SmushMixer::stop() {
 		if (_channels[i].id != -1) {
 			delete _channels[i].chan;
 			_channels[i].id = -1;
-			_channels[i].chan = NULL;
+			_channels[i].chan = nullptr;
 			if (_channels[i].stream) {
 				_channels[i].stream->finish();
-				_channels[i].stream = NULL;
+				_channels[i].stream = nullptr;
 			}
 		}
 	}
@@ -156,8 +156,8 @@ bool SmushMixer::flush() {
 				_mixer->stopHandle(_channels[i].handle);
 				delete _channels[i].chan;
 				_channels[i].id = -1;
-				_channels[i].chan = NULL;
-				_channels[i].stream = NULL;
+				_channels[i].chan = nullptr;
+				_channels[i].stream = nullptr;
 			}
 		}
 	}
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index b184bdf90d..4ef25b70b3 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -64,7 +64,7 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer)
 	_soundQue2Pos(0),
 	_sfxFilename(),
 	_sfxFileEncByte(0),
-	_offsetTable(0),
+	_offsetTable(nullptr),
 	_numSoundEffects(0),
 	_soundMode(kVOCMode),
 	_talk_sound_a1(0),
@@ -238,7 +238,7 @@ void Sound::playSound(int soundID) {
 		memcpy(sound, ptr, size);
 
 		stream = Audio::makeRawStream(sound, size, rate, Audio::FLAG_UNSIGNED);
-		_mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID);
+		_mixer->playStream(Audio::Mixer::kSFXSoundType, nullptr, stream, soundID);
 	}
 	// WORKAROUND bug # 1311447
 	else if (READ_BE_UINT32(ptr) == 0x460e200d) {
@@ -261,7 +261,7 @@ void Sound::playSound(int soundID) {
 		sound = (byte *)malloc(size);
 		memcpy(sound, ptr, size);
 		stream = Audio::makeRawStream(sound, size, rate, Audio::FLAG_UNSIGNED);
-		_mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID);
+		_mixer->playStream(Audio::Mixer::kSFXSoundType, nullptr, stream, soundID);
 	}
 	// Support for sampled sound effects in Monkey Island 1 and 2
 	else if (_vm->_game.platform != Common::kPlatformFMTowns
@@ -336,7 +336,7 @@ void Sound::playSound(int soundID) {
 		sound = (byte *)malloc(size);
 		memcpy(sound, ptr + 6, size);
 		stream = Audio::makeRawStream(sound, size, rate, Audio::FLAG_UNSIGNED);
-		_mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID);
+		_mixer->playStream(Audio::Mixer::kSFXSoundType, nullptr, stream, soundID);
 	}
 	else if (_vm->_game.platform != Common::kPlatformFMTowns && READ_BE_UINT32(ptr) == MKTAG('S','O','U','N')) {
 		if (_vm->_game.version != 3)
@@ -403,7 +403,7 @@ void Sound::playSound(int soundID) {
 			stream = plainStream;
 		}
 
-		_mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, vol, 0);
+		_mixer->playStream(Audio::Mixer::kSFXSoundType, nullptr, stream, soundID, vol, 0);
 	}
 	else {
 
@@ -566,14 +566,14 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
 			num = (b - 8) >> 1;
 		}
 
-		if (_offsetTable != NULL) {
-			MP3OffsetTable *result = NULL, key;
+		if (_offsetTable != nullptr) {
+			MP3OffsetTable *result = nullptr, key;
 
 			key.org_offset = offset;
 			result = (MP3OffsetTable *)bsearch(&key, _offsetTable, _numSoundEffects,
 													sizeof(MP3OffsetTable), compareMP3OffsetTable);
 
-			if (result == NULL) {
+			if (result == nullptr) {
 				warning("startTalkSound: did not find sound at offset %d", offset);
 				return;
 			}
@@ -632,7 +632,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
 	}
 
 	if (!_soundsPaused && _mixer->isReady()) {
-		Audio::AudioStream *input = NULL;
+		Audio::AudioStream *input = nullptr;
 
 		switch (_soundMode) {
 		case kMP3Mode:
@@ -941,11 +941,11 @@ void Sound::setupSfxFile() {
 #ifdef USE_MAD
 		{ "so3", kMP3Mode },
 #endif
-		{ 0, kVOCMode }
+		{ nullptr, kVOCMode }
 	};
 
 	ScummFile file;
-	_offsetTable = NULL;
+	_offsetTable = nullptr;
 	_sfxFileEncByte = 0;
 	_sfxFilename.clear();
 
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 00e81119d9..ff3569c457 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -644,7 +644,7 @@ void ScummEngine::CHARSET_1() {
 			return;
 	}
 
-	a = NULL;
+	a = nullptr;
 	if (getTalkingActor() != 0xFF)
 		a = derefActorSafe(getTalkingActor(), "CHARSET_1");
 
@@ -1107,13 +1107,13 @@ void ScummEngine::drawString(int a, const byte *msg) {
 	if (_game.version >= 4) {
 		// trim from the right
 		byte *tmp = buf;
-		space = NULL;
+		space = nullptr;
 		while (*tmp) {
 			if (*tmp == ' ') {
 				if (!space)
 					space = tmp;
 			} else {
-				space = NULL;
+				space = nullptr;
 			}
 			tmp++;
 		}
@@ -1246,7 +1246,7 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
 	start = dst;
 	end = dst + dstSize;
 
-	if (msg == NULL) {
+	if (msg == nullptr) {
 		debug(0, "Bad message in convertMessageToString, ignoring");
 		return 0;
 	}
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index 8da868c136..649589c79b 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -1165,14 +1165,14 @@ void ScummEngine::drawVerbBitmap(int verb, int x, int y) {
 	VerbSlot *vst = &_verbs[verb];
 	VirtScreen *vs;
 	bool twobufs;
-	const byte *imptr = 0;
+	const byte *imptr = nullptr;
 	int ydiff, xstrip;
 	int imgw, imgh;
 	int i, tmp;
 	byte *obim;
 	uint32 size;
 
-	if ((vs = findVirtScreen(y)) == NULL)
+	if ((vs = findVirtScreen(y)) == nullptr)
 		return;
 
 	_gdi->disableZBuffer();


Commit: 1296eb0c2acc3e0d1d8d049cc2ddd54bf3dde28f
    https://github.com/scummvm/scummvm/commit/1296eb0c2acc3e0d1d8d049cc2ddd54bf3dde28f
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T15:51:59+02:00

Commit Message:
SHERLOCK: Use nullptr

Using clang-tidy modernize-use-nullptr

Changed paths:
    engines/sherlock/detection.cpp
    engines/sherlock/image_file.cpp
    engines/sherlock/music.cpp
    engines/sherlock/scalpel/drivers/adlib.cpp
    engines/sherlock/scalpel/drivers/mt32.cpp
    engines/sherlock/scalpel/scalpel_debugger.cpp
    engines/sherlock/scalpel/scalpel_map.cpp
    engines/sherlock/scalpel/tsage/logo.cpp
    engines/sherlock/scene.cpp


diff --git a/engines/sherlock/detection.cpp b/engines/sherlock/detection.cpp
index eacc99e25f..638c80338c 100644
--- a/engines/sherlock/detection.cpp
+++ b/engines/sherlock/detection.cpp
@@ -29,7 +29,7 @@
 static const PlainGameDescriptor sherlockGames[] = {
 	{ "scalpel", "The Case of the Serrated Scalpel" },
 	{ "rosetattoo", "The Case of the Rose Tattoo" },
-	{0, 0}
+	{nullptr, nullptr}
 };
 
 static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/sherlock/image_file.cpp b/engines/sherlock/image_file.cpp
index 3a97cef875..29d4cdfd4f 100644
--- a/engines/sherlock/image_file.cpp
+++ b/engines/sherlock/image_file.cpp
@@ -381,7 +381,7 @@ void ImageFile3DO::loadAnimationFile(Common::SeekableReadStream &stream) {
 		streamLeft -= celDataSize;
 
 		// always 16 bits per pixel (RGB555)
-		decompress3DOCelFrame(frame, data_, celDataSize, 16, NULL);
+		decompress3DOCelFrame(frame, data_, celDataSize, 16, nullptr);
 
 		delete[] data_;
 
@@ -399,7 +399,7 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) {
 	int32  chunkStartPos = 0;
 	uint32 chunkTag = 0;
 	uint32 chunkSize = 0;
-	byte  *chunkDataPtr = NULL;
+	byte  *chunkDataPtr = nullptr;
 
 	// ANIM chunk (animation header for animation files)
 	bool   animFound = false;
@@ -596,7 +596,7 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) {
 
 			// Decompress/copy this frame
 			if (!plutFound) {
-				decompress3DOCelFrame(imageFrame, chunkDataPtr, dataSize, ccbPRE0_bitsPerPixel, NULL);
+				decompress3DOCelFrame(imageFrame, chunkDataPtr, dataSize, ccbPRE0_bitsPerPixel, nullptr);
 			} else {
 				decompress3DOCelFrame(imageFrame, chunkDataPtr, dataSize, ccbPRE0_bitsPerPixel, &plutRGBlookupTable);
 			}
@@ -721,7 +721,7 @@ void ImageFile3DO::load3DOCelRoomData(Common::SeekableReadStream &stream) {
 			imageFrame._size = 0;
 
 			// Decompress/copy this frame
-			decompress3DOCelFrame(imageFrame, celDataPtr, celDataSize, ccbPRE0_bitsPerPixel, NULL);
+			decompress3DOCelFrame(imageFrame, celDataPtr, celDataSize, ccbPRE0_bitsPerPixel, nullptr);
 
 			delete[] celDataPtr;
 
@@ -907,9 +907,9 @@ void ImageFile3DO::loadFont(Common::SeekableReadStream &stream) {
 	uint32 header_maxChar = 0;
 	uint32 header_charCount = 0;
 
-	byte  *widthTablePtr = NULL;
+	byte  *widthTablePtr = nullptr;
 	uint32 bitsTableSize = 0;
-	byte  *bitsTablePtr = NULL;
+	byte  *bitsTablePtr = nullptr;
 
 	stream.skip(2); // Unknown bytes
 	stream.skip(2); // Unknown bytes (0x000E)
@@ -938,7 +938,7 @@ void ImageFile3DO::loadFont(Common::SeekableReadStream &stream) {
 	// Now extract all characters
 	uint16      curChar = 0;
 	const byte *curBitsLinePtr = bitsTablePtr;
-	const byte *curBitsPtr = NULL;
+	const byte *curBitsPtr = nullptr;
 	byte        curBitsLeft = 0;
 	uint32      curCharHeightLeft = 0;
 	uint32      curCharWidthLeft = 0;
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 20b811ea98..741cb1b24f 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -72,7 +72,7 @@ MidiParser_SH::MidiParser_SH() {
 MidiParser_SH::~MidiParser_SH() {
 	Common::StackLock lock(_mutex);
 	unloadMusic();
-	_driver = NULL;
+	_driver = nullptr;
 }
 
 void MidiParser_SH::parseNextEvent(EventInfo &info) {
@@ -209,7 +209,7 @@ void MidiParser_SH::unloadMusic() {
 
 	if (_musData) {
 		delete[] _musData;
-		_musData = NULL;
+		_musData = nullptr;
 		_musDataSize = 0;
 	}
 
@@ -219,8 +219,8 @@ void MidiParser_SH::unloadMusic() {
 /*----------------------------------------------------------------*/
 
 Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
-	_midiDriver = NULL;
-	_midiParser = NULL;
+	_midiDriver = nullptr;
+	_midiParser = nullptr;
 	_musicType = MT_NULL;
 	_musicPlaying = false;
 	_midiOption = false;
@@ -336,7 +336,7 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
 Music::~Music() {
 	stopMusic();
 	if (_midiDriver) {
-		_midiDriver->setTimerCallback(this, NULL);
+		_midiDriver->setTimerCallback(this, nullptr);
 	}
 	if (_midiParser) {
 		_midiParser->stopPlaying();
diff --git a/engines/sherlock/scalpel/drivers/adlib.cpp b/engines/sherlock/scalpel/drivers/adlib.cpp
index 3f8855617f..34ccdb1e4f 100644
--- a/engines/sherlock/scalpel/drivers/adlib.cpp
+++ b/engines/sherlock/scalpel/drivers/adlib.cpp
@@ -217,8 +217,8 @@ uint16 frequencyLookUpTable[SHERLOCK_ADLIB_NOTES_COUNT] = {
 class MidiDriver_SH_AdLib : public MidiDriver {
 public:
 	MidiDriver_SH_AdLib(Audio::Mixer *mixer)
-		: _masterVolume(15), _opl(0),
-		  _adlibTimerProc(0), _adlibTimerParam(0), _isOpen(false) {
+		: _masterVolume(15), _opl(nullptr),
+		  _adlibTimerProc(nullptr), _adlibTimerParam(nullptr), _isOpen(false) {
 		memset(_voiceChannelMapping, 0, sizeof(_voiceChannelMapping));
 	}
 	~MidiDriver_SH_AdLib() override { }
@@ -227,8 +227,8 @@ public:
 	int open() override;
 	void close() override;
 	void send(uint32 b) override;
-	MidiChannel *allocateChannel() override { return NULL; }
-	MidiChannel *getPercussionChannel() override { return NULL; }
+	MidiChannel *allocateChannel() override { return nullptr; }
+	MidiChannel *getPercussionChannel() override { return nullptr; }
 	bool isOpen() const override { return _isOpen; }
 	uint32 getBaseTempo() override { return 1000000 / OPL::OPL::kDefaultCallbackFrequency; }
 
@@ -251,7 +251,7 @@ private:
 		byte   currentA0hReg;
 		byte   currentB0hReg;
 
-		adlib_ChannelEntry() : inUse(false), inUseTimer(0), currentInstrumentPtr(NULL), currentNote(0),
+		adlib_ChannelEntry() : inUse(false), inUseTimer(0), currentInstrumentPtr(nullptr), currentNote(0),
 								currentA0hReg(0), currentB0hReg(0) { }
 	};
 
diff --git a/engines/sherlock/scalpel/drivers/mt32.cpp b/engines/sherlock/scalpel/drivers/mt32.cpp
index e5db4fe751..deac75d98d 100644
--- a/engines/sherlock/scalpel/drivers/mt32.cpp
+++ b/engines/sherlock/scalpel/drivers/mt32.cpp
@@ -41,7 +41,7 @@ const byte mt32ReverbDataSysEx[] = {
 class MidiDriver_MT32 : public MidiDriver {
 public:
 	MidiDriver_MT32() {
-		_driver = NULL;
+		_driver = nullptr;
 		_isOpen = false;
 		_nativeMT32 = false;
 		_baseFreq = 250;
@@ -62,12 +62,12 @@ public:
 	MidiChannel *allocateChannel() override {
 		if (_driver)
 			return _driver->allocateChannel();
-		return NULL;
+		return nullptr;
 	}
 	MidiChannel *getPercussionChannel() override {
 		if (_driver)
 			return _driver->getPercussionChannel();
-		return NULL;
+		return nullptr;
 	}
 
 	void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) override {
@@ -103,11 +103,11 @@ public:
 MidiDriver_MT32::~MidiDriver_MT32() {
 	Common::StackLock lock(_mutex);
 	if (_driver) {
-		_driver->setTimerCallback(0, 0);
+		_driver->setTimerCallback(nullptr, nullptr);
 		_driver->close();
 		delete _driver;
 	}
-	_driver = NULL;
+	_driver = nullptr;
 }
 
 int MidiDriver_MT32::open() {
diff --git a/engines/sherlock/scalpel/scalpel_debugger.cpp b/engines/sherlock/scalpel/scalpel_debugger.cpp
index 02b39ade9b..acfa23e1a5 100644
--- a/engines/sherlock/scalpel/scalpel_debugger.cpp
+++ b/engines/sherlock/scalpel/scalpel_debugger.cpp
@@ -45,7 +45,7 @@ bool ScalpelDebugger::cmd3DO_PlayMovie(int argc, const char **argv) {
 	Common::String filename = argv[1];
 	_3doPlayMovieFile = filename;
 
-	return cmdExit(0, 0);
+	return cmdExit(0, nullptr);
 }
 
 bool ScalpelDebugger::cmd3DO_PlayAudio(int argc, const char **argv) {
diff --git a/engines/sherlock/scalpel/scalpel_map.cpp b/engines/sherlock/scalpel/scalpel_map.cpp
index bf845c38b9..a82759abb4 100644
--- a/engines/sherlock/scalpel/scalpel_map.cpp
+++ b/engines/sherlock/scalpel/scalpel_map.cpp
@@ -153,7 +153,7 @@ int ScalpelMap::show() {
 	screen.clear();
 
 	// Load the entire map
-	ImageFile *bigMap = NULL;
+	ImageFile *bigMap = nullptr;
 	if (!IS_3DO) {
 		// PC
 		bigMap = new ImageFile("bigmap.vgs");
diff --git a/engines/sherlock/scalpel/tsage/logo.cpp b/engines/sherlock/scalpel/tsage/logo.cpp
index 67959a19f9..f46ce3a60b 100644
--- a/engines/sherlock/scalpel/tsage/logo.cpp
+++ b/engines/sherlock/scalpel/tsage/logo.cpp
@@ -434,7 +434,7 @@ Logo::Logo(ScalpelEngine *vm) : _vm(vm), _lib("sf3.rlb") {
 	_animateObject = 0;
 	_animateStartFrame = 0;
 	_animateFrameDelay = 0;
-	_animateFrames = NULL;
+	_animateFrames = nullptr;
 	_animateFrame = 0;
 
 	// Save a copy of the original palette
@@ -499,7 +499,7 @@ void Logo::nextFrame() {
 			} else {
 				_animateObject = 0;
 				_animateFrameDelay = 0;
-				_animateFrames = NULL;
+				_animateFrames = nullptr;
 				_animateStartFrame = 0;
 				_animateFrame = 0;
 			}
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 476966064c..653fbf25a5 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -964,8 +964,8 @@ bool Scene::loadScene(const Common::String &filename) {
 			error("Could not open file - %s", roomBackgroundFilename.c_str());
 
 		int totalPixelCount = SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCENE_HEIGHT;
-		uint16 *roomBackgroundDataPtr = NULL;
-		uint16 *pixelSourcePtr = NULL;
+		uint16 *roomBackgroundDataPtr = nullptr;
+		uint16 *pixelSourcePtr = nullptr;
 		uint16 *pixelDestPtr = (uint16 *)screen._backBuffer1.getPixels();
 		uint16  curPixel = 0;
 		uint32  roomBackgroundStreamSize = roomBackgroundStream.size();




More information about the Scummvm-git-logs mailing list