mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
TINSEL: Replace usage of NULL with nullptr
This commit is contained in:
parent
20cf13074d
commit
63ae50e790
@ -136,7 +136,7 @@ struct TAGACTOR {
|
|||||||
typedef TAGACTOR *PTAGACTOR;
|
typedef TAGACTOR *PTAGACTOR;
|
||||||
|
|
||||||
|
|
||||||
static ACTORINFO *actorInfo = NULL;
|
static ACTORINFO *actorInfo = nullptr;
|
||||||
|
|
||||||
static COLORREF defaultColor = 0; // Text color
|
static COLORREF defaultColor = 0; // Text color
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ static TAGACTOR taggedActors[MAX_TAGACTORS];
|
|||||||
|
|
||||||
static int numTaggedActors = 0;
|
static int numTaggedActors = 0;
|
||||||
|
|
||||||
static uint8 *zFactors = NULL;
|
static uint8 *zFactors = nullptr;
|
||||||
|
|
||||||
static Z_POSITIONS zPositions[NUM_ZPOSITIONS];
|
static Z_POSITIONS zPositions[NUM_ZPOSITIONS];
|
||||||
|
|
||||||
@ -198,10 +198,10 @@ void RegisterActors(int num) {
|
|||||||
|
|
||||||
void FreeActors() {
|
void FreeActors() {
|
||||||
free(actorInfo);
|
free(actorInfo);
|
||||||
actorInfo = NULL;
|
actorInfo = nullptr;
|
||||||
if (TinselV2) {
|
if (TinselV2) {
|
||||||
free(zFactors);
|
free(zFactors);
|
||||||
zFactors = NULL;
|
zFactors = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ void ActorEvent(int ano, TINSEL_EVENT event, PLR_EVENT be) {
|
|||||||
atp.id = ano;
|
atp.id = ano;
|
||||||
atp.event = event;
|
atp.event = event;
|
||||||
atp.bev = be;
|
atp.bev = be;
|
||||||
atp.pic = NULL;
|
atp.pic = nullptr;
|
||||||
CoroScheduler.createProcess(PID_TCODE, ActorTinselProcess, &atp, sizeof(atp));
|
CoroScheduler.createProcess(PID_TCODE, ActorTinselProcess, &atp, sizeof(atp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -413,9 +413,9 @@ void StartActor(const T1_ACTOR_STRUC *as, bool bRunScript) {
|
|||||||
actorInfo[hActorId - 1].completed = false;
|
actorInfo[hActorId - 1].completed = false;
|
||||||
actorInfo[hActorId - 1].x = 0;
|
actorInfo[hActorId - 1].x = 0;
|
||||||
actorInfo[hActorId - 1].y = 0;
|
actorInfo[hActorId - 1].y = 0;
|
||||||
actorInfo[hActorId - 1].presReel = NULL;
|
actorInfo[hActorId - 1].presReel = nullptr;
|
||||||
actorInfo[hActorId - 1].presFilm = 0;
|
actorInfo[hActorId - 1].presFilm = 0;
|
||||||
actorInfo[hActorId - 1].presObj = NULL;
|
actorInfo[hActorId - 1].presObj = nullptr;
|
||||||
|
|
||||||
// Store current scene's parameters for this actor
|
// Store current scene's parameters for this actor
|
||||||
actorInfo[hActorId - 1].mtype = FROM_32(as->masking);
|
actorInfo[hActorId - 1].mtype = FROM_32(as->masking);
|
||||||
@ -502,9 +502,9 @@ void DropActors() {
|
|||||||
} else {
|
} else {
|
||||||
// In Tinsel v1, only certain fields get reset
|
// In Tinsel v1, only certain fields get reset
|
||||||
actorInfo[i].actorCode = 0; // No script
|
actorInfo[i].actorCode = 0; // No script
|
||||||
actorInfo[i].presReel = NULL; // No reel running
|
actorInfo[i].presReel = nullptr; // No reel running
|
||||||
actorInfo[i].presFilm = 0; // ditto
|
actorInfo[i].presFilm = 0; // ditto
|
||||||
actorInfo[i].presObj = NULL; // No object
|
actorInfo[i].presObj = nullptr; // No object
|
||||||
actorInfo[i].x = 0; // No position
|
actorInfo[i].x = 0; // No position
|
||||||
actorInfo[i].y = 0; // ditto
|
actorInfo[i].y = 0; // ditto
|
||||||
|
|
||||||
@ -1450,7 +1450,7 @@ void dwEndActor(int ano) {
|
|||||||
|
|
||||||
// Make play.c think it's been replaced
|
// Make play.c think it's been replaced
|
||||||
// The following line may have been indirectly making text go away!
|
// The following line may have been indirectly making text go away!
|
||||||
// actorInfo[ano - 1].presFilm = NULL;
|
// actorInfo[ano - 1].presFilm = nullptr;
|
||||||
// but things were returning after a cut scene.
|
// but things were returning after a cut scene.
|
||||||
// so re-instate it and de-register the object
|
// so re-instate it and de-register the object
|
||||||
actorInfo[ano - 1].presFilm = 0;
|
actorInfo[ano - 1].presFilm = 0;
|
||||||
@ -1460,7 +1460,7 @@ void dwEndActor(int ano) {
|
|||||||
// It may take a frame to remove this, so make it invisible
|
// It may take a frame to remove this, so make it invisible
|
||||||
if (actorInfo[ano-1].presObjs[i] != NULL) {
|
if (actorInfo[ano-1].presObjs[i] != NULL) {
|
||||||
MultiHideObject(actorInfo[ano-1].presObjs[i]);
|
MultiHideObject(actorInfo[ano-1].presObjs[i]);
|
||||||
actorInfo[ano-1].presObjs[i] = NULL;
|
actorInfo[ano-1].presObjs[i] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1648,7 +1648,7 @@ void StoreActorPresFilm(int ano, SCNHANDLE hFilm, int x, int y) {
|
|||||||
MultiHideObject(actorInfo[ano - 1].presObjs[i]);
|
MultiHideObject(actorInfo[ano - 1].presObjs[i]);
|
||||||
|
|
||||||
actorInfo[ano - 1].presColumns[i] = -1;
|
actorInfo[ano - 1].presColumns[i] = -1;
|
||||||
actorInfo[ano - 1].presObjs[i] = NULL;
|
actorInfo[ano - 1].presObjs[i] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1705,7 +1705,7 @@ void NotPlayingReel(int actor, int filmNumber, int column) {
|
|||||||
// De-register this reel
|
// De-register this reel
|
||||||
for (i = 0; i < MAX_REELS; i++) {
|
for (i = 0; i < MAX_REELS; i++) {
|
||||||
if (actorInfo[actor-1].presColumns[i] == column) {
|
if (actorInfo[actor-1].presColumns[i] == column) {
|
||||||
actorInfo[actor-1].presObjs[i] = NULL;
|
actorInfo[actor-1].presObjs[i] = nullptr;
|
||||||
actorInfo[actor-1].presColumns[i] = -1;
|
actorInfo[actor-1].presColumns[i] = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ void Background::InitBackground() {
|
|||||||
pPlayfield->fieldYvel = intToFrac(0);
|
pPlayfield->fieldYvel = intToFrac(0);
|
||||||
|
|
||||||
// clear playfield display list
|
// clear playfield display list
|
||||||
pPlayfield->pDispList = NULL;
|
pPlayfield->pDispList = nullptr;
|
||||||
|
|
||||||
// clear playfield moved flag
|
// clear playfield moved flag
|
||||||
pPlayfield->bMoved = false;
|
pPlayfield->bMoved = false;
|
||||||
@ -298,7 +298,7 @@ void Background::SetBackPal(SCNHANDLE hPal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Background::DropBackground() {
|
void Background::DropBackground() {
|
||||||
_pBG[0] = NULL; // No background
|
_pBG[0] = nullptr; // No background
|
||||||
|
|
||||||
if (!TinselV2)
|
if (!TinselV2)
|
||||||
_hBgPal = 0; // No background palette
|
_hBgPal = 0; // No background palette
|
||||||
|
@ -441,7 +441,7 @@ void BMVPlayer::FettleMovieText() {
|
|||||||
if (texts[i].pText) {
|
if (texts[i].pText) {
|
||||||
if (currentFrame > texts[i].dieFrame) {
|
if (currentFrame > texts[i].dieFrame) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), texts[i].pText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), texts[i].pText);
|
||||||
texts[i].pText = NULL;
|
texts[i].pText = nullptr;
|
||||||
} else {
|
} else {
|
||||||
MultiForceRedraw(texts[i].pText);
|
MultiForceRedraw(texts[i].pText);
|
||||||
bIsText = true;
|
bIsText = true;
|
||||||
@ -725,17 +725,17 @@ void BMVPlayer::FinishBMV() {
|
|||||||
|
|
||||||
// Release the data buffer
|
// Release the data buffer
|
||||||
free(bigBuffer);
|
free(bigBuffer);
|
||||||
bigBuffer = NULL;
|
bigBuffer = nullptr;
|
||||||
|
|
||||||
// Release the screen buffer
|
// Release the screen buffer
|
||||||
free(screenBuffer);
|
free(screenBuffer);
|
||||||
screenBuffer = NULL;
|
screenBuffer = nullptr;
|
||||||
|
|
||||||
// Ditch any text objects
|
// Ditch any text objects
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
if (texts[i].pText) {
|
if (texts[i].pText) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), texts[i].pText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), texts[i].pText);
|
||||||
texts[i].pText = NULL;
|
texts[i].pText = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bMovieOn = false;
|
bMovieOn = false;
|
||||||
|
@ -56,8 +56,8 @@ namespace Tinsel {
|
|||||||
|
|
||||||
// FIXME: Avoid non-const global vars
|
// FIXME: Avoid non-const global vars
|
||||||
|
|
||||||
static OBJECT *g_McurObj = NULL; // Main cursor object
|
static OBJECT *g_McurObj = nullptr; // Main cursor object
|
||||||
static OBJECT *g_AcurObj = NULL; // Auxiliary cursor object
|
static OBJECT *g_AcurObj = nullptr; // Auxiliary cursor object
|
||||||
|
|
||||||
static ANIM g_McurAnim = {0,0,0,0,0}; // Main cursor animation structure
|
static ANIM g_McurAnim = {0,0,0,0,0}; // Main cursor animation structure
|
||||||
static ANIM g_AcurAnim = {0,0,0,0,0}; // Auxiliary cursor animation structure
|
static ANIM g_AcurAnim = {0,0,0,0,0}; // Auxiliary cursor animation structure
|
||||||
@ -268,7 +268,7 @@ void DwHideCursor() {
|
|||||||
for (i = 0; i < g_numTrails; i++) {
|
for (i = 0; i < g_numTrails; i++) {
|
||||||
if (g_ntrailData[i].trailObj != NULL) {
|
if (g_ntrailData[i].trailObj != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_ntrailData[i].trailObj);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_ntrailData[i].trailObj);
|
||||||
g_ntrailData[i].trailObj = NULL;
|
g_ntrailData[i].trailObj = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -305,7 +305,7 @@ void HideCursorTrails() {
|
|||||||
for (i = 0; i < g_numTrails; i++) {
|
for (i = 0; i < g_numTrails; i++) {
|
||||||
if (g_ntrailData[i].trailObj != NULL) {
|
if (g_ntrailData[i].trailObj != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_ntrailData[i].trailObj);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_ntrailData[i].trailObj);
|
||||||
g_ntrailData[i].trailObj = NULL;
|
g_ntrailData[i].trailObj = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -358,7 +358,7 @@ IMAGE *GetImageFromFilm(SCNHANDLE hFilm, int reel, const FREEL **ppfr, const MUL
|
|||||||
void DelAuxCursor() {
|
void DelAuxCursor() {
|
||||||
if (g_AcurObj != NULL) {
|
if (g_AcurObj != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_AcurObj);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_AcurObj);
|
||||||
g_AcurObj = NULL;
|
g_AcurObj = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,7 +494,7 @@ static void InitCurObj() {
|
|||||||
pim = GetImageFromFilm(g_hCursorFilm, 0, &pfr, &pmi, &pFilm);// Get pointer to image
|
pim = GetImageFromFilm(g_hCursorFilm, 0, &pfr, &pmi, &pFilm);// Get pointer to image
|
||||||
pim->hImgPal = TO_32(_vm->_bg->BgPal());
|
pim->hImgPal = TO_32(_vm->_bg->BgPal());
|
||||||
|
|
||||||
g_AcurObj = NULL; // No auxillary cursor
|
g_AcurObj = nullptr; // No auxillary cursor
|
||||||
}
|
}
|
||||||
|
|
||||||
g_McurObj = MultiInitObject(pmi);
|
g_McurObj = MultiInitObject(pmi);
|
||||||
@ -581,7 +581,7 @@ void CursorProcess(CORO_PARAM, const void *) {
|
|||||||
if (g_ntrailData[i].trailObj != NULL) {
|
if (g_ntrailData[i].trailObj != NULL) {
|
||||||
if (StepAnimScript(&g_ntrailData[i].trailAnim) == ScriptFinished) {
|
if (StepAnimScript(&g_ntrailData[i].trailAnim) == ScriptFinished) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_ntrailData[i].trailObj);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_ntrailData[i].trailObj);
|
||||||
g_ntrailData[i].trailObj = NULL;
|
g_ntrailData[i].trailObj = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -642,8 +642,8 @@ void DropCursor() {
|
|||||||
g_restart = 0;
|
g_restart = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_AcurObj = NULL; // No auxillary cursor
|
g_AcurObj = nullptr; // No auxillary cursor
|
||||||
g_McurObj = NULL; // No cursor object (imminently deleted elsewhere)
|
g_McurObj = nullptr; // No cursor object (imminently deleted elsewhere)
|
||||||
g_bHiddenCursor = false; // Not hidden in next scene
|
g_bHiddenCursor = false; // Not hidden in next scene
|
||||||
g_bTempNoTrailers = false; // Trailers not hidden in next scene
|
g_bTempNoTrailers = false; // Trailers not hidden in next scene
|
||||||
g_bWhoa = true; // Suspend cursor processes
|
g_bWhoa = true; // Suspend cursor processes
|
||||||
@ -651,7 +651,7 @@ void DropCursor() {
|
|||||||
for (int i = 0; i < g_numTrails; i++) {
|
for (int i = 0; i < g_numTrails; i++) {
|
||||||
if (g_ntrailData[i].trailObj != NULL) {
|
if (g_ntrailData[i].trailObj != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_ntrailData[i].trailObj);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_ntrailData[i].trailObj);
|
||||||
g_ntrailData[i].trailObj = NULL;
|
g_ntrailData[i].trailObj = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -668,9 +668,9 @@ void RestartCursor() {
|
|||||||
* pointers etc.
|
* pointers etc.
|
||||||
*/
|
*/
|
||||||
void RebootCursor() {
|
void RebootCursor() {
|
||||||
g_McurObj = g_AcurObj = NULL;
|
g_McurObj = g_AcurObj = nullptr;
|
||||||
for (int i = 0; i < MAX_TRAILERS; i++)
|
for (int i = 0; i < MAX_TRAILERS; i++)
|
||||||
g_ntrailData[i].trailObj = NULL;
|
g_ntrailData[i].trailObj = nullptr;
|
||||||
|
|
||||||
g_bHiddenCursor = g_bTempNoTrailers = g_bFrozenCursor = false;
|
g_bHiddenCursor = g_bTempNoTrailers = g_bFrozenCursor = false;
|
||||||
|
|
||||||
|
@ -305,9 +305,9 @@ static SCNHANDLE g_hWinParts = 0; // Window members and cursors' graphic data
|
|||||||
static SCNHANDLE g_flagFilm = 0; // Window members and cursors' graphic data
|
static SCNHANDLE g_flagFilm = 0; // Window members and cursors' graphic data
|
||||||
static SCNHANDLE g_configStrings[20];
|
static SCNHANDLE g_configStrings[20];
|
||||||
|
|
||||||
static INV_OBJECT *g_invObjects = NULL; // Inventory objects' data
|
static INV_OBJECT *g_invObjects = nullptr; // Inventory objects' data
|
||||||
static int g_numObjects = 0; // Number of inventory objects
|
static int g_numObjects = 0; // Number of inventory objects
|
||||||
static SCNHANDLE *g_invFilms = NULL;
|
static SCNHANDLE *g_invFilms = nullptr;
|
||||||
static bool g_bNoLanguage = false;
|
static bool g_bNoLanguage = false;
|
||||||
static DIRECTION g_initialDirection;
|
static DIRECTION g_initialDirection;
|
||||||
|
|
||||||
@ -481,7 +481,7 @@ static int g_numScenes;
|
|||||||
|
|
||||||
static int g_numEntries;
|
static int g_numEntries;
|
||||||
|
|
||||||
static PHOPPER g_pChosenScene = NULL;
|
static PHOPPER g_pChosenScene = nullptr;
|
||||||
|
|
||||||
static int g_lastChosenScene;
|
static int g_lastChosenScene;
|
||||||
static bool g_bRemember;
|
static bool g_bRemember;
|
||||||
@ -1120,7 +1120,7 @@ static void PrimeSceneHopper() {
|
|||||||
*/
|
*/
|
||||||
static void FreeSceneHopper() {
|
static void FreeSceneHopper() {
|
||||||
free(g_pHopper);
|
free(g_pHopper);
|
||||||
g_pHopper = NULL;
|
g_pHopper = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FirstScene(int first) {
|
static void FirstScene(int first) {
|
||||||
@ -1218,7 +1218,7 @@ static void DumpIconArray() {
|
|||||||
for (int i = 0; i < MAX_ICONS; i++) {
|
for (int i = 0; i < MAX_ICONS; i++) {
|
||||||
if (g_iconArray[i] != NULL) {
|
if (g_iconArray[i] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[i]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[i]);
|
||||||
g_iconArray[i] = NULL;
|
g_iconArray[i] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1230,7 +1230,7 @@ static void DumpDobjArray() {
|
|||||||
for (int i = 0; i < MAX_WCOMP; i++) {
|
for (int i = 0; i < MAX_WCOMP; i++) {
|
||||||
if (g_DobjArray[i] != NULL) {
|
if (g_DobjArray[i] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_DobjArray[i]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_DobjArray[i]);
|
||||||
g_DobjArray[i] = NULL;
|
g_DobjArray[i] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1242,7 +1242,7 @@ static void DumpObjArray() {
|
|||||||
for (int i = 0; i < MAX_WCOMP; i++) {
|
for (int i = 0; i < MAX_WCOMP; i++) {
|
||||||
if (g_objArray[i] != NULL) {
|
if (g_objArray[i] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_objArray[i]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_objArray[i]);
|
||||||
g_objArray[i] = NULL;
|
g_objArray[i] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1481,7 +1481,7 @@ static void FirstFile(int first) {
|
|||||||
|
|
||||||
if (first == 0 && i < MAX_SAVED_FILES && cd.box == saveBox) {
|
if (first == 0 && i < MAX_SAVED_FILES && cd.box == saveBox) {
|
||||||
// Blank first entry for new save
|
// Blank first entry for new save
|
||||||
cd.box[0].boxText = NULL;
|
cd.box[0].boxText = nullptr;
|
||||||
cd.modifier = j = 1;
|
cd.modifier = j = 1;
|
||||||
} else {
|
} else {
|
||||||
cd.modifier = j = 0;
|
cd.modifier = j = 0;
|
||||||
@ -1518,15 +1518,15 @@ static void InvLoadGame() {
|
|||||||
cd.selBox = NOBOX;
|
cd.selBox = NOBOX;
|
||||||
if (g_iconArray[HL3] != NULL) {
|
if (g_iconArray[HL3] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
|
||||||
g_iconArray[HL3] = NULL;
|
g_iconArray[HL3] = nullptr;
|
||||||
}
|
}
|
||||||
if (g_iconArray[HL2] != NULL) {
|
if (g_iconArray[HL2] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL2]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL2]);
|
||||||
g_iconArray[HL2] = NULL;
|
g_iconArray[HL2] = nullptr;
|
||||||
}
|
}
|
||||||
if (g_iconArray[HL1] != NULL) {
|
if (g_iconArray[HL1] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
||||||
g_iconArray[HL1] = NULL;
|
g_iconArray[HL1] = nullptr;
|
||||||
}
|
}
|
||||||
RestoreGame(rGame+cd.extraBase);
|
RestoreGame(rGame+cd.extraBase);
|
||||||
}
|
}
|
||||||
@ -1594,7 +1594,7 @@ static bool InvKeyIn(const Common::KeyState &kbd) {
|
|||||||
*/
|
*/
|
||||||
if (g_iconArray[HL3] != NULL) {
|
if (g_iconArray[HL3] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
|
||||||
g_iconArray[HL3] = NULL;
|
g_iconArray[HL3] = nullptr;
|
||||||
}
|
}
|
||||||
g_iconArray[HL3] = ObjectTextOut(
|
g_iconArray[HL3] = ObjectTextOut(
|
||||||
_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_sedit, 0,
|
_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_sedit, 0,
|
||||||
@ -1637,11 +1637,11 @@ static void Select(int i, bool force) {
|
|||||||
// Clear previous selected highlight and text
|
// Clear previous selected highlight and text
|
||||||
if (g_iconArray[HL2] != NULL) {
|
if (g_iconArray[HL2] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL2]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL2]);
|
||||||
g_iconArray[HL2] = NULL;
|
g_iconArray[HL2] = nullptr;
|
||||||
}
|
}
|
||||||
if (g_iconArray[HL3] != NULL) {
|
if (g_iconArray[HL3] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
|
||||||
g_iconArray[HL3] = NULL;
|
g_iconArray[HL3] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// New highlight box
|
// New highlight box
|
||||||
@ -2277,14 +2277,14 @@ static void InvBoxes(bool InBody, int curX, int curY) {
|
|||||||
cd.pointBox = NOBOX;
|
cd.pointBox = NOBOX;
|
||||||
if (g_iconArray[HL1] != NULL) {
|
if (g_iconArray[HL1] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
||||||
g_iconArray[HL1] = NULL;
|
g_iconArray[HL1] = nullptr;
|
||||||
}
|
}
|
||||||
} else if (index != cd.pointBox) {
|
} else if (index != cd.pointBox) {
|
||||||
cd.pointBox = index;
|
cd.pointBox = index;
|
||||||
// A new box is pointed to - high-light it
|
// A new box is pointed to - high-light it
|
||||||
if (g_iconArray[HL1] != NULL) {
|
if (g_iconArray[HL1] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
||||||
g_iconArray[HL1] = NULL;
|
g_iconArray[HL1] = nullptr;
|
||||||
}
|
}
|
||||||
if ((cd.box[cd.pointBox].boxType == ARSBUT && cd.selBox != NOBOX) ||
|
if ((cd.box[cd.pointBox].boxType == ARSBUT && cd.selBox != NOBOX) ||
|
||||||
///* I don't agree */ cd.box[cd.pointBox].boxType == RGROUP ||
|
///* I don't agree */ cd.box[cd.pointBox].boxType == RGROUP ||
|
||||||
@ -2396,7 +2396,7 @@ static void ButtonToggle(CORO_PARAM, CONFBOX *box) {
|
|||||||
// Remove hilight image
|
// Remove hilight image
|
||||||
if (g_iconArray[HL1] != NULL) {
|
if (g_iconArray[HL1] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
||||||
g_iconArray[HL1] = NULL;
|
g_iconArray[HL1] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hold normal image for 1 frame
|
// Hold normal image for 1 frame
|
||||||
@ -2438,7 +2438,7 @@ static void ButtonToggle(CORO_PARAM, CONFBOX *box) {
|
|||||||
|
|
||||||
// New state, normal
|
// New state, normal
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
|
||||||
g_iconArray[HL1] = NULL;
|
g_iconArray[HL1] = nullptr;
|
||||||
|
|
||||||
// Hold normal image for 1 frame
|
// Hold normal image for 1 frame
|
||||||
CORO_SLEEP(1);
|
CORO_SLEEP(1);
|
||||||
@ -3132,7 +3132,7 @@ static void ConstructInventory(InventoryType filling) {
|
|||||||
for (int i = 0; i < MAX_WCOMP; i++) {
|
for (int i = 0; i < MAX_WCOMP; i++) {
|
||||||
if (retObj[i] != NULL) {
|
if (retObj[i] != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), retObj[i]);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), retObj[i]);
|
||||||
retObj[i] = NULL;
|
retObj[i] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3312,7 +3312,7 @@ static void ConstructInventory(InventoryType filling) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g_ino == INV_CONV) {
|
if (g_ino == INV_CONV) {
|
||||||
g_SlideObject = NULL;
|
g_SlideObject = nullptr;
|
||||||
|
|
||||||
if (TinselV2) {
|
if (TinselV2) {
|
||||||
// !!!!! MAGIC NUMBER ALERT !!!!!
|
// !!!!! MAGIC NUMBER ALERT !!!!!
|
||||||
|
@ -150,7 +150,7 @@ bool GotoCD() {
|
|||||||
bool TinselFile::_warningShown = false;
|
bool TinselFile::_warningShown = false;
|
||||||
|
|
||||||
TinselFile::TinselFile() : ReadStreamEndian(TinselV1Mac) {
|
TinselFile::TinselFile() : ReadStreamEndian(TinselV1Mac) {
|
||||||
_stream = NULL;
|
_stream = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
TinselFile::~TinselFile() {
|
TinselFile::~TinselFile() {
|
||||||
@ -189,7 +189,7 @@ bool TinselFile::open(const Common::String &filename) {
|
|||||||
|
|
||||||
void TinselFile::close() {
|
void TinselFile::close() {
|
||||||
delete _stream;
|
delete _stream;
|
||||||
_stream = NULL;
|
_stream = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 TinselFile::pos() const {
|
int32 TinselFile::pos() const {
|
||||||
|
@ -58,8 +58,8 @@ uint8* psxPJCRLEUnwinder(uint16 imageWidth, uint16 imageHeight, uint8 *srcIdx) {
|
|||||||
|
|
||||||
uint16 controlData;
|
uint16 controlData;
|
||||||
|
|
||||||
uint8* dstIdx = NULL;
|
uint8* dstIdx = nullptr;
|
||||||
uint8* destinationBuffer = NULL;
|
uint8* destinationBuffer = nullptr;
|
||||||
|
|
||||||
if (!imageWidth || !imageHeight)
|
if (!imageWidth || !imageHeight)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -673,7 +673,7 @@ static void WrtAll(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool applyClippi
|
|||||||
static void PackedWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP,
|
static void PackedWrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP,
|
||||||
bool applyClipping, bool horizFlipped, int packingType) {
|
bool applyClipping, bool horizFlipped, int packingType) {
|
||||||
uint8 numColors = 0;
|
uint8 numColors = 0;
|
||||||
uint8 *colorTable = NULL;
|
uint8 *colorTable = nullptr;
|
||||||
int topClip = 0;
|
int topClip = 0;
|
||||||
int xOffset = 0;
|
int xOffset = 0;
|
||||||
int numBytes, color;
|
int numBytes, color;
|
||||||
@ -820,7 +820,7 @@ void UpdateScreenRect(const Common::Rect &pClip) {
|
|||||||
* Draws the specified object onto the screen surface buffer
|
* Draws the specified object onto the screen surface buffer
|
||||||
*/
|
*/
|
||||||
void DrawObject(DRAWOBJECT *pObj) {
|
void DrawObject(DRAWOBJECT *pObj) {
|
||||||
uint8 *srcPtr = NULL;
|
uint8 *srcPtr = nullptr;
|
||||||
uint8 *destPtr;
|
uint8 *destPtr;
|
||||||
byte psxMapperTable[16];
|
byte psxMapperTable[16];
|
||||||
|
|
||||||
@ -836,7 +836,7 @@ void DrawObject(DRAWOBJECT *pObj) {
|
|||||||
if ((pObj->flags & DMA_CONST) == 0) {
|
if ((pObj->flags & DMA_CONST) == 0) {
|
||||||
if (TinselV2) {
|
if (TinselV2) {
|
||||||
srcPtr = (byte *)LockMem(pObj->hBits);
|
srcPtr = (byte *)LockMem(pObj->hBits);
|
||||||
pObj->charBase = NULL;
|
pObj->charBase = nullptr;
|
||||||
pObj->transOffset = 0;
|
pObj->transOffset = 0;
|
||||||
} else {
|
} else {
|
||||||
byte *p = (byte *)LockMem(pObj->hBits & HANDLEMASK);
|
byte *p = (byte *)LockMem(pObj->hBits & HANDLEMASK);
|
||||||
|
@ -126,7 +126,7 @@ void SetupHandleTable() {
|
|||||||
g_handleTable[i].filesize = f.readUint32();
|
g_handleTable[i].filesize = f.readUint32();
|
||||||
// The pointer should always be NULL. We don't
|
// The pointer should always be NULL. We don't
|
||||||
// need to read that from the file.
|
// need to read that from the file.
|
||||||
g_handleTable[i]._node = NULL;
|
g_handleTable[i]._node= nullptr;
|
||||||
f.seek(4, SEEK_CUR);
|
f.seek(4, SEEK_CUR);
|
||||||
// For Discworld 2, read in the flags2 field
|
// For Discworld 2, read in the flags2 field
|
||||||
g_handleTable[i].flags2 = t2Flag ? f.readUint32() : 0;
|
g_handleTable[i].flags2 = t2Flag ? f.readUint32() : 0;
|
||||||
@ -160,7 +160,7 @@ void SetupHandleTable() {
|
|||||||
}
|
}
|
||||||
#ifdef BODGE
|
#ifdef BODGE
|
||||||
else if ((pH->filesize & FSIZE_MASK) == 8) {
|
else if ((pH->filesize & FSIZE_MASK) == 8) {
|
||||||
pH->_node = NULL;
|
pH->_node= nullptr;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
@ -175,10 +175,10 @@ void SetupHandleTable() {
|
|||||||
|
|
||||||
void FreeHandleTable() {
|
void FreeHandleTable() {
|
||||||
free(g_handleTable);
|
free(g_handleTable);
|
||||||
g_handleTable = NULL;
|
g_handleTable= nullptr;
|
||||||
|
|
||||||
delete g_cdGraphStream;
|
delete g_cdGraphStream;
|
||||||
g_cdGraphStream = NULL;
|
g_cdGraphStream= nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -113,7 +113,7 @@ void MemoryInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// null the last mnode
|
// null the last mnode
|
||||||
g_mnodeList[NUM_MNODES - 1].pNext = NULL;
|
g_mnodeList[NUM_MNODES - 1].pNext = nullptr;
|
||||||
|
|
||||||
// clear list of fixed memory nodes
|
// clear list of fixed memory nodes
|
||||||
memset(g_s_fixedMnodesList, 0, sizeof(g_s_fixedMnodesList));
|
memset(g_s_fixedMnodesList, 0, sizeof(g_s_fixedMnodesList));
|
||||||
@ -202,7 +202,7 @@ static bool HeapCompact(long size) {
|
|||||||
|
|
||||||
// find the oldest discardable block
|
// find the oldest discardable block
|
||||||
oldest = DwGetCurrentTime();
|
oldest = DwGetCurrentTime();
|
||||||
pOldest = NULL;
|
pOldest = nullptr;
|
||||||
for (pCur = pHeap->pNext; pCur != pHeap; pCur = pCur->pNext) {
|
for (pCur = pHeap->pNext; pCur != pHeap; pCur = pCur->pNext) {
|
||||||
if (pCur->flags == DWM_USED) {
|
if (pCur->flags == DWM_USED) {
|
||||||
// found a non-discarded discardable block
|
// found a non-discarded discardable block
|
||||||
@ -359,7 +359,7 @@ void MemoryDiscard(MEM_NODE *pMemNode) {
|
|||||||
|
|
||||||
// mark the node as discarded
|
// mark the node as discarded
|
||||||
pMemNode->flags |= DWM_DISCARDED;
|
pMemNode->flags |= DWM_DISCARDED;
|
||||||
pMemNode->pBaseAddr = NULL;
|
pMemNode->pBaseAddr = nullptr;
|
||||||
pMemNode->size = 0;
|
pMemNode->size = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ OBJECT *MultiInitObject(const MULTI_INIT *pInitTbl) {
|
|||||||
|
|
||||||
obj_init.hObjImg = READ_32(pFrame); // first objects shape
|
obj_init.hObjImg = READ_32(pFrame); // first objects shape
|
||||||
} else { // this must be a animation list for a NULL object
|
} else { // this must be a animation list for a NULL object
|
||||||
pFrame = NULL;
|
pFrame = nullptr;
|
||||||
obj_init.hObjImg = 0; // first objects shape
|
obj_init.hObjImg = 0; // first objects shape
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ OBJECT *MultiInitObject(const MULTI_INIT *pInitTbl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// null end of list for final object
|
// null end of list for final object
|
||||||
pObj->pSlave = NULL;
|
pObj->pSlave = nullptr;
|
||||||
|
|
||||||
// return master object
|
// return master object
|
||||||
return pFirst;
|
return pFirst;
|
||||||
|
@ -352,7 +352,7 @@ void Music::OpenMidiFiles() {
|
|||||||
|
|
||||||
void Music::DeleteMidiBuffer() {
|
void Music::DeleteMidiBuffer() {
|
||||||
free(_midiBuffer.pDat);
|
free(_midiBuffer.pDat);
|
||||||
_midiBuffer.pDat = NULL;
|
_midiBuffer.pDat = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Music::CurrentMidiFacts(SCNHANDLE* pMidi, bool* pLoop) {
|
void Music::CurrentMidiFacts(SCNHANDLE* pMidi, bool* pLoop) {
|
||||||
@ -412,7 +412,7 @@ void dumpMusic() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
MidiMusicPlayer::MidiMusicPlayer(TinselEngine *vm) {
|
MidiMusicPlayer::MidiMusicPlayer(TinselEngine *vm) {
|
||||||
_driver = NULL;
|
_driver = nullptr;
|
||||||
_milesAudioMode = false;
|
_milesAudioMode = false;
|
||||||
bool milesAudioEnabled = false;
|
bool milesAudioEnabled = false;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ static int maxObj = 0;
|
|||||||
|
|
||||||
void FreeObjectList() {
|
void FreeObjectList() {
|
||||||
free(objectList);
|
free(objectList);
|
||||||
objectList = NULL;
|
objectList= nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,7 +85,7 @@ void KillAllObjects() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// null the last object
|
// null the last object
|
||||||
objectList[NUM_OBJECTS - 1].pNext = NULL;
|
objectList[NUM_OBJECTS - 1].pNext= nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ void CopyObject(OBJECT *pDest, OBJECT *pSrc) {
|
|||||||
pDest->flags |= DMA_CHANGED;
|
pDest->flags |= DMA_CHANGED;
|
||||||
|
|
||||||
// null the links
|
// null the links
|
||||||
pDest->pNext = pDest->pSlave = NULL;
|
pDest->pNext = pDest->pSlave= nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -370,7 +370,7 @@ OBJECT *InitObject(const OBJ_INIT *pInitTbl) {
|
|||||||
// get pointer to image
|
// get pointer to image
|
||||||
if (pInitTbl->hObjImg) {
|
if (pInitTbl->hObjImg) {
|
||||||
int aniX, aniY; // objects animation offsets
|
int aniX, aniY; // objects animation offsets
|
||||||
PALQ *pPalQ = NULL; // palette queue pointer
|
PALQ *pPalQ= nullptr; // palette queue pointer
|
||||||
const IMAGE *pImg = (const IMAGE *)LockMem(pInitTbl->hObjImg); // handle to image
|
const IMAGE *pImg = (const IMAGE *)LockMem(pInitTbl->hObjImg); // handle to image
|
||||||
|
|
||||||
if (pImg->hImgPal) {
|
if (pImg->hImgPal) {
|
||||||
|
@ -470,10 +470,10 @@ void RegisterGlobals(int num) {
|
|||||||
|
|
||||||
void FreeGlobals() {
|
void FreeGlobals() {
|
||||||
free(g_pGlobals);
|
free(g_pGlobals);
|
||||||
g_pGlobals = NULL;
|
g_pGlobals= nullptr;
|
||||||
|
|
||||||
free(g_icList);
|
free(g_icList);
|
||||||
g_icList = NULL;
|
g_icList= nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -491,9 +491,9 @@ void syncGlobInfo(Common::Serializer &s) {
|
|||||||
void INT_CONTEXT::syncWithSerializer(Common::Serializer &s) {
|
void INT_CONTEXT::syncWithSerializer(Common::Serializer &s) {
|
||||||
if (s.isLoading()) {
|
if (s.isLoading()) {
|
||||||
// Null out the pointer fields
|
// Null out the pointer fields
|
||||||
pProc = NULL;
|
pProc= nullptr;
|
||||||
code = NULL;
|
code= nullptr;
|
||||||
pinvo = NULL;
|
pinvo= nullptr;
|
||||||
}
|
}
|
||||||
// Write out used fields
|
// Write out used fields
|
||||||
s.syncAsUint32LE(GSort);
|
s.syncAsUint32LE(GSort);
|
||||||
@ -531,7 +531,7 @@ static int32 GetBytes(const byte *scriptCode, const WorkaroundEntry* &wkEntry, i
|
|||||||
if (ip >= wkEntry->numBytes) {
|
if (ip >= wkEntry->numBytes) {
|
||||||
// Finished the workaround
|
// Finished the workaround
|
||||||
ip = wkEntry->ip;
|
ip = wkEntry->ip;
|
||||||
wkEntry = NULL;
|
wkEntry= nullptr;
|
||||||
} else {
|
} else {
|
||||||
code = wkEntry->script;
|
code = wkEntry->script;
|
||||||
}
|
}
|
||||||
@ -606,7 +606,7 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (wkEntry->script == NULL)
|
if (wkEntry->script == NULL)
|
||||||
wkEntry = NULL;
|
wkEntry= nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte opcode = (byte)GetBytes(ic->code, wkEntry, ip, 0);
|
byte opcode = (byte)GetBytes(ic->code, wkEntry, ip, 0);
|
||||||
@ -724,7 +724,7 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
|
|||||||
case OP_JUMP: // unconditional jump
|
case OP_JUMP: // unconditional jump
|
||||||
|
|
||||||
ip = Fetch(opcode, ic->code, wkEntry, ip);
|
ip = Fetch(opcode, ic->code, wkEntry, ip);
|
||||||
wkEntry = NULL; // In case a jump occurs from a workaround
|
wkEntry= nullptr; // In case a jump occurs from a workaround
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OP_JMPFALSE: // conditional jump
|
case OP_JMPFALSE: // conditional jump
|
||||||
@ -733,7 +733,7 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
|
|||||||
if (ic->stack[ic->sp--] == 0) {
|
if (ic->stack[ic->sp--] == 0) {
|
||||||
// condition satisfied - do the jump
|
// condition satisfied - do the jump
|
||||||
ip = tmp;
|
ip = tmp;
|
||||||
wkEntry = NULL; // In case a jump occurs from a workaround
|
wkEntry= nullptr; // In case a jump occurs from a workaround
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -743,7 +743,7 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
|
|||||||
if (ic->stack[ic->sp--] != 0) {
|
if (ic->stack[ic->sp--] != 0) {
|
||||||
// condition satisfied - do the jump
|
// condition satisfied - do the jump
|
||||||
ip = tmp;
|
ip = tmp;
|
||||||
wkEntry = NULL; // In case a jump occurs from a workaround
|
wkEntry= nullptr; // In case a jump occurs from a workaround
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -120,11 +120,11 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
|
|||||||
// _ctx->prevOver = -1;
|
// _ctx->prevOver = -1;
|
||||||
_ctx->prevString = -1;
|
_ctx->prevString = -1;
|
||||||
|
|
||||||
_ctx->cpText = NULL;
|
_ctx->cpText = nullptr;
|
||||||
_ctx->cpathText = NULL;
|
_ctx->cpathText = nullptr;
|
||||||
_ctx->rpText = NULL;
|
_ctx->rpText = nullptr;
|
||||||
// _ctx->opText = NULL;
|
// _ctx->opText = nullptr;
|
||||||
_ctx->spText = NULL;
|
_ctx->spText = nullptr;
|
||||||
|
|
||||||
|
|
||||||
int aniX, aniY; // cursor/lead actor position
|
int aniX, aniY; // cursor/lead actor position
|
||||||
@ -151,7 +151,7 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
|
|||||||
}
|
}
|
||||||
if (_ctx->cpathText) {
|
if (_ctx->cpathText) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->cpathText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->cpathText);
|
||||||
_ctx->cpathText = NULL;
|
_ctx->cpathText = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// New text objects
|
// New text objects
|
||||||
@ -414,7 +414,7 @@ static bool ActorTag(int curX, int curY, HotSpotTag *pTag, OBJECT **ppText) {
|
|||||||
assert(*ppText);
|
assert(*ppText);
|
||||||
MultiSetZPosition(*ppText, Z_TAG_TEXT);
|
MultiSetZPosition(*ppText, Z_TAG_TEXT);
|
||||||
} else
|
} else
|
||||||
*ppText = NULL;
|
*ppText = nullptr;
|
||||||
} else if (*ppText) {
|
} else if (*ppText) {
|
||||||
// Same actor, maintain tag position
|
// Same actor, maintain tag position
|
||||||
GetActorTagPos(actor, &newX, &newY, false);
|
GetActorTagPos(actor, &newX, &newY, false);
|
||||||
@ -512,7 +512,7 @@ static bool PolyTag(HotSpotTag *pTag, OBJECT **ppText) {
|
|||||||
if (hp != GetTaggedPoly()) {
|
if (hp != GetTaggedPoly()) {
|
||||||
if (*ppText) {
|
if (*ppText) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), *ppText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), *ppText);
|
||||||
*ppText = NULL;
|
*ppText = nullptr;
|
||||||
}
|
}
|
||||||
*pTag = POLY_HOTSPOT_TAG;
|
*pTag = POLY_HOTSPOT_TAG;
|
||||||
SaveTaggedActor(0); // No tagged actor
|
SaveTaggedActor(0); // No tagged actor
|
||||||
@ -553,7 +553,7 @@ static bool PolyTag(HotSpotTag *pTag, OBJECT **ppText) {
|
|||||||
|
|
||||||
if (strLen == 0)
|
if (strLen == 0)
|
||||||
// No valid string returned, so leave ppText as NULL
|
// No valid string returned, so leave ppText as NULL
|
||||||
ppText = NULL;
|
ppText = nullptr;
|
||||||
else if (TinselV2 && !PolyTagFollowsCursor(hp)) {
|
else if (TinselV2 && !PolyTagFollowsCursor(hp)) {
|
||||||
// May have buggered cursor
|
// May have buggered cursor
|
||||||
EndCursorFollowed();
|
EndCursorFollowed();
|
||||||
@ -646,7 +646,7 @@ void TagProcess(CORO_PARAM, const void *) {
|
|||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
_ctx->Tag = NO_HOTSPOT_TAG;
|
_ctx->Tag = NO_HOTSPOT_TAG;
|
||||||
|
|
||||||
SaveTaggedActor(0); // No tagged actor yet
|
SaveTaggedActor(0); // No tagged actor yet
|
||||||
@ -663,7 +663,7 @@ void TagProcess(CORO_PARAM, const void *) {
|
|||||||
// Nothing tagged. Remove tag, if there is one
|
// Nothing tagged. Remove tag, if there is one
|
||||||
if (_ctx->pText) {
|
if (_ctx->pText) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
|
|
||||||
if (TinselV2)
|
if (TinselV2)
|
||||||
// May have buggered cursor
|
// May have buggered cursor
|
||||||
@ -678,7 +678,7 @@ void TagProcess(CORO_PARAM, const void *) {
|
|||||||
if (_ctx->pText) {
|
if (_ctx->pText) {
|
||||||
// kill current text objects
|
// kill current text objects
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
_ctx->Tag = NO_HOTSPOT_TAG;
|
_ctx->Tag = NO_HOTSPOT_TAG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ static void t1PlayReel(CORO_PARAM, const PPINIT *ppi) {
|
|||||||
|
|
||||||
_ctx->lifeNoMatter = false;
|
_ctx->lifeNoMatter = false;
|
||||||
_ctx->replaced = false;
|
_ctx->replaced = false;
|
||||||
_ctx->pActor = NULL;
|
_ctx->pActor= nullptr;
|
||||||
bNewMover = false;
|
bNewMover = false;
|
||||||
|
|
||||||
pfilm = (const FILM *)LockMem(ppi->hFilm);
|
pfilm = (const FILM *)LockMem(ppi->hFilm);
|
||||||
|
@ -1803,7 +1803,7 @@ void InitPolygons(SCNHANDLE ph, int numPoly, bool bRestart) {
|
|||||||
for (int i = 0; i < noofPolys; i++) {
|
for (int i = 0; i < noofPolys; i++) {
|
||||||
if (Polys[i]) {
|
if (Polys[i]) {
|
||||||
Polys[i]->pointState = PS_NOT_POINTING;
|
Polys[i]->pointState = PS_NOT_POINTING;
|
||||||
Polys[i] = NULL;
|
Polys[i]= nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1889,17 +1889,17 @@ void InitPolygons(SCNHANDLE ph, int numPoly, bool bRestart) {
|
|||||||
void DropPolygons() {
|
void DropPolygons() {
|
||||||
pathsOnRoute = 0;
|
pathsOnRoute = 0;
|
||||||
memset(RoutePaths, 0, sizeof(RoutePaths));
|
memset(RoutePaths, 0, sizeof(RoutePaths));
|
||||||
RouteEnd = NULL;
|
RouteEnd= nullptr;
|
||||||
|
|
||||||
for (int i = 0; i < noofPolys; i++) {
|
for (int i = 0; i < noofPolys; i++) {
|
||||||
if (Polys[i]) {
|
if (Polys[i]) {
|
||||||
Polys[i]->pointState = PS_NOT_POINTING;
|
Polys[i]->pointState = PS_NOT_POINTING;
|
||||||
Polys[i] = NULL;
|
Polys[i]= nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
noofPolys = 0;
|
noofPolys = 0;
|
||||||
free(Polygons);
|
free(Polygons);
|
||||||
Polygons = NULL;
|
Polygons= nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ void KillMover(PMOVER pMover) {
|
|||||||
if (pMover->bActive) {
|
if (pMover->bActive) {
|
||||||
pMover->bActive = false;
|
pMover->bActive = false;
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_WORLD), pMover->actorObj);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_WORLD), pMover->actorObj);
|
||||||
pMover->actorObj = NULL;
|
pMover->actorObj = nullptr;
|
||||||
assert(CoroScheduler.getCurrentProcess() != pMover->pProc);
|
assert(CoroScheduler.getCurrentProcess() != pMover->pProc);
|
||||||
CoroScheduler.killProcess(pMover->pProc);
|
CoroScheduler.killProcess(pMover->pProc);
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ void UnHideMover(PMOVER pMover) {
|
|||||||
*/
|
*/
|
||||||
static void InitMover(PMOVER pMover) {
|
static void InitMover(PMOVER pMover) {
|
||||||
pMover->bActive = false;
|
pMover->bActive = false;
|
||||||
pMover->actorObj = NULL;
|
pMover->actorObj = nullptr;
|
||||||
pMover->objX = pMover->objY = 0;
|
pMover->objX = pMover->objY = 0;
|
||||||
|
|
||||||
pMover->hRpath = NOPOLY;
|
pMover->hRpath = NOPOLY;
|
||||||
|
@ -547,7 +547,7 @@ static void SaveFailure(Common::OutSaveFile *f) {
|
|||||||
delete f;
|
delete f;
|
||||||
_vm->getSaveFileMan()->removeSavefile(g_SaveSceneName);
|
_vm->getSaveFileMan()->removeSavefile(g_SaveSceneName);
|
||||||
}
|
}
|
||||||
g_SaveSceneName = NULL; // Invalidate save name
|
g_SaveSceneName= nullptr; // Invalidate save name
|
||||||
GUI::MessageDialog dialog(_("Failed to save game to file."));
|
GUI::MessageDialog dialog(_("Failed to save game to file."));
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
}
|
}
|
||||||
@ -623,7 +623,7 @@ static void DoSave() {
|
|||||||
|
|
||||||
f->finalize();
|
f->finalize();
|
||||||
delete f;
|
delete f;
|
||||||
g_SaveSceneName = NULL; // Invalidate save name
|
g_SaveSceneName= nullptr; // Invalidate save name
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,7 +86,7 @@ static int g_savedSceneCount = 0;
|
|||||||
static bool g_bNotDoneYet = false;
|
static bool g_bNotDoneYet = false;
|
||||||
|
|
||||||
//static SAVED_DATA ssData[MAX_NEST];
|
//static SAVED_DATA ssData[MAX_NEST];
|
||||||
static SAVED_DATA *g_ssData = NULL;
|
static SAVED_DATA *g_ssData = nullptr;
|
||||||
static SAVED_DATA g_sgData;
|
static SAVED_DATA g_sgData;
|
||||||
|
|
||||||
static SAVED_DATA *g_rsd = 0;
|
static SAVED_DATA *g_rsd = 0;
|
||||||
@ -160,7 +160,7 @@ void InitializeSaveScenes() {
|
|||||||
|
|
||||||
void FreeSaveScenes() {
|
void FreeSaveScenes() {
|
||||||
free(g_ssData);
|
free(g_ssData);
|
||||||
g_ssData = NULL;
|
g_ssData = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -237,7 +237,7 @@ bool GlobalProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWai
|
|||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
uint32 i; // Loop counter
|
uint32 i; // Loop counter
|
||||||
_ctx->pProc = NULL;
|
_ctx->pProc= nullptr;
|
||||||
|
|
||||||
for (i = 0; i < g_numGlobalProcess; ++i) {
|
for (i = 0; i < g_numGlobalProcess; ++i) {
|
||||||
if (g_pGlobalProcess[i].processId == procID) {
|
if (g_pGlobalProcess[i].processId == procID) {
|
||||||
|
@ -90,7 +90,7 @@ void ChangeLanguage(LANGUAGE newLang) {
|
|||||||
|
|
||||||
// free the previous buffer
|
// free the previous buffer
|
||||||
free(g_textBuffer);
|
free(g_textBuffer);
|
||||||
g_textBuffer = NULL;
|
g_textBuffer = nullptr;
|
||||||
|
|
||||||
// Try and open the specified language file. If it fails, and the language
|
// Try and open the specified language file. If it fails, and the language
|
||||||
// isn't English, try falling back on opening 'english.txt' - some foreign
|
// isn't English, try falling back on opening 'english.txt' - some foreign
|
||||||
@ -354,7 +354,7 @@ int SubStringCount(int id) {
|
|||||||
|
|
||||||
void FreeTextBuffer() {
|
void FreeTextBuffer() {
|
||||||
free(g_textBuffer);
|
free(g_textBuffer);
|
||||||
g_textBuffer = NULL;
|
g_textBuffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,7 +121,7 @@ OBJECT *ObjectTextOut(OBJECT **pList, char *szStr, int color,
|
|||||||
const FONT *pFont = (const FONT *)LockMem(hFont);
|
const FONT *pFont = (const FONT *)LockMem(hFont);
|
||||||
|
|
||||||
// init head of text list
|
// init head of text list
|
||||||
pFirst = NULL;
|
pFirst = nullptr;
|
||||||
|
|
||||||
// get image for capital W
|
// get image for capital W
|
||||||
assert(pFont->fontDef[(int)'W']);
|
assert(pFont->fontDef[(int)'W']);
|
||||||
|
@ -1868,7 +1868,7 @@ static void Print(CORO_PARAM, int x, int y, SCNHANDLE text, int time, bool bSust
|
|||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
_ctx->bSample = false;
|
_ctx->bSample = false;
|
||||||
|
|
||||||
// Don't do it if it's not wanted
|
// Don't do it if it's not wanted
|
||||||
@ -2105,7 +2105,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const INV_OBJECT *pinvo,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
|
|
||||||
if (TinselV2) {
|
if (TinselV2) {
|
||||||
if (event == POINTED) {
|
if (event == POINTED) {
|
||||||
@ -2124,7 +2124,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const INV_OBJECT *pinvo,
|
|||||||
if (g_bNotPointedRunning) {
|
if (g_bNotPointedRunning) {
|
||||||
// Delete the text, and wait for the all-clear
|
// Delete the text, and wait for the all-clear
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
|
|
||||||
while (g_bNotPointedRunning)
|
while (g_bNotPointedRunning)
|
||||||
CORO_SLEEP(1);
|
CORO_SLEEP(1);
|
||||||
@ -2242,7 +2242,7 @@ static void PrintObjPointed(CORO_PARAM, const SCNHANDLE text, const INV_OBJECT *
|
|||||||
if (g_bNotPointedRunning) {
|
if (g_bNotPointedRunning) {
|
||||||
// Delete the text, and wait for the all-clear
|
// Delete the text, and wait for the all-clear
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), pText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), pText);
|
||||||
pText = NULL;
|
pText = nullptr;
|
||||||
while (g_bNotPointedRunning)
|
while (g_bNotPointedRunning)
|
||||||
CORO_SLEEP(1);
|
CORO_SLEEP(1);
|
||||||
|
|
||||||
@ -3173,7 +3173,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x
|
|||||||
_ctx->Loffset = 0;
|
_ctx->Loffset = 0;
|
||||||
_ctx->Toffset = 0;
|
_ctx->Toffset = 0;
|
||||||
_ctx->ticks = 0;
|
_ctx->ticks = 0;
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
|
|
||||||
// If waiting is enabled, wait for ongoing scroll
|
// If waiting is enabled, wait for ongoing scroll
|
||||||
if (TinselV2 && SysVar(SV_SPEECHWAITS))
|
if (TinselV2 && SysVar(SV_SPEECHWAITS))
|
||||||
@ -3297,7 +3297,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x
|
|||||||
* Display the text.
|
* Display the text.
|
||||||
*/
|
*/
|
||||||
_ctx->bSample = _ctx->bSamples;
|
_ctx->bSample = _ctx->bSamples;
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
|
|
||||||
if (_vm->_config->isJapanMode()) {
|
if (_vm->_config->isJapanMode()) {
|
||||||
_ctx->ticks = JAP_TEXT_TIME;
|
_ctx->ticks = JAP_TEXT_TIME;
|
||||||
@ -3443,7 +3443,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x
|
|||||||
|
|
||||||
if (_ctx->pText != NULL) {
|
if (_ctx->pText != NULL) {
|
||||||
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
|
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
|
||||||
_ctx->pText = NULL;
|
_ctx->pText = nullptr;
|
||||||
}
|
}
|
||||||
if (TinselV2 && _ctx->bSample)
|
if (TinselV2 && _ctx->bSample)
|
||||||
_vm->_sound->stopSpecSample(hText, _ctx->sub);
|
_vm->_sound->stopSpecSample(hText, _ctx->sub);
|
||||||
|
@ -825,7 +825,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
|
|||||||
_vm = this;
|
_vm = this;
|
||||||
|
|
||||||
_gameId = 0;
|
_gameId = 0;
|
||||||
_driver = NULL;
|
_driver = nullptr;
|
||||||
|
|
||||||
_config = new Config(this);
|
_config = new Config(this);
|
||||||
|
|
||||||
@ -843,7 +843,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
|
|||||||
|
|
||||||
_mousePos.x = 0;
|
_mousePos.x = 0;
|
||||||
_mousePos.y = 0;
|
_mousePos.y = 0;
|
||||||
_keyHandler = NULL;
|
_keyHandler = nullptr;
|
||||||
_dosPlayerDir = 0;
|
_dosPlayerDir = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ static void TerminateProcess(Common::PROCESS *tProc) {
|
|||||||
// Release tokens held by the process
|
// Release tokens held by the process
|
||||||
for (int i = 0; i < NUMTOKENS; i++) {
|
for (int i = 0; i < NUMTOKENS; i++) {
|
||||||
if (g_tokens[i].proc == tProc) {
|
if (g_tokens[i].proc == tProc) {
|
||||||
g_tokens[i].proc = NULL;
|
g_tokens[i].proc = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ void GetControlToken() {
|
|||||||
*/
|
*/
|
||||||
void FreeControlToken() {
|
void FreeControlToken() {
|
||||||
// Allow anyone to free TOKEN_CONTROL
|
// Allow anyone to free TOKEN_CONTROL
|
||||||
g_tokens[TOKEN_CONTROL].proc = NULL;
|
g_tokens[TOKEN_CONTROL].proc = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ void FreeToken(int which) {
|
|||||||
|
|
||||||
assert(g_tokens[which].proc == CoroScheduler.getCurrentProcess()); // we'd have been killed if some other proc had taken this token
|
assert(g_tokens[which].proc == CoroScheduler.getCurrentProcess()); // we'd have been killed if some other proc had taken this token
|
||||||
|
|
||||||
g_tokens[which].proc = NULL;
|
g_tokens[which].proc = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -119,7 +119,7 @@ bool TestToken(int which) {
|
|||||||
*/
|
*/
|
||||||
void FreeAllTokens() {
|
void FreeAllTokens() {
|
||||||
for (int i = 0; i < NUMTOKENS; i++) {
|
for (int i = 0; i < NUMTOKENS; i++) {
|
||||||
g_tokens[i].proc = NULL;
|
g_tokens[i].proc = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user