TINSEL: Replace usage of NULL with nullptr

This commit is contained in:
Filippos Karapetis 2020-02-23 15:43:48 +02:00
parent 20cf13074d
commit 63ae50e790
25 changed files with 123 additions and 123 deletions

View File

@ -136,7 +136,7 @@ struct TAGACTOR {
typedef TAGACTOR *PTAGACTOR;
static ACTORINFO *actorInfo = NULL;
static ACTORINFO *actorInfo = nullptr;
static COLORREF defaultColor = 0; // Text color
@ -150,7 +150,7 @@ static TAGACTOR taggedActors[MAX_TAGACTORS];
static int numTaggedActors = 0;
static uint8 *zFactors = NULL;
static uint8 *zFactors = nullptr;
static Z_POSITIONS zPositions[NUM_ZPOSITIONS];
@ -198,10 +198,10 @@ void RegisterActors(int num) {
void FreeActors() {
free(actorInfo);
actorInfo = NULL;
actorInfo = nullptr;
if (TinselV2) {
free(zFactors);
zFactors = NULL;
zFactors = nullptr;
}
}
@ -357,7 +357,7 @@ void ActorEvent(int ano, TINSEL_EVENT event, PLR_EVENT be) {
atp.id = ano;
atp.event = event;
atp.bev = be;
atp.pic = NULL;
atp.pic = nullptr;
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].x = 0;
actorInfo[hActorId - 1].y = 0;
actorInfo[hActorId - 1].presReel = NULL;
actorInfo[hActorId - 1].presReel = nullptr;
actorInfo[hActorId - 1].presFilm = 0;
actorInfo[hActorId - 1].presObj = NULL;
actorInfo[hActorId - 1].presObj = nullptr;
// Store current scene's parameters for this actor
actorInfo[hActorId - 1].mtype = FROM_32(as->masking);
@ -502,9 +502,9 @@ void DropActors() {
} else {
// In Tinsel v1, only certain fields get reset
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].presObj = NULL; // No object
actorInfo[i].presObj = nullptr; // No object
actorInfo[i].x = 0; // No position
actorInfo[i].y = 0; // ditto
@ -1450,7 +1450,7 @@ void dwEndActor(int ano) {
// Make play.c think it's been replaced
// 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.
// so re-instate it and de-register the object
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
if (actorInfo[ano-1].presObjs[i] != NULL) {
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]);
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
for (i = 0; i < MAX_REELS; i++) {
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;
break;
}

View File

@ -95,7 +95,7 @@ void Background::InitBackground() {
pPlayfield->fieldYvel = intToFrac(0);
// clear playfield display list
pPlayfield->pDispList = NULL;
pPlayfield->pDispList = nullptr;
// clear playfield moved flag
pPlayfield->bMoved = false;
@ -298,7 +298,7 @@ void Background::SetBackPal(SCNHANDLE hPal) {
}
void Background::DropBackground() {
_pBG[0] = NULL; // No background
_pBG[0] = nullptr; // No background
if (!TinselV2)
_hBgPal = 0; // No background palette

View File

@ -441,7 +441,7 @@ void BMVPlayer::FettleMovieText() {
if (texts[i].pText) {
if (currentFrame > texts[i].dieFrame) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), texts[i].pText);
texts[i].pText = NULL;
texts[i].pText = nullptr;
} else {
MultiForceRedraw(texts[i].pText);
bIsText = true;
@ -725,17 +725,17 @@ void BMVPlayer::FinishBMV() {
// Release the data buffer
free(bigBuffer);
bigBuffer = NULL;
bigBuffer = nullptr;
// Release the screen buffer
free(screenBuffer);
screenBuffer = NULL;
screenBuffer = nullptr;
// Ditch any text objects
for (i = 0; i < 2; i++) {
if (texts[i].pText) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), texts[i].pText);
texts[i].pText = NULL;
texts[i].pText = nullptr;
}
}
bMovieOn = false;

View File

@ -56,8 +56,8 @@ namespace Tinsel {
// FIXME: Avoid non-const global vars
static OBJECT *g_McurObj = NULL; // Main cursor object
static OBJECT *g_AcurObj = NULL; // Auxiliary cursor object
static OBJECT *g_McurObj = nullptr; // Main 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_AcurAnim = {0,0,0,0,0}; // Auxiliary cursor animation structure
@ -268,7 +268,7 @@ void DwHideCursor() {
for (i = 0; i < g_numTrails; i++) {
if (g_ntrailData[i].trailObj != NULL) {
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++) {
if (g_ntrailData[i].trailObj != NULL) {
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() {
if (g_AcurObj != NULL) {
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->hImgPal = TO_32(_vm->_bg->BgPal());
g_AcurObj = NULL; // No auxillary cursor
g_AcurObj = nullptr; // No auxillary cursor
}
g_McurObj = MultiInitObject(pmi);
@ -581,7 +581,7 @@ void CursorProcess(CORO_PARAM, const void *) {
if (g_ntrailData[i].trailObj != NULL) {
if (StepAnimScript(&g_ntrailData[i].trailAnim) == ScriptFinished) {
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_AcurObj = NULL; // No auxillary cursor
g_McurObj = NULL; // No cursor object (imminently deleted elsewhere)
g_AcurObj = nullptr; // No auxillary cursor
g_McurObj = nullptr; // No cursor object (imminently deleted elsewhere)
g_bHiddenCursor = false; // Not hidden in next scene
g_bTempNoTrailers = false; // Trailers not hidden in next scene
g_bWhoa = true; // Suspend cursor processes
@ -651,7 +651,7 @@ void DropCursor() {
for (int i = 0; i < g_numTrails; i++) {
if (g_ntrailData[i].trailObj != NULL) {
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.
*/
void RebootCursor() {
g_McurObj = g_AcurObj = NULL;
g_McurObj = g_AcurObj = nullptr;
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;

View File

@ -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_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 SCNHANDLE *g_invFilms = NULL;
static SCNHANDLE *g_invFilms = nullptr;
static bool g_bNoLanguage = false;
static DIRECTION g_initialDirection;
@ -481,7 +481,7 @@ static int g_numScenes;
static int g_numEntries;
static PHOPPER g_pChosenScene = NULL;
static PHOPPER g_pChosenScene = nullptr;
static int g_lastChosenScene;
static bool g_bRemember;
@ -1120,7 +1120,7 @@ static void PrimeSceneHopper() {
*/
static void FreeSceneHopper() {
free(g_pHopper);
g_pHopper = NULL;
g_pHopper = nullptr;
}
static void FirstScene(int first) {
@ -1218,7 +1218,7 @@ static void DumpIconArray() {
for (int i = 0; i < MAX_ICONS; i++) {
if (g_iconArray[i] != NULL) {
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++) {
if (g_DobjArray[i] != NULL) {
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++) {
if (g_objArray[i] != NULL) {
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) {
// Blank first entry for new save
cd.box[0].boxText = NULL;
cd.box[0].boxText = nullptr;
cd.modifier = j = 1;
} else {
cd.modifier = j = 0;
@ -1518,15 +1518,15 @@ static void InvLoadGame() {
cd.selBox = NOBOX;
if (g_iconArray[HL3] != NULL) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
g_iconArray[HL3] = NULL;
g_iconArray[HL3] = nullptr;
}
if (g_iconArray[HL2] != NULL) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL2]);
g_iconArray[HL2] = NULL;
g_iconArray[HL2] = nullptr;
}
if (g_iconArray[HL1] != NULL) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
g_iconArray[HL1] = NULL;
g_iconArray[HL1] = nullptr;
}
RestoreGame(rGame+cd.extraBase);
}
@ -1594,7 +1594,7 @@ static bool InvKeyIn(const Common::KeyState &kbd) {
*/
if (g_iconArray[HL3] != NULL) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
g_iconArray[HL3] = NULL;
g_iconArray[HL3] = nullptr;
}
g_iconArray[HL3] = ObjectTextOut(
_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
if (g_iconArray[HL2] != NULL) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL2]);
g_iconArray[HL2] = NULL;
g_iconArray[HL2] = nullptr;
}
if (g_iconArray[HL3] != NULL) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL3]);
g_iconArray[HL3] = NULL;
g_iconArray[HL3] = nullptr;
}
// New highlight box
@ -2277,14 +2277,14 @@ static void InvBoxes(bool InBody, int curX, int curY) {
cd.pointBox = NOBOX;
if (g_iconArray[HL1] != NULL) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
g_iconArray[HL1] = NULL;
g_iconArray[HL1] = nullptr;
}
} else if (index != cd.pointBox) {
cd.pointBox = index;
// A new box is pointed to - high-light it
if (g_iconArray[HL1] != NULL) {
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) ||
///* I don't agree */ cd.box[cd.pointBox].boxType == RGROUP ||
@ -2396,7 +2396,7 @@ static void ButtonToggle(CORO_PARAM, CONFBOX *box) {
// Remove hilight image
if (g_iconArray[HL1] != NULL) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
g_iconArray[HL1] = NULL;
g_iconArray[HL1] = nullptr;
}
// Hold normal image for 1 frame
@ -2438,7 +2438,7 @@ static void ButtonToggle(CORO_PARAM, CONFBOX *box) {
// New state, normal
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), g_iconArray[HL1]);
g_iconArray[HL1] = NULL;
g_iconArray[HL1] = nullptr;
// Hold normal image for 1 frame
CORO_SLEEP(1);
@ -3132,7 +3132,7 @@ static void ConstructInventory(InventoryType filling) {
for (int i = 0; i < MAX_WCOMP; i++) {
if (retObj[i] != NULL) {
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) {
g_SlideObject = NULL;
g_SlideObject = nullptr;
if (TinselV2) {
// !!!!! MAGIC NUMBER ALERT !!!!!

View File

@ -150,7 +150,7 @@ bool GotoCD() {
bool TinselFile::_warningShown = false;
TinselFile::TinselFile() : ReadStreamEndian(TinselV1Mac) {
_stream = NULL;
_stream = nullptr;
}
TinselFile::~TinselFile() {
@ -189,7 +189,7 @@ bool TinselFile::open(const Common::String &filename) {
void TinselFile::close() {
delete _stream;
_stream = NULL;
_stream = nullptr;
}
int32 TinselFile::pos() const {

View File

@ -58,8 +58,8 @@ uint8* psxPJCRLEUnwinder(uint16 imageWidth, uint16 imageHeight, uint8 *srcIdx) {
uint16 controlData;
uint8* dstIdx = NULL;
uint8* destinationBuffer = NULL;
uint8* dstIdx = nullptr;
uint8* destinationBuffer = nullptr;
if (!imageWidth || !imageHeight)
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,
bool applyClipping, bool horizFlipped, int packingType) {
uint8 numColors = 0;
uint8 *colorTable = NULL;
uint8 *colorTable = nullptr;
int topClip = 0;
int xOffset = 0;
int numBytes, color;
@ -820,7 +820,7 @@ void UpdateScreenRect(const Common::Rect &pClip) {
* Draws the specified object onto the screen surface buffer
*/
void DrawObject(DRAWOBJECT *pObj) {
uint8 *srcPtr = NULL;
uint8 *srcPtr = nullptr;
uint8 *destPtr;
byte psxMapperTable[16];
@ -836,7 +836,7 @@ void DrawObject(DRAWOBJECT *pObj) {
if ((pObj->flags & DMA_CONST) == 0) {
if (TinselV2) {
srcPtr = (byte *)LockMem(pObj->hBits);
pObj->charBase = NULL;
pObj->charBase = nullptr;
pObj->transOffset = 0;
} else {
byte *p = (byte *)LockMem(pObj->hBits & HANDLEMASK);

View File

@ -126,7 +126,7 @@ void SetupHandleTable() {
g_handleTable[i].filesize = f.readUint32();
// The pointer should always be NULL. We don't
// need to read that from the file.
g_handleTable[i]._node = NULL;
g_handleTable[i]._node= nullptr;
f.seek(4, SEEK_CUR);
// For Discworld 2, read in the flags2 field
g_handleTable[i].flags2 = t2Flag ? f.readUint32() : 0;
@ -160,7 +160,7 @@ void SetupHandleTable() {
}
#ifdef BODGE
else if ((pH->filesize & FSIZE_MASK) == 8) {
pH->_node = NULL;
pH->_node= nullptr;
}
#endif
else {
@ -175,10 +175,10 @@ void SetupHandleTable() {
void FreeHandleTable() {
free(g_handleTable);
g_handleTable = NULL;
g_handleTable= nullptr;
delete g_cdGraphStream;
g_cdGraphStream = NULL;
g_cdGraphStream= nullptr;
}
/**

View File

@ -113,7 +113,7 @@ void MemoryInit() {
}
// null the last mnode
g_mnodeList[NUM_MNODES - 1].pNext = NULL;
g_mnodeList[NUM_MNODES - 1].pNext = nullptr;
// clear list of fixed memory nodes
memset(g_s_fixedMnodesList, 0, sizeof(g_s_fixedMnodesList));
@ -202,7 +202,7 @@ static bool HeapCompact(long size) {
// find the oldest discardable block
oldest = DwGetCurrentTime();
pOldest = NULL;
pOldest = nullptr;
for (pCur = pHeap->pNext; pCur != pHeap; pCur = pCur->pNext) {
if (pCur->flags == DWM_USED) {
// found a non-discarded discardable block
@ -359,7 +359,7 @@ void MemoryDiscard(MEM_NODE *pMemNode) {
// mark the node as discarded
pMemNode->flags |= DWM_DISCARDED;
pMemNode->pBaseAddr = NULL;
pMemNode->pBaseAddr = nullptr;
pMemNode->size = 0;
}
}

View File

@ -46,7 +46,7 @@ OBJECT *MultiInitObject(const MULTI_INIT *pInitTbl) {
obj_init.hObjImg = READ_32(pFrame); // first objects shape
} else { // this must be a animation list for a NULL object
pFrame = NULL;
pFrame = nullptr;
obj_init.hObjImg = 0; // first objects shape
}
@ -77,7 +77,7 @@ OBJECT *MultiInitObject(const MULTI_INIT *pInitTbl) {
}
// null end of list for final object
pObj->pSlave = NULL;
pObj->pSlave = nullptr;
// return master object
return pFirst;

View File

@ -352,7 +352,7 @@ void Music::OpenMidiFiles() {
void Music::DeleteMidiBuffer() {
free(_midiBuffer.pDat);
_midiBuffer.pDat = NULL;
_midiBuffer.pDat = nullptr;
}
void Music::CurrentMidiFacts(SCNHANDLE* pMidi, bool* pLoop) {
@ -412,7 +412,7 @@ void dumpMusic() {
#endif
MidiMusicPlayer::MidiMusicPlayer(TinselEngine *vm) {
_driver = NULL;
_driver = nullptr;
_milesAudioMode = false;
bool milesAudioEnabled = false;

View File

@ -51,7 +51,7 @@ static int maxObj = 0;
void FreeObjectList() {
free(objectList);
objectList = NULL;
objectList= nullptr;
}
/**
@ -85,7 +85,7 @@ void KillAllObjects() {
}
// 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;
// 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
if (pInitTbl->hObjImg) {
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
if (pImg->hImgPal) {

View File

@ -470,10 +470,10 @@ void RegisterGlobals(int num) {
void FreeGlobals() {
free(g_pGlobals);
g_pGlobals = NULL;
g_pGlobals= nullptr;
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) {
if (s.isLoading()) {
// Null out the pointer fields
pProc = NULL;
code = NULL;
pinvo = NULL;
pProc= nullptr;
code= nullptr;
pinvo= nullptr;
}
// Write out used fields
s.syncAsUint32LE(GSort);
@ -531,7 +531,7 @@ static int32 GetBytes(const byte *scriptCode, const WorkaroundEntry* &wkEntry, i
if (ip >= wkEntry->numBytes) {
// Finished the workaround
ip = wkEntry->ip;
wkEntry = NULL;
wkEntry= nullptr;
} else {
code = wkEntry->script;
}
@ -606,7 +606,7 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
}
}
if (wkEntry->script == NULL)
wkEntry = NULL;
wkEntry= nullptr;
}
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
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;
case OP_JMPFALSE: // conditional jump
@ -733,7 +733,7 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
if (ic->stack[ic->sp--] == 0) {
// condition satisfied - do the jump
ip = tmp;
wkEntry = NULL; // In case a jump occurs from a workaround
wkEntry= nullptr; // In case a jump occurs from a workaround
}
break;
@ -743,7 +743,7 @@ void Interpret(CORO_PARAM, INT_CONTEXT *ic) {
if (ic->stack[ic->sp--] != 0) {
// condition satisfied - do the jump
ip = tmp;
wkEntry = NULL; // In case a jump occurs from a workaround
wkEntry= nullptr; // In case a jump occurs from a workaround
}
break;

View File

@ -120,11 +120,11 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
// _ctx->prevOver = -1;
_ctx->prevString = -1;
_ctx->cpText = NULL;
_ctx->cpathText = NULL;
_ctx->rpText = NULL;
// _ctx->opText = NULL;
_ctx->spText = NULL;
_ctx->cpText = nullptr;
_ctx->cpathText = nullptr;
_ctx->rpText = nullptr;
// _ctx->opText = nullptr;
_ctx->spText = nullptr;
int aniX, aniY; // cursor/lead actor position
@ -151,7 +151,7 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
}
if (_ctx->cpathText) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->cpathText);
_ctx->cpathText = NULL;
_ctx->cpathText = nullptr;
}
// New text objects
@ -414,7 +414,7 @@ static bool ActorTag(int curX, int curY, HotSpotTag *pTag, OBJECT **ppText) {
assert(*ppText);
MultiSetZPosition(*ppText, Z_TAG_TEXT);
} else
*ppText = NULL;
*ppText = nullptr;
} else if (*ppText) {
// Same actor, maintain tag position
GetActorTagPos(actor, &newX, &newY, false);
@ -512,7 +512,7 @@ static bool PolyTag(HotSpotTag *pTag, OBJECT **ppText) {
if (hp != GetTaggedPoly()) {
if (*ppText) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), *ppText);
*ppText = NULL;
*ppText = nullptr;
}
*pTag = POLY_HOTSPOT_TAG;
SaveTaggedActor(0); // No tagged actor
@ -553,7 +553,7 @@ static bool PolyTag(HotSpotTag *pTag, OBJECT **ppText) {
if (strLen == 0)
// No valid string returned, so leave ppText as NULL
ppText = NULL;
ppText = nullptr;
else if (TinselV2 && !PolyTagFollowsCursor(hp)) {
// May have buggered cursor
EndCursorFollowed();
@ -646,7 +646,7 @@ void TagProcess(CORO_PARAM, const void *) {
CORO_BEGIN_CODE(_ctx);
_ctx->pText = NULL;
_ctx->pText = nullptr;
_ctx->Tag = NO_HOTSPOT_TAG;
SaveTaggedActor(0); // No tagged actor yet
@ -663,7 +663,7 @@ void TagProcess(CORO_PARAM, const void *) {
// Nothing tagged. Remove tag, if there is one
if (_ctx->pText) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
_ctx->pText = NULL;
_ctx->pText = nullptr;
if (TinselV2)
// May have buggered cursor
@ -678,7 +678,7 @@ void TagProcess(CORO_PARAM, const void *) {
if (_ctx->pText) {
// kill current text objects
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
_ctx->pText = NULL;
_ctx->pText = nullptr;
_ctx->Tag = NO_HOTSPOT_TAG;
}
}

View File

@ -447,7 +447,7 @@ static void t1PlayReel(CORO_PARAM, const PPINIT *ppi) {
_ctx->lifeNoMatter = false;
_ctx->replaced = false;
_ctx->pActor = NULL;
_ctx->pActor= nullptr;
bNewMover = false;
pfilm = (const FILM *)LockMem(ppi->hFilm);

View File

@ -1803,7 +1803,7 @@ void InitPolygons(SCNHANDLE ph, int numPoly, bool bRestart) {
for (int i = 0; i < noofPolys; i++) {
if (Polys[i]) {
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() {
pathsOnRoute = 0;
memset(RoutePaths, 0, sizeof(RoutePaths));
RouteEnd = NULL;
RouteEnd= nullptr;
for (int i = 0; i < noofPolys; i++) {
if (Polys[i]) {
Polys[i]->pointState = PS_NOT_POINTING;
Polys[i] = NULL;
Polys[i]= nullptr;
}
}
noofPolys = 0;
free(Polygons);
Polygons = NULL;
Polygons= nullptr;
}

View File

@ -201,7 +201,7 @@ void KillMover(PMOVER pMover) {
if (pMover->bActive) {
pMover->bActive = false;
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_WORLD), pMover->actorObj);
pMover->actorObj = NULL;
pMover->actorObj = nullptr;
assert(CoroScheduler.getCurrentProcess() != pMover->pProc);
CoroScheduler.killProcess(pMover->pProc);
}
@ -338,7 +338,7 @@ void UnHideMover(PMOVER pMover) {
*/
static void InitMover(PMOVER pMover) {
pMover->bActive = false;
pMover->actorObj = NULL;
pMover->actorObj = nullptr;
pMover->objX = pMover->objY = 0;
pMover->hRpath = NOPOLY;

View File

@ -547,7 +547,7 @@ static void SaveFailure(Common::OutSaveFile *f) {
delete f;
_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."));
dialog.runModal();
}
@ -623,7 +623,7 @@ static void DoSave() {
f->finalize();
delete f;
g_SaveSceneName = NULL; // Invalidate save name
g_SaveSceneName= nullptr; // Invalidate save name
}
/**

View File

@ -86,7 +86,7 @@ static int g_savedSceneCount = 0;
static bool g_bNotDoneYet = false;
//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_rsd = 0;
@ -160,7 +160,7 @@ void InitializeSaveScenes() {
void FreeSaveScenes() {
free(g_ssData);
g_ssData = NULL;
g_ssData = nullptr;
}
/**

View File

@ -237,7 +237,7 @@ bool GlobalProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWai
CORO_BEGIN_CODE(_ctx);
uint32 i; // Loop counter
_ctx->pProc = NULL;
_ctx->pProc= nullptr;
for (i = 0; i < g_numGlobalProcess; ++i) {
if (g_pGlobalProcess[i].processId == procID) {

View File

@ -90,7 +90,7 @@ void ChangeLanguage(LANGUAGE newLang) {
// free the previous buffer
free(g_textBuffer);
g_textBuffer = NULL;
g_textBuffer = nullptr;
// 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
@ -354,7 +354,7 @@ int SubStringCount(int id) {
void FreeTextBuffer() {
free(g_textBuffer);
g_textBuffer = NULL;
g_textBuffer = nullptr;
}
/**

View File

@ -121,7 +121,7 @@ OBJECT *ObjectTextOut(OBJECT **pList, char *szStr, int color,
const FONT *pFont = (const FONT *)LockMem(hFont);
// init head of text list
pFirst = NULL;
pFirst = nullptr;
// get image for capital W
assert(pFont->fontDef[(int)'W']);

View File

@ -1868,7 +1868,7 @@ static void Print(CORO_PARAM, int x, int y, SCNHANDLE text, int time, bool bSust
CORO_BEGIN_CODE(_ctx);
_ctx->pText = NULL;
_ctx->pText = nullptr;
_ctx->bSample = false;
// 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
_ctx->pText = NULL;
_ctx->pText = nullptr;
if (TinselV2) {
if (event == POINTED) {
@ -2124,7 +2124,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const INV_OBJECT *pinvo,
if (g_bNotPointedRunning) {
// Delete the text, and wait for the all-clear
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
_ctx->pText = NULL;
_ctx->pText = nullptr;
while (g_bNotPointedRunning)
CORO_SLEEP(1);
@ -2242,7 +2242,7 @@ static void PrintObjPointed(CORO_PARAM, const SCNHANDLE text, const INV_OBJECT *
if (g_bNotPointedRunning) {
// Delete the text, and wait for the all-clear
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), pText);
pText = NULL;
pText = nullptr;
while (g_bNotPointedRunning)
CORO_SLEEP(1);
@ -3173,7 +3173,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x
_ctx->Loffset = 0;
_ctx->Toffset = 0;
_ctx->ticks = 0;
_ctx->pText = NULL;
_ctx->pText = nullptr;
// If waiting is enabled, wait for ongoing scroll
if (TinselV2 && SysVar(SV_SPEECHWAITS))
@ -3297,7 +3297,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x
* Display the text.
*/
_ctx->bSample = _ctx->bSamples;
_ctx->pText = NULL;
_ctx->pText = nullptr;
if (_vm->_config->isJapanMode()) {
_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) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _ctx->pText);
_ctx->pText = NULL;
_ctx->pText = nullptr;
}
if (TinselV2 && _ctx->bSample)
_vm->_sound->stopSpecSample(hText, _ctx->sub);

View File

@ -825,7 +825,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
_vm = this;
_gameId = 0;
_driver = NULL;
_driver = nullptr;
_config = new Config(this);
@ -843,7 +843,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
_mousePos.x = 0;
_mousePos.y = 0;
_keyHandler = NULL;
_keyHandler = nullptr;
_dosPlayerDir = 0;
}

View File

@ -45,7 +45,7 @@ static void TerminateProcess(Common::PROCESS *tProc) {
// Release tokens held by the process
for (int i = 0; i < NUMTOKENS; i++) {
if (g_tokens[i].proc == tProc) {
g_tokens[i].proc = NULL;
g_tokens[i].proc = nullptr;
}
}
@ -69,7 +69,7 @@ void GetControlToken() {
*/
void FreeControlToken() {
// 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
g_tokens[which].proc = NULL;
g_tokens[which].proc = nullptr;
}
/**
@ -119,7 +119,7 @@ bool TestToken(int which) {
*/
void FreeAllTokens() {
for (int i = 0; i < NUMTOKENS; i++) {
g_tokens[i].proc = NULL;
g_tokens[i].proc = nullptr;
}
}