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