aboutsummaryrefslogtreecommitdiff
path: root/engines/pink
diff options
context:
space:
mode:
authorwhiterandrek2018-05-21 14:27:29 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commita45e58319d7aa6da38f4ecee3ca07889a75d3a82 (patch)
treec6fee74bb9430e44c822e12ec52bc1d1866802a3 /engines/pink
parent656ca285ac7ac6f365fdde45accb020b80ec7898 (diff)
downloadscummvm-rg350-a45e58319d7aa6da38f4ecee3ca07889a75d3a82.tar.gz
scummvm-rg350-a45e58319d7aa6da38f4ecee3ca07889a75d3a82.tar.bz2
scummvm-rg350-a45e58319d7aa6da38f4ecee3ca07889a75d3a82.zip
PINK: fix signed vs unsigned comparison
Diffstat (limited to 'engines/pink')
-rw-r--r--engines/pink/archive.h2
-rw-r--r--engines/pink/director.cpp10
-rw-r--r--engines/pink/objects/actions/action_play.cpp2
-rw-r--r--engines/pink/objects/actions/action_play_with_sfx.cpp6
-rw-r--r--engines/pink/objects/actions/action_still.cpp2
-rw-r--r--engines/pink/objects/actors/actor.cpp6
-rw-r--r--engines/pink/objects/actors/audio_info_pda_button.h2
-rw-r--r--engines/pink/objects/actors/cursor_actor.h2
-rw-r--r--engines/pink/objects/actors/inventory_actor.h2
-rw-r--r--engines/pink/objects/actors/lead_actor.cpp6
-rw-r--r--engines/pink/objects/actors/supporting_actor.cpp2
-rw-r--r--engines/pink/objects/handlers/handler.cpp26
-rw-r--r--engines/pink/objects/handlers/handler_mgr.cpp22
-rw-r--r--engines/pink/objects/handlers/handler_timer.cpp12
-rw-r--r--engines/pink/objects/inventory.cpp8
-rw-r--r--engines/pink/objects/module.cpp2
-rw-r--r--engines/pink/objects/pages/game_page.cpp10
-rw-r--r--engines/pink/objects/pages/page.cpp10
-rw-r--r--engines/pink/objects/sequences/sequence.cpp8
-rw-r--r--engines/pink/objects/sequences/sequence.h2
-rw-r--r--engines/pink/objects/sequences/sequence_context.cpp4
-rw-r--r--engines/pink/objects/sequences/sequence_context.h4
-rw-r--r--engines/pink/objects/sequences/sequencer.cpp10
-rw-r--r--engines/pink/objects/side_effect.cpp2
-rw-r--r--engines/pink/objects/walk/walk_location.cpp2
-rw-r--r--engines/pink/objects/walk/walk_mgr.cpp2
-rw-r--r--engines/pink/objects/walk/walk_shortest_path.cpp16
-rw-r--r--engines/pink/pink.cpp2
28 files changed, 92 insertions, 92 deletions
diff --git a/engines/pink/archive.h b/engines/pink/archive.h
index f12c3e572d..9a1875869c 100644
--- a/engines/pink/archive.h
+++ b/engines/pink/archive.h
@@ -110,7 +110,7 @@ inline Archive &operator>>(Archive &archive, Common::StringArray &array){
inline Archive &operator>>(Archive &archive, Common::StringMap &map){
uint size = archive.readCount();
- for (int i = 0; i < size; ++i) {
+ for (uint i = 0; i < size; ++i) {
Common::String key = archive.readString();
Common::String val = archive.readString();
map.setVal(key, val);
diff --git a/engines/pink/director.cpp b/engines/pink/director.cpp
index fb5a0344f7..c504194daa 100644
--- a/engines/pink/director.cpp
+++ b/engines/pink/director.cpp
@@ -34,7 +34,7 @@ Director::Director(OSystem *system)
void Director::draw() {
_system->fillScreen(0);
- for (int i = 0; i < _sprites.size(); ++i) {
+ for (uint i = 0; i < _sprites.size(); ++i) {
drawSprite(_sprites[i]);
}
_system->updateScreen();
@@ -88,7 +88,7 @@ void Director::addSprite(ActionCEL *sprite) {
}
void Director::removeSprite(ActionCEL *sprite) {
- for (int i = 0; i < _sprites.size(); ++i) {
+ for (uint i = 0; i < _sprites.size(); ++i) {
if (sprite == _sprites[i]) {
_sprites.remove_at(i);
break;
@@ -101,10 +101,10 @@ void Director::setPallette(const byte *pallete) {
}
void Director::update() {
- for (int i = 0; i < _sounds.size(); ++i) {
+ for (uint i = 0; i < _sounds.size(); ++i) {
_sounds[i]->update();
}
- for (int i = 0; i < _sprites.size(); ++i) {
+ for (uint i = 0; i < _sprites.size(); ++i) {
_sprites[i]->update();
}
}
@@ -114,7 +114,7 @@ void Director::addSound(ActionSound *sound) {
}
void Director::removeSound(ActionSound *sound) {
- for (int i = 0; i < _sounds.size(); ++i) {
+ for (uint i = 0; i < _sounds.size(); ++i) {
if (_sounds[i] == sound)
_sounds.remove_at(i);
}
diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp
index 8c0be27b39..34f11009b5 100644
--- a/engines/pink/objects/actions/action_play.cpp
+++ b/engines/pink/objects/actions/action_play.cpp
@@ -47,7 +47,7 @@ void ActionPlay::end() {
void ActionPlay::onStart() {
debug("Actor %s has now ActionPlay %s", _actor->getName().c_str(), _name.c_str());
_decoder->start();
- for (int i = 0; i < _startFrame; ++i) {
+ for (uint i = 0; i < _startFrame; ++i) {
_decoder->skipFrame();
}
_decoder->decodeNextFrame();
diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp
index b43b498eeb..44033705ff 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.cpp
+++ b/engines/pink/objects/actions/action_play_with_sfx.cpp
@@ -36,7 +36,7 @@ void ActionPlayWithSfx::deserialize(Pink::Archive &archive) {
void ActionPlayWithSfx::toConsole() {
debug("\tActionPlayWithSfx: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
" _endFrame = %u, _isLoop = %u", _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _isLoop);
- for (int i = 0; i < _sfxArray.size(); ++i) {
+ for (uint i = 0; i < _sfxArray.size(); ++i) {
_sfxArray[i]->toConsole();
}
}
@@ -64,7 +64,7 @@ void ActionPlayWithSfx::updateSound() {
if (!_actor->isPlaying() && !_isLoop)
return;
- for (int i = 0; i < _sfxArray.size(); ++i) {
+ for (uint i = 0; i < _sfxArray.size(); ++i) {
if (_sfxArray[i]->getFrame() == _decoder->getCurFrame()) {
_sfxArray[i]->play(_actor->getPage());
}
@@ -73,7 +73,7 @@ void ActionPlayWithSfx::updateSound() {
ActionPlayWithSfx::~ActionPlayWithSfx() {
ActionPlay::end();
- for (int i = 0; i < _sfxArray.size(); ++i) {
+ for (uint i = 0; i < _sfxArray.size(); ++i) {
delete _sfxArray[i];
}
}
diff --git a/engines/pink/objects/actions/action_still.cpp b/engines/pink/objects/actions/action_still.cpp
index acc0a2e30d..0bcfcebf3b 100644
--- a/engines/pink/objects/actions/action_still.cpp
+++ b/engines/pink/objects/actions/action_still.cpp
@@ -46,7 +46,7 @@ void ActionStill::end() {
void ActionStill::onStart() {
debug("Actor %s has now ActionStill %s", _actor->getName().c_str(), _name.c_str());
- for (int i = 0; i < _startFrame; ++i) {
+ for (uint i = 0; i < _startFrame; ++i) {
_decoder->skipFrame();
}
_decoder->decodeNextFrame();
diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp
index 189e531c92..67e0b2a7bd 100644
--- a/engines/pink/objects/actors/actor.cpp
+++ b/engines/pink/objects/actors/actor.cpp
@@ -37,7 +37,7 @@ void Actor::deserialize(Archive &archive) {
void Actor::toConsole() {
debug("Actor: _name = %s", _name.c_str());
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
}
@@ -116,7 +116,7 @@ bool Actor::isPlaying() {
}
bool Actor::initPallete(Director *director) {
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
if (_actions[i]->initPalette(director))
return true;
}
@@ -128,7 +128,7 @@ void Actor::onMouseOver(Common::Point point, CursorMgr *mgr) {
}
Actor::~Actor() {
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
delete _actions[i];
}
}
diff --git a/engines/pink/objects/actors/audio_info_pda_button.h b/engines/pink/objects/actors/audio_info_pda_button.h
index f27f70acc4..63badfd64f 100644
--- a/engines/pink/objects/actors/audio_info_pda_button.h
+++ b/engines/pink/objects/actors/audio_info_pda_button.h
@@ -36,7 +36,7 @@ class AudioInfoPDAButton : public Actor {
public:
void toConsole() {
debug("CursorActor: _name = %s", _name.c_str());
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
}
diff --git a/engines/pink/objects/actors/cursor_actor.h b/engines/pink/objects/actors/cursor_actor.h
index 8e0005a183..7c83a6b289 100644
--- a/engines/pink/objects/actors/cursor_actor.h
+++ b/engines/pink/objects/actors/cursor_actor.h
@@ -35,7 +35,7 @@ class CursorActor : public Actor {
public:
void toConsole() {
debug("CursorActor: _name = %s", _name.c_str());
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
}
diff --git a/engines/pink/objects/actors/inventory_actor.h b/engines/pink/objects/actors/inventory_actor.h
index 3f9c1ec21e..61ebbc4c09 100644
--- a/engines/pink/objects/actors/inventory_actor.h
+++ b/engines/pink/objects/actors/inventory_actor.h
@@ -34,7 +34,7 @@ class InventoryActor : public Actor {
public:
void toConsole() {
debug("CursorActor: _name = %s", _name.c_str());
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
}
diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp
index 5de351bc03..05d9a763f4 100644
--- a/engines/pink/objects/actors/lead_actor.cpp
+++ b/engines/pink/objects/actors/lead_actor.cpp
@@ -59,7 +59,7 @@ void LeadActor::init(bool unk) {
void LeadActor::toConsole() {
debug("LeadActor: _name = %s", _name.c_str());
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
}
@@ -314,7 +314,7 @@ bool LeadActor::isInteractingWith(SupportingActor *actor) {
void ParlSqPink::toConsole() {
debug("ParlSqPink: _name = %s", _name.c_str());
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
}
@@ -334,7 +334,7 @@ PubPink::PubPink() :
void PubPink::toConsole() {
debug("PubPink: _name = %s", _name.c_str());
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
}
diff --git a/engines/pink/objects/actors/supporting_actor.cpp b/engines/pink/objects/actors/supporting_actor.cpp
index 5fd575d57f..4971cca7c8 100644
--- a/engines/pink/objects/actors/supporting_actor.cpp
+++ b/engines/pink/objects/actors/supporting_actor.cpp
@@ -38,7 +38,7 @@ void SupportingActor::deserialize(Archive &archive) {
void SupportingActor::toConsole() {
debug("SupportingActor: _name = %s, _location=%s, _pdaLink=%s, _cursor=%s",
_name.c_str(), _location.c_str(), _pdaLink.c_str(), _cursor.c_str());
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
_handlerMgr.toConsole();
diff --git a/engines/pink/objects/handlers/handler.cpp b/engines/pink/objects/handlers/handler.cpp
index cd55d5a3be..4c302224e8 100644
--- a/engines/pink/objects/handlers/handler.cpp
+++ b/engines/pink/objects/handlers/handler.cpp
@@ -38,7 +38,7 @@ void Handler::deserialize(Archive &archive) {
}
bool Handler::isSuitable(Actor *actor) {
- for (int i = 0; i < _conditions.size(); ++i) {
+ for (uint i = 0; i < _conditions.size(); ++i) {
if (!_conditions[i]->evaluate(actor)){
return false;
}
@@ -47,7 +47,7 @@ bool Handler::isSuitable(Actor *actor) {
}
void Handler::executeSideEffects(Actor *actor) {
- for (int i = 0; i < _sideEffects.size(); ++i) {
+ for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->execute(actor);
}
}
@@ -57,10 +57,10 @@ void Handler::handle(Actor *actor) {
}
Handler::~Handler() {
- for (int i = 0; i < _sideEffects.size(); ++i) {
+ for (uint i = 0; i < _sideEffects.size(); ++i) {
delete _sideEffects[i];
}
- for (int i = 0; i < _conditions.size(); ++i) {
+ for (uint i = 0; i < _conditions.size(); ++i) {
delete _conditions[i];
}
}
@@ -95,17 +95,17 @@ void HandlerStartPage::toConsole() {
debug("HandlerStartPage:");
debug("\tSideEffects:");
- for (int i = 0; i < _sideEffects.size(); ++i) {
+ for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
debug("\tConditions:");
- for (int i = 0; i < _conditions.size(); ++i) {
+ for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
debug("\tSequences:");
- for (int i = 0; i < _sequences.size(); ++i) {
+ for (uint i = 0; i < _sequences.size(); ++i) {
debug("\t\t%s", _sequences[i].c_str());
}
}
@@ -114,17 +114,17 @@ void HandlerLeftClick::toConsole() {
debug("HandlerLeftClick:");
debug("\tSideEffects:");
- for (int i = 0; i < _sideEffects.size(); ++i) {
+ for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
debug("\tConditions:");
- for (int i = 0; i < _conditions.size(); ++i) {
+ for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
debug("\tSequences:");
- for (int i = 0; i < _sequences.size(); ++i) {
+ for (uint i = 0; i < _sequences.size(); ++i) {
debug("\t\t%s", _sequences[i].c_str());
}
}
@@ -137,17 +137,17 @@ void HandlerUseClick::deserialize(Archive &archive) {
void HandlerUseClick::toConsole() {
debug("HandlerUseClick: _inventoryItem=%s, _recepient=%s", _inventoryItem.c_str(), _recepient.c_str());
debug("\tSideEffects:");
- for (int i = 0; i < _sideEffects.size(); ++i) {
+ for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
debug("\tConditions:");
- for (int i = 0; i < _conditions.size(); ++i) {
+ for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
debug("\tSequences:");
- for (int i = 0; i < _sequences.size(); ++i) {
+ for (uint i = 0; i < _sequences.size(); ++i) {
debug("\t\t%s", _sequences[i].c_str());
}
}
diff --git a/engines/pink/objects/handlers/handler_mgr.cpp b/engines/pink/objects/handlers/handler_mgr.cpp
index f11c7280d5..c326ae8aab 100644
--- a/engines/pink/objects/handlers/handler_mgr.cpp
+++ b/engines/pink/objects/handlers/handler_mgr.cpp
@@ -33,19 +33,19 @@ void HandlerMgr::deserialize(Archive &archive) {
void HandlerMgr::toConsole() {
debug("HandlerMgr:");
- for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ for (uint i = 0; i < _leftClickHandlers.size(); ++i) {
_leftClickHandlers[i]->toConsole();
}
- for (int i = 0; i < _useClickHandlers.size(); ++i) {
+ for (uint i = 0; i < _useClickHandlers.size(); ++i) {
_useClickHandlers[i]->toConsole();
}
- for (int i = 0; i < _timerHandlers.size(); ++i) {
+ for (uint i = 0; i < _timerHandlers.size(); ++i) {
_timerHandlers[i]->toConsole();
}
}
bool HandlerMgr::isLeftClickHandler(Actor *actor) {
- for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ for (uint i = 0; i < _leftClickHandlers.size(); ++i) {
if (_leftClickHandlers[i]->isSuitable(actor))
return true;
}
@@ -54,7 +54,7 @@ bool HandlerMgr::isLeftClickHandler(Actor *actor) {
}
bool HandlerMgr::isUseClickHandler(Actor *actor, const Common::String &itemName){
- for (int i = 0; i < _useClickHandlers.size(); ++i) {
+ for (uint i = 0; i < _useClickHandlers.size(); ++i) {
if (itemName == _useClickHandlers[i]->getInventoryItem() &&
_useClickHandlers[i]->isSuitable(actor))
return true;
@@ -91,7 +91,7 @@ bool HandlerMgr::onUseClickMessage(Actor *actor, InventoryItem *item, InventoryM
}
Handler *HandlerMgr::findSuitableHandlerTimer(Actor *actor) {
- for (int i = 0; i < _timerHandlers.size(); ++i) {
+ for (uint i = 0; i < _timerHandlers.size(); ++i) {
if (_timerHandlers[i]->isSuitable(actor))
return _timerHandlers[i];
}
@@ -100,7 +100,7 @@ Handler *HandlerMgr::findSuitableHandlerTimer(Actor *actor) {
}
HandlerLeftClick *HandlerMgr::findSuitableHandlerLeftClick(Actor *actor) {
- for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ for (uint i = 0; i < _leftClickHandlers.size(); ++i) {
if (_leftClickHandlers[i]->isSuitable(actor))
return _leftClickHandlers[i];
}
@@ -109,7 +109,7 @@ HandlerLeftClick *HandlerMgr::findSuitableHandlerLeftClick(Actor *actor) {
}
HandlerUseClick *HandlerMgr::findSuitableHandlerUseClick(Actor *actor, InventoryItem *item) {
- for (int i = 0; i < _useClickHandlers.size(); ++i) {
+ for (uint i = 0; i < _useClickHandlers.size(); ++i) {
if (item->getName() == _useClickHandlers[i]->getInventoryItem() && _useClickHandlers[i]->isSuitable(actor))
return _useClickHandlers[i];
}
@@ -118,13 +118,13 @@ HandlerUseClick *HandlerMgr::findSuitableHandlerUseClick(Actor *actor, Inventory
}
HandlerMgr::~HandlerMgr() {
- for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ for (uint i = 0; i < _leftClickHandlers.size(); ++i) {
delete _leftClickHandlers[i];
}
- for (int j = 0; j < _useClickHandlers.size(); ++j) {
+ for (uint j = 0; j < _useClickHandlers.size(); ++j) {
delete _useClickHandlers[j];
}
- for (int k = 0; k < _timerHandlers.size(); ++k) {
+ for (uint k = 0; k < _timerHandlers.size(); ++k) {
delete _timerHandlers[k];
}
}
diff --git a/engines/pink/objects/handlers/handler_timer.cpp b/engines/pink/objects/handlers/handler_timer.cpp
index 18818ab964..e9af952ad1 100644
--- a/engines/pink/objects/handlers/handler_timer.cpp
+++ b/engines/pink/objects/handlers/handler_timer.cpp
@@ -44,17 +44,17 @@ void HandlerTimerActions::toConsole() {
debug("HandlerTimerActions:");
debug("\tSideEffects:");
- for (int i = 0; i < _sideEffects.size(); ++i) {
+ for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
debug("\tConditions:");
- for (int i = 0; i < _conditions.size(); ++i) {
+ for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
debug("\tActions:");
- for (int i = 0; i < _actions.size(); ++i) {
+ for (uint i = 0; i < _actions.size(); ++i) {
debug("\t\t%s", _actions[i].c_str());
}
}
@@ -79,17 +79,17 @@ void HandlerTimerSequences::toConsole() {
debug("HandlerTimerSequences:");
debug("\tSideEffects:");
- for (int i = 0; i < _sideEffects.size(); ++i) {
+ for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
debug("\tConditions:");
- for (int i = 0; i < _conditions.size(); ++i) {
+ for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
debug("\tSequences:");
- for (int i = 0; i < _sequences.size(); ++i) {
+ for (uint i = 0; i < _sequences.size(); ++i) {
debug("\t\t%s", _sequences[i].c_str());
}
}
diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp
index d62530c553..1869147e52 100644
--- a/engines/pink/objects/inventory.cpp
+++ b/engines/pink/objects/inventory.cpp
@@ -77,7 +77,7 @@ void InventoryMgr::setLeadActor(LeadActor *lead) {
void InventoryMgr::toConsole() {
debug("InventoryMgr:");
- for (int i = 0; i < _items.size(); ++i) {
+ for (uint i = 0; i < _items.size(); ++i) {
_items[i]->toConsole();
}
}
@@ -86,7 +86,7 @@ bool InventoryMgr::isPinkOwnsAnyItems() {
if (_item)
return true;
- for (int i = 0; i < _items.size(); ++i) {
+ for (uint i = 0; i < _items.size(); ++i) {
if (_items[i]->getCurrentOwner() == _lead->getName()){
_item = _items[i];
return true;
@@ -179,14 +179,14 @@ void InventoryMgr::close() {
void InventoryMgr::showNextItem(bool direction) {
int index = 0;
- for (int i = 0; i < _items.size(); ++i) {
+ for (uint i = 0; i < _items.size(); ++i) {
if (_item == _items[i]) {
index = i + _items.size();
break;
}
}
- int i = 0;
+ uint i = 0;
do {
index = (direction == kLeft) ? --index : ++index;
} while(_items[index % _items.size()]->getCurrentOwner() != _item->getCurrentOwner() && ++i < _items.size());
diff --git a/engines/pink/objects/module.cpp b/engines/pink/objects/module.cpp
index 0d607783e9..2b1518704a 100644
--- a/engines/pink/objects/module.cpp
+++ b/engines/pink/objects/module.cpp
@@ -37,7 +37,7 @@ Module::Module(PinkEngine *game, const Common::String &name)
{}
Module::~Module() {
- for (int i = 0; i < _pages.size(); ++i) {
+ for (uint i = 0; i < _pages.size(); ++i) {
delete _pages[i];
}
}
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index 2ac88fbfdf..bdfb92bef6 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -43,7 +43,7 @@ void GamePage::toConsole() {
Page::toConsole();
_walkMgr->toConsole();
_sequencer->toConsole();
- for (int i = 0; i < _handlers.size(); ++i) {
+ for (uint i = 0; i < _handlers.size(); ++i) {
_handlers[i]->toConsole();
}
}
@@ -74,7 +74,7 @@ void GamePage::init(bool isLoadingSave) {
toConsole();
- for (int j = 0; j < _actors.size(); ++j) {
+ for (uint j = 0; j < _actors.size(); ++j) {
if (_actors[j]->initPallete(_module->getGame()->getDirector()))
break;
}
@@ -82,7 +82,7 @@ void GamePage::init(bool isLoadingSave) {
LeadActor::State state = _leadActor->getState();
bool startNow = !(state == LeadActor::kInventory || state == LeadActor::kPDA);
- for (int i = 0; i < _actors.size(); ++i) {
+ for (uint i = 0; i < _actors.size(); ++i) {
_actors[i]->init(startNow);
}
@@ -173,7 +173,7 @@ void GamePage::saveState() {
archive << _variables;
archive.writeWORD(_actors.size());
- for (int i = 0; i < _actors.size(); ++i) {
+ for (uint i = 0; i < _actors.size(); ++i) {
archive.writeString(_actors[i]->getName());
_actors[i]->saveState(archive);
}
@@ -193,7 +193,7 @@ void GamePage::clear() {
Page::clear();
//_variables.clear(1);
- for (int i = 0; i < _handlers.size(); ++i) {
+ for (uint i = 0; i < _handlers.size(); ++i) {
delete _handlers[i];
}
diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp
index 9c923e2ebb..cf2d3a01be 100644
--- a/engines/pink/objects/pages/page.cpp
+++ b/engines/pink/objects/pages/page.cpp
@@ -57,7 +57,7 @@ CelDecoder *Page::loadCel(Common::String &fileName) {
void Page::toConsole() {
- for (int i = 0; i < _actors.size(); ++i) {
+ for (uint i = 0; i < _actors.size(); ++i) {
_actors[i]->toConsole();
}
}
@@ -66,7 +66,7 @@ void Page::init() {
LeadActor::State state = _leadActor->getState();
bool unk = (state == LeadActor::kInventory || state == LeadActor::kPDA);
- for (int i = 0; i < _actors.size(); ++i) {
+ for (uint i = 0; i < _actors.size(); ++i) {
_actors[i]->init(unk);
}
}
@@ -76,7 +76,7 @@ LeadActor *Page::getLeadActor() {
}
void Page::clear() {
- for (int i = 0; i < _actors.size(); ++i) {
+ for (uint i = 0; i < _actors.size(); ++i) {
delete _actors[i];
}
_actors.clear();
@@ -84,13 +84,13 @@ void Page::clear() {
}
void Page::pause() {
- for (int i = 0; i < _actors.size(); ++i) {
+ for (uint i = 0; i < _actors.size(); ++i) {
_actors[i]->pause();
}
}
void Page::unpause() {
- for (int i = 0; i < _actors.size(); ++i) {
+ for (uint i = 0; i < _actors.size(); ++i) {
_actors[i]->unpause();
}
}
diff --git a/engines/pink/objects/sequences/sequence.cpp b/engines/pink/objects/sequences/sequence.cpp
index b2cc5e764d..ae979658f2 100644
--- a/engines/pink/objects/sequences/sequence.cpp
+++ b/engines/pink/objects/sequences/sequence.cpp
@@ -38,7 +38,7 @@ Sequence::Sequence()
_sequencer(nullptr) {}
Sequence::~Sequence() {
- for (int i = 0; i < _items.size(); ++i) {
+ for (uint i = 0; i < _items.size(); ++i) {
delete _items[i];
}
}
@@ -52,7 +52,7 @@ void Sequence::deserialize(Archive &archive) {
void Sequence::toConsole() {
debug("\t\tSequence %s", _name.c_str());
debug("\t\t\tItems:");
- for (int i = 0; i < _items.size(); ++i) {
+ for (uint i = 0; i < _items.size(); ++i) {
_items[i]->toConsole();
}
}
@@ -144,14 +144,14 @@ void SequenceAudio::deserialize(Archive &archive) {
void SequenceAudio::toConsole() {
debug("\t\tSequenceAudio %s : _sound = %s", _name.c_str(), _soundName.c_str());
debug("\t\t\tItems:");
- for (int i = 0; i < _items.size(); ++i) {
+ for (uint i = 0; i < _items.size(); ++i) {
_items[i]->toConsole();
}
}
void SequenceAudio::start(int unk) {
Sequence::start(unk);
- int index = _context->getNextItemIndex();
+ uint index = _context->getNextItemIndex();
if (index < _items.size()) {
SequenceItemLeaderAudio* leaderAudio = (SequenceItemLeaderAudio*) _items[index];
_sample = leaderAudio->getSample();
diff --git a/engines/pink/objects/sequences/sequence.h b/engines/pink/objects/sequences/sequence.h
index 2cbdff42ba..ba6d3be35a 100644
--- a/engines/pink/objects/sequences/sequence.h
+++ b/engines/pink/objects/sequences/sequence.h
@@ -82,7 +82,7 @@ public:
private:
Common::String _soundName;
Sound *_sound;
- int _sample;
+ uint _sample;
};
} // End of namespace Pink
diff --git a/engines/pink/objects/sequences/sequence_context.cpp b/engines/pink/objects/sequences/sequence_context.cpp
index 01b76a8770..4aec5fe4c5 100644
--- a/engines/pink/objects/sequences/sequence_context.cpp
+++ b/engines/pink/objects/sequences/sequence_context.cpp
@@ -72,7 +72,7 @@ SequenceContext::SequenceContext(Sequence *sequence, Sequencer *sequencer)
}
}
-int SequenceContext::getNextItemIndex() const {
+uint SequenceContext::getNextItemIndex() const {
return _nextItemIndex;
}
@@ -81,7 +81,7 @@ Sequence *SequenceContext::getSequence() const {
}
void SequenceContext::clearActionsFromActorStates() {
- for (int i = 0; i < _states.size(); ++i) {
+ for (uint i = 0; i < _states.size(); ++i) {
_states[i]._actionName.clear();
}
}
diff --git a/engines/pink/objects/sequences/sequence_context.h b/engines/pink/objects/sequences/sequence_context.h
index 11b43bb491..334553cf57 100644
--- a/engines/pink/objects/sequences/sequence_context.h
+++ b/engines/pink/objects/sequences/sequence_context.h
@@ -49,7 +49,7 @@ class SequenceContext {
public:
SequenceContext(Sequence *sequence, Sequencer* sequencer);
- int getNextItemIndex() const;
+ uint getNextItemIndex() const;
Sequence *getSequence() const;
void setNextItemIndex(int index);
@@ -59,7 +59,7 @@ public:
public:
Sequence *_sequence;
Sequencer *_sequencer;
- int _nextItemIndex;
+ uint _nextItemIndex;
Actor *_actor;
Common::Array<SequenceActorState> _states;
int _index;
diff --git a/engines/pink/objects/sequences/sequencer.cpp b/engines/pink/objects/sequences/sequencer.cpp
index 349f7ad840..b8628193ff 100644
--- a/engines/pink/objects/sequences/sequencer.cpp
+++ b/engines/pink/objects/sequences/sequencer.cpp
@@ -38,7 +38,7 @@ Sequencer::Sequencer(GamePage *page)
{}
Sequencer::~Sequencer() {
- for (int i = 0; i < _sequences.size(); ++i) {
+ for (uint i = 0; i < _sequences.size(); ++i) {
delete _sequences[i];
}
}
@@ -70,10 +70,10 @@ void Sequencer::authorSequence(Sequence *sequence, bool unk) {
void Sequencer::toConsole() {
debug("Sequencer:");
- for (int i = 0; i < _sequences.size(); ++i) {
+ for (uint i = 0; i < _sequences.size(); ++i) {
_sequences[i]->toConsole();
}
- for (int i = 0; i < _timers.size(); ++i) {
+ for (uint i = 0; i < _timers.size(); ++i) {
_timers[i]->toConsole();
}
}
@@ -109,7 +109,7 @@ void Sequencer::updateTimers() {
}
_time = time;
- for (int i = 0; i < _timers.size(); ++i) {
+ for (uint i = 0; i < _timers.size(); ++i) {
_timers[i]->update();
}
}
@@ -118,7 +118,7 @@ SequenceActorState *Sequencer::findSequenceActorState(const Common::String &name
if (!_context)
return nullptr;
- for (int i = 0; i < _context->_states.size(); ++i) {
+ for (uint i = 0; i < _context->_states.size(); ++i) {
if (_context->_states[i].getActor() == name)
return &_context->_states[i];
}
diff --git a/engines/pink/objects/side_effect.cpp b/engines/pink/objects/side_effect.cpp
index ec0f24e9d2..cbd8291498 100644
--- a/engines/pink/objects/side_effect.cpp
+++ b/engines/pink/objects/side_effect.cpp
@@ -116,7 +116,7 @@ void SideEffectRandomPageVariable::execute(Actor *actor) {
void SideEffectRandomPageVariable::toConsole() {
Common::String values("{");
- for (int i = 0; i < _values.size(); ++i) {
+ for (uint i = 0; i < _values.size(); ++i) {
values += _values[i];
values += ',';
}
diff --git a/engines/pink/objects/walk/walk_location.cpp b/engines/pink/objects/walk/walk_location.cpp
index 9ef6a7ff28..da5718f3d9 100644
--- a/engines/pink/objects/walk/walk_location.cpp
+++ b/engines/pink/objects/walk/walk_location.cpp
@@ -35,7 +35,7 @@ void WalkLocation::deserialize(Pink::Archive &archive) {
void WalkLocation::toConsole() {
debug("\tWalkLocation: _name =%s", _name.c_str());
debug("\tNeighbors:");
- for (int i = 0; i < _neighbors.size(); ++i) {
+ for (uint i = 0; i < _neighbors.size(); ++i) {
debug("\t\t%s", _neighbors[i].c_str());
}
}
diff --git a/engines/pink/objects/walk/walk_mgr.cpp b/engines/pink/objects/walk/walk_mgr.cpp
index eb2ce5e204..ad447a94bf 100644
--- a/engines/pink/objects/walk/walk_mgr.cpp
+++ b/engines/pink/objects/walk/walk_mgr.cpp
@@ -51,7 +51,7 @@ WalkLocation *WalkMgr::findLocation(const Common::String &name) {
void WalkMgr::toConsole() {
debug("WalkMgr:");
- for (int i = 0; i < _locations.size(); ++i) {
+ for (uint i = 0; i < _locations.size(); ++i) {
_locations[i]->toConsole();
}
}
diff --git a/engines/pink/objects/walk/walk_shortest_path.cpp b/engines/pink/objects/walk/walk_shortest_path.cpp
index ca07da9602..aa74f0e3b3 100644
--- a/engines/pink/objects/walk/walk_shortest_path.cpp
+++ b/engines/pink/objects/walk/walk_shortest_path.cpp
@@ -50,7 +50,7 @@ WalkLocation *WalkShortestPath::build() {
WalkLocation *location = nullptr;
double len = -1.0;
addLocationsToVisit();
- for (int i = 0; i < _toVisit.size(); ++i) {
+ for (uint i = 0; i < _toVisit.size(); ++i) {
double curLen = getLengthToNearestNeigbor(_toVisit[i]);
if (curLen < 0) {
remove(_toVisit[i]);
@@ -74,7 +74,7 @@ WalkLocation *WalkShortestPath::build() {
}
WalkLocation *WalkShortestPath::getNearestNeighbor(WalkLocation *location) {
- for(int i = 0; i < _visited.size(); ++i){
+ for(uint i = 0; i < _visited.size(); ++i){
if (_visited[i] == location)
return _nearestNeigbor[i];
}
@@ -84,7 +84,7 @@ WalkLocation *WalkShortestPath::getNearestNeighbor(WalkLocation *location) {
void WalkShortestPath::addLocationsToVisit() {
_toVisit.resize(_locations.size());
- for (int i = 0; i < _locations.size(); ++i) {
+ for (uint i = 0; i < _locations.size(); ++i) {
_toVisit[i] = _locations[i];
}
}
@@ -92,7 +92,7 @@ void WalkShortestPath::addLocationsToVisit() {
double WalkShortestPath::getLengthToNearestNeigbor(WalkLocation *location) {
double minLength = -1.0;
Common::StringArray &neighbors = location->getNeigbors();
- for (int i = 0; i < neighbors.size(); ++i) {
+ for (uint i = 0; i < neighbors.size(); ++i) {
WalkLocation *neighbor = _manager->findLocation(neighbors[i]);
if (!isLocationVisited(neighbor)){
double length = _manager->getLengthBetweenLocations(location, neighbor);
@@ -111,7 +111,7 @@ WalkLocation *WalkShortestPath::findNearestNeighbor(WalkLocation *location) {
double minLength = -1.0;
WalkLocation *nearest = nullptr;
Common::StringArray &neighbors = location->getNeigbors();
- for (int i = 0; i < neighbors.size(); ++i) {
+ for (uint i = 0; i < neighbors.size(); ++i) {
WalkLocation *neighbor = _manager->findLocation(neighbors[i]);
if (!isLocationVisited(neighbor)){
double length = _manager->getLengthBetweenLocations(location, neighbor);
@@ -132,7 +132,7 @@ WalkLocation *WalkShortestPath::findNearestNeighbor(WalkLocation *location) {
}
double WalkShortestPath::getWeight(WalkLocation *location) {
- for (int i = 0; i < _locations.size(); ++i) {
+ for (uint i = 0; i < _locations.size(); ++i) {
if (_locations[i] == location)
return _weight[i];
}
@@ -140,7 +140,7 @@ double WalkShortestPath::getWeight(WalkLocation *location) {
}
bool WalkShortestPath::isLocationVisited(WalkLocation *location) {
- for (int i = 0; i < _visited.size(); ++i) {
+ for (uint i = 0; i < _visited.size(); ++i) {
if (_visited[i] == location)
return true;
}
@@ -148,7 +148,7 @@ bool WalkShortestPath::isLocationVisited(WalkLocation *location) {
}
void WalkShortestPath::remove(WalkLocation *location) {
- for (int i = 0; i < _locations.size(); ++i) {
+ for (uint i = 0; i < _locations.size(); ++i) {
if (_locations[i] == location){
_locations.remove_at(i);
_weight.remove_at(i);
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 56166b0ab4..1923c00250 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -56,7 +56,7 @@ Pink::PinkEngine::~PinkEngine() {
for (uint i = 0; i < _modules.size(); ++i) {
delete _modules[i];
}
- for (int j = 0; j < _cursors.size(); ++j) {
+ for (uint j = 0; j < _cursors.size(); ++j) {
delete _cursors[j];
}