[Scummvm-git-logs] scummvm master -> ebaa3857bb6e833eb4345f20bc55c21cdfe99e73
AndywinXp
noreply at scummvm.org
Mon Oct 16 06:45:23 UTC 2023
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:
ebaa3857bb SWORD1: Change NULL to nullptr
Commit: ebaa3857bb6e833eb4345f20bc55c21cdfe99e73
https://github.com/scummvm/scummvm/commit/ebaa3857bb6e833eb4345f20bc55c21cdfe99e73
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-10-16T08:45:15+02:00
Commit Message:
SWORD1: Change NULL to nullptr
This engine has somehow escaped the big NULL
purge from when we switched to C++11
Changed paths:
engines/sword1/control.cpp
engines/sword1/logic.cpp
engines/sword1/memman.cpp
engines/sword1/menu.cpp
engines/sword1/mouse.cpp
engines/sword1/objectman.cpp
engines/sword1/resman.cpp
engines/sword1/screen.cpp
engines/sword1/screen.h
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index 0c3548f7786..2eb11ebd106 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -2957,7 +2957,7 @@ bool Control::restoreGameFromFile(uint8 slot) {
displayMessage(0, "Can't read from file '%s'. (%s)", fName, _saveFileMan->popErrorDesc().c_str());
delete inf;
free(_restoreBuf);
- _restoreBuf = NULL;
+ _restoreBuf = nullptr;
return false;
}
delete inf;
@@ -3011,7 +3011,7 @@ bool Control::convertSaveGame(uint8 slot, char *desc) {
// Display a warning message and do nothing
warning("Unable to create file '%s'. (%s)", newFileName, _saveFileMan->popErrorDesc().c_str());
delete[] saveData;
- saveData = NULL;
+ saveData = nullptr;
return false;
}
@@ -3042,7 +3042,7 @@ bool Control::convertSaveGame(uint8 slot, char *desc) {
// Cleanup
delete[] saveData;
- saveData = NULL;
+ saveData = nullptr;
return true;
}
diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp
index 1d2257f900c..19dd6e7da31 100644
--- a/engines/sword1/logic.cpp
+++ b/engines/sword1/logic.cpp
@@ -1761,16 +1761,16 @@ int Logic::fnBlack(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, in
}
void Logic::startPosCallFn(uint8 fnId, uint32 param1, uint32 param2, uint32 param3) {
- Object *obj = NULL;
+ Object *obj = nullptr;
switch (fnId) {
case opcPlaySequence:
- fnPlaySequence(NULL, 0, param1, 0, 0, 0, 0, 0);
+ fnPlaySequence(nullptr, 0, param1, 0, 0, 0, 0, 0);
break;
case opcAddObject:
- fnAddObject(NULL, 0, param1, 0, 0, 0, 0, 0);
+ fnAddObject(nullptr, 0, param1, 0, 0, 0, 0, 0);
break;
case opcRemoveObject:
- fnRemoveObject(NULL, 0, param1, 0, 0, 0, 0, 0);
+ fnRemoveObject(nullptr, 0, param1, 0, 0, 0, 0, 0);
break;
case opcMegaSet:
obj = _objMan->fetchObject(param1);
@@ -1843,7 +1843,7 @@ void Logic::startPositions(uint32 pos) {
spainVisit2 = true;
pos -= 900;
}
- if ((pos > 80) || (_startData[pos] == NULL))
+ if ((pos > 80) || (_startData[pos] == nullptr))
error("Starting in Section %d is not supported", pos);
Logic::_scriptVars[CHANGE_STANCE] = STAND;
diff --git a/engines/sword1/memman.cpp b/engines/sword1/memman.cpp
index 0f56e9eb7d5..34b769a3b92 100644
--- a/engines/sword1/memman.cpp
+++ b/engines/sword1/memman.cpp
@@ -28,7 +28,7 @@ namespace Sword1 {
MemMan::MemMan() {
_alloced = 0;
- _memListFree = _memListFreeEnd = NULL;
+ _memListFree = _memListFreeEnd = nullptr;
}
MemMan::~MemMan() {
@@ -80,7 +80,7 @@ void MemMan::flush() {
break;
}
free(_memListFreeEnd->data);
- _memListFreeEnd->data = NULL;
+ _memListFreeEnd->data = nullptr;
_memListFreeEnd->cond = MEM_FREED;
_alloced -= _memListFreeEnd->size;
removeFromFreeList(_memListFreeEnd);
@@ -97,7 +97,7 @@ void MemMan::checkMemoryUsage() {
break;
}
free(_memListFreeEnd->data);
- _memListFreeEnd->data = NULL;
+ _memListFreeEnd->data = nullptr;
_memListFreeEnd->cond = MEM_FREED;
_alloced -= _memListFreeEnd->size;
removeFromFreeList(_memListFreeEnd);
@@ -109,7 +109,7 @@ void MemMan::addToFreeList(MemHandle *bsMem) {
warning("addToFreeList: mem block is already in freeList");
return;
}
- bsMem->prev = NULL;
+ bsMem->prev = nullptr;
bsMem->next = _memListFree;
if (bsMem->next)
bsMem->next->prev = bsMem;
@@ -128,7 +128,7 @@ void MemMan::removeFromFreeList(MemHandle *bsMem) {
bsMem->next->prev = bsMem->prev;
if (bsMem->prev)
bsMem->prev->next = bsMem->next;
- bsMem->next = bsMem->prev = NULL;
+ bsMem->next = bsMem->prev = nullptr;
}
void MemMan::initHandle(MemHandle *bsMem) {
diff --git a/engines/sword1/menu.cpp b/engines/sword1/menu.cpp
index 620cca98e0f..c06707ef6ba 100644
--- a/engines/sword1/menu.cpp
+++ b/engines/sword1/menu.cpp
@@ -97,9 +97,9 @@ Menu::Menu(Screen *pScreen, Mouse *pMouse) {
_fadeSubject = 0;
_fadeObject = 0;
for (cnt = 0; cnt < 16; cnt++)
- _subjects[cnt] = NULL;
+ _subjects[cnt] = nullptr;
for (cnt = 0; cnt < TOTAL_pockets; cnt++)
- _objects[cnt] = NULL;
+ _objects[cnt] = nullptr;
_inMenu = 0;
}
@@ -108,11 +108,11 @@ Menu::~Menu() {
// the menu may be open, so delete the icons
for (i = 0; i < TOTAL_pockets; i++) {
delete _objects[i];
- _objects[i] = NULL;
+ _objects[i] = nullptr;
}
for (i = 0; i < 16; i++) {
delete _subjects[i];
- _subjects[i] = NULL;
+ _subjects[i] = nullptr;
}
}
@@ -217,7 +217,7 @@ void Menu::buildSubjects() {
for (cnt = 0; cnt < 16; cnt++)
if (_subjects[cnt]) {
delete _subjects[cnt];
- _subjects[cnt] = NULL;
+ _subjects[cnt] = nullptr;
}
for (cnt = 0; cnt < Logic::_scriptVars[IN_SUBJECT]; cnt++) {
uint32 res = _subjectList[(_subjectBar[cnt] & 65535) - BASE_SUBJECT].subjectRes;
@@ -254,7 +254,7 @@ void Menu::refresh(uint8 menuType) {
else {
for (i = 0; i < _inMenu; i++) {
delete _objects[i];
- _objects[i] = NULL;
+ _objects[i] = nullptr;
}
_objectBarStatus = MENU_CLOSED;
}
@@ -279,7 +279,7 @@ void Menu::refresh(uint8 menuType) {
else {
for (i = 0; i < Logic::_scriptVars[IN_SUBJECT]; i++) {
delete _subjects[i];
- _subjects[i] = NULL;
+ _subjects[i] = nullptr;
}
_subjectBarStatus = MENU_CLOSED;
}
@@ -293,7 +293,7 @@ void Menu::buildMenu() {
for (uint8 cnt = 0; cnt < _inMenu; cnt++)
if (_objects[cnt]) {
delete _objects[cnt];
- _objects[cnt] = NULL;
+ _objects[cnt] = nullptr;
}
_inMenu = 0;
for (uint32 pocketNo = 0; pocketNo < TOTAL_pockets; pocketNo++)
diff --git a/engines/sword1/mouse.cpp b/engines/sword1/mouse.cpp
index b83782a4da6..994c7a2c5a7 100644
--- a/engines/sword1/mouse.cpp
+++ b/engines/sword1/mouse.cpp
@@ -39,7 +39,7 @@ Mouse::Mouse(OSystem *system, ResMan *pResMan, ObjectMan *pObjMan) {
_resMan = pResMan;
_objMan = pObjMan;
_system = system;
- _currentPtr = NULL;
+ _currentPtr = nullptr;
}
Mouse::~Mouse() {
@@ -157,7 +157,7 @@ void Mouse::engine(uint16 x, uint16 y, uint16 eventFlags) {
if (touchedId != (int)Logic::_scriptVars[SPECIAL_ITEM]) { //the mouse collision situation has changed in one way or another
Logic::_scriptVars[SPECIAL_ITEM] = touchedId;
if (_getOff) { // there was something else selected before, run its get-off script
- _logic->runMouseScript(NULL, _getOff);
+ _logic->runMouseScript(nullptr, _getOff);
_getOff = 0;
}
if (touchedId) { // there's something new selected, now.
@@ -178,7 +178,7 @@ void Mouse::engine(uint16 x, uint16 y, uint16 eventFlags) {
Logic::_scriptVars[GEORGE_WALKING] = 2;
}
- _logic->runMouseScript(NULL, _menu->_objectDefs[Logic::_scriptVars[SECOND_ITEM]].useScript);
+ _logic->runMouseScript(nullptr, _menu->_objectDefs[Logic::_scriptVars[SECOND_ITEM]].useScript);
}
if (Logic::_scriptVars[MENU_LOOKING]) {
@@ -188,7 +188,7 @@ void Mouse::engine(uint16 x, uint16 y, uint16 eventFlags) {
Logic::_scriptVars[GEORGE_WALKING] = 2;
}
- _logic->cfnPresetScript(NULL, -1, PLAYER, SCR_menu_look, 0, 0, 0, 0);
+ _logic->cfnPresetScript(nullptr, -1, PLAYER, SCR_menu_look, 0, 0, 0, 0);
}
}
@@ -208,11 +208,11 @@ uint16 Mouse::testEvent() {
void Mouse::createPointer(uint32 ptrId, uint32 luggageId) {
if (_currentPtr) {
free(_currentPtr);
- _currentPtr = NULL;
+ _currentPtr = nullptr;
}
if (ptrId) {
- MousePtr *lugg = NULL;
+ MousePtr *lugg = nullptr;
MousePtr *ptr = (MousePtr *)_resMan->openFetchRes(ptrId);
uint16 noFrames = _resMan->getLEUint16(ptr->numFrames);
uint16 ptrSizeX = _resMan->getLEUint16(ptr->sizeX);
diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp
index a12505cb7a7..870d18d80d0 100644
--- a/engines/sword1/objectman.cpp
+++ b/engines/sword1/objectman.cpp
@@ -48,7 +48,7 @@ void ObjectMan::initialize() {
if (_liveList[cnt])
_cptData[cnt] = (uint8 *)_resMan->cptResOpen(_objectList[cnt]) + sizeof(Header);
else
- _cptData[cnt] = NULL;
+ _cptData[cnt] = nullptr;
}
}
@@ -74,7 +74,7 @@ void ObjectMan::megaLeaving(uint16 section, int id) {
_liveList[section]--;
if ((_liveList[section] == 0) && (id != PLAYER)) {
_resMan->resClose(_objectList[section]);
- _cptData[section] = NULL;
+ _cptData[section] = nullptr;
}
/* if the player is leaving the section then we have to close the resources after
mainloop ends, because the screen will still need the resources*/
@@ -114,8 +114,8 @@ char *ObjectMan::lockText(uint32 textId) {
char *ObjectMan::lockText(uint32 textId, uint8 lang) {
char *addr = (char *)_resMan->openFetchRes(_textList[textId / ITM_PER_SEC][lang]);
- if (addr == 0)
- return NULL;
+ if (addr == nullptr)
+ return nullptr;
addr += sizeof(Header);
if ((textId & ITM_ID) >= _resMan->readUint32(addr)) {
// Workaround for missing sentences in some languages in the demo.
@@ -157,7 +157,7 @@ char *ObjectMan::lockText(uint32 textId, uint8 lang) {
}
warning("ObjectMan::lockText(%d): only %d texts in file", textId & ITM_ID, _resMan->readUint32(addr));
- return NULL;
+ return nullptr;
}
uint32 offset = _resMan->readUint32(addr + ((textId & ITM_ID) + 1) * 4);
if (offset == 0) {
@@ -178,7 +178,7 @@ char *ObjectMan::lockText(uint32 textId, uint8 lang) {
return const_cast<char *>(_translationId6488083[lang]);
}
warning("ObjectMan::lockText(%d): text number has no text lines", textId);
- return NULL;
+ return nullptr;
}
return addr + offset;
}
@@ -209,7 +209,7 @@ Object *ObjectMan::fetchObject(uint32 id) {
}
uint32 ObjectMan::fetchNoObjects(int section) {
- if (_cptData[section] == NULL)
+ if (_cptData[section] == nullptr)
error("fetchNoObjects: section %d is not open", section);
return *(uint32 *)_cptData[section];
}
@@ -223,7 +223,7 @@ void ObjectMan::loadLiveList(uint16 *src) {
for (uint16 cnt = 0; cnt < TOTAL_SECTIONS; cnt++) {
if (_liveList[cnt]) {
_resMan->resClose(_objectList[cnt]);
- _cptData[cnt] = NULL;
+ _cptData[cnt] = nullptr;
}
_liveList[cnt] = src[cnt];
if (_liveList[cnt])
@@ -276,7 +276,7 @@ const char *const ObjectMan::_translationId2950145[7] = {
"Eh?", // Italian
"\277Eh?", // Spanish
"Ano?", // Czech
- NULL // Portuguese
+ nullptr // Portuguese
};
// The translations for the next texts are missing in the demo but are present
@@ -284,145 +284,145 @@ const char *const ObjectMan::_translationId2950145[7] = {
// Missing translation for textId 8455194 (in the demo).
const char *const ObjectMan::_translationId8455194[7] = {
- NULL, // "Who was the guy you were supposed to meet?", // English (not needed)
+ nullptr, // "Who was the guy you were supposed to meet?", // English (not needed)
"Qui \351tait l'homme que vous deviez rencontrer?", // French
"Wer war der Typ, den Du treffen wolltest?", // German
"Chi dovevi incontrare?", // Italian
"\277Qui\351n era el hombre con el que ten\355as que encontrarte?", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455195 (in the demo).
const char *const ObjectMan::_translationId8455195[7] = {
- NULL, // "His name was Plantard. I didn't know him, but he called me last night.", // English (not needed)
+ nullptr, // "His name was Plantard. I didn't know him, but he called me last night.", // English (not needed)
"Son nom \351tait Plantard. Je ne le connaissais pas, mais il m'avait t\351l\351phon\351 la veille.", // French
"Sein Name war Plantard. Ich kannte ihn nicht, aber er hat mich letzte Nacht angerufen.", // German
"Si chiamava Plantard. Mi ha chiamato ieri sera, ma non lo conoscevo.", // Italian
"Su nombre era Plantard. Yo no lo conoc\355a pero \351l me llam\363 ayer por la noche.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455196 (in the demo).
const char *const ObjectMan::_translationId8455196[7] = {
- NULL, // "He said he had a story which would interest me.", // English (not needed)
+ nullptr, // "He said he had a story which would interest me.", // English (not needed)
"Il a dit qu'il avait une histoire qui devrait m'int\351resser.", // French
"Er sagte, er h\344tte eine Story, die mich interessieren w\374rde.", // German
"Mi disse che aveva una storia che mi poteva interessare.", // Italian
"Dijo que ten\355a una historia que me interesar\355a.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455197 (in the demo).
const char *const ObjectMan::_translationId8455197[7] = {
- NULL, // "He asked me to meet him at the caf\351.", // English (not needed)
+ nullptr, // "He asked me to meet him at the caf\351.", // English (not needed)
"Il m'a demand\351 de le rencontrer au caf\351.", // French
"Er fragte mich, ob wir uns im Caf\351 treffen k\366nnten.", // German
"Mi chiese di incontrarci al bar.", // Italian
"Me pidi\363 que nos encontr\341ramos en el caf\351.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455198 (in the demo).
const char *const ObjectMan::_translationId8455198[7] = {
- NULL, // "I guess I'll never know what he wanted to tell me...", // English (not needed)
- "Je suppose que je ne saurai jamais ce qu'il voulait me dire...", // French
- "Ich werde wohl nie erfahren, was er mir sagen wollte...", // German
- "Penso che non sapr\362 mai che cosa voleva dirmi...", // Italian
- "Supongo que nunca sabr\351 qu\351 me quer\355a contar...", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // "I guess I'll never know what he wanted to tell me...", // English (not needed)
+ "Je suppose que je ne saurai jamais ce qu'il voulait me dire...", // French
+ "Ich werde wohl nie erfahren, was er mir sagen wollte...", // German
+ "Penso che non sapr\362 mai che cosa voleva dirmi...", // Italian
+ "Supongo que nunca sabr\351 qu\351 me quer\355a contar...", // Spanish
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455199 (in the demo).
const char *const ObjectMan::_translationId8455199[7] = {
- NULL, // "Not unless you have Rosso's gift for psychic interrogation.", // English (not needed)
+ nullptr, // "Not unless you have Rosso's gift for psychic interrogation.", // English (not needed)
"Non, \340 moins d'avoir les dons de Rosso pour les interrogatoires psychiques.", // French
"Es sei denn, Du h\344ttest Rosso's Gabe der parapsychologischen Befragung.", // German
"A meno che tu non riesca a fare interrogatori telepatici come Rosso.", // Italian
"A no ser que tengas el don de Rosso para la interrogaci\363n ps\355quica.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455200 (in the demo).
const char *const ObjectMan::_translationId8455200[7] = {
- NULL, // "How did Plantard get your name?", // English (not needed)
+ nullptr, // "How did Plantard get your name?", // English (not needed)
"Comment Plantard a-t-il obtenu votre nom?", // French
"Woher hat Plantard Deinen Namen?", // German
"Come ha fatto Plantard a sapere il tuo nome?", // Italian
"\277C\363mo consigui\363 Plantard tu nombre?", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455201 (in the demo).
const char *const ObjectMan::_translationId8455201[7] = {
- NULL, // "Through the newspaper - La Libert\351.", // English (not needed)
- "Par mon journal... La Libert\351.", // French
- "\334ber die Zeitung - La Libert\351.", // German
- "Tramite il giornale La Libert\351.", // Italian
- "Por el peri\363dico - La Libert\351.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // "Through the newspaper - La Libert\351.", // English (not needed)
+ "Par mon journal... La Libert\351.", // French
+ "\334ber die Zeitung - La Libert\351.", // German
+ "Tramite il giornale La Libert\351.", // Italian
+ "Por el peri\363dico - La Libert\351.", // Spanish
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455202 (in the demo).
const char *const ObjectMan::_translationId8455202[7] = {
- NULL, // "I'd written an article linking two unsolved murders, one in Italy, the other in Japan.", // English (not needed)
+ nullptr, // "I'd written an article linking two unsolved murders, one in Italy, the other in Japan.", // English (not needed)
"J'ai \351crit un article o\371 je faisais le lien entre deux meurtres inexpliqu\351s, en Italie et au japon.", // French
"Ich habe einen Artikel geschrieben, in dem ich zwei ungel\366ste Morde miteinander in Verbindung bringe, einen in Italien, einen anderen in Japan.", // German
"Ho scritto un articolo che metteva in collegamento due omicidi insoluti in Italia e Giappone.", // Italian
"Yo hab\355a escrito un art\355culo conectando dos asesinatos sin resolver, uno en Italia, el otro en Jap\363n.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455203 (in the demo).
const char *const ObjectMan::_translationId8455203[7] = {
- NULL, // "The cases were remarkably similar...", // English (not needed)
+ nullptr, // "The cases were remarkably similar...", // English (not needed)
"Les affaires \351taient quasiment identiques...", // French
"Die F\344lle sind sich bemerkenswert \344hnlich...", // German
"I casi erano sorprendentemente uguali...", // Italian
"Los casos eran incre\355blemente parecidos...", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455204 (in the demo).
const char *const ObjectMan::_translationId8455204[7] = {
- NULL, // "...a wealthy victim, no apparent motive, and a costumed killer.", // English (not needed)
+ nullptr, // "...a wealthy victim, no apparent motive, and a costumed killer.", // English (not needed)
"...une victime riche, pas de motif apparent, et un tueur d\351guis\351.", // French
"...ein wohlhabendes Opfer, kein offensichtliches Motiv, und ein verkleideter Killer.", // German
"...una vittima ricca, nessun motivo apparente e un assassino in costume.", // Italian
"...una v\355ctima rica, sin motivo aparente, y un asesino disfrazado.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 8455205 (in the demo).
const char *const ObjectMan::_translationId8455205[7] = {
- NULL, // "Plantard said he could supply me with more information.", // English (not needed)
+ nullptr, // "Plantard said he could supply me with more information.", // English (not needed)
"Plantard m'a dit qu'il pourrait me fournir des renseignements.", // French
"Plantard sagte, er k\366nne mir weitere Informationen beschaffen.", // German
"Plantard mi disse che mi avrebbe fornito ulteriori informazioni.", // Italian
"Plantard dijo que \351l me pod\355a proporcionar m\341s informaci\363n.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 6488080 (in the demo).
const char *const ObjectMan::_translationId6488080[7] = {
- NULL, // "I wasn't going to head off all over Paris until I'd investigated some more.", // English (not needed)
- "Je ferais mieux d'enqu\351ter un peu par ici avant d'aller me promener ailleurs.", // French
- "Ich durchquere nicht ganz Paris, bevor ich etwas mehr herausgefunden habe.", // German
- "Non mi sarei incamminato per tutta Parigi prima di ulteriori indagini.", // Italian
- "No iba a empezar a recorrerme todo Par\355s hasta haber investigado algo m\341s.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // "I wasn't going to head off all over Paris until I'd investigated some more.", // English (not needed)
+ "Je ferais mieux d'enqu\351ter un peu par ici avant d'aller me promener ailleurs.", // French
+ "Ich durchquere nicht ganz Paris, bevor ich etwas mehr herausgefunden habe.", // German
+ "Non mi sarei incamminato per tutta Parigi prima di ulteriori indagini.", // Italian
+ "No iba a empezar a recorrerme todo Par\355s hasta haber investigado algo m\341s.", // Spanish
+ nullptr, // Czech
+ nullptr // Portuguese
};
// The next three sentences are specific to the demo and only the english text is present.
@@ -434,35 +434,35 @@ const char *const ObjectMan::_translationId6488080[7] = {
// Missing translation for textId 6488081 (in the demo).
const char *const ObjectMan::_translationId6488081[7] = {
- NULL, // "I wasn't sure what I was going to do when I caught up with that clown...", // English (not needed)
- "Je ne savais pas ce que je ferais quand je rattraperais le clown...", // French
- "Ich wu\337te nicht, worauf ich mich einlie\337, als ich dem Clown nachjagte...", // German
- "Non sapevo cosa avrei fatto una volta raggiunto quel clown...", // Italian
- "No estaba seguro de qu\351 iba a hacer cuando alcanzara a ese payaso...", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // "I wasn't sure what I was going to do when I caught up with that clown...", // English (not needed)
+ "Je ne savais pas ce que je ferais quand je rattraperais le clown...", // French
+ "Ich wu\337te nicht, worauf ich mich einlie\337, als ich dem Clown nachjagte...", // German
+ "Non sapevo cosa avrei fatto una volta raggiunto quel clown...", // Italian
+ "No estaba seguro de qu\351 iba a hacer cuando alcanzara a ese payaso...", // Spanish
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 6488082 (in the demo).
const char *const ObjectMan::_translationId6488082[7] = {
- NULL, // "...but before I knew it, I was drawn into a desperate race between two ruthless enemies.", // English (not needed)
+ nullptr, // "...but before I knew it, I was drawn into a desperate race between two ruthless enemies.", // English (not needed)
"...mais avant de m'en rendre compte je me retrouvais happ\351 dans une course effr\351n\351e entre deux ennemis impitoyables.", // French
"... doch bevor ich mich versah, war ich inmitten eines Wettlaufs von zwei r\374cksichtslosen Feinden.", // German
"... ma prima che me ne rendessi conto, fui trascinato in una corsa disperata con due spietati nemici.", // Italian
"... pero antes de que me diera tiempo a pensarlo, me encontr\351 metido en una carrera desesperada entre dos enemigos sin piedad.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
// Missing translation for textId 6488083 (in the demo).
const char *const ObjectMan::_translationId6488083[7] = {
- NULL, // "The goal: the mysterious power of the Broken Sword.", // English (not needed)
+ nullptr, // "The goal: the mysterious power of the Broken Sword.", // English (not needed)
"Le but: les pouvoirs myst\351rieux de l'\351p\351e bris\351e.", // French
"Das Ziel: die geheimnisvolle Macht des zerbrochenen Schwertes.", // German
"Obiettivo: il misterioso potere della Spada spezzata.", // Italian
"El objetivo: el misterioso poder de la Espada Rota.", // Spanish
- NULL, // Czech
- NULL // Portuguese
+ nullptr, // Czech
+ nullptr // Portuguese
};
} // End of namespace Sword1
diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp
index 2c1b0de6b83..e0896268614 100644
--- a/engines/sword1/resman.cpp
+++ b/engines/sword1/resman.cpp
@@ -44,7 +44,7 @@ void guiFatalError(char *msg) {
#define MAX_PATH_LEN 260
ResMan::ResMan(const char *fileName, bool isMacFile) {
- _openCluStart = _openCluEnd = NULL;
+ _openCluStart = _openCluEnd = nullptr;
_openClus = 0;
_isBigEndian = isMacFile;
_memMan = new MemMan();
@@ -99,10 +99,10 @@ void ResMan::loadCluDescript(const char *fileName) {
Clu *cluster = _prj.clu + clusCnt;
file.read(cluster->label, MAX_LABEL_SIZE);
- cluster->file = NULL;
+ cluster->file = nullptr;
cluster->noGrp = file.readUint32LE();
cluster->grp = new Grp[cluster->noGrp];
- cluster->nextOpen = NULL;
+ cluster->nextOpen = nullptr;
memset(cluster->grp, 0, cluster->noGrp * sizeof(Grp));
cluster->refCount = 0;
@@ -147,7 +147,7 @@ void ResMan::freeCluDescript() {
Clu *cluster = _prj.clu + clusCnt;
for (uint32 grpCnt = 0; grpCnt < cluster->noGrp; grpCnt++) {
Grp *group = cluster->grp + grpCnt;
- if (group->resHandle != NULL) {
+ if (group->resHandle != nullptr) {
for (uint32 resCnt = 0; resCnt < group->noRes; resCnt++)
_memMan->freeNow(group->resHandle + resCnt);
@@ -177,12 +177,12 @@ void ResMan::flush() {
if (cluster->file) {
cluster->file->close();
delete cluster->file;
- cluster->file = NULL;
+ cluster->file = nullptr;
cluster->refCount = 0;
}
}
_openClus = 0;
- _openCluStart = _openCluEnd = NULL;
+ _openCluStart = _openCluEnd = nullptr;
// the memory manager cached the blocks we asked it to free, so explicitly make it free them
_memMan->flush();
}
@@ -192,7 +192,7 @@ void *ResMan::fetchRes(uint32 id) {
if (!memHandle) {
warning("fetchRes:: resource %d out of bounds", id);
- return NULL;
+ return nullptr;
}
if (!memHandle->data)
error("fetchRes:: resource %d is not open", id);
@@ -245,7 +245,7 @@ void *ResMan::cptResOpen(uint32 id) {
openCptResourceLittleEndian(id);
#endif
MemHandle *handle = resHandle(id);
- return handle != NULL ? handle->data : NULL;
+ return handle != nullptr ? handle->data : nullptr;
}
void ResMan::resOpen(uint32 id) { // load resource ID into memory
@@ -304,9 +304,9 @@ FrameHeader *ResMan::fetchFrame(void *resourceData, uint32 frameNo) {
Common::File *ResMan::resFile(uint32 id) {
Clu *cluster = _prj.clu + ((id >> 24) - 1);
- if (cluster->file == NULL) {
+ if (cluster->file == nullptr) {
_openClus++;
- if (_openCluEnd == NULL) {
+ if (_openCluEnd == nullptr) {
_openCluStart = _openCluEnd = cluster;
} else {
_openCluEnd->nextOpen = cluster;
@@ -334,8 +334,8 @@ Common::File *ResMan::resFile(uint32 id) {
if (closeClu->file)
closeClu->file->close();
delete closeClu->file;
- closeClu->file = NULL;
- closeClu->nextOpen = NULL;
+ closeClu->file = nullptr;
+ closeClu->nextOpen = nullptr;
_openClus--;
}
@@ -353,7 +353,7 @@ MemHandle *ResMan::resHandle(uint32 id) {
// portuguese subtitles (cluster file 2, group 6) with a version that does not
// contain subtitles for this languages (i.e. has only 6 languages and not 7).
if (cluster >= _prj.noClu || group >= _prj.clu[cluster].noGrp)
- return NULL;
+ return nullptr;
return &(_prj.clu[cluster].grp[group].resHandle[id & 0xFFFF]);
}
diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp
index ea6a203436c..02d06189554 100644
--- a/engines/sword1/screen.cpp
+++ b/engines/sword1/screen.cpp
@@ -49,12 +49,12 @@ Screen::Screen(OSystem *system, SwordEngine *vm, ResMan *pResMan, ObjectMan *pOb
_vm = vm;
_resMan = pResMan;
_objMan = pObjMan;
- _screenBuf = _screenGrid = NULL;
+ _screenBuf = _screenGrid = nullptr;
_backLength = _foreLength = _sortLength = 0;
_currentScreen = 0xFFFF;
_updatePalette = false;
- _psxCache.decodedBackground = NULL;
- _psxCache.extPlxCache = NULL;
+ _psxCache.decodedBackground = nullptr;
+ _psxCache.extPlxCache = nullptr;
_oldScrollX = 0;
_oldScrollY = 0;
@@ -522,7 +522,7 @@ void Screen::newScreen(uint32 screen) {
_layerGrid[cnt] = (uint16 *)_resMan->openFetchRes(_roomDefTable[_currentScreen].grids[cnt]);
_layerGrid[cnt] += 14;
}
- _parallax[0] = _parallax[1] = NULL;
+ _parallax[0] = _parallax[1] = nullptr;
if (_roomDefTable[_currentScreen].parallax[0])
_parallax[0] = (uint8 *)_resMan->openFetchRes(_roomDefTable[_currentScreen].parallax[0]);
if (_roomDefTable[_currentScreen].parallax[1])
@@ -674,8 +674,8 @@ void Screen::processImage(uint32 id) {
spriteY += (int16)_resMan->readUint16(&frameHead->offsetY);
}
- uint8 *tonyBuf = NULL;
- uint8 *hifBuf = NULL;
+ uint8 *tonyBuf = nullptr;
+ uint8 *hifBuf = nullptr;
if (SwordEngine::isPsx() && compact->o_type != TYPE_TEXT) { // PSX sprites are compressed with HIF
hifBuf = (uint8 *)malloc(_resMan->readUint16(&frameHead->width) * _resMan->readUint16(&frameHead->height) / 2);
memset(hifBuf, 0x00, (_resMan->readUint16(&frameHead->width) * _resMan->readUint16(&frameHead->height) / 2));
@@ -833,8 +833,8 @@ void Screen::renderParallax(uint8 *data) {
uint16 scrnScrlX, scrnScrlY;
uint16 scrnWidth, scrnHeight;
uint16 paraSizeX, paraSizeY;
- ParallaxHeader *header = NULL;
- uint32 *lineIndexes = NULL;
+ ParallaxHeader *header = nullptr;
+ uint32 *lineIndexes = nullptr;
if (SwordEngine::isPsx()) //Parallax headers are different in PSX version
fetchPsxParallaxSize(data, ¶SizeX, ¶SizeY);
@@ -1317,12 +1317,12 @@ void Screen::decompressHIF(uint8 *src, uint8 *dest) {
void Screen::flushPsxCache() {
if (_psxCache.decodedBackground) {
free(_psxCache.decodedBackground);
- _psxCache.decodedBackground = NULL;
+ _psxCache.decodedBackground = nullptr;
}
if (_psxCache.extPlxCache) {
free(_psxCache.extPlxCache);
- _psxCache.extPlxCache = NULL;
+ _psxCache.extPlxCache = nullptr;
}
}
diff --git a/engines/sword1/screen.h b/engines/sword1/screen.h
index cca6f57bde7..7834da2550d 100644
--- a/engines/sword1/screen.h
+++ b/engines/sword1/screen.h
@@ -99,7 +99,7 @@ public:
bool showScrollFrame();
void updateScreen();
- void showFrame(uint16 x, uint16 y, uint32 resId, uint32 frameNo, const byte *fadeMask = NULL, int8 fadeStatus = 0);
+ void showFrame(uint16 x, uint16 y, uint32 resId, uint32 frameNo, const byte *fadeMask = nullptr, int8 fadeStatus = 0);
void fnSetParallax(uint32 screen, uint32 resId);
void fnFlash(uint8 color);
More information about the Scummvm-git-logs
mailing list