[Scummvm-git-logs] scummvm master -> 4a7f8c18c5be13f1c5848d341ba2a66a15d2ee74
yuv422
yuv422 at users.noreply.github.com
Sat Mar 14 03:39:10 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4a7f8c18c5 DRAGONS: replace NULL with nullptr
Commit: 4a7f8c18c5be13f1c5848d341ba2a66a15d2ee74
https://github.com/scummvm/scummvm/commit/4a7f8c18c5be13f1c5848d341ba2a66a15d2ee74
Author: Eric Fry (yuv422 at users.noreply.github.com)
Date: 2020-03-14T14:39:06+11:00
Commit Message:
DRAGONS: replace NULL with nullptr
Changed paths:
engines/dragons/actor.cpp
engines/dragons/background.cpp
engines/dragons/bag.cpp
engines/dragons/credits.cpp
engines/dragons/cutscene.cpp
engines/dragons/dragonini.cpp
engines/dragons/dragons.cpp
engines/dragons/dragons.h
engines/dragons/inventory.cpp
engines/dragons/minigame2.cpp
engines/dragons/minigame3.cpp
engines/dragons/minigame4.cpp
engines/dragons/minigame5.cpp
engines/dragons/scene.cpp
engines/dragons/scriptopcodes.cpp
engines/dragons/sound.cpp
engines/dragons/specialopcodes.cpp
engines/dragons/talk.cpp
engines/dragons/vabsound.cpp
diff --git a/engines/dragons/actor.cpp b/engines/dragons/actor.cpp
index d3081f0ae6..42889802d5 100644
--- a/engines/dragons/actor.cpp
+++ b/engines/dragons/actor.cpp
@@ -73,7 +73,7 @@ Actor *ActorManager::findFreeActor(int16 resourceId) {
return actor;
}
}
- return NULL;
+ return nullptr;
}
Actor *ActorManager::getActor(uint16 actorId) {
@@ -133,7 +133,7 @@ Actor *ActorManager::getActorByDisplayOrder(uint16 position) {
}
Actor::Actor(uint16 id) : _actorID(id) {
- _actorResource = NULL;
+ _actorResource = nullptr;
_resourceID = -1;
_seqCodeIp = 0;
_priorityLayer = 3;
@@ -144,8 +144,8 @@ Actor::Actor(uint16 id) : _actorID(id) {
_walkSpeed = 0;
_flags = 0;
_frame_flags = 0;
- _frame = NULL;
- _surface = NULL;
+ _frame = nullptr;
+ _surface = nullptr;
}
void Actor::init(ActorResource *resource, int16 x, int16 y, uint32 sequenceID) {
@@ -188,7 +188,7 @@ void Actor::loadFrame(uint16 frameOffset) {
_frame_flags &= ~ACTOR_FRAME_FLAG_2;
}
- _surface = _actorResource->loadFrame(*_frame, NULL); // TODO paletteId == 0xf1 ? getEngine()->getBackgroundPalette() : NULL);
+ _surface = _actorResource->loadFrame(*_frame, nullptr); // TODO paletteId == 0xf1 ? getEngine()->getBackgroundPalette() : nullptr);
debug(5, "ActorId: %d load frame header: (%d,%d)", _actorID, _frame->width, _frame->height);
@@ -199,8 +199,8 @@ void Actor::loadFrame(uint16 frameOffset) {
void Actor::freeFrame() {
delete _frame;
delete _surface;
- _frame = NULL;
- _surface = NULL;
+ _frame = nullptr;
+ _surface = nullptr;
}
byte *Actor::getSeqIpAtOffset(uint32 offset) {
@@ -212,7 +212,7 @@ void Actor::reset_maybe() {
//TODO actor_find_by_resourceId_and_remove_resource_from_mem_maybe(resourceID);
freeFrame();
delete _actorResource;
- _actorResource = NULL;
+ _actorResource = nullptr;
}
uint32 calcDistance(int32 x1, int32 y1, int32 x2, int32 y2) {
diff --git a/engines/dragons/background.cpp b/engines/dragons/background.cpp
index 32f6247e91..368a9d8def 100644
--- a/engines/dragons/background.cpp
+++ b/engines/dragons/background.cpp
@@ -85,9 +85,9 @@ void PriorityLayer::restoreTileMap(int16 x, int16 y, int16 w, int16 h) {
}
Background::Background() : _priorityLayer(0), _points2(0), _data(0) {
- _layerSurface[0] = NULL;
- _layerSurface[1] = NULL;
- _layerSurface[2] = NULL;
+ _layerSurface[0] = nullptr;
+ _layerSurface[1] = nullptr;
+ _layerSurface[2] = nullptr;
_layerOffset[0] = Common::Point(0, 0);
_layerOffset[1] = Common::Point(0, 0);
_layerOffset[2] = Common::Point(0, 0);
@@ -403,7 +403,7 @@ uint16 ScaleLayer::getScale(uint16 y) {
return uVar1 & 0xfff8u;
}
-ScaleLayer::ScaleLayer(): _savedBands(NULL) {
+ScaleLayer::ScaleLayer(): _savedBands(nullptr) {
for (int i = 0; i < 32; i++) {
_bands[i]._y = -1;
_bands[i]._priority = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE;
diff --git a/engines/dragons/bag.cpp b/engines/dragons/bag.cpp
index 01697ce4bd..73d625647f 100644
--- a/engines/dragons/bag.cpp
+++ b/engines/dragons/bag.cpp
@@ -32,7 +32,7 @@ namespace Dragons {
#define TILEMAP_HEIGHT 25
Bag::Bag(BigfileArchive *bigFileArchive, Screen *screen): _screen(screen) {
- _surface = NULL;
+ _surface = nullptr;
_position.x = 0;
_position.y = 0;
load(bigFileArchive);
diff --git a/engines/dragons/credits.cpp b/engines/dragons/credits.cpp
index 3cb07cf1b0..7e8f7277f2 100644
--- a/engines/dragons/credits.cpp
+++ b/engines/dragons/credits.cpp
@@ -34,7 +34,7 @@ void creditsUpdateFunction() {
}
Credits::Credits(DragonsEngine *vm, FontManager *fontManager, BigfileArchive *bigfileArchive) : _vm(vm),
- _fontManager(fontManager), _bigfileArchive(bigfileArchive), _surface(NULL), _curPtr(NULL) {
+ _fontManager(fontManager), _bigfileArchive(bigfileArchive), _surface(nullptr), _curPtr(nullptr) {
_running = false;
_updateCounter = 0;
_yOffset = 0;
@@ -64,7 +64,7 @@ void Credits::draw() {
}
void Credits::cleanup() {
- _vm->setVsyncUpdateFunction(NULL);
+ _vm->setVsyncUpdateFunction(nullptr);
_surface->free();
delete _surface;
}
diff --git a/engines/dragons/cutscene.cpp b/engines/dragons/cutscene.cpp
index 248044fc97..578bf5e9ee 100644
--- a/engines/dragons/cutscene.cpp
+++ b/engines/dragons/cutscene.cpp
@@ -50,7 +50,7 @@ void CutScene::scene1() {
DragonINI *flicker = _vm->_dragonINIResource->getFlickerRecord();
_actor_80063514 = 0xb00;
- _vm->_dragonINIResource->setFlickerRecord(NULL);
+ _vm->_dragonINIResource->setFlickerRecord(nullptr);
_vm->setUnkFlags(ENGINE_UNK1_FLAG_2);
//fade_related_calls_with_1f();
@@ -541,7 +541,7 @@ void CutScene::knightsSavedBackAtCastle() {
uVar1 = _vm->_dragonINIResource->getFlickerRecord();
_actor_80063514 = 0xa00;
- _vm->_dragonINIResource->setFlickerRecord(NULL);
+ _vm->_dragonINIResource->setFlickerRecord(nullptr);
_vm->setUnkFlags(ENGINE_UNK1_FLAG_2);
isFlag0x10Set = _vm->isFlagSet(ENGINE_FLAG_10);
//TODO fade_related_calls_with_1f();
@@ -647,7 +647,7 @@ void CutScene::flameReturnsCutScene() {
uVar1 = _vm->_dragonINIResource->getFlickerRecord();
_actor_80063514 = 0x3f;
- _vm->_dragonINIResource->setFlickerRecord(NULL);
+ _vm->_dragonINIResource->setFlickerRecord(nullptr);
_vm->setUnkFlags(ENGINE_UNK1_FLAG_2);
engineFlag10Set = _vm->isFlagSet(ENGINE_FLAG_10);
//fade_related_calls_with_1f();
@@ -723,7 +723,7 @@ void CutScene::knightsSavedAgain() {
flicker = _vm->_dragonINIResource->getFlickerRecord();
_actor_80063514 = 0;
- _vm->_dragonINIResource->setFlickerRecord(NULL);
+ _vm->_dragonINIResource->setFlickerRecord(nullptr);
_vm->setUnkFlags(ENGINE_UNK1_FLAG_2);
engineFlag10Set = _vm->isFlagSet(ENGINE_FLAG_10);
//fade_related_calls_with_1f();
@@ -826,7 +826,7 @@ void CutScene::tournamentCutScene() {
_vm->_talk->loadText(0x4C6E8, dialogText, 1000);
_vm->_talk->displayDialogAroundPoint(dialogText, 0, 0, 0x1e01, 1, 0x4C6E8);
- _vm->setVsyncUpdateFunction(NULL);
+ _vm->setVsyncUpdateFunction(nullptr);
_vm->setFlags(ENGINE_FLAG_20000);
// fade_related_calls_with_1f();
Actor *actor = _vm->_dragonINIResource->getRecord(0x02BE)->actor;
diff --git a/engines/dragons/dragonini.cpp b/engines/dragons/dragonini.cpp
index cca789e741..c5191ab828 100644
--- a/engines/dragons/dragonini.cpp
+++ b/engines/dragons/dragonini.cpp
@@ -49,7 +49,7 @@ void DragonINIResource::reset() {
_dragonINI[i].inventorySequenceId = readStream->readSint16LE();
uint16 v = readStream->readUint16LE();
assert(v == 0); // actorId
- _dragonINI[i].actor = NULL;
+ _dragonINI[i].actor = nullptr;
_dragonINI[i].sceneId = readStream->readUint16LE();
_dragonINI[i].direction = readStream->readSint16LE();
_dragonINI[i].counter = readStream->readSint16LE();
diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp
index 2362f96f4a..919520480e 100644
--- a/engines/dragons/dragons.cpp
+++ b/engines/dragons/dragons.cpp
@@ -61,21 +61,21 @@ DragonsEngine *getEngine() {
DragonsEngine::DragonsEngine(OSystem *syst, const ADGameDescription *desc) : Engine(syst) {
_language = desc->language;
- _bigfileArchive = NULL;
- _dragonRMS = NULL;
- _backgroundResourceLoader = NULL;
- _screen = NULL;
+ _bigfileArchive = nullptr;
+ _dragonRMS = nullptr;
+ _backgroundResourceLoader = nullptr;
+ _screen = nullptr;
_sequenceOpcodes = new SequenceOpcodes(this);
- _scriptOpcodes = NULL;
+ _scriptOpcodes = nullptr;
_engine = this;
_inventory = new Inventory(this);
_cursor = new Cursor(this);
- _credits = NULL;
- _talk = NULL;
- _fontManager = NULL;
- _strPlayer = NULL;
- _sceneUpdateFunction = NULL;
- _vsyncUpdateFunction = NULL;
+ _credits = nullptr;
+ _talk = nullptr;
+ _fontManager = nullptr;
+ _strPlayer = nullptr;
+ _sceneUpdateFunction = nullptr;
+ _vsyncUpdateFunction = nullptr;
_leftMouseButtonUp = false;
_leftMouseButtonDown = false;
@@ -881,10 +881,10 @@ void DragonsEngine::engineFlag0x20UpdateFunction() {
DragonINI *flickerINI = _dragonINIResource->getFlickerRecord();
DragonINI *ini1 = getINI(1);
- if (flickerINI != NULL) {
+ if (flickerINI != nullptr) {
if (flickerINI->sceneId == currentSceneId) {
- if (flickerINI->actor == NULL || flickerINI->actor->isFlagSet(ACTOR_FLAG_10)) {
- if (ini1->actor != NULL) {
+ if (flickerINI->actor == nullptr || flickerINI->actor->isFlagSet(ACTOR_FLAG_10)) {
+ if (ini1->actor != nullptr) {
ini1->actor->updateSequence(8);
ini1->actor->_priorityLayer = 0;
}
@@ -898,7 +898,7 @@ void DragonsEngine::engineFlag0x20UpdateFunction() {
&& flickerINI->actor->_direction != flickerINI->actor->_sequenceID) {
flickerINI->actor->updateSequence(flickerINI->actor->_direction);
}
- if (ini1->actor != NULL) {
+ if (ini1->actor != nullptr) {
ini1->actor->_priorityLayer = 0;
}
}
@@ -985,8 +985,8 @@ void DragonsEngine::performAction() {
uVar2 = _scriptOpcodes->_scriptTargetINI;
uVar1 = _flags;
- local_58_code = NULL;
- local_58_codeEnd = NULL;
+ local_58_code = nullptr;
+ local_58_codeEnd = nullptr;
uVar6 = 0;
_scriptOpcodes->_numDialogStackFramesToPop = 0;
@@ -1021,7 +1021,7 @@ void DragonsEngine::performAction() {
local_58_codeEnd = local_58_code + READ_LE_UINT16(local_48._code + 6);
}
uVar4 = uVar4 & 0xfffd;
- if (local_58_code != NULL && local_58_codeEnd != NULL) {
+ if (local_58_code != nullptr && local_58_codeEnd != nullptr) {
clearFlags(ENGINE_FLAG_8);
ScriptOpCall local_58(local_58_code, local_58_codeEnd - local_58_code);
_scriptOpcodes->runScript(local_58);
@@ -1115,7 +1115,7 @@ void DragonsEngine::walkFlickerToObject() {
return;
}
flickerINI = _dragonINIResource->getFlickerRecord();
- if (flickerINI != NULL && flickerINI->actor != NULL) {
+ if (flickerINI != nullptr && flickerINI->actor != nullptr) {
flickerINI->actor->clearFlag(ACTOR_FLAG_10);
flickerINI->actor->setFlag(ACTOR_FLAG_4);
targetINI = getINI(_cursor->_performActionTargetINI - 1);
@@ -1230,12 +1230,12 @@ void DragonsEngine::reset() {
_paletteCyclingTbl[i].updateCounter = 0;
}
- setSceneUpdateFunction(NULL);
+ clearSceneUpdateFunction();
}
void DragonsEngine::runSceneUpdaterFunction() {
if ((isFlagSet(ENGINE_FLAG_20) && (_run_func_ptr_unk_countdown_timer == 0)) &&
- (_run_func_ptr_unk_countdown_timer = 1, _sceneUpdateFunction != NULL)) {
+ (_run_func_ptr_unk_countdown_timer = 1, _sceneUpdateFunction != nullptr)) {
_sceneUpdateFunction();
}
}
@@ -1244,6 +1244,10 @@ void DragonsEngine::setSceneUpdateFunction(void (*newUpdateFunction)()) {
_sceneUpdateFunction = newUpdateFunction;
}
+void DragonsEngine::clearSceneUpdateFunction() {
+ setSceneUpdateFunction(nullptr);
+}
+
void DragonsEngine::setVsyncUpdateFunction(void (*newUpdateFunction)()) {
_vsyncUpdateFunction = newUpdateFunction;
}
@@ -1316,7 +1320,7 @@ bool DragonsEngine::isDebugMode() {
}
bool DragonsEngine::isVsyncUpdaterFunctionRunning() {
- return _vsyncUpdateFunction != NULL;
+ return _vsyncUpdateFunction != nullptr;
}
void DragonsEngine::runVsyncUpdaterFunction() {
diff --git a/engines/dragons/dragons.h b/engines/dragons/dragons.h
index 1ffc8f14e3..c9ca698bf6 100644
--- a/engines/dragons/dragons.h
+++ b/engines/dragons/dragons.h
@@ -256,6 +256,7 @@ public:
void runSceneUpdaterFunction();
void setSceneUpdateFunction(void (*newUpdateFunction)());
+ void clearSceneUpdateFunction();
void (*getSceneUpdateFunction())();
void setVsyncUpdateFunction(void (*newUpdateFunction)());
diff --git a/engines/dragons/inventory.cpp b/engines/dragons/inventory.cpp
index 2ec2f1dc5e..6792861ef2 100644
--- a/engines/dragons/inventory.cpp
+++ b/engines/dragons/inventory.cpp
@@ -67,10 +67,10 @@ Inventory::Inventory(DragonsEngine *vm) : _vm(vm) {
_sequenceId = 0;
_screenPositionIndex = 0;
_previousState = Closed;
- _bag = NULL;
- _actor = NULL;
+ _bag = nullptr;
+ _actor = nullptr;
- _inventionBookPrevSceneUpdateFunc = NULL;
+ _inventionBookPrevSceneUpdateFunc = nullptr;
_inventionBookPrevSceneId = 0;
_inventionBookPrevFlickerINISceneId = 0;
_inventionBookPrevFlickerINIPosition = Common::Point(0, 0);
@@ -282,7 +282,7 @@ void Inventory::loadInventoryItemsFromSave() {
void Inventory::openInventionBook() {
_inventionBookPrevSceneUpdateFunc = _vm->getSceneUpdateFunction();
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
// fade_related_calls_with_1f();
_sequenceId = 2;
_actor->updateSequence(2);
@@ -404,7 +404,7 @@ void Inventory::inventoryMissing() {
static uint16 counter = 0;
DragonINI *flicker = _vm->_dragonINIResource->getFlickerRecord();
- if (flicker->actor != NULL) {
+ if (flicker->actor != nullptr) {
flicker->actor->clearFlag(ACTOR_FLAG_10);
if ((_vm->getCurrentSceneId() != 0x2e) || (flicker->actor->_resourceID != 0x91)) {
flicker->actor->setFlag(ACTOR_FLAG_4);
diff --git a/engines/dragons/minigame2.cpp b/engines/dragons/minigame2.cpp
index ae6b4f0618..d992ce6901 100644
--- a/engines/dragons/minigame2.cpp
+++ b/engines/dragons/minigame2.cpp
@@ -157,7 +157,7 @@ void Minigame2::run(int16 param_1, uint16 param_2, int16 param_3) {
_vm->reset_screen_maybe();
_vm->_inventory->setState(Closed);
flicker->sceneId = 0;
- _vm->_dragonINIResource->setFlickerRecord(NULL);
+ _vm->_dragonINIResource->setFlickerRecord(nullptr);
_vm->setFlags(ENGINE_FLAG_800);
_vm->_scene->setSceneId(5);
_vm->_scene->loadSceneData(5 | 0x8000, 0);
diff --git a/engines/dragons/minigame3.cpp b/engines/dragons/minigame3.cpp
index 34b3f6934d..569f6ff653 100644
--- a/engines/dragons/minigame3.cpp
+++ b/engines/dragons/minigame3.cpp
@@ -174,7 +174,7 @@ void Minigame3::run() {
_vm->reset_screen_maybe();
flicker = _vm->_dragonINIResource->getFlickerRecord();
flicker->sceneId = 0;
- _vm->_dragonINIResource->setFlickerRecord(NULL);
+ _vm->_dragonINIResource->setFlickerRecord(nullptr);
origSceneId = _vm->getCurrentSceneId();
_vm->_scene->setSceneId(6);
_vm->_scene->loadScene(6 | 0x8000, 0);
@@ -201,7 +201,7 @@ void Minigame3::run() {
int i = 0;
while ((int16)i < 4) {
bunnyActorTbl[(int16)i] = _vm->_actorManager->loadActor(0x15, 4, 0, 0);
- if (bunnyActorTbl[(int16)i] == NULL) {
+ if (bunnyActorTbl[(int16)i] == nullptr) {
error("Couldn't_alloc_bunny");
}
bunnyActorTbl[(int16)i]->setFlag(ACTOR_FLAG_80);
@@ -217,7 +217,7 @@ void Minigame3::run() {
i = 0;
while ((int16)i < 8) {
tearActorTbl[(int16)i] = _vm->_actorManager->loadActor(0x15, 0x13, 0, 0);
- if (tearActorTbl[(int16)i] == NULL) {
+ if (tearActorTbl[(int16)i] == nullptr) {
error("Couldn't alloc tear");
}
tearActorTbl[(int16)i]->_flags = tearActorTbl[(int16)i]->_flags | 0x380;
@@ -230,7 +230,7 @@ void Minigame3::run() {
local_1e0 = 0;
local_1e8 = 0;
handActorId = _vm->_actorManager->loadActor(0x19, 0, 0, 0);
- if (handActorId == NULL) {
+ if (handActorId == nullptr) {
error("Couldn't alloc hand");
}
handActorId->setFlag(ACTOR_FLAG_80);
@@ -245,7 +245,7 @@ void Minigame3::run() {
i = 0;
while ((int16)i < 2) {
tearBlinkActorTbl[(int16)i] = _vm->_actorManager->loadActor(0x34, (uint)i, 0, 0);
- if (tearBlinkActorTbl[(int16)i] == NULL) {
+ if (tearBlinkActorTbl[(int16)i] == nullptr) {
error("Couldn't alloc tear blink");
}
tearBlinkActorTbl[(int16)i]->_flags = tearBlinkActorTbl[(int16)i]->_flags | 0x4384;
@@ -256,7 +256,7 @@ void Minigame3::run() {
i = 0;
while ((int16)i < 2) {
tearBlinkActorTbl2[(int16)i] = _vm->_actorManager->loadActor(0x16, (uint)i, 0, 0);
- if (tearBlinkActorTbl2[(int16)i] == NULL) {
+ if (tearBlinkActorTbl2[(int16)i] == nullptr) {
error("Couldn't alloc tear blink");
}
tearBlinkActorTbl2[(int16)i]->setFlag(ACTOR_FLAG_100);
diff --git a/engines/dragons/minigame4.cpp b/engines/dragons/minigame4.cpp
index 692d68f1ac..bc9033e701 100644
--- a/engines/dragons/minigame4.cpp
+++ b/engines/dragons/minigame4.cpp
@@ -48,7 +48,7 @@ void Minigame4::run() {
// fade_related_calls_with_1f();
_vm->reset_screen_maybe();
_vm->_dragonINIResource->getFlickerRecord()->sceneId = 0;
- _vm->_dragonINIResource->setFlickerRecord(NULL);
+ _vm->_dragonINIResource->setFlickerRecord(nullptr);
_vm->_inventory->setState(Closed);
_vm->_scene->setSceneId(7);
_vm->_scene->loadSceneData(0x8007, 0);
@@ -98,7 +98,7 @@ void Minigame4::run() {
_vm->waitForFrames(2 * 0x3c);
// fade_related_calls_with_1f();
//DisableVSyncEvent();
- _vm->setVsyncUpdateFunction(NULL);
+ _vm->setVsyncUpdateFunction(nullptr);
_vm->setFlags(ENGINE_FLAG_1);
_vm->_videoFlags &= ~(uint16)4;
// EnableVSyncEvent();
diff --git a/engines/dragons/minigame5.cpp b/engines/dragons/minigame5.cpp
index 8453d75703..172c267b55 100644
--- a/engines/dragons/minigame5.cpp
+++ b/engines/dragons/minigame5.cpp
@@ -121,7 +121,7 @@ void Minigame5::run() {
pusherActor = _vm->_actorManager->loadActor
(0x26, 0, (int)(short)local_850, (int)(((uint)uVar1 + 5) * 0x10000) >> 0x10);
// EnableVSyncEvent();
- if (pusherActor == NULL) {
+ if (pusherActor == nullptr) {
error("Couldn't alloc pusher!");
}
pusherActor->_flags = pusherActor->_flags | 0x380;
@@ -132,7 +132,7 @@ void Minigame5::run() {
// DisableVSyncEvent();
wheelsActor = _vm->_actorManager->loadActor(7, 0x11, 0, 0);
// EnableVSyncEvent();
- if (wheelsActor == NULL) {
+ if (wheelsActor == nullptr) {
error("Couldn't alloc wheels!");
}
wheelsActor->_flags = wheelsActor->_flags | 0x380;
@@ -145,7 +145,7 @@ void Minigame5::run() {
// DisableVSyncEvent();
bombActor = _vm->_actorManager->loadActor(7, 0x1c, 0, 0);
// EnableVSyncEvent();
- if (bombActor == NULL) {
+ if (bombActor == nullptr) {
error("Couldn't alloc bomb!");
}
bombActor->_flags = bombActor->_flags | 0x380;
@@ -154,7 +154,7 @@ void Minigame5::run() {
// DisableVSyncEvent();
dustActor = _vm->_actorManager->loadActor(8, 8, 100, 100, 0);
// EnableVSyncEvent();
- if (dustActor == NULL) {
+ if (dustActor == nullptr) {
error("Couldn't alloc dust sprite!");
}
dustActor->_flags = dustActor->_flags | 0x380;
diff --git a/engines/dragons/scene.cpp b/engines/dragons/scene.cpp
index bc5e0ed7dd..730d396eef 100644
--- a/engines/dragons/scene.cpp
+++ b/engines/dragons/scene.cpp
@@ -136,7 +136,7 @@ void Scene::loadSceneData(uint32 sceneId, uint32 cameraPointId) {
DragonINI *flicker = _vm->_dragonINIResource->getFlickerRecord();
- if (flicker == NULL || flicker->sceneId == 0) {
+ if (flicker == nullptr || flicker->sceneId == 0) {
_vm->getINI(1)->sceneId = 0;
} else {
_currentSceneId = (uint16)(sceneId & 0x7fff);
diff --git a/engines/dragons/scriptopcodes.cpp b/engines/dragons/scriptopcodes.cpp
index 6b80680f5c..c89d6ebfb7 100644
--- a/engines/dragons/scriptopcodes.cpp
+++ b/engines/dragons/scriptopcodes.cpp
@@ -904,7 +904,7 @@ void ScriptOpcodes::opLoadScene(ScriptOpCall &scriptOpCall) {
}
//TODO fade_related_calls_with_1f();
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
_vm->_sound->PauseCDMusic();
if (newSceneID != 0) {
diff --git a/engines/dragons/sound.cpp b/engines/dragons/sound.cpp
index f81e55cfd2..a715d1ab53 100644
--- a/engines/dragons/sound.cpp
+++ b/engines/dragons/sound.cpp
@@ -472,7 +472,7 @@ Audio::SoundHandle *SoundManager::getVoiceHandle(uint16 soundID) {
return &_voice[i].handle;
}
}
- return NULL;
+ return nullptr;
}
void SoundManager::stopVoicePlaying(uint16 soundID) {
diff --git a/engines/dragons/specialopcodes.cpp b/engines/dragons/specialopcodes.cpp
index c814a10fb2..aa5116a6e3 100644
--- a/engines/dragons/specialopcodes.cpp
+++ b/engines/dragons/specialopcodes.cpp
@@ -329,7 +329,7 @@ void SpecialOpcodes::spcLadyOfTheLakeCapturedSceneLogic() {
}
void SpecialOpcodes::spcStopLadyOfTheLakeCapturedSceneLogic() {
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
_vm->_sound->PauseCDMusic();
if ((_dat_80083148 != 0) || (_uint16_t_80083154 != 0)) {
//TODO FUN_8001ac5c((uint)_dat_80083148, (uint)DAT_80083150, (uint)_uint16_t_80083154, (uint)DAT_80083158);
@@ -480,7 +480,7 @@ void SpecialOpcodes::spcActivatePizzaMakerActor() {
void SpecialOpcodes::spcDeactivatePizzaMakerActor() {
if (_vm->getSceneUpdateFunction() == pizzaUpdateFunction) {
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
}
}
@@ -545,7 +545,7 @@ void SpecialOpcodes::spcMenInMinesSceneLogic() {
void SpecialOpcodes::spcStopMenInMinesSceneLogic() {
if (_vm->getSceneUpdateFunction() == menInMinesSceneUpdateFunction) {
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
if (0x3c < _specialOpCounter) {
_specialOpCounter = 0x3c;
}
@@ -566,7 +566,7 @@ void SpecialOpcodes::spcMonksAtBarSceneLogic() {
void SpecialOpcodes::spcStopMonksAtBarSceneLogic() {
if (_vm->getSceneUpdateFunction() == monksAtBarSceneUpdateFunction) {
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
if ((_dat_80083148 != 0) && (_uint16_t_80083154 != 0)) {
//TODO FUN_8001ac5c((uint)_dat_80083148, (uint)DAT_80083150, (uint)_uint16_t_80083154, (uint)DAT_80083158);
}
@@ -594,7 +594,7 @@ void SpecialOpcodes::spcStopFlameBedroomEscapeSceneLogic() {
_dat_80083148 = 0;
_vm->_dragonINIResource->getRecord(0x96)->actor->updateSequence(0);
if (_vm->getSceneUpdateFunction() == flameEscapeSceneUpdateFunction) {
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
}
}
@@ -919,7 +919,7 @@ void SpecialOpcodes::spcCastleBuildBlackDragonSceneLogic() {
}
void SpecialOpcodes::spcStopSceneUpdateFunction() {
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
}
void SpecialOpcodes::spcSetInventorySequenceTo5() {
@@ -981,7 +981,7 @@ void SpecialOpcodes::panCamera(int16 mode) {
if (mode == 1) {
_vm->getINI(0x2ab)->objectState = _vm->_scene->_camera.x;
- _vm->_dragonINIResource->setFlickerRecord(NULL);
+ _vm->_dragonINIResource->setFlickerRecord(nullptr);
iVar2 = (int) _vm->_scene->_camera.x;
iVar1 = iVar2;
while (iVar1 <= (_vm->_scene->getStageWidth() - 320)) {
@@ -1043,7 +1043,7 @@ void SpecialOpcodes::spc82CallResetDataMaybe() {
}
void SpecialOpcodes::spcStopScreenShakeUpdater() {
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
_vm->_screen->setScreenShakeOffset(0, 0);
}
@@ -1268,7 +1268,7 @@ void SpecialOpcodes::clearSceneUpdateFunction() {
if (sceneUpdater.sequenceID != -1) {
_vm->getINI(sceneUpdater.iniID)->actor->updateSequence(sceneUpdater.sequenceID);
}
- _vm->setSceneUpdateFunction(NULL);
+ _vm->clearSceneUpdateFunction();
}
void SpecialOpcodes::setupTableBasedSceneUpdateFunction(uint16 initialCounter, uint16 numSequences,
diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp
index 31f430f417..78d4a0d027 100644
--- a/engines/dragons/talk.cpp
+++ b/engines/dragons/talk.cpp
@@ -169,7 +169,7 @@ uint8 Talk::conversation_related_maybe(uint16 *dialogText, uint16 x, uint16 y, u
_vm->clearFlags(ENGINE_FLAG_8);
}
tmpTextPtr = findCharInU16Str(dialogText, 0x5c);
- if (tmpTextPtr != NULL) {
+ if (tmpTextPtr != nullptr) {
sVar3 = tmpTextPtr[1];
*tmpTextPtr = sVar3;
while (sVar3 != 0) {
@@ -579,7 +579,7 @@ bool Talk::talkToActor(ScriptOpCall &scriptOpCall) {
}
selectedDialogText = displayTalkDialogMenu(dialogEntries);
- if (selectedDialogText == NULL) {
+ if (selectedDialogText == nullptr) {
callMaybeResetData();
exitTalkMenu(isFlag8Set, isFlag100Set, dialogEntries);
return true;
@@ -660,7 +660,7 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
bool hasDialogEntries;
uint16 *_dat_80083104;
- talkDialogEntry = NULL;
+ talkDialogEntry = nullptr;
for (int i = 0; i < 0x24; i++) {
local_430[i] = 0x20;
}
@@ -864,7 +864,7 @@ void Talk::talkFromIni(uint32 iniId, uint32 textIndex) {
if (textIndex == 0) {
return;
}
- Actor *actor = NULL;
+ Actor *actor = nullptr;
if (iniId == 0) {
//TODO playSoundFromTxtIndex(textIndex);
actor = _vm->_dragonINIResource->getFlickerRecord()->actor;
@@ -892,7 +892,7 @@ void Talk::talkFromIni(uint32 iniId, uint32 textIndex) {
// if (((unkFlags1 & 1) == 0) && (((engine_flags_maybe & 0x1000) == 0 || (sVar1 == -1)))) {
// pcVar2 = load_string_from_dragon_txt(textIndex, acStack2016);
// }
- _vm->_talk->displayDialogAroundINI(iniId, dialog, textIndex); //TODO need to pass dialog here (pcVar2). not NULL
+ _vm->_talk->displayDialogAroundINI(iniId, dialog, textIndex); //TODO need to pass dialog here (pcVar2). not nullptr
if (iniId == 0) {
if (!_vm->isFlagSet(ENGINE_FLAG_2000000)) {
if (_vm->getCurrentSceneId() != 0x32) {
@@ -1014,7 +1014,7 @@ uint16 *Talk::findCharInU16Str(uint16 *text, uint16 chr) {
}
}
- return NULL;
+ return nullptr;
}
uint16 *Talk::UTF16ToUTF16Z(uint16 *dest, uint16 *src) {
diff --git a/engines/dragons/vabsound.cpp b/engines/dragons/vabsound.cpp
index d2e772a30d..5924229fbb 100644
--- a/engines/dragons/vabsound.cpp
+++ b/engines/dragons/vabsound.cpp
@@ -30,7 +30,7 @@
namespace Dragons {
-VabSound::VabSound(Common::SeekableReadStream *msfData, const DragonsEngine *_vm): _toneAttrs(NULL), _vbData(NULL) {
+VabSound::VabSound(Common::SeekableReadStream *msfData, const DragonsEngine *_vm): _toneAttrs(nullptr), _vbData(nullptr) {
loadHeader(msfData);
int32 dataSize = msfData->size() - msfData->pos();
@@ -46,7 +46,7 @@ VabSound::VabSound(Common::SeekableReadStream *msfData, const DragonsEngine *_vm
delete msfData;
}
-VabSound::VabSound(Common::SeekableReadStream *vhData, Common::SeekableReadStream *vbData): _toneAttrs(NULL), _vbData(NULL) {
+VabSound::VabSound(Common::SeekableReadStream *vhData, Common::SeekableReadStream *vbData): _toneAttrs(nullptr), _vbData(nullptr) {
loadHeader(vhData);
assert(vhData->pos() == vhData->size());
More information about the Scummvm-git-logs
mailing list