diff --git a/engines/saga2/floating.h b/engines/saga2/floating.h index 06c5e882629..ae7f8a22693 100644 --- a/engines/saga2/floating.h +++ b/engines/saga2/floating.h @@ -109,8 +109,8 @@ private: class gButton : public gControl { public: - gButton(gPanelList &list, const Rect16 &box, char *title, uint16 ident, AppFunc *cmd = NULL) : - gControl(list, box, title, ident, cmd) {} + gButton(gPanelList &list, const Rect16 &box, char *title_, uint16 ident, AppFunc *cmd = NULL) : + gControl(list, box, title_, ident, cmd) {} gButton(gPanelList &list, const Rect16 &box, gPixelMap &img, uint16 ident, AppFunc *cmd = NULL) : gControl(list, box, img, ident, cmd) {} @@ -150,8 +150,8 @@ public: selImage = &img1; deselImage = &img2; } - gImageButton(gPanelList &list, const Rect16 &box, gPixelMap &img1, gPixelMap &img2, char *title, uint16 ident, AppFunc *cmd = NULL) : - gButton(list, box, title, ident, cmd) { + gImageButton(gPanelList &list, const Rect16 &box, gPixelMap &img1, gPixelMap &img2, char *title_, uint16 ident, AppFunc *cmd = NULL) : + gButton(list, box, title_, ident, cmd) { selImage = &img1; deselImage = &img2; } diff --git a/engines/saga2/sensor.cpp b/engines/saga2/sensor.cpp index e3e46249e3b..4a91c56c095 100644 --- a/engines/saga2/sensor.cpp +++ b/engines/saga2/sensor.cpp @@ -482,7 +482,7 @@ bool ProtaganistSensor::check(SenseInfo &info, uint32 senseFlags) { int16 i; bool objIsActor = isActor(getObject()); - for (i = 0; i < elementsof(playerActorIDs); i++) { + for (i = 0; i < (long)elementsof(playerActorIDs); i++) { Actor *protag = getPlayerActorAddress(playerActorIDs[i])->getActor(); @@ -680,12 +680,12 @@ bool SpecificObjectSensor::check(SenseInfo &info, uint32 senseFlags) { //---------------------------------------------------------------------- // Determine if an object meets the search criteria -bool SpecificObjectSensor::isObjectSought(GameObject *obj) { - assert(isObject(obj) || isActor(obj)); +bool SpecificObjectSensor::isObjectSought(GameObject *obj_) { + assert(isObject(obj_) || isActor(obj_)); assert(soughtObjID != Nothing); assert(isObject(soughtObjID) || isActor(soughtObjID)); - return obj == GameObject::objectAddress(soughtObjID); + return obj_ == GameObject::objectAddress(soughtObjID); } /* ===================================================================== * @@ -736,10 +736,10 @@ int16 ObjectPropertySensor::getType(void) { //---------------------------------------------------------------------- // Determine if an object meets the search criteria -bool ObjectPropertySensor::isObjectSought(GameObject *obj) { - assert(isObject(obj) || isActor(obj)); +bool ObjectPropertySensor::isObjectSought(GameObject *obj_) { + assert(isObject(obj_) || isActor(obj_)); - return obj->hasProperty(*getObjProp(objectProperty)); + return obj_->hasProperty(*getObjProp(objectProperty)); } /* ===================================================================== * @@ -749,11 +749,11 @@ bool ObjectPropertySensor::isObjectSought(GameObject *obj) { //---------------------------------------------------------------------- // Determine if an object meets the search criteria -bool ActorSensor::isObjectSought(GameObject *obj) { - assert(isObject(obj) || isActor(obj)); +bool ActorSensor::isObjectSought(GameObject *obj_) { + assert(isObject(obj_) || isActor(obj_)); // Only actors need apply - return isActor(obj) && isActorSought((Actor *)obj); + return isActor(obj_) && isActorSought((Actor *)obj_); } /* ===================================================================== * diff --git a/engines/saga2/speech.cpp b/engines/saga2/speech.cpp index 353d1b28130..ffb13633f00 100644 --- a/engines/saga2/speech.cpp +++ b/engines/saga2/speech.cpp @@ -269,7 +269,7 @@ bool Speech::append(char *text, int32 sampID) { int16 len = strlen(text); // Check to see if there's enough room in the character buffer - if (charCount + len >= sizeof(speechBuffer) + if (charCount + len >= (long)sizeof(speechBuffer) || sampleCount >= MAX_SAMPLES) return false; // Copy text to end of text in buffer, including '\0' @@ -1015,7 +1015,7 @@ bool isVisible(GameObject *obj) { SpeechTaskList::SpeechTaskList(void) { lockFlag = false; - for (int i = 0; i < elementsof(array); i++) { + for (int i = 0; i < (long)elementsof(array); i++) { free.addTail(array[i]); } } @@ -1032,7 +1032,7 @@ SpeechTaskList::SpeechTaskList(void **buf) { lockFlag = false; // Initialize the free list - for (i = 0; i < elementsof(array); i++) { + for (i = 0; i < (long)elementsof(array); i++) { free.addTail(array[i]); } diff --git a/engines/saga2/sprite.h b/engines/saga2/sprite.h index 8845f311577..5b0e826be98 100644 --- a/engines/saga2/sprite.h +++ b/engines/saga2/sprite.h @@ -293,12 +293,11 @@ public: loadSpriteBanks((int16)(1 << bank)); } - // FIXME: Pointer Arithmetic ActorAnimation *animation(int num) { if (poseList == nullptr) return nullptr; - if (num >= poseList->numAnimations) { + if (num >= (int)poseList->numAnimations) { warning("ActorPose:animation(), animation number is too high, %d >= %d", num, poseList->numAnimations); return nullptr; } @@ -318,7 +317,7 @@ public: num += anim->start[dir]; - if (num >= poseList->numPoses) { + if (num >= (int)poseList->numPoses) { warning("ActorPose::pose(), pose number is too high, %d >= %d", num, poseList->numPoses); return nullptr; } diff --git a/engines/saga2/task.cpp b/engines/saga2/task.cpp index ac2210583bd..249298d6288 100644 --- a/engines/saga2/task.cpp +++ b/engines/saga2/task.cpp @@ -1973,7 +1973,7 @@ TaskResult GoAwayFromTask::evaluate(void) { // Update this task TaskResult GoAwayFromTask::update(void) { - static const TilePoint dirTable[] = { + static const TilePoint dirTable_[] = { TilePoint(64, 64, 0), TilePoint(0, 64, 0), TilePoint(-64, 64, 0), @@ -1996,7 +1996,7 @@ TaskResult GoAwayFromTask::update(void) { dest.v = actorLoc.v + ((int32)repulsionVector.v * 64 / repulsionDist); dest.z = actorLoc.z; } else - dest = actorLoc + dirTable[a->currentFacing]; + dest = actorLoc + dirTable_[a->currentFacing]; if (goTask != NULL) { if (goTask->getTarget() != dest) @@ -3950,7 +3950,7 @@ void BandTask::evaluateTarget(void) { int16 j = repulsorCount; if (repulsorDist < repulsorDistArray[j - 1]) { - if (repulsorCount < elementsof(repulsorVectorArray)) { + if (repulsorCount < (long)elementsof(repulsorVectorArray)) { repulsorDistArray[j] = repulsorDistArray[j - 1]; repulsorVectorArray[j] = repulsorVectorArray[j - 1]; repulsorStrengthArray[j] = repulsorStrengthArray[j - 1]; @@ -3965,8 +3965,8 @@ void BandTask::evaluateTarget(void) { j--; } - if (j < elementsof(repulsorVectorArray)) { - if (repulsorCount < elementsof(repulsorVectorArray)) + if (j < (long)elementsof(repulsorVectorArray)) { + if (repulsorCount < (long)elementsof(repulsorVectorArray)) repulsorCount++; repulsorDistArray[j] = repulsorDist; repulsorVectorArray[j] = repulsorVector; diff --git a/engines/saga2/tile.cpp b/engines/saga2/tile.cpp index 5faf49c181d..4a74a8ada80 100644 --- a/engines/saga2/tile.cpp +++ b/engines/saga2/tile.cpp @@ -1312,8 +1312,6 @@ bool TileActivityTask::setWait(ActiveItem *tai, ThreadID script) { // Calls the handling routine for each tile activity task void moveActiveTerrain(int32 deltaTime) { - deltaTime = 0; - TileActivityTask::updateActiveItems(); }