[Scummvm-git-logs] scummvm master -> d486799ea783f96eb8b856d97071b1384ea00d90
bluegr
bluegr at gmail.com
Sat Feb 29 00:21:59 UTC 2020
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
63ae50e790 TINSEL: Replace usage of NULL with nullptr
e8bc50e3f5 TINSEL: Remove dead code
d8350221f0 PINK: Clear actor actions after deleting them
d486799ea7 PINK: Simplify and fix PDAPage object creation
Commit: 63ae50e790da20f8faaa88daa3a0e3fff97cf713
https://github.com/scummvm/scummvm/commit/63ae50e790da20f8faaa88daa3a0e3fff97cf713
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-02-29T02:21:41+02:00
Commit Message:
TINSEL: Replace usage of NULL with nullptr
Changed paths:
engines/tinsel/actors.cpp
engines/tinsel/background.cpp
engines/tinsel/bmv.cpp
engines/tinsel/cursor.cpp
engines/tinsel/dialogs.cpp
engines/tinsel/drives.cpp
engines/tinsel/graphics.cpp
engines/tinsel/handle.cpp
engines/tinsel/heapmem.cpp
engines/tinsel/multiobj.cpp
engines/tinsel/music.cpp
engines/tinsel/object.cpp
engines/tinsel/pcode.cpp
engines/tinsel/pdisplay.cpp
engines/tinsel/play.cpp
engines/tinsel/polygons.cpp
engines/tinsel/rince.cpp
engines/tinsel/saveload.cpp
engines/tinsel/savescn.cpp
engines/tinsel/sched.cpp
engines/tinsel/strres.cpp
engines/tinsel/text.cpp
engines/tinsel/tinlib.cpp
engines/tinsel/tinsel.cpp
engines/tinsel/token.cpp
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp
index 83340ff564..e51973ad35 100644
--- a/engines/tinsel/actors.cpp
+++ b/engines/tinsel/actors.cpp
@@ -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;
}
diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp
index 19aa5851bb..2dc91f435d 100644
--- a/engines/tinsel/background.cpp
+++ b/engines/tinsel/background.cpp
@@ -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
diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index 66d0e81946..a5e074cb66 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -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;
diff --git a/engines/tinsel/cursor.cpp b/engines/tinsel/cursor.cpp
index dfd1ca2551..bc741bee87 100644
--- a/engines/tinsel/cursor.cpp
+++ b/engines/tinsel/cursor.cpp
@@ -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;
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 6071517c2b..db5709a1d4 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -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 !!!!!
diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp
index 1ed659040d..f425bb110d 100644
--- a/engines/tinsel/drives.cpp
+++ b/engines/tinsel/drives.cpp
@@ -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 {
diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp
index 90b5299ff0..fcd678a028 100644
--- a/engines/tinsel/graphics.cpp
+++ b/engines/tinsel/graphics.cpp
@@ -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);
diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp
index 9ffd477c4a..117bf46718 100644
--- a/engines/tinsel/handle.cpp
+++ b/engines/tinsel/handle.cpp
@@ -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;
}
/**
diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp
index 82fc3fd11a..49062ca4ef 100644
--- a/engines/tinsel/heapmem.cpp
+++ b/engines/tinsel/heapmem.cpp
@@ -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;
}
}
diff --git a/engines/tinsel/multiobj.cpp b/engines/tinsel/multiobj.cpp
index 2cd46ae90b..e35d282dec 100644
--- a/engines/tinsel/multiobj.cpp
+++ b/engines/tinsel/multiobj.cpp
@@ -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;
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index 244d9be47d..60a5dbe10a 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -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;
diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp
index 38d44d60e1..f8a62d0f21 100644
--- a/engines/tinsel/object.cpp
+++ b/engines/tinsel/object.cpp
@@ -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) {
diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp
index e55adc4b16..71dff0f3b1 100644
--- a/engines/tinsel/pcode.cpp
+++ b/engines/tinsel/pcode.cpp
@@ -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;
diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp
index dc97ee831c..165be434e2 100644
--- a/engines/tinsel/pdisplay.cpp
+++ b/engines/tinsel/pdisplay.cpp
@@ -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;
}
}
diff --git a/engines/tinsel/play.cpp b/engines/tinsel/play.cpp
index 9d4ca6d3e7..c9fa16b950 100644
--- a/engines/tinsel/play.cpp
+++ b/engines/tinsel/play.cpp
@@ -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);
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index 767c0b442f..cf1bec2067 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -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;
}
diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp
index 3e98317e64..5185e085f2 100644
--- a/engines/tinsel/rince.cpp
+++ b/engines/tinsel/rince.cpp
@@ -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;
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 21f8a4f1d8..c9e0006628 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -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
}
/**
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index 7fc7e13893..013b1fc4c9 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -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;
}
/**
diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp
index 894ffb7f5b..edc10075cb 100644
--- a/engines/tinsel/sched.cpp
+++ b/engines/tinsel/sched.cpp
@@ -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) {
diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp
index 6ad01a0d35..4d825cdb7e 100644
--- a/engines/tinsel/strres.cpp
+++ b/engines/tinsel/strres.cpp
@@ -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;
}
/**
diff --git a/engines/tinsel/text.cpp b/engines/tinsel/text.cpp
index 1c114fffa1..c741d0809f 100644
--- a/engines/tinsel/text.cpp
+++ b/engines/tinsel/text.cpp
@@ -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']);
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 98a511dd35..1f0386ab51 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -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);
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 4e8c1efd6d..e98d01c3a1 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -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;
}
diff --git a/engines/tinsel/token.cpp b/engines/tinsel/token.cpp
index 1e4efe7445..1f2483fbd8 100644
--- a/engines/tinsel/token.cpp
+++ b/engines/tinsel/token.cpp
@@ -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;
}
}
Commit: e8bc50e3f5bec341ab8916d0a8e0fb4c82890647
https://github.com/scummvm/scummvm/commit/e8bc50e3f5bec341ab8916d0a8e0fb4c82890647
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-02-29T02:21:41+02:00
Commit Message:
TINSEL: Remove dead code
Changed paths:
engines/tinsel/sched.h
engines/tinsel/strres.cpp
engines/tinsel/strres.h
diff --git a/engines/tinsel/sched.h b/engines/tinsel/sched.h
index da06c545bf..495693c8b0 100644
--- a/engines/tinsel/sched.h
+++ b/engines/tinsel/sched.h
@@ -37,14 +37,12 @@ struct INT_CONTEXT;
//----------------- FUNCTION PROTOTYPES --------------------
void SceneProcesses(uint32 numProcess, SCNHANDLE hProcess);
-void CallSceneProcess(uint32 procID);
void KillSceneProcess(uint32 procID);
void SceneProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWait,
int myEscape, bool *result = NULL);
void RestoreSceneProcess(INT_CONTEXT *pic);
void GlobalProcesses(uint32 numProcess, byte *pProcess);
-void xCallGlobalProcess(uint32 procID);
void xKillGlobalProcess(uint32 procID);
bool GlobalProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWait, int myEscape);
void RestoreGlobalProcess(INT_CONTEXT *pic);
diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp
index 4d825cdb7e..32aefd008a 100644
--- a/engines/tinsel/strres.cpp
+++ b/engines/tinsel/strres.cpp
@@ -392,40 +392,6 @@ int NumberOfLanguages() {
return count;
}
-LANGUAGE NextLanguage(LANGUAGE thisOne) {
- int i;
-
- for (i = thisOne+1; i < NUM_LANGUAGES; i++) {
- if (g_languages[i].bPresent)
- return (LANGUAGE)i;
- }
-
- for (i = 0; i < thisOne; i++) {
- if (g_languages[i].bPresent)
- return (LANGUAGE)i;
- }
-
- // No others!
- return thisOne;
-}
-
-LANGUAGE PrevLanguage(LANGUAGE thisOne) {
- int i;
-
- for (i = thisOne-1; i >= 0; i--) {
- if (g_languages[i].bPresent)
- return (LANGUAGE)i;
- }
-
- for (i = NUM_LANGUAGES-1; i > thisOne; i--) {
- if (g_languages[i].bPresent)
- return (LANGUAGE)i;
- }
-
- // No others!
- return thisOne;
-}
-
SCNHANDLE LanguageDesc(LANGUAGE thisOne) {
return g_languages[thisOne].hDescription;
}
diff --git a/engines/tinsel/strres.h b/engines/tinsel/strres.h
index 56d5273153..15631662b2 100644
--- a/engines/tinsel/strres.h
+++ b/engines/tinsel/strres.h
@@ -88,8 +88,6 @@ LANGUAGE TextLanguage();
LANGUAGE SampleLanguage();
int NumberOfLanguages();
-LANGUAGE NextLanguage(LANGUAGE thisOne);
-LANGUAGE PrevLanguage(LANGUAGE thisOne);
SCNHANDLE LanguageDesc(LANGUAGE thisOne);
SCNHANDLE LanguageFlag(LANGUAGE thisOne);
Commit: d8350221f09a4cd0d75256f306972848effe9b2c
https://github.com/scummvm/scummvm/commit/d8350221f09a4cd0d75256f306972848effe9b2c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-02-29T02:21:41+02:00
Commit Message:
PINK: Clear actor actions after deleting them
Changed paths:
engines/pink/objects/actors/actor.cpp
diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp
index ecc5142189..616a05b3e8 100644
--- a/engines/pink/objects/actors/actor.cpp
+++ b/engines/pink/objects/actors/actor.cpp
@@ -38,6 +38,8 @@ Actor::~Actor() {
for (uint i = 0; i < _actions.size(); ++i) {
delete _actions[i];
}
+
+ _actions.clear();
}
void Actor::deserialize(Archive &archive) {
Commit: d486799ea783f96eb8b856d97071b1384ea00d90
https://github.com/scummvm/scummvm/commit/d486799ea783f96eb8b856d97071b1384ea00d90
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-02-29T02:21:42+02:00
Commit Message:
PINK: Simplify and fix PDAPage object creation
Avoid mixing objects on the stack and heap. This simplifies the code,
and fixes crashes when changing pages in the PDA
Changed paths:
engines/pink/objects/pages/pda_page.cpp
engines/pink/objects/pages/pda_page.h
engines/pink/pda_mgr.cpp
engines/pink/pda_mgr.h
diff --git a/engines/pink/objects/pages/pda_page.cpp b/engines/pink/objects/pages/pda_page.cpp
index ac69c38cb2..ed95204e35 100644
--- a/engines/pink/objects/pages/pda_page.cpp
+++ b/engines/pink/objects/pages/pda_page.cpp
@@ -27,11 +27,10 @@
namespace Pink {
-PDAPage PDAPage::create(const Common::String &pageName, PDAMgr &pdaMgr) {
- PDAPage page(pageName);
- page._name = pageName;
- page._resMgr.init(pdaMgr.getGame(), &page);
- return page;
+PDAPage::PDAPage(const Common::String& name, PinkEngine *vm) {
+ _name = name;
+ _resMgr.init(vm, this);
+ init();
}
} // End of namespace Pink
diff --git a/engines/pink/objects/pages/pda_page.h b/engines/pink/objects/pages/pda_page.h
index 76cc05810e..bb87dd52d7 100644
--- a/engines/pink/objects/pages/pda_page.h
+++ b/engines/pink/objects/pages/pda_page.h
@@ -31,10 +31,7 @@ class PDAMgr;
class PDAPage : public Page {
public:
- static PDAPage create(const Common::String &pageName, PDAMgr &pdaMgr);
-
-private:
- PDAPage(const Common::String &name) { _name = name; }
+ PDAPage(const Common::String& name, PinkEngine* vm);
};
} // End of namespace Pink
diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp
index 5edc93a3bc..f8cd0c4f46 100644
--- a/engines/pink/pda_mgr.cpp
+++ b/engines/pink/pda_mgr.cpp
@@ -95,17 +95,14 @@ void PDAMgr::execute(const Command &command) {
}
}
-void PDAMgr::goToPage(const Common::String &pageName) {
+void PDAMgr::goToPage(const Common::String pageName) {
if (_page && !_page->getName().compareToIgnoreCase(pageName))
return;
loadGlobal();
- PDAPage *newPage = new PDAPage(PDAPage::create(pageName, *this));
delete _page;
- _page = newPage;
-
- _page->init();
+ _page = new PDAPage(pageName, getGame());
_previousPages.push(_page->getName());
@@ -188,8 +185,8 @@ void PDAMgr::loadGlobal() {
if (_globalPage)
return;
- _globalPage = new PDAPage(PDAPage::create("GLOBAL", *this));
- _globalPage->init();
+ delete _globalPage;
+ _globalPage = new PDAPage("GLOBAL", getGame());
}
void PDAMgr::initPerilButtons() {
diff --git a/engines/pink/pda_mgr.h b/engines/pink/pda_mgr.h
index 5dfd531ccc..1ad9bfda59 100644
--- a/engines/pink/pda_mgr.h
+++ b/engines/pink/pda_mgr.h
@@ -45,7 +45,7 @@ public:
void saveState(Archive &archive);
void execute(const Command &command);
- void goToPage(const Common::String &pageName);
+ void goToPage(const Common::String pageName);
void update() { _cursorMgr.update(); }
More information about the Scummvm-git-logs
mailing list