[Scummvm-git-logs] scummvm master -> a37e9a8f9a5d130baa5d87c735a34ae4e1f6d7f9

sev- sev at scummvm.org
Tue Apr 28 07:42:46 UTC 2020


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

Summary:
a446809fc3 HDB: Remove redundant check thanks to strlcpy()
6e162cfe60 HDB: Init rest of the variables and replace NULL with nullptr
a37e9a8f9a HDB: Replace NULL with nullptr


Commit: a446809fc3084df3195d5b2fbfdcaf1b0c4bff7e
    https://github.com/scummvm/scummvm/commit/a446809fc3084df3195d5b2fbfdcaf1b0c4bff7e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-28T09:40:05+02:00

Commit Message:
HDB: Remove redundant check thanks to strlcpy()

Changed paths:
    engines/hdb/window.cpp


diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp
index cebe2345d3..38b646a11e 100644
--- a/engines/hdb/window.cpp
+++ b/engines/hdb/window.cpp
@@ -632,10 +632,8 @@ void Window::openDialog(const char *title, int tileIndex, const char *string, in
 	Common::strlcpy(_dialogInfo.title, title, 128);
 	_dialogInfo.active = true;
 
-	if (strlen(string) > sizeof(_dialogInfo.string))
-		Common::strlcpy(_dialogInfo.string, string, 128);
-	else
-		Common::strlcpy(_dialogInfo.string, string, 128);
+	// This could need to be truncated
+	Common::strlcpy(_dialogInfo.string, string, 128);
 
 	int e1, e2, e3, e4;
 	g_hdb->_gfx->getTextEdges(&e1, &e2, &e3, &e4);


Commit: 6e162cfe60e917463a16cbf745516d061ef88dc5
    https://github.com/scummvm/scummvm/commit/6e162cfe60e917463a16cbf745516d061ef88dc5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-28T09:40:30+02:00

Commit Message:
HDB: Init rest of the variables and replace NULL with nullptr

Changed paths:
    engines/hdb/ai-init.cpp


diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp
index c77ff4fd11..f6e37dd1a5 100644
--- a/engines/hdb/ai-init.cpp
+++ b/engines/hdb/ai-init.cpp
@@ -588,7 +588,7 @@ AIStateDef monkeystone[] = {
 AIEntTypeInfo aiEntList[] = {
 	// AI.H enum name		lua name				list of gfx for states	name of init function
 	//--------------------------------------------------------------------------------------------
-	{ AI_NONE,				"AI_NONE",				&none[0],				aiNoneInit,				NULL  },
+	{ AI_NONE,				"AI_NONE",				&none[0],				aiNoneInit,				nullptr  },
 	{ AI_GUY,				"AI_GUY",				&guy[0],				aiPlayerInit,			aiPlayerInit2  },
 	{ AI_DOLLY,				"AI_DOLLY",				&dolly[0],				aiDollyInit,			aiDollyInit2  },
 	{ AI_SERGEANT,			"AI_SERGEANT",			&sergeant[0],			aiSergeantInit,			aiSergeantInit2  },
@@ -602,7 +602,7 @@ AIEntTypeInfo aiEntList[] = {
 	{ AI_SHOCKBOT,			"AI_SHOCKBOT",			&shockBot[0],			aiShockBotInit,			aiShockBotInit2  },
 	{ AI_FOURFIRER,			"AI_FOURFIRER",			&fourFirer[0],			aiFourFirerInit,		aiFourFirerInit2  },
 	{ AI_OMNIBOT_MISSILE,	"AI_OMNIBOT_MISSILE",	&omniBotMissile[0],		aiOmniBotMissileInit,	aiOmniBotMissileInit2  },
-	{ AI_GEM_ATTACK,		"AI_GEM_ATTACK",		&gemAttack[0],			aiGemAttackInit,		NULL  },
+	{ AI_GEM_ATTACK,		"AI_GEM_ATTACK",		&gemAttack[0],			aiGemAttackInit,		nullptr  },
 	{ AI_WORKER,			"AI_WORKER",			&worker[0],				aiWorkerInit,			aiWorkerInit2  },
 	{ AI_ACCOUNTANT,		"AI_ACCOUNTANT",		&accountant[0],			aiAccountantInit,		aiAccountantInit2  },
 	{ AI_SLUG_ATTACK,		"AI_SLUG_ATTACK",		&slugAttack[0],			aiSlugAttackInit,		aiSlugAttackInit2  },
@@ -674,7 +674,7 @@ AIEntTypeInfo aiEntList[] = {
 	{ ITEM_SLICER,			"ITEM_SLICER",			&slicer[0],				aiSlicerInit,			aiSlicerInit2  },
 	{ ITEM_PACKAGE,			"ITEM_PACKAGE",			&package[0],			aiPackageInit,			aiPackageInit2  },
 
-	{ END_AI_TYPES,			NULL,					NULL,					NULL,					NULL }
+	{ END_AI_TYPES,			nullptr,					nullptr,					nullptr,					nullptr }
 };
 
 FuncLookUp aiFuncList[] = {
@@ -901,7 +901,7 @@ FuncLookUp aiFuncList[] = {
 	{aiIceBlockInit,			"aiIceBlockInit"},
 	{aiIceBlockInit2,			"aiIceBlockInit2"},
 	{aiIceBlockAction,			"aiIceBlockAction"},
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 AI::AI() {
@@ -923,10 +923,10 @@ AI::AI() {
 
 	// Free Player Graphics
 	for (int i = 0; i < 8; i++)
-		_slugAttackGfx[i] = NULL;
+		_slugAttackGfx[i] = nullptr;
 
-	_weaponSelGfx = NULL;
-	_weaponGfx = NULL;
+	_weaponSelGfx = nullptr;
+	_weaponGfx = nullptr;
 
 	memset(_clubDownGfx, 0, sizeof(_clubDownGfx));
 	memset(_clubUpGfx, 0, sizeof(_clubUpGfx));
@@ -954,7 +954,7 @@ AI::AI() {
 	memset(_dyingGfx, 0, sizeof(_dyingGfx));
 
 	memset(_waypointGfx, 0, sizeof(_waypointGfx));
-	_debugQMark = NULL;
+	_debugQMark = nullptr;
 
 	if (g_hdb->isPPC())
 		_youGotY = 306;
@@ -983,6 +983,11 @@ AI::AI() {
 		_gfxLaserbeamLRLeft[i] = nullptr;
 		_gfxLaserbeamLRRight[i] = nullptr;
 	}
+	for (int i = 0; i < ARRAYSIZE(_getGfx); i++)
+		_getGfx[i] = nullptr;
+	for (int i = 0; i < ARRAYSIZE(_stunnedGfx); i++)
+		_stunnedGfx[i] = nullptr;
+
 	_player = nullptr;
 	_cineAbortable = false;
 	_cineAborted = false;
@@ -1055,7 +1060,7 @@ AI::AI() {
 	_numMonkeystones = 0;
 
 	_useSwitchOff = _useSwitchOn = 0;
-	_useHolderEmpty = _useHolderEmpty = 0;
+	_useHolderEmpty = _useHolderFull = 0;
 
 	_useSwitch2Off = _useSwitch2On = 0;
 	_useMailsorter = _useAskcomp = _useTeleporter = 0;
@@ -1063,6 +1068,18 @@ AI::AI() {
 
 	_targetDoorN = _targetDoorP = _targetDoorS = _targetDoorNv = _targetDoorPv = 0;
 	_targetDoorSv = _targetDoor2N = _targetDoor2P = 0;
+
+	_playerDead = false;
+	_playerInvisible = false;
+	_playerOnIce = false;
+	_playerEmerging = false;
+	_playerRunning = false;
+
+	_horrible1Frames = _horrible2Frames = _horrible3Frames = _horrible4Frames = 0;
+	_plummetFrames = _dyingFrames = 0;
+	_pushdownFrames = _pushupFrames = _pushleftFrames = _pushrightFrames = 0;
+	_stunDownFrames = _stunUpFrames = _stunLeftFrames = _stunRightFrames = 0;
+	_slugDownFrames = _slugUpFrames = _slugLeftFrames = _slugRightFrames = 0;
 }
 
 AI::~AI() {
@@ -1091,22 +1108,22 @@ AI::~AI() {
 	// Free Player Graphics
 	for (int i = 0; i < 8; i++) {
 		delete _slugAttackGfx[i];
-		_slugAttackGfx[i] = NULL;
+		_slugAttackGfx[i] = nullptr;
 	}
 	if (_weaponSelGfx) {
 		delete _weaponSelGfx;
-		_weaponSelGfx = NULL;
+		_weaponSelGfx = nullptr;
 	}
 	if (_weaponGfx) {
 		delete _weaponGfx;
-		_weaponGfx = NULL;
+		_weaponGfx = nullptr;
 	}
 
 	for (int i = 0; i < 4; i++)
 		delete _waypointGfx[i];
 	memset(_waypointGfx, 0, sizeof(_waypointGfx));
 	delete _debugQMark;
-	_debugQMark = NULL;
+	_debugQMark = nullptr;
 
 	// Free AnimTargets
 
@@ -1194,17 +1211,17 @@ void AI::init() {
 
 	// icepuff snowball
 	_icepSnowballGfxDown = _icepSnowballGfxLeft =
-		_icepSnowballGfxRight = NULL;
+		_icepSnowballGfxRight = nullptr;
 
 	// Frogglick
-	_tileFroglickMiddleUD = _tileFroglickMiddleLR = NULL;
-	_tileFroglickWiggleUD[0] = _tileFroglickWiggleLeft[0] = _tileFroglickWiggleRight[0] = NULL;
+	_tileFroglickMiddleUD = _tileFroglickMiddleLR = nullptr;
+	_tileFroglickWiggleUD[0] = _tileFroglickWiggleLeft[0] = _tileFroglickWiggleRight[0] = nullptr;
 
 	// Dragon
-	_gfxDragonAsleep = NULL;
+	_gfxDragonAsleep = nullptr;
 
 	// laser beam
-	_gfxLaserbeamUD[0] = _gfxLaserbeamUD[1] = _gfxLaserbeamLR[0] = _gfxLaserbeamLR[1] = NULL;
+	_gfxLaserbeamUD[0] = _gfxLaserbeamUD[1] = _gfxLaserbeamLR[0] = _gfxLaserbeamLR[1] = nullptr;
 
 	_laserRescan = false;
 	_laserOnScreen = false;
@@ -1214,7 +1231,7 @@ void AI::init() {
 	Common::strlcpy(_dummyPlayer.entityName, "Virtual Player", 32);
 	_numDeliveries = 0;
 	_playerRunning = false;
-	_weaponSelGfx = NULL;
+	_weaponSelGfx = nullptr;
 
 	restartSystem();
 }
@@ -1225,7 +1242,7 @@ void AI::clearPersistent() {
 
 const char *AI::funcLookUp(void(*function)(AIEntity *e)) {
 	if (!function)
-		return NULL;
+		return nullptr;
 
 	int i = 0;
 	while (aiFuncList[i].funcName) {
@@ -1233,12 +1250,12 @@ const char *AI::funcLookUp(void(*function)(AIEntity *e)) {
 			return aiFuncList[i].funcName;
 		i++;
 	}
-	return NULL;
+	return nullptr;
 }
 
 FuncPtr AI::funcLookUp(const char *function) {
 	if (!function)
-		return NULL;
+		return nullptr;
 
 	int i = 0;
 	while (aiFuncList[i].funcName) {
@@ -1246,12 +1263,12 @@ FuncPtr AI::funcLookUp(const char *function) {
 			return aiFuncList[i].function;
 		i++;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void AI::restartSystem() {
 	// init special player vars
-	_player = NULL;
+	_player = nullptr;
 
 	// Clear the Action list
 	memset(_actions, 0, sizeof(_actions));
@@ -1345,81 +1362,81 @@ void AI::restartSystem() {
 	_playerEmerging = false;
 
 	_weaponSelected = AI_NONE;
-	_weaponGfx = NULL;
-	_weaponSelGfx = NULL;
+	_weaponGfx = nullptr;
+	_weaponSelGfx = nullptr;
 
 	// Clear Cinematic System
 	_cineActive = _cameraLock = _playerLock = _cineAborted = false;
 
 	if (_icepSnowballGfxDown) {
 		delete _icepSnowballGfxDown;
-		_icepSnowballGfxDown = NULL;
+		_icepSnowballGfxDown = nullptr;
 	}
 	if (_icepSnowballGfxLeft) {
 		delete _icepSnowballGfxLeft;
-		_icepSnowballGfxLeft = NULL;
+		_icepSnowballGfxLeft = nullptr;
 	}
 	if (_icepSnowballGfxRight) {
 		delete _icepSnowballGfxRight;
-		_icepSnowballGfxRight = NULL;
+		_icepSnowballGfxRight = nullptr;
 	}
 
 	if (_tileFroglickMiddleUD) {
 		delete _tileFroglickMiddleUD;
-		_tileFroglickMiddleUD = NULL;
+		_tileFroglickMiddleUD = nullptr;
 	}
 	if (_tileFroglickWiggleUD[0]) {
 		for (int i = 0; i < 3; i++) {
 			delete _tileFroglickWiggleUD[i];
-			_tileFroglickWiggleUD[i] = NULL;
+			_tileFroglickWiggleUD[i] = nullptr;
 		}
 	}
 
 	if (_tileFroglickMiddleLR) {
 		delete _tileFroglickMiddleLR;
-		_tileFroglickMiddleLR = NULL;
+		_tileFroglickMiddleLR = nullptr;
 	}
 	if (_tileFroglickWiggleLeft[0]) {
 		for (int i = 0; i < 3; i++) {
 			delete _tileFroglickWiggleLeft[i];
-			_tileFroglickWiggleLeft[i] = NULL;
+			_tileFroglickWiggleLeft[i] = nullptr;
 		}
 	}
 	if (_tileFroglickWiggleRight[0]) {
 		for (int i = 0; i < 3; i++) {
 			delete _tileFroglickWiggleRight[i];
-			_tileFroglickWiggleRight[i] = NULL;
+			_tileFroglickWiggleRight[i] = nullptr;
 		}
 	}
 
 	// dragon!  see ya!
 	if (_gfxDragonAsleep) {
 		delete _gfxDragonAsleep;
-		_gfxDragonAsleep = NULL;
+		_gfxDragonAsleep = nullptr;
 		delete _gfxDragonFlap[0];
 		delete _gfxDragonFlap[1];
-		_gfxDragonFlap[0] = _gfxDragonFlap[1] = NULL;
+		_gfxDragonFlap[0] = _gfxDragonFlap[1] = nullptr;
 		delete _gfxDragonBreathe[0];
 		delete _gfxDragonBreathe[1];
 		delete _gfxDragonBreathe[2];
 		_gfxDragonBreathe[0] = _gfxDragonBreathe[1] =
-			_gfxDragonBreathe[2] = NULL;
+			_gfxDragonBreathe[2] = nullptr;
 	}
 
 	// PANIC ZONE gfx - see ya!
 	if (g_hdb->_window->_pzInfo.gfxPanic) {
 		delete g_hdb->_window->_pzInfo.gfxPanic;
-		g_hdb->_window->_pzInfo.gfxPanic = NULL;
+		g_hdb->_window->_pzInfo.gfxPanic = nullptr;
 		delete g_hdb->_window->_pzInfo.gfxZone;
-		g_hdb->_window->_pzInfo.gfxZone = NULL;
+		g_hdb->_window->_pzInfo.gfxZone = nullptr;
 		delete g_hdb->_window->_pzInfo.gfxFace[0];
-		g_hdb->_window->_pzInfo.gfxFace[0] = NULL;
+		g_hdb->_window->_pzInfo.gfxFace[0] = nullptr;
 		delete g_hdb->_window->_pzInfo.gfxFace[1];
-		g_hdb->_window->_pzInfo.gfxFace[1] = NULL;
+		g_hdb->_window->_pzInfo.gfxFace[1] = nullptr;
 
 		for (int i = 0; i < 10; i++) {
 			delete g_hdb->_window->_pzInfo.gfxNumber[i];
-			g_hdb->_window->_pzInfo.gfxNumber[i] = NULL;
+			g_hdb->_window->_pzInfo.gfxNumber[i] = nullptr;
 		}
 	}
 	g_hdb->_window->_pzInfo.active = false;
@@ -1434,12 +1451,12 @@ void AI::restartSystem() {
 			delete _gfxLaserbeamLRLeft[i];
 			delete _gfxLaserbeamLRRight[i];
 
-			_gfxLaserbeamUD[i] = NULL;
-			_gfxLaserbeamUDTop[i] = NULL;
-			_gfxLaserbeamUDBottom[i] = NULL;
-			_gfxLaserbeamLR[i] = NULL;
-			_gfxLaserbeamLRLeft[i] = NULL;
-			_gfxLaserbeamLRRight[i] = NULL;
+			_gfxLaserbeamUD[i] = nullptr;
+			_gfxLaserbeamUDTop[i] = nullptr;
+			_gfxLaserbeamUDBottom[i] = nullptr;
+			_gfxLaserbeamLR[i] = nullptr;
+			_gfxLaserbeamLRLeft[i] = nullptr;
+			_gfxLaserbeamLRRight[i] = nullptr;
 		}
 	}
 
@@ -1773,15 +1790,15 @@ void AI::loadSaveFile(Common::InSaveFile *in) {
 			temp->blinkGfx[j] = temp->movedownGfx[j] = temp->moveupGfx[j] =
 			temp->moveleftGfx[j] = temp->moverightGfx[j] = temp->standdownGfx[j] =
 			temp->standupGfx[j] = temp->standleftGfx[j] = temp->standrightGfx[j] =
-			temp->special1Gfx[j] = NULL;
+			temp->special1Gfx[j] = nullptr;
 
 		temp->blinkFrames = temp->movedownFrames = temp->moveupFrames = temp->moveleftFrames =
 			temp->moverightFrames = temp->standdownFrames = temp->standupFrames = temp->standleftFrames =
 			temp->standrightFrames = 0;
 
-		temp->draw = NULL;
-		temp->aiDraw = NULL;
-		temp->aiAction = temp->aiInit = temp->aiUse = NULL;
+		temp->draw = nullptr;
+		temp->aiDraw = nullptr;
+		temp->aiAction = temp->aiInit = temp->aiUse = nullptr;
 
 		cacheEntGfx(temp, false);
 	}


Commit: a37e9a8f9a5d130baa5d87c735a34ae4e1f6d7f9
    https://github.com/scummvm/scummvm/commit/a37e9a8f9a5d130baa5d87c735a34ae4e1f6d7f9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-28T09:42:27+02:00

Commit Message:
HDB: Replace NULL with nullptr

Changed paths:
    engines/hdb/ai-bots.cpp
    engines/hdb/ai-cinematic.cpp
    engines/hdb/ai-funcs.cpp
    engines/hdb/ai-inventory.cpp
    engines/hdb/ai-lists.cpp
    engines/hdb/ai-player.cpp
    engines/hdb/ai-use.cpp
    engines/hdb/ai-waypoint.cpp
    engines/hdb/ai.h
    engines/hdb/file-manager.cpp
    engines/hdb/file-manager.h
    engines/hdb/gfx.cpp
    engines/hdb/gfx.h
    engines/hdb/hdb.cpp
    engines/hdb/lua-script.cpp
    engines/hdb/map.cpp
    engines/hdb/menu.cpp
    engines/hdb/saveload.cpp
    engines/hdb/sound.cpp
    engines/hdb/window.cpp
    engines/hdb/window.h


diff --git a/engines/hdb/ai-bots.cpp b/engines/hdb/ai-bots.cpp
index 56db4642cd..4525fe8367 100644
--- a/engines/hdb/ai-bots.cpp
+++ b/engines/hdb/ai-bots.cpp
@@ -123,7 +123,7 @@ void aiOmniBotAction(AIEntity *e) {
 				// (2) Check we're not shooting into an Entity unless it's the player
 				AIEntity *hit = g_hdb->_ai->legalMoveOverWater(e->tileX + xv, e->tileY + yv, e->level, &result);
 				if (shoot && !hit && result) {
-					AIEntity *omni = g_hdb->_ai->spawn(AI_OMNIBOT_MISSILE, e->dir, e->tileX + xv, e->tileY + yv, NULL, NULL, NULL, DIR_NONE, e->level, 0, 0, 1);
+					AIEntity *omni = g_hdb->_ai->spawn(AI_OMNIBOT_MISSILE, e->dir, e->tileX + xv, e->tileY + yv, nullptr, nullptr, nullptr, DIR_NONE, e->level, 0, 0, 1);
 					omni->xVel = xv * kPlayerMoveSpeed * 2;
 					omni->yVel = yv * kPlayerMoveSpeed * 2;
 					if (g_hdb->_map->onScreen(e->tileX, e->tileY))
@@ -402,15 +402,15 @@ void aiRightBotFindGoal(AIEntity *e) {
 			bg = g_hdb->_map->getMapBGTileFlags(sx + xv, sy + yv) & (kFlagSolid | kFlagWater | kFlagSlime | kFlagSpecial);
 			e1 = g_hdb->_ai->findEntity(sx + xv, sy + yv);
 			if (e1 && e1 == p)
-				e1 = NULL;
+				e1 = nullptr;
 			bg2 = g_hdb->_map->getMapBGTileFlags(sx + xv2, sy + yv2) & (kFlagSolid | kFlagWater | kFlagSlime | kFlagSpecial);
 			e2 = g_hdb->_ai->findEntity(sx + xv2, sy + yv2);
 			if (e2 && e2 == p)
-				e2 = NULL;
+				e2 = nullptr;
 			bg3 = g_hdb->_map->getMapBGTileFlags(sx + xv3, sy + yv3) & (kFlagSolid | kFlagWater | kFlagSlime | kFlagSpecial);
 			e3 = g_hdb->_ai->findEntity(sx + xv3, sy + yv3);
 			if (e3 && e3 == p)
-				e3 = NULL;
+				e3 = nullptr;
 
 			// Okay to move forward?
 			if ((!bg && !e1) && (bg2 || e2 || bg3 || e3)) {
@@ -437,9 +437,9 @@ void aiRightBotFindGoal(AIEntity *e) {
 			bg2 = g_hdb->_map->getMapBGTileFlags(sx + xv3, sy + yv3) & (kFlagSolid | kFlagWater | kFlagSlime | kFlagSpecial);
 			e2 = g_hdb->_ai->findEntity(sx + xv3, sy + yv3);
 			if (e1 && e1->type == AI_GUY)
-				e1 = NULL;
+				e1 = nullptr;
 			if (e2 && e2->type == AI_GUY)
-				e2 = NULL;
+				e2 = nullptr;
 
 			// Is tile to the right clear?
 			// Is tile to the left clear?
@@ -917,7 +917,7 @@ void aiRailRiderOnAction(AIEntity *e) {
 			if (onEvenTile(e->x, e->y) && e->tileX == e->value1 && e->tileY == e->value2)
 				e->value1 = 0;
 			else
-				e->draw = NULL;
+				e->draw = nullptr;
 		} else if (e->dir2 && e->dir2 != (AIDir)(e->tileX + e->tileY))
 			e->dir2 = DIR_NONE;
 		break;
@@ -1204,7 +1204,7 @@ void aiFourFirerAction(AIEntity *e) {
 		hit = nullptr;
 
 	if (shoot && !hit && result) {
-		AIEntity *fire = g_hdb->_ai->spawn(AI_OMNIBOT_MISSILE, e->dir, e->tileX + xv, e->tileY + yv, NULL, NULL, NULL, DIR_NONE, e->level, 0, 0, 1);
+		AIEntity *fire = g_hdb->_ai->spawn(AI_OMNIBOT_MISSILE, e->dir, e->tileX + xv, e->tileY + yv, nullptr, nullptr, nullptr, DIR_NONE, e->level, 0, 0, 1);
 		if (g_hdb->_map->onScreen(e->tileX, e->tileY))
 			g_hdb->_sound->playSound(SND_FOUR_FIRE);
 		fire->xVel = xv * kPlayerMoveSpeed * 2;
@@ -1600,18 +1600,18 @@ void aiLaserAction(AIEntity *e) {
 			// check for hitting the BACK of a Diverter.  It stops the laser.
 			if (hit && hit->type == AI_DIVERTER) {
 				if (e->int2 < 0 && hit->state != STATE_DIVERTER_BL && hit->state != STATE_DIVERTER_BR)
-					hit = NULL;
+					hit = nullptr;
 				else if (e->int2 > 0 && hit->state != STATE_DIVERTER_TL && hit->state != STATE_DIVERTER_TR)
-					hit = NULL;
+					hit = nullptr;
 			}
 		} else {
 			e->value2 = nx;
 			// check for hitting the BACK of a Diverter.  It stops the laser.
 			if (hit && hit->type == AI_DIVERTER) {
 				if (e->int1 < 0 && hit->state != STATE_DIVERTER_BR && hit->state != STATE_DIVERTER_TR)
-					hit = NULL;
+					hit = nullptr;
 				else if (e->int1 > 0 && hit->state != STATE_DIVERTER_TL && hit->state != STATE_DIVERTER_BL)
-					hit = NULL;
+					hit = nullptr;
 			}
 		}
 
@@ -1620,7 +1620,7 @@ void aiLaserAction(AIEntity *e) {
 		// It is possible to set a configuration which leads to a closed loop.
 		// Thus, we're breaking it here
 		if (moveCount > 1000)
-			hit = NULL;
+			hit = nullptr;
 	} while (hit && hit->type == AI_DIVERTER);
 }
 
@@ -1873,7 +1873,7 @@ void aiMeerkatInit(AIEntity *e) {
 
 void aiMeerkatInit2(AIEntity *e) {
 	//  hidden at the start!
-	e->draw = NULL;
+	e->draw = nullptr;
 
 	// make the looking around cycle better...
 	e->movedownGfx[3] = e->movedownGfx[1];
@@ -1967,7 +1967,7 @@ void aiMeerkatAction(AIEntity *e) {
 		if (!e->animFrame && e->animDelay == e->animCycle) {
 			e->sequence = 0;
 			e->state = STATE_NONE;
-			e->draw = NULL;
+			e->draw = nullptr;
 		}
 		break;
 
@@ -2032,7 +2032,7 @@ void aiMeerkatAction(AIEntity *e) {
 	if (e->value1) {
 		if (gem_xv[e->blinkFrames] == 100) {
 			e->value1 = 0;
-			e->aiDraw = NULL;
+			e->aiDraw = nullptr;
 			return;
 		}
 		e->value1 += gem_xv[e->blinkFrames];
@@ -2182,7 +2182,7 @@ void aiFatFrogAction(AIEntity *e) {
 			e->value1++;
 			if (e->value1 == 14) {
 				e->animFrame = e->value1 = 0;
-				e->aiDraw = NULL;
+				e->aiDraw = nullptr;
 				e->state = STATE_STANDDOWN;
 			}
 		} else {
@@ -2214,7 +2214,7 @@ void aiFatFrogAction(AIEntity *e) {
 			e->value1++;
 			if (e->value1 == 14) {
 				e->animFrame = e->value1 = 0;
-				e->aiDraw = NULL;
+				e->aiDraw = nullptr;
 				e->state = STATE_STANDLEFT;
 			}
 		} else {
@@ -2246,7 +2246,7 @@ void aiFatFrogAction(AIEntity *e) {
 			e->value1++;
 			if (e->value1 == 14) {
 				e->animFrame = e->value1 = 0;
-				e->aiDraw = NULL;
+				e->aiDraw = nullptr;
 				e->state = STATE_STANDRIGHT;
 			}
 		} else {
@@ -2435,8 +2435,8 @@ void aiGoodFairyAction(AIEntity *e) {
 					e->sequence = 30;
 					e->state = STATE_MOVEDOWN;
 					// is something there already?
-					if ((g_hdb->_ai->findEntityType(AI_CRATE, e->tileX + xv, e->tileY + yv) != NULL) ||
-						(g_hdb->_ai->findEntityType(AI_LIGHTBARREL, e->tileX + xv, e->tileY + yv) != NULL))
+					if ((g_hdb->_ai->findEntityType(AI_CRATE, e->tileX + xv, e->tileY + yv) != nullptr) ||
+						(g_hdb->_ai->findEntityType(AI_LIGHTBARREL, e->tileX + xv, e->tileY + yv) != nullptr))
 						return;
 					int spawnOK;
 					AIEntity *hit = g_hdb->_ai->legalMove(e->tileX + xv, e->tileY + yv, e->level, &spawnOK);
@@ -2444,7 +2444,7 @@ void aiGoodFairyAction(AIEntity *e) {
 					if (hit || !spawnOK || (bg_flags & kFlagSpecial))
 						return;
 
-					g_hdb->_ai->spawn(ITEM_GEM_WHITE, e->dir, e->tileX + xv, e->tileY + yv, NULL, NULL, NULL, DIR_NONE, e->level, 0, 0, 1);
+					g_hdb->_ai->spawn(ITEM_GEM_WHITE, e->dir, e->tileX + xv, e->tileY + yv, nullptr, nullptr, nullptr, DIR_NONE, e->level, 0, 0, 1);
 					g_hdb->_ai->addAnimateTarget(e->x + xv * kTileWidth, e->y + yv * kTileHeight, 0, 3, ANIM_NORMAL, false, false, GEM_FLASH);
 					if (e->onScreen) {
 						g_hdb->_sound->playSound(SND_GET_GEM);
@@ -2520,7 +2520,7 @@ void aiGoodFairyAction(AIEntity *e) {
 					// make sure we can move over water & white gems, but not fg_hdb->_ai->y blockers and solids
 					AIEntity *hit = g_hdb->_ai->legalMoveOverWater(e->tileX + e->value1, e->tileY + e->value2, e->level, &result);
 					if (hit && ((hit->type == ITEM_GEM_WHITE) || (hit->type == AI_GUY)))
-						hit = NULL;
+						hit = nullptr;
 					uint32 bg_flags = g_hdb->_map->getMapBGTileFlags(e->tileX + e->value1, e->tileY + e->value2);
 					if (result && !hit && !(bg_flags & kFlagSpecial)) {
 						g_hdb->_ai->setEntityGoal(e, e->tileX + xv, e->tileY + yv);
@@ -2632,7 +2632,7 @@ void aiBadFairyAction(AIEntity *e) {
 
 					e->sequence = 30;
 					e->state = STATE_MOVEUP;
-					g_hdb->_ai->spawn(AI_GATEPUDDLE, opposite[e->dir], e->tileX, e->tileY, NULL, NULL, NULL, DIR_NONE, e->level, 0, 0, 1);
+					g_hdb->_ai->spawn(AI_GATEPUDDLE, opposite[e->dir], e->tileX, e->tileY, nullptr, nullptr, nullptr, DIR_NONE, e->level, 0, 0, 1);
 					g_hdb->_ai->addAnimateTarget(e->x, e->y, 0, 7, ANIM_NORMAL, false, false, TELEPORT_FLASH);
 					g_hdb->_ai->addGatePuddle(1);
 					if (e->onScreen)
@@ -2672,7 +2672,7 @@ void aiBadFairyAction(AIEntity *e) {
 					uint32 bg_flags = g_hdb->_map->getMapBGTileFlags(e->tileX + e->value1, e->tileY + e->value2);
 					if (hit == p && !g_hdb->_ai->playerDead()) {
 						g_hdb->_ai->killPlayer(DEATH_FRIED);
-						hit = NULL;
+						hit = nullptr;
 					}
 
 					if (!hit && result && !(bg_flags & kFlagSpecial)) {
@@ -2834,7 +2834,7 @@ void aiGatePuddleAction(AIEntity *e) {
 		int move_ok;
 		AIEntity *hit = g_hdb->_ai->legalMoveOverWater(nx, ny, e->level, &move_ok);
 		if (hit == p)
-			hit = NULL;
+			hit = nullptr;
 
 		if (!hit && move_ok) {
 			uint32	bg_flags = g_hdb->_map->getMapBGTileFlags(nx, ny);
@@ -2909,7 +2909,7 @@ void aiIcePuffSnowballAction(AIEntity *e) {
 	// hit something solid - kill the snowball
 	if (!result) {
 		e->dir2 = DIR_NONE;
-		e->aiDraw = NULL;
+		e->aiDraw = nullptr;
 		return;
 	}
 
@@ -3235,7 +3235,7 @@ void aiDragonInit(AIEntity *e) {
 }
 
 void aiDragonInit2(AIEntity *e) {
-	e->draw = NULL;
+	e->draw = nullptr;
 	if (!g_hdb->_ai->_gfxDragonAsleep) {
 		g_hdb->_ai->_gfxDragonAsleep = g_hdb->_gfx->loadPic(DRAGON_ASLEEP);
 		g_hdb->_ai->_gfxDragonFlap[0] = g_hdb->_gfx->loadPic(DRAGON_FLAP1);
diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp
index 91ad2cf760..1d0715e3e1 100644
--- a/engines/hdb/ai-cinematic.cpp
+++ b/engines/hdb/ai-cinematic.cpp
@@ -291,7 +291,7 @@ void AI::processCines() {
 			break;
 		case C_DIALOG:
 			if (_cine[i]->start) {
-				g_hdb->_window->openDialog(_cine[i]->title, -1, _cine[i]->string, 0, NULL);
+				g_hdb->_window->openDialog(_cine[i]->title, -1, _cine[i]->string, 0, nullptr);
 				g_hdb->_window->setDialogDelay(_cine[i]->delay);
 				_cine[i]->start = 0;
 			} else if (g_hdb->_window->getDialogDelay() < g_hdb->getTimeSlice())
@@ -314,7 +314,7 @@ void AI::processCines() {
 		case C_DRAWPIC:
 			{
 				Picture *p = cineFindInBlitList(_cine[i]->id);
-				if (p == NULL) {
+				if (p == nullptr) {
 					p = g_hdb->_gfx->loadPic(_cine[i]->string);
 					cineAddToFreeList(p);
 					cineAddToBlitList(_cine[i]->id, p, (int)_cine[i]->x, (int)_cine[i]->y, false);
@@ -327,7 +327,7 @@ void AI::processCines() {
 		case C_DRAWMASKEDPIC:
 			{
 				Picture *p = cineFindInBlitList(_cine[i]->id);
-				if (p == NULL) {
+				if (p == nullptr) {
 					p = g_hdb->_gfx->loadPic(_cine[i]->string);
 					cineAddToFreeList(p);
 					cineAddToBlitList(_cine[i]->id, p, (int)_cine[i]->x, (int)_cine[i]->y, true);
@@ -515,7 +515,7 @@ Picture *AI::cineFindInBlitList(const char *name) {
 		if (Common::matchString(_cineBlitList[i]->id, name, true))
 			return _cineBlitList[i]->pic;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void AI::cineRemoveFromBlitList(const char *name) {
@@ -525,7 +525,7 @@ void AI::cineRemoveFromBlitList(const char *name) {
 			for (; i < _numCineBlitList - 1; i++)
 				_cineBlitList[i] = _cineBlitList[i + 1];
 			_numCineBlitList--;
-			_cineBlitList[_numCineBlitList] = NULL;
+			_cineBlitList[_numCineBlitList] = nullptr;
 			return;
 		}
 	}
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp
index 1feef77134..104ace6bb3 100644
--- a/engines/hdb/ai-funcs.cpp
+++ b/engines/hdb/ai-funcs.cpp
@@ -81,7 +81,7 @@ AIEntity *AI::spawn(AIType type, AIDir dir, int x, int y, const char *funcInit,
 	e->blinkFrames = 0;
 
 	if (!cacheEntGfx(e, (bool)callInit))
-		return NULL;
+		return nullptr;
 	else
 		_ents->push_back(e);
 
@@ -522,7 +522,7 @@ AIEntity *AI::locateEntity(const char *luaName) {
 		if (Common::matchString((*it)->entityName, luaName))
 			return *it;
 	}
-	return NULL;
+	return nullptr;
 }
 
 AIEntity *AI::findEntity(int x, int y) {
@@ -539,7 +539,7 @@ AIEntity *AI::findEntity(int x, int y) {
 	if (g_hdb->_map->laserBeamExist(x, y))
 		return &_dummyLaser;
 
-	return NULL;
+	return nullptr;
 }
 
 AIEntity *AI::findEntityIgnore(int x, int y, AIEntity *ignore) {
@@ -556,7 +556,7 @@ AIEntity *AI::findEntityIgnore(int x, int y, AIEntity *ignore) {
 	if (g_hdb->_map->laserBeamExist(x, y) && ignore->type != AI_LASERBEAM)
 		return &_dummyLaser;
 
-	return NULL;
+	return nullptr;
 }
 
 AIEntity *AI::findEntityType(AIType type, int x, int y) {
@@ -573,7 +573,7 @@ AIEntity *AI::findEntityType(AIType type, int x, int y) {
 	if (g_hdb->_map->laserBeamExist(x, y) && type == AI_LASERBEAM)
 		return &_dummyLaser;
 
-	return NULL;
+	return nullptr;
 }
 
 void AI::getEntityXY(const char *entName, int *x, int *y) {
@@ -733,16 +733,16 @@ void AI::initAllEnts() {
 
 		// Clear out all ptrs in entity before writing
 		for (int j = 0; j < kMaxAnimFrames; j++) {
-			temp->blinkGfx[j] = NULL;
-			temp->movedownGfx[j] = NULL;
-			temp->moveupGfx[j] = NULL;
-			temp->moveleftGfx[j] = NULL;
-			temp->moverightGfx[j] = NULL;
-			temp->standdownGfx[j] = NULL;
-			temp->standupGfx[j] = NULL;
-			temp->standleftGfx[j] = NULL;
-			temp->standrightGfx[j] = NULL;
-			temp->special1Gfx[j] = NULL;
+			temp->blinkGfx[j] = nullptr;
+			temp->movedownGfx[j] = nullptr;
+			temp->moveupGfx[j] = nullptr;
+			temp->moveleftGfx[j] = nullptr;
+			temp->moverightGfx[j] = nullptr;
+			temp->standdownGfx[j] = nullptr;
+			temp->standupGfx[j] = nullptr;
+			temp->standleftGfx[j] = nullptr;
+			temp->standrightGfx[j] = nullptr;
+			temp->special1Gfx[j] = nullptr;
 		}
 
 		temp->blinkFrames = 0;
@@ -755,9 +755,9 @@ void AI::initAllEnts() {
 		temp->standleftFrames = 0;
 		temp->standrightFrames = 0;
 
-		temp->draw = NULL;
-		temp->aiDraw = NULL;
-		temp->aiAction = temp->aiInit = temp->aiUse = NULL;
+		temp->draw = nullptr;
+		temp->aiDraw = nullptr;
+		temp->aiAction = temp->aiInit = temp->aiUse = nullptr;
 
 		cacheEntGfx(temp, false);
 	}
@@ -994,7 +994,7 @@ void AI::animateEntity(AIEntity *e) {
 					case ITEM_GEM_RED:
 					case AI_GOODFAIRY:
 					case AI_BADFAIRY:
-						hit = NULL;
+						hit = nullptr;
 						break;
 					default:
 						break;
@@ -1771,11 +1771,11 @@ void AI::drawEnts(int x, int y, int w, int h) {
 				break;
 			default:
 				if (e->level == 2 && _numLevel2Ents < kMaxLevel2Ents) {
-					_entsLevel2[_numLevel2Ents].aiDraw = NULL;
+					_entsLevel2[_numLevel2Ents].aiDraw = nullptr;
 					_entsLevel2[_numLevel2Ents].draw = e->draw;
 					_entsLevel2[_numLevel2Ents].x = e->x - x + e->drawXOff;
 					_entsLevel2[_numLevel2Ents].y = e->y - y + e->drawYOff;
-					_entsLevel2[_numLevel2Ents].e = NULL;
+					_entsLevel2[_numLevel2Ents].e = nullptr;
 					_entsLevel2[_numLevel2Ents].stunnedWait = e->stunnedWait;
 					_numLevel2Ents++;
 					debugN(5, "not trying to draw...");
@@ -2021,9 +2021,9 @@ AIEntity *AI::legalMove(int tileX, int tileY, int level, int *result) {
 		// If player and entity are not at the same level, are they on stairs?
 		if (hit->level != level) {
 			if (level == 1 && !(bgFlags & kFlagStairTop))
-				hit = NULL;
+				hit = nullptr;
 			else if (level == 2 && !(bgFlags & kFlagStairBot))
-				hit = NULL;
+				hit = nullptr;
 		}
 	}
 
@@ -2036,7 +2036,7 @@ AIEntity *AI::legalMove(int tileX, int tileY, int level, int *result) {
 		if (bgFlags & (kFlagWater | kFlagSlime)) {
 			if (hit && hit->state == STATE_FLOATING) {
 				*result = 1;
-				return NULL;
+				return nullptr;
 			} else
 				*result = 0;
 			return hit;
@@ -2057,7 +2057,7 @@ AIEntity *AI::legalMove(int tileX, int tileY, int level, int *result) {
 		if (bgFlags & (kFlagWater | kFlagSlime | kFlagPlummet)) {
 			if (hit && hit->state == STATE_FLOATING) {
 				*result = 1;
-				return NULL;
+				return nullptr;
 			} else
 				*result = 0;
 			return hit;
@@ -2102,7 +2102,7 @@ AIEntity *AI::playerCollision(int topBorder, int bottomBorder, int leftBorder, i
 		if (e->x > (_player->x - 32 - leftBorder) && e->x < (_player->x + 32 + rightBorder) && e->y >(_player->y - 32 - topBorder) && e->y < (_player->y + 32 + bottomBorder))
 			return e;
 	}
-	return NULL;
+	return nullptr;
 }
 
 bool AI::checkPlayerTileCollision(int x, int y) {
@@ -2479,7 +2479,7 @@ void AI::movePlayer(uint16 buttons) {
 					_player->animFrame = 0;
 					_player->animDelay = _player->animCycle;
 					spawn(AI_SLUG_ATTACK, _player->dir, _player->tileX, _player->tileY,
-						NULL, NULL, NULL, DIR_NONE, _player->level, 0, 0, 1);
+						nullptr, nullptr, nullptr, DIR_NONE, _player->level, 0, 0, 1);
 				}
 				break;
 
@@ -2499,7 +2499,7 @@ void AI::movePlayer(uint16 buttons) {
 			nx = _player->tileX + xv;
 			ny = _player->tileY + yv;
 
-			spawn(AI_GEM_ATTACK, _player->dir, nx, ny, NULL, NULL, NULL, DIR_NONE, _player->level, amt == 1, 0, 1);
+			spawn(AI_GEM_ATTACK, _player->dir, nx, ny, nullptr, nullptr, nullptr, DIR_NONE, _player->level, amt == 1, 0, 1);
 			setGemAmount(amt - 1);
 			animGrabbing();
 			return;
@@ -2576,7 +2576,7 @@ void AI::movePlayer(uint16 buttons) {
 	int moveOK;
 	AIEntity *hit = legalMove(nx, ny, _player->level, &moveOK);
 	if (hit && walkThroughEnt(hit->type))
-		hit = NULL;
+		hit = nullptr;
 
 	if (hit || !moveOK) {
 		lookAtXY(nx, ny);
diff --git a/engines/hdb/ai-inventory.cpp b/engines/hdb/ai-inventory.cpp
index 05f75703cb..d89a01e202 100644
--- a/engines/hdb/ai-inventory.cpp
+++ b/engines/hdb/ai-inventory.cpp
@@ -106,7 +106,7 @@ void AI::clearInventory() {
 
 AIEntity *AI::getInvItem(int which) {
 	if (which >= _numInventory)
-		return NULL;
+		return nullptr;
 	return &_inventory[which].ent;
 }
 
diff --git a/engines/hdb/ai-lists.cpp b/engines/hdb/ai-lists.cpp
index 111c400bb8..7e19ef3921 100644
--- a/engines/hdb/ai-lists.cpp
+++ b/engines/hdb/ai-lists.cpp
@@ -362,7 +362,7 @@ HereT *AI::findHere(int x, int y) {
 		if ((*it)->x == x && (*it)->y == y)
 			return *it;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void AI::addToAutoList(int x, int y, const char *luaFuncInit, const char *luaFuncUse) {
@@ -525,11 +525,11 @@ bool AI::autoActive(int x, int y) {
 }
 
 CallbackDef allCallbacks[] = {
-	{NO_FUNCTION, NULL},
+	{NO_FUNCTION, nullptr},
 	{AI_BARREL_EXPLOSION_END, aiBarrelExplosionEnd},
 	{CALLBACK_DOOR_OPEN_CLOSE, callbackDoorOpenClose},
 	{CALLBACK_AUTODOOR_OPEN_CLOSE, callbackAutoDoorOpenClose},
-	{CALLBACK_END, NULL}
+	{CALLBACK_END, nullptr}
 };
 
 void AI::addCallback(CallbackType type, int x, int y, int delay) {
@@ -801,7 +801,7 @@ ArrowPath *AI::findArrowPath(int x, int y) {
 		if ((*it)->tileX == x && (*it)->tileY == y)
 			return *it;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void AI::addToTriggerList(char *luaFuncInit, char *luaFuncUse, int x, int y, int value1, int value2, char *id) {
diff --git a/engines/hdb/ai-player.cpp b/engines/hdb/ai-player.cpp
index e8afe42cea..ff109abfec 100644
--- a/engines/hdb/ai-player.cpp
+++ b/engines/hdb/ai-player.cpp
@@ -122,7 +122,7 @@ void aiPlayerAction(AIEntity *e) {
 	static const int xvAhead[5] = {9, 0, 0, -1, 1};
 	static const int yvAhead[5] = {9, -1, 1, 0, 0};
 
-	AIEntity *hit = NULL;
+	AIEntity *hit = nullptr;
 
 	// Draw the STUN lightning if it exists
 	if (e->sequence) {
@@ -307,7 +307,7 @@ void aiPlayerAction(AIEntity *e) {
 		}
 		if ((!e->animFrame) && (e->animDelay == e->animCycle)) {
 			e->state = stand[e->dir];
-			e->aiDraw = NULL;
+			e->aiDraw = nullptr;
 			switch (e->state) {
 			case STATE_ATK_CLUB_UP:
 				e->draw = e->standupGfx[0];
@@ -333,7 +333,7 @@ void aiPlayerAction(AIEntity *e) {
 		cycleFrames(e, g_hdb->_ai->_stunUpFrames);
 		if (!e->animFrame && e->animDelay == e->animCycle) {
 			e->state = stand[e->dir];
-			e->aiDraw = NULL;
+			e->aiDraw = nullptr;
 			e->sequence = 0;
 		}
 		return;
@@ -342,7 +342,7 @@ void aiPlayerAction(AIEntity *e) {
 		cycleFrames(e, g_hdb->_ai->_stunDownFrames);
 		if (!e->animFrame && e->animDelay == e->animCycle) {
 			e->state = stand[e->dir];
-			e->aiDraw = NULL;
+			e->aiDraw = nullptr;
 			e->sequence = 0;
 		}
 		return;
@@ -351,7 +351,7 @@ void aiPlayerAction(AIEntity *e) {
 		cycleFrames(e, g_hdb->_ai->_stunLeftFrames);
 		if (!e->animFrame && e->animDelay == e->animCycle) {
 			e->state = stand[e->dir];
-			e->aiDraw = NULL;
+			e->aiDraw = nullptr;
 			e->sequence = 0;
 		}
 		return;
@@ -360,7 +360,7 @@ void aiPlayerAction(AIEntity *e) {
 		cycleFrames(e, g_hdb->_ai->_stunRightFrames);
 		if (!e->animFrame && e->animDelay == e->animCycle) {
 			e->state = stand[e->dir];
-			e->aiDraw = NULL;
+			e->aiDraw = nullptr;
 			e->sequence = 0;
 		}
 		return;
@@ -977,15 +977,15 @@ void aiSlugAttackAction(AIEntity *e) {
 
 	AIEntity *hit = g_hdb->_ai->findEntityIgnore(e->tileX, e->tileY, e);
 	if (hit && hit->type == AI_GUY)
-		hit = NULL;
+		hit = nullptr;
 
 	// don't hit anything you can walk through...
 	if (hit && true == g_hdb->_ai->getTableEnt(hit->type))
-		hit = NULL;
+		hit = nullptr;
 
 	// don't hit floating stuff
 	if (hit && hit->state == STATE_FLOATING)
-		hit = NULL;
+		hit = nullptr;
 
 	uint32 bg_flags = g_hdb->_map->getMapBGTileFlags(e->tileX, e->tileY);
 	uint32 fg_flags = g_hdb->_map->getMapFGTileFlags(e->tileX, e->tileY);
@@ -1103,7 +1103,7 @@ void aiSlugAttackInit(AIEntity *e) {
 
 	e->moveSpeed = kPlayerMoveSpeed << 1;
 	g_hdb->_ai->setEntityGoal(e, e->tileX + xv[e->dir], e->tileY + yv[e->dir]);
-	e->draw = NULL;					// use custom draw function
+	e->draw = nullptr;					// use custom draw function
 	e->aiDraw = aiSlugAttackDraw;
 	e->state = STATE_MOVEDOWN;		// so it will draw & animate
 	e->aiAction = aiSlugAttackAction;
@@ -1452,10 +1452,10 @@ void aiMagicEggInit2(AIEntity *e) {
 
 void aiMagicEggUse(AIEntity *e) {
 	if (!scumm_strnicmp(e->luaFuncAction, "ai_", 3) || !scumm_strnicmp(e->luaFuncAction, "item_", 5)) {
-		AIEntity *spawned = NULL;
+		AIEntity *spawned = nullptr;
 		for (int i = 0; aiEntList[i].type != END_AI_TYPES; ++i) {
 			if (!scumm_stricmp(aiEntList[i].luaName, e->luaFuncAction)) {
-				spawned = g_hdb->_ai->spawn(aiEntList[i].type, e->dir, e->tileX, e->tileY, NULL, NULL, NULL, DIR_NONE, e->level, 0, 0, 1);
+				spawned = g_hdb->_ai->spawn(aiEntList[i].type, e->dir, e->tileX, e->tileY, nullptr, nullptr, nullptr, DIR_NONE, e->level, 0, 0, 1);
 				break;
 			}
 		}
@@ -1603,7 +1603,7 @@ void aiMonkeystoneAction(AIEntity *e) {
 			g_hdb->_lua->callFunction(e->luaFuncUse, 0);
 
 		g_hdb->_ai->addToInventory(e);
-		aiMonkeystoneUse(NULL);
+		aiMonkeystoneUse(nullptr);
 	}
 }
 
diff --git a/engines/hdb/ai-use.cpp b/engines/hdb/ai-use.cpp
index 1b4b08c187..957a36fe41 100644
--- a/engines/hdb/ai-use.cpp
+++ b/engines/hdb/ai-use.cpp
@@ -97,7 +97,7 @@ bool AI::useTarget(int x, int y, int targetX, int targetY, int newTile, int *wor
 	if (isClosedDoor(targetX, targetY)) {
 		int tileIndex = g_hdb->_map->getMapBGTileIndex(targetX, targetY);
 
-		addAnimateTarget(targetX, targetY, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, NULL);
+		addAnimateTarget(targetX, targetY, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, nullptr);
 		g_hdb->_map->setMapBGTileIndex(x, y, newTile);
 		if (g_hdb->_map->onScreen(x, y))
 			g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE);
@@ -109,7 +109,7 @@ bool AI::useTarget(int x, int y, int targetX, int targetY, int newTile, int *wor
 	if (isOpenDoor(targetX, targetY)) {
 		int tileIndex = g_hdb->_map->getMapBGTileIndex(targetX, targetY);
 
-		addAnimateTarget(targetX, targetY, tileIndex, tileIndex + 3, ANIM_SLOW, false, true, NULL);
+		addAnimateTarget(targetX, targetY, tileIndex, tileIndex + 3, ANIM_SLOW, false, true, nullptr);
 		g_hdb->_map->setMapBGTileIndex(x, y, newTile);
 		if (g_hdb->_map->onScreen(x, y))
 			g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE);
@@ -188,7 +188,7 @@ bool AI::useLockedSwitchOn(AIEntity *e, int x, int y, int targetX, int targetY,
 	int	worked;
 	bool rtn = useTarget(x, y, targetX, targetY, offTile, &worked);
 	if (worked) {
-		addItemToInventory(item, 1, NULL, NULL, NULL);
+		addItemToInventory(item, 1, nullptr, nullptr, nullptr);
 		if (g_hdb->_map->onScreen(x, y))
 			g_hdb->_sound->playSound(SND_SWITCH_USE);
 	}
@@ -217,7 +217,7 @@ bool AI::useCellHolder(AIEntity *e, int x, int y, int targetX, int targetY) {
 			g_hdb->_sound->playSound(SND_CELLHOLDER_USE_REJECT);
 	}
 
-	g_hdb->_window->openDialog("Locked!", -1, "I can't use that unless I have an Energy Cell.", 0, NULL);
+	g_hdb->_window->openDialog("Locked!", -1, "I can't use that unless I have an Energy Cell.", 0, nullptr);
 	g_hdb->_sound->playVoice(GUY_ENERGY_CELL, 0);
 	return false;
 }
@@ -243,7 +243,7 @@ void callbackDoorOpenClose(int x, int y) {
 		return;
 	}
 
-	g_hdb->_ai->addAnimateTarget(x, y, tileIndex, tileIndex + 3, ANIM_SLOW, false, true, NULL);
+	g_hdb->_ai->addAnimateTarget(x, y, tileIndex, tileIndex + 3, ANIM_SLOW, false, true, nullptr);
 	if (g_hdb->_map->onScreen(x, y))
 		g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE);
 	return;
@@ -253,7 +253,7 @@ void callbackDoorOpenClose(int x, int y) {
 bool AI::useDoorOpenClose(AIEntity *e, int x, int y) {
 	int tileIndex = g_hdb->_map->getMapBGTileIndex(x, y);
 
-	addAnimateTarget(x, y, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, NULL);
+	addAnimateTarget(x, y, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, nullptr);
 	addCallback(CALLBACK_DOOR_OPEN_CLOSE, x, y, kDelay5Seconds);
 	if (g_hdb->_map->onScreen(x, y))
 		g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE);
@@ -269,7 +269,7 @@ void callbackAutoDoorOpenClose(int x, int y) {
 		return;
 	}
 
-	g_hdb->_ai->addAnimateTarget(x, y, tileIndex, tileIndex + 3, ANIM_SLOW, true, true, NULL);
+	g_hdb->_ai->addAnimateTarget(x, y, tileIndex, tileIndex + 3, ANIM_SLOW, true, true, nullptr);
 	if (g_hdb->_map->onScreen(x, y))
 		g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE);
 	return;
@@ -281,7 +281,7 @@ bool AI::useAutoDoorOpenClose(AIEntity *e, int x, int y) {
 	if (autoActive(x, y))
 		return false;
 
-	addAnimateTarget(x, y, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, NULL);
+	addAnimateTarget(x, y, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, nullptr);
 	addCallback(CALLBACK_AUTODOOR_OPEN_CLOSE, x, y, kDelay5Seconds);
 	if (g_hdb->_map->onScreen(x, y))
 		g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE);
@@ -298,7 +298,7 @@ bool AI::useDoorOpenCloseBot(AIEntity *e, int x, int y) {
 		return false;
 	}
 
-	addAnimateTarget(x, y, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, NULL);
+	addAnimateTarget(x, y, tileIndex, tileIndex - 3, ANIM_SLOW, false, true, nullptr);
 	//	AddCallback( CALLBACK_DOOR_OPEN_CLOSE, x, y, DELAY_5SECONDS / fs );
 	if (g_hdb->_map->onScreen(x, y))
 		g_hdb->_sound->playSound(SND_DOOR_OPEN_CLOSE);
diff --git a/engines/hdb/ai-waypoint.cpp b/engines/hdb/ai-waypoint.cpp
index a71f45c8b0..1f78530ed6 100644
--- a/engines/hdb/ai-waypoint.cpp
+++ b/engines/hdb/ai-waypoint.cpp
@@ -346,7 +346,7 @@ bool AI::traceStraightPath(int x1, int y1, int *x2, int *y2, int *level) {
 		if (ok) {
 			e = findEntity(x1, y1);
 			if (e == _player)
-				e = NULL;
+				e = nullptr;
 			else if (g_hdb->_map->laserBeamExist(x1, y1)) {
 				*x2 = x1 - xVel;
 				*y2 = y1 - yVel;
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 47d810bf03..f383591a87 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -467,12 +467,12 @@ struct AIEntity {
 		state = STATE_NONE;
 		dir = DIR_NONE;
 
-		draw = NULL;
+		draw = nullptr;
 
-		aiInit = aiInit2 = NULL;
-		aiAction = NULL;
-		aiUse = NULL;
-		aiDraw = NULL;
+		aiInit = aiInit2 = nullptr;
+		aiAction = nullptr;
+		aiUse = nullptr;
+		aiDraw = nullptr;
 
 		level = 0;
 		value1 = value2 = 0;
@@ -495,52 +495,52 @@ struct AIEntity {
 
 		blinkFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			blinkGfx[i] = NULL;
+			blinkGfx[i] = nullptr;
 		}
 
 		special1Frames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			special1Gfx[i] = NULL;
+			special1Gfx[i] = nullptr;
 		}
 
 		standdownFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			standdownGfx[i] = NULL;
+			standdownGfx[i] = nullptr;
 		}
 
 		standupFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			standupGfx[i] = NULL;
+			standupGfx[i] = nullptr;
 		}
 
 		standleftFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			standleftGfx[i] = NULL;
+			standleftGfx[i] = nullptr;
 		}
 
 		standrightFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			standrightGfx[i] = NULL;
+			standrightGfx[i] = nullptr;
 		}
 
 		movedownFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			movedownGfx[i] = NULL;
+			movedownGfx[i] = nullptr;
 		}
 
 		moveupFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			moveupGfx[i] = NULL;
+			moveupGfx[i] = nullptr;
 		}
 
 		moveleftFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			moveleftGfx[i] = NULL;
+			moveleftGfx[i] = nullptr;
 		}
 
 		moverightFrames = 0;
 		for (int i = 0; i < kMaxAnimFrames; i++) {
-			moverightGfx[i] = NULL;
+			moverightGfx[i] = nullptr;
 		}
 	}
 
@@ -583,7 +583,7 @@ struct AIEntLevel2 {
 	void(*aiDraw)(AIEntity *e, int x, int y);
 	uint32 stunnedWait;
 
-	AIEntLevel2() : x(0), y(0), draw(NULL), e(NULL), aiDraw(NULL), stunnedWait(0) {}
+	AIEntLevel2() : x(0), y(0), draw(nullptr), e(nullptr), aiDraw(nullptr), stunnedWait(0) {}
 };
 
 struct AnimTarget {
@@ -598,7 +598,7 @@ struct AnimTarget {
 
 	AnimTarget() : x(0), y(0), start(0), end(0), vel(0), animCycle(0), animFrame(0), killAuto(false), inMap(false) {
 		for (int i = 0; i < kMaxAnimTFrames; i++) {
-			gfxList[i] = NULL;
+			gfxList[i] = nullptr;
 		}
 	}
 };
@@ -628,7 +628,7 @@ struct DlvEnt {
 
 	char id[32];
 
-	DlvEnt() : itemGfx(NULL), destGfx(NULL) {
+	DlvEnt() : itemGfx(nullptr), destGfx(nullptr) {
 		itemTextName[0] = 0;
 		itemGfxName[0] = 0;
 		destTextName[0] = 0;
@@ -636,8 +636,8 @@ struct DlvEnt {
 	}
 
 	~DlvEnt() {
-		itemGfx = NULL;
-		destGfx = NULL;
+		itemGfx = nullptr;
+		destGfx = nullptr;
 	}
 };
 
@@ -802,7 +802,7 @@ struct CineCommand {
 	Picture *pic;
 
 	CineCommand() : cmdType(C_NO_COMMAND), x(0.0), y(0.0), x2(0.0), y2(0.0), xv(0.0), yv(0.0),
-				start(0), end(0), delay(0), speed(0), title(NULL), string(NULL), id(NULL), e(NULL), pic(NULL) {}
+				start(0), end(0), delay(0), speed(0), title(nullptr), string(nullptr), id(nullptr), e(nullptr), pic(nullptr) {}
 };
 
 struct CineBlit {
@@ -812,7 +812,7 @@ struct CineBlit {
 	const char *id;
 	bool masked;
 
-	CineBlit() : x(0), y(0), pic(NULL), name(NULL), id(NULL), masked(false) {}
+	CineBlit() : x(0), y(0), pic(nullptr), name(nullptr), id(nullptr), masked(false) {}
 };
 
 #define onEvenTile(x, y)		( !(x & 31) && !(y & 31) )
@@ -827,7 +827,7 @@ struct CineBlit {
 				e->animFrame = 0; \
 		} \
 	}
-#define spawnBlocking(x, y, level)	g_hdb->_ai->spawn(AI_NONE, DIR_NONE, x, y, NULL, NULL, NULL, DIR_NONE, level, 0, 0, 0)
+#define spawnBlocking(x, y, level)	g_hdb->_ai->spawn(AI_NONE, DIR_NONE, x, y, nullptr, nullptr, nullptr, DIR_NONE, level, 0, 0, 0)
 
 class AI {
 public:
diff --git a/engines/hdb/file-manager.cpp b/engines/hdb/file-manager.cpp
index c92acd3829..11d6677535 100644
--- a/engines/hdb/file-manager.cpp
+++ b/engines/hdb/file-manager.cpp
@@ -93,7 +93,7 @@ void FileMan::seek(int32 offset, int flag) {
 
 Common::SeekableReadStream *FileMan::findFirstData(const char *string, DataType type, int *length) {
 	Common::String fileString;
-	MPCEntry *file = NULL;
+	MPCEntry *file = nullptr;
 
 	char fname[128];
 	Common::strlcpy(fname, string, 128);
@@ -119,9 +119,9 @@ Common::SeekableReadStream *FileMan::findFirstData(const char *string, DataType
 		}
 	}
 
-	if (file == NULL) {
+	if (file == nullptr) {
 		debug(4, "Couldn't find Data: '%s'", fnameS.c_str());
-		return NULL;
+		return nullptr;
 	}
 
 	// Load corresponding file into a buffer
@@ -140,7 +140,7 @@ Common::SeekableReadStream *FileMan::findFirstData(const char *string, DataType
 
 int32 FileMan::getLength(const char *string, DataType type) {
 	Common::String fileString;
-	MPCEntry *file = NULL;
+	MPCEntry *file = nullptr;
 
 	char fname[128];
 	Common::strlcpy(fname, string, 128);
@@ -162,7 +162,7 @@ int32 FileMan::getLength(const char *string, DataType type) {
 		}
 	}
 
-	if (file == NULL) {
+	if (file == nullptr) {
 		return 0;
 	}
 
diff --git a/engines/hdb/file-manager.h b/engines/hdb/file-manager.h
index f3a65bb1b4..20e6b685fb 100644
--- a/engines/hdb/file-manager.h
+++ b/engines/hdb/file-manager.h
@@ -72,7 +72,7 @@ public:
 	void closeMPC();
 	void seek(int32 offset, int flag);
 
-	Common::SeekableReadStream *findFirstData(const char *string, DataType type, int *length = NULL);
+	Common::SeekableReadStream *findFirstData(const char *string, DataType type, int *length = nullptr);
 	int32 getLength(const char *string, DataType type);
 	int getCount(const char *subString, DataType type);
 	Common::Array<const char *> *findFiles(const char *string, DataType type);
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp
index f8ca14b099..b1fb00f44d 100644
--- a/engines/hdb/gfx.cpp
+++ b/engines/hdb/gfx.cpp
@@ -38,7 +38,7 @@
 namespace HDB {
 
 Gfx::Gfx() {
-	_tLookupArray = NULL;
+	_tLookupArray = nullptr;
 	_starsInfo.active = false;
 	_gfxCache = new Common::Array<GfxCache *>;
 	_globalSurface.create(g_hdb->_screenWidth, g_hdb->_screenHeight, g_hdb->_format);
@@ -116,7 +116,7 @@ Gfx::~Gfx() {
 	_globalSurface.free();
 	for (int i = 0; i < _numTiles; i++) {
 		delete _tLookupArray[i].tData;
-		_tLookupArray[i].tData = NULL;
+		_tLookupArray[i].tData = nullptr;
 	}
 	delete[] _tLookupArray;
 	for (int i = 0; i < 8; i++)
@@ -218,7 +218,7 @@ void Gfx::init() {
 	int index = 0, skyIndex = 0;
 	for (; index < _numTiles; index++) {
 		_tLookupArray[index].filename = tileData->operator[](index);
-		_tLookupArray[index].tData = NULL;
+		_tLookupArray[index].tData = nullptr;
 		_tLookupArray[index].skyIndex = 0;
 		_tLookupArray[index].animIndex = index;
 		// Check if the loaded Tile is a Sky Tile
@@ -259,7 +259,7 @@ void Gfx::init() {
 	_tileSkyStars = getTileIndex(TILE_SKY_STARS);
 	_tileSkyStarsLeft = getTileIndex(TILE_SKY_STARS_LEFT_SLOW);
 	_tileSkyClouds = getTileIndex(TILE_SKY_CLOUDS); // Not completely sure about this filename.
-	_skyClouds = NULL;
+	_skyClouds = nullptr;
 
 	if (!g_hdb->isPPC()) {
 		// Load Mouse Pointer and Display Cursor
@@ -281,12 +281,12 @@ void Gfx::init() {
 		_snowflake = getPicture(PIC_SNOWFLAKE);
 	} else {
 		for (int i = 0; i < 8; i++)
-			_mousePointer[i] = NULL;
+			_mousePointer[i] = nullptr;
 
 		for (int i = 0; i < 4; i++)
-			_starField[i] = NULL;
+			_starField[i] = nullptr;
 
-		_snowflake = NULL;
+		_snowflake = nullptr;
 
 		_showCursor = false;
 	}
@@ -588,7 +588,7 @@ void Gfx::turnOnSnow() {
 Picture *Gfx::loadPic(const char *picName) {
 	Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(picName, TYPE_PIC);
 	if (!stream)
-		return NULL;
+		return nullptr;
 
 	Picture *pic = new Picture;
 	pic->load(stream);
@@ -599,7 +599,7 @@ Picture *Gfx::loadPic(const char *picName) {
 Tile *Gfx::loadTile(const char *tileName) {
 	Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(tileName, TYPE_TILE32);
 	if (!stream)
-		return NULL;
+		return nullptr;
 
 	Tile *tile = new Tile;
 	tile->load(stream);
@@ -610,7 +610,7 @@ Tile *Gfx::loadTile(const char *tileName) {
 Tile *Gfx::loadIcon(const char *tileName) {
 	Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(tileName, TYPE_ICON32);
 	if (!stream)
-		return NULL;
+		return nullptr;
 
 	Tile *tile = new Tile;
 	tile->load(stream);
@@ -630,15 +630,15 @@ Tile *Gfx::getTile(int index) {
 	if (index < 0 || index > _numTiles) {
 		if (index != 0xFFFF)
 			debug(6, "getTile(%d): wrong index > %d", index, _numTiles);
-		return NULL;
+		return nullptr;
 	}
 	if (_tLookupArray[index].skyIndex) {
 		debug(6, "getTile(%d): sky tile (%d)", index, _tLookupArray[index].skyIndex);
-		// We don't draw Sky Tiles, so return NULL
-		return NULL;
+		// We don't draw Sky Tiles, so return nullptr
+		return nullptr;
 	}
 
-	if (_tLookupArray[index].tData == NULL) {
+	if (_tLookupArray[index].tData == nullptr) {
 		Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(_tLookupArray[index].filename, TYPE_TILE32);
 		Tile *tile = new Tile;
 		tile->load(stream);
@@ -805,7 +805,7 @@ void Gfx::setSky(int skyIndex) {
 	// Clear memory used by last sky
 	if (tileIndex != _tileSkyClouds && _skyClouds) {
 		delete _skyClouds;
-		_skyClouds = NULL;
+		_skyClouds = nullptr;
 	}
 
 	// Setup current sky
diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h
index b0c4ca749d..8e7a26be42 100644
--- a/engines/hdb/gfx.h
+++ b/engines/hdb/gfx.h
@@ -40,7 +40,7 @@ struct TileLookup {
 	uint16 skyIndex;
 	uint16 animIndex;
 
-	TileLookup() : filename(NULL), tData(NULL), skyIndex(0), animIndex(0) {}
+	TileLookup() : filename(nullptr), tData(nullptr), skyIndex(0), animIndex(0) {}
 };
 
 struct GfxCache {
@@ -53,7 +53,7 @@ struct GfxCache {
 	uint32 size;
 	int16 loaded;
 
-	GfxCache() : status(false), tileGfx(NULL), size(0), loaded(0) { name[0] = 0; }
+	GfxCache() : status(false), tileGfx(nullptr), size(0), loaded(0) { name[0] = 0; }
 };
 
 struct FontInfo {
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index f4c697192f..6a62f66c87 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -81,8 +81,8 @@ HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst
 
 	_timePlayed = _timeSlice = _prevTimeSlice = _timeSeconds = _tiempo = 0;
 
-	_currentOutSaveFile = NULL;
-	_currentInSaveFile = NULL;
+	_currentOutSaveFile = nullptr;
+	_currentInSaveFile = nullptr;
 
 	_progressActive = false;
 
@@ -127,17 +127,17 @@ HDBGame::~HDBGame() {
 	delete _rnd;
 
 	delete _progressGfx;
-	_progressGfx = NULL;
+	_progressGfx = nullptr;
 	delete _progressMarkGfx;
-	_progressMarkGfx = NULL;
+	_progressMarkGfx = nullptr;
 	delete _loadingScreenGfx;
-	_loadingScreenGfx = NULL;
+	_loadingScreenGfx = nullptr;
 	if (_logoGfx) {
 		delete _logoGfx;
-		_logoGfx = NULL;
+		_logoGfx = nullptr;
 	}
 	delete _debugLogo;
-	_debugLogo = NULL;
+	_debugLogo = nullptr;
 }
 
 bool HDBGame::init() {
@@ -171,7 +171,7 @@ bool HDBGame::init() {
 	_debugLogo = _gfx->loadIcon("icon_debug_logo");
 	_progressGfx = _gfx->loadPic(PIC_LOADBAR);
 	_progressMarkGfx = _gfx->loadPic(PIC_LOADSTAR);
-	_logoGfx = NULL;
+	_logoGfx = nullptr;
 
 	_changeLevel = false;
 	_changeMapname[0] = 0;
@@ -185,7 +185,7 @@ bool HDBGame::init() {
 	if (!g_hdb->isPPC())
 		_loadingScreenGfx = _gfx->loadPic(PIC_LOADSCREEN);
 	else
-		_loadingScreenGfx = NULL;
+		_loadingScreenGfx = nullptr;
 
 	return true;
 }
@@ -910,7 +910,7 @@ Common::Error HDBGame::run() {
 
 #if 0
 	Common::SeekableReadStream *titleStream = _fileMan->findFirstData("monkeylogoscreen", TYPE_PIC);
-	if (titleStream == NULL) {
+	if (titleStream == nullptr) {
 		debug("The TitleScreen MPC entry can't be found.");
 		delete titleStream;
 		return Common::kReadingFailed;
@@ -921,7 +921,7 @@ Common::Error HDBGame::run() {
 	delete titleStream;
 
 	Common::SeekableReadStream *tileStream = _fileMan->findFirstData("t32_ground1", TYPE_TILE32);
-	if (tileStream == NULL) {
+	if (tileStream == nullptr) {
 		debug("The t32_shipwindow_lr MPC entry can't be found.");
 		delete tileStream;
 		return Common::kReadingFailed;
@@ -960,7 +960,7 @@ Common::Error HDBGame::run() {
 			_gameState = GAME_PLAY;
 	}
 
-	//_window->openDialog("Sgt. Filibuster", 0, "You address me as 'sarge' or 'sergeant' or get your snappin' teeth kicked in! Got me?", 0, NULL);
+	//_window->openDialog("Sgt. Filibuster", 0, "You address me as 'sarge' or 'sergeant' or get your snappin' teeth kicked in! Got me?", 0, nullptr);
 
 #if 0
 	lua->executeFile("test.lua");
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index 548140397a..47c6d7995d 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -100,7 +100,7 @@ struct ScriptPatch {
 	// Jump straight to credits
 	//{"CINE_OUTRO", "-- delegate", "-- delegate\nCine_FadeOutBlack( 40 )\nCredits()"},
 
-	{NULL, NULL, NULL}
+	{nullptr, nullptr, nullptr}
 };
 
 LuaScript::LuaScript() {
@@ -113,7 +113,7 @@ LuaScript::LuaScript() {
 		_cameraYOff = (32 * 2 + 16);	// 2.50 Tiles Extra
 	}
 
-	_state = NULL;
+	_state = nullptr;
 	_systemInit = false;
 
 
@@ -134,7 +134,7 @@ void LuaScript::init() {
 	// Load Global Lua Code
 	_globalLuaStream = g_hdb->_fileMan->findFirstData("GLOBAL.LUA", TYPE_BINARY);
 	_globalLuaLength = g_hdb->_fileMan->getLength("GLOBAL.LUA", TYPE_BINARY);
-	if (_globalLuaStream == NULL || _globalLuaLength == 0) {
+	if (_globalLuaStream == nullptr || _globalLuaLength == 0) {
 		error("LuaScript::initScript: 'global code' failed to load");
 	}
 }
@@ -142,7 +142,7 @@ void LuaScript::init() {
 bool LuaScript::loadLua(const char *name) {
 	Common::SeekableReadStream *luaStream = g_hdb->_fileMan->findFirstData(name, TYPE_BINARY);
 	int32 luaLength = g_hdb->_fileMan->getLength(name, TYPE_BINARY);
-	if (luaStream == NULL) {
+	if (luaStream == nullptr) {
 		warning("The %s MPC entry can't be found", name);
 
 		_systemInit = false;
@@ -235,7 +235,7 @@ void LuaScript::save(Common::OutSaveFile *out) {
 	lua_pushstring(_state, "tempSave");
 	lua_call(_state, 1, 0);
 
-	g_hdb->_currentOutSaveFile = NULL;
+	g_hdb->_currentOutSaveFile = nullptr;
 }
 
 void LuaScript::loadSaveFile(Common::InSaveFile *in) {
@@ -263,7 +263,7 @@ void LuaScript::loadSaveFile(Common::InSaveFile *in) {
 
 	lua_call(_state, 1, 0);
 
-	g_hdb->_currentInSaveFile = NULL;
+	g_hdb->_currentInSaveFile = nullptr;
 }
 
 void LuaScript::setLuaGlobalValue(const char *name, int value) {
@@ -292,7 +292,7 @@ static int cineStart(lua_State *L) {
 }
 
 static int cineStop(lua_State *L) {
-	const char *funcNext = NULL;
+	const char *funcNext = nullptr;
 
 	int stackTop = lua_gettop(L);
 	if (stackTop) {
@@ -933,7 +933,7 @@ static int dialog(lua_State *L) {
 	const char *more = lua_tostring(L, 4);
 
 	if (!more || more[0] == '0')
-		more = NULL;
+		more = nullptr;
 
 	g_hdb->_lua->checkParameters("dialog", 4);
 
@@ -1566,7 +1566,7 @@ struct VarInit {
 	{ PIC_RANK3,						"PIC_RANK3" },
 	{ PIC_RANK4,						"PIC_RANK4" },
 	{ PIC_RANK5,						"PIC_RANK5" },
-	{NULL, NULL}
+	{nullptr, nullptr}
 };
 
 // For AI States, to be implemented
@@ -1649,7 +1649,7 @@ struct NumberInit {
 	{ STATE_DOLLYUSERIGHT,	"STATE_DOLLYUSERIGHT"	},
 	{ STATE_YELL,			"STATE_YELL"			},
 
-	{ STATE_NONE, NULL }
+	{ STATE_NONE, nullptr }
 };
 
 struct FuncInit {
@@ -1744,7 +1744,7 @@ struct FuncInit {
 	{	"closefile",			closeFile,			},
 	{	"dofile",				dofile,				},
 	{	"writeto",				writeto,			},
-	{ NULL, NULL }
+	{ nullptr, nullptr }
 };
 
 namespace {
@@ -1762,13 +1762,13 @@ void debugHook(lua_State *L, lua_Debug *ar) {
 }
 
 bool LuaScript::initScript(Common::SeekableReadStream *stream, const char *scriptName, int32 length) {
-	if (_state != NULL) {
+	if (_state != nullptr) {
 		lua_close(_state);
 	}
 
 	// Initialize Lua Environment
 	_state = lua_open();
-	if (_state == NULL) {
+	if (_state == nullptr) {
 		error("Couldn't initialize Lua script.");
 		return false;
 	}
@@ -2109,7 +2109,7 @@ void lua_printstack(lua_State *L) {
 
 const char *LuaScript::getStringOffStack() {
 	if (!_systemInit) {
-		return NULL;
+		return nullptr;
 	}
 
 	const char *string = lua_tostring(_state, 1);
diff --git a/engines/hdb/map.cpp b/engines/hdb/map.cpp
index a85b21a3c9..71fc3a7a4c 100644
--- a/engines/hdb/map.cpp
+++ b/engines/hdb/map.cpp
@@ -48,13 +48,13 @@ Map::Map() {
 
 	_numForegrounds = _numGratings = 0;
 
-	_mapExplosions = NULL;
-	_mapExpBarrels = NULL;
-	_mapLaserBeams = NULL;
+	_mapExplosions = nullptr;
+	_mapExpBarrels = nullptr;
+	_mapLaserBeams = nullptr;
 
-	_background = NULL;
-	_foreground = NULL;
-	_iconList = NULL;
+	_background = nullptr;
+	_foreground = nullptr;
+	_iconList = nullptr;
 
 	_width = 0;
 	_height = 0;
@@ -268,11 +268,11 @@ void Map::restartSystem() {
 	_listFGAnimSlow.clear();
 
 	delete[] _background;
-	_background = NULL;
+	_background = nullptr;
 	delete[] _foreground;
-	_foreground = NULL;
+	_foreground = nullptr;
 	delete[] _iconList;
-	_iconList = NULL;
+	_iconList = nullptr;
 
 	_width = _height = 0;
 	_animCycle = 0;
@@ -281,9 +281,9 @@ void Map::restartSystem() {
 	free(_mapExpBarrels);
 	free(_mapLaserBeams);
 
-	_mapExplosions = NULL;
-	_mapExpBarrels = NULL;
-	_mapLaserBeams = NULL;
+	_mapExplosions = nullptr;
+	_mapExpBarrels = nullptr;
+	_mapLaserBeams = nullptr;
 
 	// mark all in-memory tiles as being in memory, but able to be freed
 	g_hdb->_gfx->markTileCacheFreeable();
@@ -294,7 +294,7 @@ void Map::restartSystem() {
 
 bool Map::loadMap(char *name) {
 	Common::SeekableReadStream *mapStream = g_hdb->_fileMan->findFirstData(name, TYPE_BINARY);
-	if (mapStream == NULL) {
+	if (mapStream == nullptr) {
 		warning("The %s MPC entry can't be found", name);
 		delete mapStream;
 		return false;
diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp
index 4a40036039..37ee05bd24 100644
--- a/engines/hdb/menu.cpp
+++ b/engines/hdb/menu.cpp
@@ -195,68 +195,68 @@ Menu::Menu() {
 	_keyAssignRight = Common::KEYCODE_RIGHT;
 	_keyAssignUse = Common::KEYCODE_RETURN;
 
-	_gCheckEmpty = NULL;
-	_gCheckOff = NULL;
-	_gCheckOn = NULL;
-	_gCheckLeft = NULL;
-	_gCheckRight = NULL;
-
-	_contArrowUp = NULL;
-	_contArrowDown = NULL;
-	_contArrowLeft = NULL;
-	_contArrowRight = NULL;
-	_contAssign = NULL;
-
-	_warpPlaque = NULL;
-	_hdbLogoScreen = NULL;
-
-	_titleScreen = NULL;
-	_oohOohGfx = NULL;
-	_newGfx = NULL;
-	_loadGfx = NULL;
-	_optionsGfx = NULL;
-	_quitGfx = NULL;
-	_resumeGfx = NULL;
-	_slotGfx = NULL;
-	_rocketMain = NULL;
-	_rocketSecond = NULL;
-	_rocketEx1 = NULL;
-	_rocketEx2 = NULL;
-	_titleLogo = NULL;
-	_hdbLogoScreen = NULL;
+	_gCheckEmpty = nullptr;
+	_gCheckOff = nullptr;
+	_gCheckOn = nullptr;
+	_gCheckLeft = nullptr;
+	_gCheckRight = nullptr;
+
+	_contArrowUp = nullptr;
+	_contArrowDown = nullptr;
+	_contArrowLeft = nullptr;
+	_contArrowRight = nullptr;
+	_contAssign = nullptr;
+
+	_warpPlaque = nullptr;
+	_hdbLogoScreen = nullptr;
+
+	_titleScreen = nullptr;
+	_oohOohGfx = nullptr;
+	_newGfx = nullptr;
+	_loadGfx = nullptr;
+	_optionsGfx = nullptr;
+	_quitGfx = nullptr;
+	_resumeGfx = nullptr;
+	_slotGfx = nullptr;
+	_rocketMain = nullptr;
+	_rocketSecond = nullptr;
+	_rocketEx1 = nullptr;
+	_rocketEx2 = nullptr;
+	_titleLogo = nullptr;
+	_hdbLogoScreen = nullptr;
 	for (int i = 0; i < kNebulaCount; i++)
-		_nebulaGfx[i] = NULL;
+		_nebulaGfx[i] = nullptr;
 
-	_sliderLeft = NULL;
-	_sliderMid = NULL;
-	_sliderRight = NULL;
-	_sliderKnob = NULL;
-	_modePuzzleGfx = NULL;
-	_modeActionGfx = NULL;
-	_modeLoadGfx = NULL;
-	_modeSaveGfx = NULL;
-	_menuBackoutGfx = NULL;
-	_menuBackspaceGfx = NULL;
+	_sliderLeft = nullptr;
+	_sliderMid = nullptr;
+	_sliderRight = nullptr;
+	_sliderKnob = nullptr;
+	_modePuzzleGfx = nullptr;
+	_modeActionGfx = nullptr;
+	_modeLoadGfx = nullptr;
+	_modeSaveGfx = nullptr;
+	_menuBackoutGfx = nullptr;
+	_menuBackspaceGfx = nullptr;
 
-	_controlButtonGfx = NULL;
+	_controlButtonGfx = nullptr;
 
-	_controlsGfx = NULL;
-	_screenshots1gfx = NULL;
-	_screenshots1agfx = NULL;
-	_screenshots2gfx = NULL;
-	_demoPlaqueGfx = NULL;
+	_controlsGfx = nullptr;
+	_screenshots1gfx = nullptr;
+	_screenshots1agfx = nullptr;
+	_screenshots2gfx = nullptr;
+	_demoPlaqueGfx = nullptr;
 
-	_vortexian[0] = _vortexian[1] = _vortexian[2] = NULL;
+	_vortexian[0] = _vortexian[1] = _vortexian[2] = nullptr;
 
-	_star[0] = _star[1] = _star[2] = NULL;
+	_star[0] = _star[1] = _star[2] = nullptr;
 
 	// secret stars
-	_starRedGfx[0] = _starRedGfx[1] = NULL;
-	_starGreenGfx[0] = _starGreenGfx[1] = NULL;
-	_starBlueGfx[0] = _starBlueGfx[1] = NULL;
+	_starRedGfx[0] = _starRedGfx[1] = nullptr;
+	_starGreenGfx[0] = _starGreenGfx[1] = nullptr;
+	_starBlueGfx[0] = _starBlueGfx[1] = nullptr;
 
-	_versionGfx = NULL;
-	_warpGfx = NULL;
+	_versionGfx = nullptr;
+	_warpGfx = nullptr;
 
 	_warpBackoutX = 0;
 	_warpBackoutY = 0;
@@ -475,8 +475,8 @@ void Menu::startMenu() {
 		} else {
 			_screenshots1agfx = g_hdb->_gfx->loadPic("pic_demoscreenshots");
 			_screenshots1gfx = g_hdb->_gfx->loadPic("pic_demoscreenshots2");
-			_screenshots2gfx = NULL;
-			_demoPlaqueGfx =  NULL;
+			_screenshots2gfx = nullptr;
+			_demoPlaqueGfx =  nullptr;
 		}
 	}
 
@@ -522,7 +522,7 @@ void Menu::startMenu() {
 		}
 	}
 
-	_quitScreen = NULL;
+	_quitScreen = nullptr;
 
 	// did we skip the intro?
 	if (!_nebulaY) {
@@ -907,126 +907,126 @@ void Menu::freeMenu() {
 	// title sequence stuff
 	if (_titleScreen)
 		delete _titleScreen;
-	_titleScreen = NULL;
+	_titleScreen = nullptr;
 	if (_oohOohGfx)
 		delete _oohOohGfx;
-	_oohOohGfx = NULL;
+	_oohOohGfx = nullptr;
 
 	if (_newGfx)
 		delete _newGfx;
-	_newGfx = NULL;
+	_newGfx = nullptr;
 	if (_loadGfx)
 		delete _loadGfx;
-	_loadGfx = NULL;
+	_loadGfx = nullptr;
 	if (_optionsGfx)
 		delete _optionsGfx;
-	_optionsGfx = NULL;
+	_optionsGfx = nullptr;
 	if (_quitGfx)
 		delete _quitGfx;
-	_quitGfx = NULL;
+	_quitGfx = nullptr;
 	if (_resumeGfx)
 		delete _resumeGfx;
-	_resumeGfx = NULL;
+	_resumeGfx = nullptr;
 	if (_slotGfx)
 		delete _slotGfx;
-	_slotGfx = NULL;
+	_slotGfx = nullptr;
 	if (_rocketMain)
 		delete _rocketMain;
-	_rocketMain = NULL;
+	_rocketMain = nullptr;
 	if (_rocketSecond)
 		delete _rocketSecond;
-	_rocketSecond = NULL;
+	_rocketSecond = nullptr;
 	if (_rocketEx1)
 		delete _rocketEx1;
-	_rocketEx1 = NULL;
+	_rocketEx1 = nullptr;
 	if (_rocketEx2)
 		delete _rocketEx2;
-	_rocketEx2 = NULL;
+	_rocketEx2 = nullptr;
 	if (_titleLogo)
 		delete _titleLogo;
-	_titleLogo = NULL;
+	_titleLogo = nullptr;
 
 	if (_hdbLogoScreen)
 		delete _hdbLogoScreen;
-	_hdbLogoScreen = NULL;
+	_hdbLogoScreen = nullptr;
 
 	if (_screenshots1gfx)
 		delete _screenshots1gfx;
-	_screenshots1gfx = NULL;
+	_screenshots1gfx = nullptr;
 	if (_screenshots1agfx)
 		delete _screenshots1agfx;
-	_screenshots1agfx = NULL;
+	_screenshots1agfx = nullptr;
 	if (_screenshots2gfx)
 		delete _screenshots2gfx;
-	_screenshots2gfx = NULL;
+	_screenshots2gfx = nullptr;
 	if (_demoPlaqueGfx)
 		delete _demoPlaqueGfx;
-	_demoPlaqueGfx = NULL;
+	_demoPlaqueGfx = nullptr;
 
 	if (g_hdb->isPPC() && g_hdb->isHandango()) {
 		if (_handangoGfx)
 			delete _handangoGfx;
-		_handangoGfx = NULL;
+		_handangoGfx = nullptr;
 	}
 
 	if (_nebulaGfx[0]) {
 		for (int i = 0; i < kNebulaCount; i++) {
 			delete _nebulaGfx[i];
-			_nebulaGfx[i] = NULL;
+			_nebulaGfx[i] = nullptr;
 		}
 	}
 
 	if (_sliderLeft)
 		delete _sliderLeft;
-	_sliderLeft = NULL;
+	_sliderLeft = nullptr;
 	if (_sliderMid)
 		delete _sliderMid;
-	_sliderMid = NULL;
+	_sliderMid = nullptr;
 	if (_sliderRight)
 		delete _sliderRight;
-	_sliderRight = NULL;
+	_sliderRight = nullptr;
 	if (_sliderKnob)
 		delete _sliderKnob;
-	_sliderKnob = NULL;
+	_sliderKnob = nullptr;
 	if (_modePuzzleGfx)
 		delete _modePuzzleGfx;
-	_modePuzzleGfx = NULL;
+	_modePuzzleGfx = nullptr;
 	if (_modeActionGfx)
 		delete _modeActionGfx;
-	_modeActionGfx = NULL;
+	_modeActionGfx = nullptr;
 	if (_modeLoadGfx)
 		delete _modeLoadGfx;
-	_modeLoadGfx = NULL;
+	_modeLoadGfx = nullptr;
 	if (_modeSaveGfx)
 		delete _modeSaveGfx;
-	_modeSaveGfx = NULL;
+	_modeSaveGfx = nullptr;
 	if (_menuBackoutGfx)
 		delete _menuBackoutGfx;
-	_menuBackoutGfx = NULL;
+	_menuBackoutGfx = nullptr;
 	if (_menuBackspaceGfx)
 		delete _menuBackspaceGfx;
-	_menuBackspaceGfx = NULL;
+	_menuBackspaceGfx = nullptr;
 
 	if (_controlButtonGfx)
 		delete _controlButtonGfx;
-	_controlButtonGfx = NULL;
+	_controlButtonGfx = nullptr;
 
 	if (_controlsGfx)
 		delete _controlsGfx;
-	_controlsGfx = NULL;
+	_controlsGfx = nullptr;
 
 	if (_vortexian[0]) {
 		delete _vortexian[0];
 		delete _vortexian[1];
 		delete _vortexian[2];
-		_vortexian[0] = _vortexian[1] = _vortexian[2] = NULL;
+		_vortexian[0] = _vortexian[1] = _vortexian[2] = nullptr;
 	}
 
 	if (_star[0]) {
 		delete _star[0];
 		delete _star[1];
 		delete _star[2];
-		_star[0] = _star[1] = _star[2] = NULL;
+		_star[0] = _star[1] = _star[2] = nullptr;
 	}
 
 	// secret stars
@@ -1037,18 +1037,18 @@ void Menu::freeMenu() {
 		delete _starGreenGfx[1];
 		delete _starBlueGfx[0];
 		delete _starBlueGfx[1];
-		_starRedGfx[0] = _starRedGfx[1] = NULL;
-		_starGreenGfx[0] = _starGreenGfx[1] = NULL;
-		_starBlueGfx[0] = _starBlueGfx[1] = NULL;
+		_starRedGfx[0] = _starRedGfx[1] = nullptr;
+		_starGreenGfx[0] = _starGreenGfx[1] = nullptr;
+		_starBlueGfx[0] = _starBlueGfx[1] = nullptr;
 	}
 
 	if (_versionGfx)
 		delete _versionGfx;
-	_versionGfx = NULL;
+	_versionGfx = nullptr;
 
 	if (_warpGfx)
 		delete _warpGfx;
-	_warpGfx = NULL;
+	_warpGfx = nullptr;
 }
 
 bool Menu::startTitle() {
@@ -1636,7 +1636,7 @@ void Menu::processInput(int x, int y) {
 			if ((x >= _quitNoX1 && x <= _quitNoX2 && y > _quitNoY1 && y < _quitNoY2 && _quitTimer < g_hdb->getTimeSlice()) || xit) {
 				g_hdb->_sound->playSound(SND_MENU_BACKOUT);
 				delete _quitScreen;
-				_quitScreen = NULL;
+				_quitScreen = nullptr;
 
 				_menuActive = true;
 				_quitActive = 0;
@@ -1654,7 +1654,7 @@ void Menu::processInput(int x, int y) {
 				if (_quitActive == 3 && (x >= _quitNoX1 && x <= _quitNoX2 && y > _quitNoY1 && y < _quitNoY2 && _quitTimer < g_hdb->getTimeSlice())) {
 					g_hdb->_sound->playSound(SND_MENU_BACKOUT);
 					delete _quitScreen;
-					_quitScreen = NULL;
+					_quitScreen = nullptr;
 
 					_menuActive = true;
 					_quitActive = 0;
diff --git a/engines/hdb/saveload.cpp b/engines/hdb/saveload.cpp
index 8d178fa413..00304eaae2 100644
--- a/engines/hdb/saveload.cpp
+++ b/engines/hdb/saveload.cpp
@@ -315,8 +315,8 @@ void AIEntity::load(Common::InSaveFile *in) {
 	FuncPtr init, init2, use, action;
 	EntFuncPtr drawf;
 
-	action = init = init2 = use = NULL;
-	drawf = NULL;
+	action = init = init2 = use = nullptr;
+	drawf = nullptr;
 
 	// Read 32-char names for the function ptrs we have in entity struct
 	in->read(funcString, 32);
diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp
index 2cd0839582..3a62f8ad34 100644
--- a/engines/hdb/sound.cpp
+++ b/engines/hdb/sound.cpp
@@ -1402,7 +1402,7 @@ const SoundLookUp soundList[] =  {
 	{DEMO_SCIENTIST_01,		DEMO_SCIENTIST_01_MP3,		"DEMO_SCIENTIST_01"},
 	{DEMO_SCIENTIST_02,		DEMO_SCIENTIST_02_MP3,		"DEMO_SCIENTIST_02"},
 
-	{LAST_SOUND,			NULL,						NULL}
+	{LAST_SOUND,			nullptr,						nullptr}
 };
 
 Sound::Sound() {
diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp
index 38b646a11e..ee53f2cd9f 100644
--- a/engines/hdb/window.cpp
+++ b/engines/hdb/window.cpp
@@ -215,7 +215,7 @@ void Window::init() {
 	_gfxIndent = g_hdb->_gfx->loadPic(MENU_DELIVERY_INDENTATION);
 	_gfxArrowTo = g_hdb->_gfx->loadPic(MENU_ARROW_DELIVERTO);
 
-	_gfxTry = _gfxAgain = NULL; // They will be loaded when needed
+	_gfxTry = _gfxAgain = nullptr; // They will be loaded when needed
 
 	_gfxInvSelect = g_hdb->_gfx->loadPic(INVENTORY_NORMAL);
 	_gfxHandright = g_hdb->_gfx->loadPic(MENU_HAND_POINTRIGHT);
@@ -251,7 +251,7 @@ void Window::init() {
 		_dlvsInfo.y = 272;
 	}
 
-	_gemGfx = NULL;
+	_gemGfx = nullptr;
 
 	restartSystem();
 }
@@ -268,11 +268,11 @@ void Window::save(Common::OutSaveFile *out) {
 	memcpy(&_tempPzInfo, &_pzInfo, sizeof(_pzInfo));
 
 	for (i = 0; i < 10; i++) {
-		_tempPzInfo.gfxNumber[i] = NULL;
+		_tempPzInfo.gfxNumber[i] = nullptr;
 		if (i < 2)
-			_tempPzInfo.gfxFace[i] = NULL;
+			_tempPzInfo.gfxFace[i] = nullptr;
 	}
-	_tempPzInfo.gfxPanic = _tempPzInfo.gfxZone = NULL;
+	_tempPzInfo.gfxPanic = _tempPzInfo.gfxZone = nullptr;
 
 	out->writeByte(_tempPzInfo.active);
 	out->writeSint32LE(_tempPzInfo.sequence);
@@ -401,11 +401,11 @@ void Window::loadSaveFile(Common::InSaveFile *in) {
 
 	// Load Panic Zone Info
 	for (i = 0; i < 10; i++) {
-		_pzInfo.gfxNumber[i] = NULL;
+		_pzInfo.gfxNumber[i] = nullptr;
 		if (i < 2)
-			_pzInfo.gfxFace[i] = NULL;
+			_pzInfo.gfxFace[i] = nullptr;
 	}
-	_pzInfo.gfxPanic = _pzInfo.gfxZone = NULL;
+	_pzInfo.gfxPanic = _pzInfo.gfxZone = nullptr;
 
 	_pzInfo.active = in->readByte();
 	_pzInfo.sequence = in->readSint32LE();
@@ -624,7 +624,7 @@ void Window::openDialog(const char *title, int tileIndex, const char *string, in
 	if (_dialogInfo.active)
 		return;
 
-	_dialogInfo.gfx = NULL;
+	_dialogInfo.gfx = nullptr;
 	_dialogInfo.el = _dialogInfo.er = _dialogInfo.et = _dialogInfo.eb = 0;
 	_dialogInfo.luaMore[0] = 0;
 
@@ -1120,7 +1120,7 @@ void Window::drawInventory() {
 		int drawY = _invWinInfo.y + 16;
 
 		// Draw Inv Items
-		AIEntity *sel = NULL;
+		AIEntity *sel = nullptr;
 		if (_invWinInfo.selection >= g_hdb->_ai->getInvAmount())
 			_invWinInfo.selection = g_hdb->_ai->getInvAmount() - 1;
 
@@ -1185,7 +1185,7 @@ void Window::drawInventory() {
 		int drawY = _invWinInfo.y;
 
 		// Draw Inv Items
-		AIEntity *sel = NULL;
+		AIEntity *sel = nullptr;
 		if (_invWinInfo.selection >= g_hdb->_ai->getInvAmount())
 			_invWinInfo.selection = g_hdb->_ai->getInvAmount() - 1;
 
@@ -1733,7 +1733,7 @@ void Window::drawTryAgain() {
 	if (!g_hdb->_ai->playerDead())
 		return;
 
-	if (NULL == _gfxTry) {
+	if (nullptr == _gfxTry) {
 		_gfxTry = g_hdb->_gfx->loadPic(GAME_TRY);
 		_gfxAgain = g_hdb->_gfx->loadPic(GAME_AGAIN);
 		_gfxLevelRestart = g_hdb->_gfx->loadPic(GAME_TA_LEVELRESTART);
@@ -1756,7 +1756,7 @@ void Window::clearTryAgain() {
 	delete _gfxAgain;
 	delete _gfxLevelRestart;
 
-	_gfxTry = _gfxAgain = _gfxLevelRestart = NULL;
+	_gfxTry = _gfxAgain = _gfxLevelRestart = nullptr;
 }
 
 void Window::loadPanicZoneGfx() {
diff --git a/engines/hdb/window.h b/engines/hdb/window.h
index d6b8384185..fa39c12224 100644
--- a/engines/hdb/window.h
+++ b/engines/hdb/window.h
@@ -56,7 +56,7 @@ struct DialogInfo {
 	char		luaMore[64];			// the name of the function to call after clicking the MORE button
 
 	DialogInfo() : tileIndex(0), active(false), x(0), y(0),
-		width(0), height(0), titleWidth(0), gfx(NULL), more(0), el(0), er(0), et(0),
+		width(0), height(0), titleWidth(0), gfx(nullptr), more(0), el(0), er(0), et(0),
 		eb(0) {
 			title[0] = 0;
 			string[0] = 0;
@@ -141,7 +141,7 @@ struct PanicZone {
 	Picture *gfxNumber[10];
 
 	PanicZone() : active(false), sequence(0), timer(0), x1(0), y1(0), x2(0), y2(0), xv(0), yv(0),
-		numberTime(0), numberTimeMaster(0), numberValue(0), gfxPanic(NULL), gfxZone(NULL) {
+		numberTime(0), numberTimeMaster(0), numberValue(0), gfxPanic(nullptr), gfxZone(nullptr) {
 		memset(&gfxFace, 0, sizeof(gfxFace));
 		memset(&gfxNumber, 0, sizeof(gfxNumber));
 	}




More information about the Scummvm-git-logs mailing list