diff options
Diffstat (limited to 'engines/wintermute/ad')
30 files changed, 178 insertions, 171 deletions
diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp index 9087d66844..d175855d1e 100644 --- a/engines/wintermute/ad/ad_actor.cpp +++ b/engines/wintermute/ad/ad_actor.cpp @@ -602,13 +602,13 @@ bool AdActor::update() { } // finished playing animation? - if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) { + if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->isFinished()) { _state = _nextState; _nextState = STATE_READY; _currentSprite = _animSprite; } - if (_state == STATE_PLAYING_ANIM_SET && _animSprite2 != NULL && _animSprite2->_finished) { + if (_state == STATE_PLAYING_ANIM_SET && _animSprite2 != NULL && _animSprite2->isFinished()) { _state = _nextState; _nextState = STATE_READY; _currentSprite = _animSprite2; @@ -649,7 +649,7 @@ bool AdActor::update() { ////////////////////////////////////////////////////////////////////////// case STATE_TURNING_LEFT: - if (_tempSprite2 == NULL || _tempSprite2->_finished) { + if (_tempSprite2 == NULL || _tempSprite2->isFinished()) { if (_dir > 0) { _dir = (TDirection)(_dir - 1); } else { @@ -686,7 +686,7 @@ bool AdActor::update() { ////////////////////////////////////////////////////////////////////////// case STATE_TURNING_RIGHT: - if (_tempSprite2 == NULL || _tempSprite2->_finished) { + if (_tempSprite2 == NULL || _tempSprite2->isFinished()) { _dir = (TDirection)(_dir + 1); if ((int)_dir >= (int)NUM_DIRECTIONS) { @@ -753,7 +753,7 @@ bool AdActor::update() { } bool timeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= _gameRef->_timer - _sentence->_startTime); - if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ timeIsUp)) { + if (_tempSprite2 == NULL || _tempSprite2->isFinished() || (/*_tempSprite2->_looping &&*/ timeIsUp)) { if (timeIsUp) { _sentence->finish(); _tempSprite2 = NULL; @@ -798,7 +798,7 @@ bool AdActor::update() { if (_currentSprite && !already_moved) { _currentSprite->getCurrentFrame(_zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100, _zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100); - if (_currentSprite->_changed) { + if (_currentSprite->isChanged()) { _posX += _currentSprite->_moveX; _posY += _currentSprite->_moveY; afterMove(); @@ -830,7 +830,7 @@ void AdActor::followPath() { // are there points to follow? if (_path->getCurrent() != NULL) { - _state = STATE_FOLLOWING_PATH;; + _state = STATE_FOLLOWING_PATH; initLine(BasePoint(_posX, _posY), *_path->getCurrent()); } else { if (_afterWalkDir != DI_NONE) { @@ -858,7 +858,7 @@ void AdActor::getNextStep() { } _currentSprite->getCurrentFrame(_zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100, _zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100); - if (!_currentSprite->_changed) { + if (!_currentSprite->isChanged()) { return; } @@ -1075,27 +1075,27 @@ bool AdActor::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, ////////////////////////////////////////////////////////////////////////// -ScValue *AdActor::scGetProperty(const char *name) { +ScValue *AdActor::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Direction ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Direction") == 0) { + if (name == "Direction") { _scValue->setInt(_dir); return _scValue; } ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Type") == 0) { + else if (name == "Type") { _scValue->setString("actor"); return _scValue; } ////////////////////////////////////////////////////////////////////////// // TalkAnimName ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "TalkAnimName") == 0) { + else if (name == "TalkAnimName") { _scValue->setString(_talkAnimName); return _scValue; } @@ -1103,7 +1103,7 @@ ScValue *AdActor::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // WalkAnimName ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "WalkAnimName") == 0) { + else if (name == "WalkAnimName") { _scValue->setString(_walkAnimName); return _scValue; } @@ -1111,7 +1111,7 @@ ScValue *AdActor::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // IdleAnimName ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "IdleAnimName") == 0) { + else if (name == "IdleAnimName") { _scValue->setString(_idleAnimName); return _scValue; } @@ -1119,7 +1119,7 @@ ScValue *AdActor::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // TurnLeftAnimName ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "TurnLeftAnimName") == 0) { + else if (name == "TurnLeftAnimName") { _scValue->setString(_turnLeftAnimName); return _scValue; } @@ -1127,7 +1127,7 @@ ScValue *AdActor::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // TurnRightAnimName ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "TurnRightAnimName") == 0) { + else if (name == "TurnRightAnimName") { _scValue->setString(_turnRightAnimName); return _scValue; } else { @@ -1351,7 +1351,7 @@ bool AdActor::persist(BasePersistenceManager *persistMgr) { ////////////////////////////////////////////////////////////////////////// TDirection AdActor::angleToDirection(int angle) { - TDirection ret = DI_DOWN;; + TDirection ret = DI_DOWN; if (angle > -112 && angle <= -67) { ret = DI_UP; diff --git a/engines/wintermute/ad/ad_actor.h b/engines/wintermute/ad/ad_actor.h index 271e57cb85..543c9d063a 100644 --- a/engines/wintermute/ad/ad_actor.h +++ b/engines/wintermute/ad/ad_actor.h @@ -83,7 +83,7 @@ private: AdSpriteSet *getAnimByName(const Common::String &animName); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ad/ad_entity.cpp b/engines/wintermute/ad/ad_entity.cpp index 234af1fffa..9af7e034ca 100644 --- a/engines/wintermute/ad/ad_entity.cpp +++ b/engines/wintermute/ad/ad_entity.cpp @@ -28,28 +28,29 @@ #include "engines/wintermute/ad/ad_entity.h" -#include "engines/wintermute/base/base_parser.h" -#include "engines/wintermute/base/base_dynamic_buffer.h" -#include "engines/wintermute/base/base_active_rect.h" -#include "engines/wintermute/base/base_surface_storage.h" -#include "engines/wintermute/base/base_game.h" #include "engines/wintermute/ad/ad_game.h" #include "engines/wintermute/ad/ad_scene.h" -#include "engines/wintermute/base/sound/base_sound.h" #include "engines/wintermute/ad/ad_waypoint_group.h" -#include "engines/wintermute/base/font/base_font_storage.h" -#include "engines/wintermute/base/font/base_font.h" #include "engines/wintermute/ad/ad_sentence.h" +#include "engines/wintermute/base/base_active_rect.h" +#include "engines/wintermute/base/base_dynamic_buffer.h" +#include "engines/wintermute/base/base_file_manager.h" +#include "engines/wintermute/base/base_game.h" +#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_region.h" #include "engines/wintermute/base/base_sprite.h" -#include "engines/wintermute/base/base_file_manager.h" -#include "engines/wintermute/platform_osystem.h" -#include "engines/wintermute/utils/utils.h" +#include "engines/wintermute/base/base_surface_storage.h" +#include "engines/wintermute/base/font/base_font_storage.h" +#include "engines/wintermute/base/font/base_font.h" +#include "engines/wintermute/base/gfx/base_renderer.h" +#include "engines/wintermute/base/particles/part_emitter.h" #include "engines/wintermute/base/scriptables/script_value.h" #include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/scriptables/script_stack.h" +#include "engines/wintermute/base/sound/base_sound.h" #include "engines/wintermute/video/video_theora_player.h" -#include "engines/wintermute/base/particles/part_emitter.h" +#include "engines/wintermute/utils/utils.h" +#include "engines/wintermute/platform_osystem.h" #include "common/str.h" namespace Wintermute { @@ -577,7 +578,7 @@ bool AdEntity::update() { } // finished playing animation? - if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) { + if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->isFinished()) { _state = STATE_READY; _currentSprite = _animSprite; } @@ -612,7 +613,7 @@ bool AdEntity::update() { } bool timeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= _gameRef->_timer - _sentence->_startTime); - if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ timeIsUp)) { + if (_tempSprite2 == NULL || _tempSprite2->isFinished() || (/*_tempSprite2->_looping &&*/ timeIsUp)) { if (timeIsUp) { _sentence->finish(); _tempSprite2 = NULL; @@ -638,7 +639,7 @@ bool AdEntity::update() { if (_currentSprite) { _currentSprite->getCurrentFrame(_zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100); - if (_currentSprite->_changed) { + if (_currentSprite->isChanged()) { _posX += _currentSprite->_moveX; _posY += _currentSprite->_moveY; } @@ -828,13 +829,13 @@ bool AdEntity::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// -ScValue *AdEntity::scGetProperty(const char *name) { +ScValue *AdEntity::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type (RO) ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("entity"); return _scValue; } @@ -842,7 +843,7 @@ ScValue *AdEntity::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Item ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Item") == 0) { + else if (name == "Item") { if (_item) { _scValue->setString(_item); } else { @@ -855,7 +856,7 @@ ScValue *AdEntity::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Subtype (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Subtype") == 0) { + else if (name == "Subtype") { if (_subtype == ENTITY_SOUND) { _scValue->setString("sound"); } else { @@ -868,7 +869,7 @@ ScValue *AdEntity::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // WalkToX ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "WalkToX") == 0) { + else if (name == "WalkToX") { _scValue->setInt(_walkToX); return _scValue; } @@ -876,7 +877,7 @@ ScValue *AdEntity::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // WalkToY ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "WalkToY") == 0) { + else if (name == "WalkToY") { _scValue->setInt(_walkToY); return _scValue; } @@ -884,7 +885,7 @@ ScValue *AdEntity::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // WalkToDirection ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "WalkToDirection") == 0) { + else if (name == "WalkToDirection") { _scValue->setInt((int)_walkToDir); return _scValue; } @@ -892,7 +893,7 @@ ScValue *AdEntity::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Region (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Region") == 0) { + else if (name == "Region") { if (_region) { _scValue->setNative(_region, true); } else { diff --git a/engines/wintermute/ad/ad_entity.h b/engines/wintermute/ad/ad_entity.h index 39dc133eef..415987e50a 100644 --- a/engines/wintermute/ad/ad_entity.h +++ b/engines/wintermute/ad/ad_entity.h @@ -56,7 +56,7 @@ public: TEntityType _subtype; // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ad/ad_game.cpp b/engines/wintermute/ad/ad_game.cpp index fe8a5991e2..4481b774c1 100644 --- a/engines/wintermute/ad/ad_game.cpp +++ b/engines/wintermute/ad/ad_game.cpp @@ -50,6 +50,7 @@ #include "engines/wintermute/base/base_viewport.h" #include "engines/wintermute/base/particles/part_emitter.h" #include "engines/wintermute/base/saveload.h" +#include "engines/wintermute/base/gfx/base_renderer.h" #include "engines/wintermute/base/scriptables/script_engine.h" #include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/scriptables/script_stack.h" @@ -875,20 +876,20 @@ bool AdGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, ////////////////////////////////////////////////////////////////////////// -ScValue *AdGame::scGetProperty(const char *name) { +ScValue *AdGame::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("game"); return _scValue; } ////////////////////////////////////////////////////////////////////////// // Scene ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Scene") == 0) { + else if (name == "Scene") { if (_scene) { _scValue->setNative(_scene, true); } else { @@ -900,7 +901,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SelectedItem ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SelectedItem") == 0) { + else if (name == "SelectedItem") { //if (_selectedItem) _scValue->setString(_selectedItem->_name); if (_selectedItem) { _scValue->setNative(_selectedItem, true); @@ -913,14 +914,14 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NumItems ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NumItems") == 0) { + else if (name == "NumItems") { return _invObject->scGetProperty(name); } ////////////////////////////////////////////////////////////////////////// // SmartItemCursor ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SmartItemCursor") == 0) { + else if (name == "SmartItemCursor") { _scValue->setBool(_smartItemCursor); return _scValue; } @@ -928,7 +929,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // InventoryVisible ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "InventoryVisible") == 0) { + else if (name == "InventoryVisible") { _scValue->setBool(_inventoryBox && _inventoryBox->_visible); return _scValue; } @@ -936,7 +937,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // InventoryScrollOffset ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "InventoryScrollOffset") == 0) { + else if (name == "InventoryScrollOffset") { if (_inventoryBox) { _scValue->setInt(_inventoryBox->_scrollOffset); } else { @@ -949,7 +950,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ResponsesVisible (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ResponsesVisible") == 0) { + else if (name == "ResponsesVisible") { _scValue->setBool(_stateEx == GAME_WAITING_RESPONSE); return _scValue; } @@ -957,7 +958,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // PrevScene / PreviousScene (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "PrevScene") == 0 || strcmp(name, "PreviousScene") == 0) { + else if (name == "PrevScene" || name == "PreviousScene") { if (!_prevSceneName) { _scValue->setString(""); } else { @@ -969,7 +970,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // PrevSceneFilename / PreviousSceneFilename (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "PrevSceneFilename") == 0 || strcmp(name, "PreviousSceneFilename") == 0) { + else if (name == "PrevSceneFilename" || name == "PreviousSceneFilename") { if (!_prevSceneFilename) { _scValue->setString(""); } else { @@ -981,7 +982,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // LastResponse (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "LastResponse") == 0) { + else if (name == "LastResponse") { if (!_responseBox || !_responseBox->_lastResponseText) { _scValue->setString(""); } else { @@ -993,7 +994,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // LastResponseOrig (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "LastResponseOrig") == 0) { + else if (name == "LastResponseOrig") { if (!_responseBox || !_responseBox->_lastResponseTextOrig) { _scValue->setString(""); } else { @@ -1005,7 +1006,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // InventoryObject ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "InventoryObject") == 0) { + else if (name == "InventoryObject") { if (_inventoryOwner == _invObject) { _scValue->setNative(this, true); } else { @@ -1018,7 +1019,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // TotalNumItems ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "TotalNumItems") == 0) { + else if (name == "TotalNumItems") { _scValue->setInt(_items.size()); return _scValue; } @@ -1026,7 +1027,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // TalkSkipButton ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "TalkSkipButton") == 0) { + else if (name == "TalkSkipButton") { _scValue->setInt(_talkSkipButton); return _scValue; } @@ -1034,7 +1035,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ChangingScene ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ChangingScene") == 0) { + else if (name == "ChangingScene") { _scValue->setBool(_scheduledScene != NULL); return _scValue; } @@ -1042,7 +1043,7 @@ ScValue *AdGame::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // StartupScene ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "StartupScene") == 0) { + else if (name == "StartupScene") { if (!_startupScene) { _scValue->setNULL(); } else { diff --git a/engines/wintermute/ad/ad_game.h b/engines/wintermute/ad/ad_game.h index 46427331bf..81c79a3da8 100644 --- a/engines/wintermute/ad/ad_game.h +++ b/engines/wintermute/ad/ad_game.h @@ -126,7 +126,7 @@ public: bool loadItemsBuffer(byte *buffer, bool merge = false); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); bool validMouse(); diff --git a/engines/wintermute/ad/ad_inventory_box.cpp b/engines/wintermute/ad/ad_inventory_box.cpp index 16b8e01ff3..7ae8ff8d69 100644 --- a/engines/wintermute/ad/ad_inventory_box.cpp +++ b/engines/wintermute/ad/ad_inventory_box.cpp @@ -35,6 +35,7 @@ #include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/base/base_viewport.h" #include "engines/wintermute/base/base_dynamic_buffer.h" +#include "engines/wintermute/base/gfx/base_renderer.h" #include "engines/wintermute/ui/ui_button.h" #include "engines/wintermute/ui/ui_window.h" #include "engines/wintermute/platform_osystem.h" diff --git a/engines/wintermute/ad/ad_item.cpp b/engines/wintermute/ad/ad_item.cpp index afd813933b..427b1c7db4 100644 --- a/engines/wintermute/ad/ad_item.cpp +++ b/engines/wintermute/ad/ad_item.cpp @@ -36,11 +36,11 @@ #include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/sound/base_sound.h" #include "engines/wintermute/base/base_sprite.h" -#include "engines/wintermute/utils/utils.h" -#include "engines/wintermute/platform_osystem.h" #include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/scriptables/script_stack.h" #include "engines/wintermute/base/scriptables/script_value.h" +#include "engines/wintermute/utils/utils.h" +#include "engines/wintermute/platform_osystem.h" #include "common/str.h" namespace Wintermute { @@ -340,7 +340,7 @@ bool AdItem::update() { } // finished playing animation? - if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) { + if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->isFinished()) { _state = STATE_READY; _currentSprite = _animSprite; } @@ -379,7 +379,7 @@ bool AdItem::update() { } bool timeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= _gameRef->_timer - _sentence->_startTime); - if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ timeIsUp)) { + if (_tempSprite2 == NULL || _tempSprite2->isFinished() || (/*_tempSprite2->_looping &&*/ timeIsUp)) { if (timeIsUp) { _sentence->finish(); _tempSprite2 = NULL; @@ -614,13 +614,13 @@ bool AdItem::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, ////////////////////////////////////////////////////////////////////////// -ScValue *AdItem::scGetProperty(const char *name) { +ScValue *AdItem::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("item"); return _scValue; } @@ -628,7 +628,7 @@ ScValue *AdItem::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Name ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Name") == 0) { + else if (name == "Name") { _scValue->setString(getName()); return _scValue; } @@ -636,7 +636,7 @@ ScValue *AdItem::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // DisplayAmount ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "DisplayAmount") == 0) { + else if (name == "DisplayAmount") { _scValue->setBool(_displayAmount); return _scValue; } @@ -644,7 +644,7 @@ ScValue *AdItem::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Amount ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Amount") == 0) { + else if (name == "Amount") { _scValue->setInt(_amount); return _scValue; } @@ -652,7 +652,7 @@ ScValue *AdItem::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // AmountOffsetX ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "AmountOffsetX") == 0) { + else if (name == "AmountOffsetX") { _scValue->setInt(_amountOffsetX); return _scValue; } @@ -660,7 +660,7 @@ ScValue *AdItem::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // AmountOffsetY ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "AmountOffsetY") == 0) { + else if (name == "AmountOffsetY") { _scValue->setInt(_amountOffsetY); return _scValue; } @@ -668,7 +668,7 @@ ScValue *AdItem::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // AmountAlign ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "AmountAlign") == 0) { + else if (name == "AmountAlign") { _scValue->setInt(_amountAlign); return _scValue; } @@ -676,7 +676,7 @@ ScValue *AdItem::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // AmountString ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "AmountString") == 0) { + else if (name == "AmountString") { if (!_amountString) { _scValue->setNULL(); } else { @@ -688,7 +688,7 @@ ScValue *AdItem::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // CursorCombined ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "CursorCombined") == 0) { + else if (name == "CursorCombined") { _scValue->setBool(_cursorCombined); return _scValue; } else { diff --git a/engines/wintermute/ad/ad_item.h b/engines/wintermute/ad/ad_item.h index 6047c542c1..79978f9f72 100644 --- a/engines/wintermute/ad/ad_item.h +++ b/engines/wintermute/ad/ad_item.h @@ -51,7 +51,7 @@ public: bool loadBuffer(byte *buffer, bool complete = true); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ad/ad_layer.cpp b/engines/wintermute/ad/ad_layer.cpp index 46b75b8b21..209c12b7a2 100644 --- a/engines/wintermute/ad/ad_layer.cpp +++ b/engines/wintermute/ad/ad_layer.cpp @@ -29,12 +29,12 @@ #include "engines/wintermute/base/base_game.h" #include "engines/wintermute/ad/ad_layer.h" #include "engines/wintermute/ad/ad_scene_node.h" -#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_dynamic_buffer.h" +#include "engines/wintermute/base/base_file_manager.h" +#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/scriptables/script_value.h" #include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/scriptables/script_stack.h" -#include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/platform_osystem.h" #include "common/str.h" @@ -376,13 +376,13 @@ bool AdLayer::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, ////////////////////////////////////////////////////////////////////////// -ScValue *AdLayer::scGetProperty(const char *name) { +ScValue *AdLayer::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("layer"); return _scValue; } @@ -390,7 +390,7 @@ ScValue *AdLayer::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NumNodes (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NumNodes") == 0) { + else if (name == "NumNodes") { _scValue->setInt(_nodes.size()); return _scValue; } @@ -398,7 +398,7 @@ ScValue *AdLayer::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Width ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Width") == 0) { + else if (name == "Width") { _scValue->setInt(_width); return _scValue; } @@ -406,7 +406,7 @@ ScValue *AdLayer::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Height ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Height") == 0) { + else if (name == "Height") { _scValue->setInt(_height); return _scValue; } @@ -414,7 +414,7 @@ ScValue *AdLayer::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Main (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Main") == 0) { + else if (name == "Main") { _scValue->setBool(_main); return _scValue; } @@ -422,7 +422,7 @@ ScValue *AdLayer::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // CloseUp ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "CloseUp") == 0) { + else if (name == "CloseUp") { _scValue->setBool(_closeUp); return _scValue; } @@ -430,7 +430,7 @@ ScValue *AdLayer::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Active ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Active") == 0) { + else if (name == "Active") { _scValue->setBool(_active); return _scValue; } else { diff --git a/engines/wintermute/ad/ad_layer.h b/engines/wintermute/ad/ad_layer.h index bb5f73b13a..de65e2822f 100644 --- a/engines/wintermute/ad/ad_layer.h +++ b/engines/wintermute/ad/ad_layer.h @@ -47,7 +47,7 @@ public: virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ad/ad_object.cpp b/engines/wintermute/ad/ad_object.cpp index 6c77917979..7b91daab2e 100644 --- a/engines/wintermute/ad/ad_object.cpp +++ b/engines/wintermute/ad/ad_object.cpp @@ -37,18 +37,19 @@ #include "engines/wintermute/ad/ad_waypoint_group.h" #include "engines/wintermute/base/base_game.h" #include "engines/wintermute/base/base_frame.h" -#include "engines/wintermute/base/sound/base_sound.h" -#include "engines/wintermute/base/base_surface_storage.h" +#include "engines/wintermute/base/base_sprite.h" +#include "engines/wintermute/base/base_string_table.h" #include "engines/wintermute/base/base_sub_frame.h" +#include "engines/wintermute/base/base_surface_storage.h" #include "engines/wintermute/base/font/base_font.h" #include "engines/wintermute/base/font/base_font_storage.h" -#include "engines/wintermute/base/base_sprite.h" -#include "engines/wintermute/base/base_string_table.h" +#include "engines/wintermute/base/gfx/base_renderer.h" +#include "engines/wintermute/base/particles/part_emitter.h" #include "engines/wintermute/base/scriptables/script_engine.h" #include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/scriptables/script_stack.h" #include "engines/wintermute/base/scriptables/script_value.h" -#include "engines/wintermute/base/particles/part_emitter.h" +#include "engines/wintermute/base/sound/base_sound.h" #include "common/str.h" #include "common/util.h" @@ -658,13 +659,13 @@ bool AdObject::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// -ScValue *AdObject::scGetProperty(const char *name) { +ScValue *AdObject::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("object"); return _scValue; } @@ -672,7 +673,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Active ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Active") == 0) { + else if (name == "Active") { _scValue->setBool(_active); return _scValue; } @@ -680,7 +681,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // IgnoreItems ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "IgnoreItems") == 0) { + else if (name == "IgnoreItems") { _scValue->setBool(_ignoreItems); return _scValue; } @@ -688,7 +689,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SceneIndependent ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SceneIndependent") == 0) { + else if (name == "SceneIndependent") { _scValue->setBool(_sceneIndependent); return _scValue; } @@ -696,7 +697,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SubtitlesWidth ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SubtitlesWidth") == 0) { + else if (name == "SubtitlesWidth") { _scValue->setInt(_subtitlesWidth); return _scValue; } @@ -704,7 +705,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SubtitlesPosRelative ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SubtitlesPosRelative") == 0) { + else if (name == "SubtitlesPosRelative") { _scValue->setBool(_subtitlesModRelative); return _scValue; } @@ -712,7 +713,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SubtitlesPosX ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SubtitlesPosX") == 0) { + else if (name == "SubtitlesPosX") { _scValue->setInt(_subtitlesModX); return _scValue; } @@ -720,7 +721,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SubtitlesPosY ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SubtitlesPosY") == 0) { + else if (name == "SubtitlesPosY") { _scValue->setInt(_subtitlesModY); return _scValue; } @@ -728,7 +729,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // SubtitlesPosXCenter ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "SubtitlesPosXCenter") == 0) { + else if (name == "SubtitlesPosXCenter") { _scValue->setBool(_subtitlesModXCenter); return _scValue; } @@ -736,7 +737,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NumItems (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NumItems") == 0) { + else if (name == "NumItems") { _scValue->setInt(getInventory()->_takenItems.size()); return _scValue; } @@ -744,7 +745,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ParticleEmitter (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ParticleEmitter") == 0) { + else if (name == "ParticleEmitter") { if (_partEmitter) { _scValue->setNative(_partEmitter, true); } else { @@ -757,7 +758,7 @@ ScValue *AdObject::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NumAttachments (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NumAttachments") == 0) { + else if (name == "NumAttachments") { _scValue->setInt(_attachmentsPre.size() + _attachmentsPost.size()); return _scValue; } else { diff --git a/engines/wintermute/ad/ad_object.h b/engines/wintermute/ad/ad_object.h index 8395f58cff..d1a20908e1 100644 --- a/engines/wintermute/ad/ad_object.h +++ b/engines/wintermute/ad/ad_object.h @@ -100,7 +100,7 @@ public: AdRegion *_currentRegions[MAX_NUM_REGIONS]; // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ad/ad_region.cpp b/engines/wintermute/ad/ad_region.cpp index 88bd8201a2..c9f1553c9a 100644 --- a/engines/wintermute/ad/ad_region.cpp +++ b/engines/wintermute/ad/ad_region.cpp @@ -27,12 +27,12 @@ */ #include "engines/wintermute/ad/ad_region.h" -#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_dynamic_buffer.h" -#include "engines/wintermute/base/scriptables/script_value.h" -#include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/base_game.h" #include "engines/wintermute/base/base_file_manager.h" +#include "engines/wintermute/base/base_parser.h" +#include "engines/wintermute/base/scriptables/script_value.h" +#include "engines/wintermute/base/scriptables/script.h" namespace Wintermute { @@ -242,13 +242,13 @@ bool AdRegion::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// -ScValue *AdRegion::scGetProperty(const char *name) { +ScValue *AdRegion::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("ad region"); return _scValue; } @@ -256,7 +256,7 @@ ScValue *AdRegion::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Name ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Name") == 0) { + else if (name == "Name") { _scValue->setString(getName()); return _scValue; } @@ -264,7 +264,7 @@ ScValue *AdRegion::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Blocked ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Blocked") == 0) { + else if (name == "Blocked") { _scValue->setBool(_blocked); return _scValue; } @@ -272,7 +272,7 @@ ScValue *AdRegion::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Decoration ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Decoration") == 0) { + else if (name == "Decoration") { _scValue->setBool(_decoration); return _scValue; } @@ -280,7 +280,7 @@ ScValue *AdRegion::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Scale ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Scale") == 0) { + else if (name == "Scale") { _scValue->setFloat(_zoom); return _scValue; } @@ -288,7 +288,7 @@ ScValue *AdRegion::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // AlphaColor ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "AlphaColor") == 0) { + else if (name == "AlphaColor") { _scValue->setInt((int)_alpha); return _scValue; } else { diff --git a/engines/wintermute/ad/ad_region.h b/engines/wintermute/ad/ad_region.h index a60cb9a3f2..6112900361 100644 --- a/engines/wintermute/ad/ad_region.h +++ b/engines/wintermute/ad/ad_region.h @@ -47,7 +47,7 @@ public: virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ad/ad_response.cpp b/engines/wintermute/ad/ad_response.cpp index 37f46118bf..a2225f2632 100644 --- a/engines/wintermute/ad/ad_response.cpp +++ b/engines/wintermute/ad/ad_response.cpp @@ -28,8 +28,8 @@ #include "engines/wintermute/ad/ad_response.h" #include "engines/wintermute/base/base_game.h" -#include "engines/wintermute/base/font/base_font_storage.h" #include "engines/wintermute/base/base_sprite.h" +#include "engines/wintermute/base/font/base_font_storage.h" #include "engines/wintermute/utils/utils.h" namespace Wintermute { diff --git a/engines/wintermute/ad/ad_response_box.cpp b/engines/wintermute/ad/ad_response_box.cpp index a27f1ca54b..fb31aa0bb8 100644 --- a/engines/wintermute/ad/ad_response_box.cpp +++ b/engines/wintermute/ad/ad_response_box.cpp @@ -27,19 +27,20 @@ */ #include "engines/wintermute/ad/ad_game.h" +#include "engines/wintermute/ad/ad_response.h" #include "engines/wintermute/ad/ad_response_box.h" +#include "engines/wintermute/base/base_dynamic_buffer.h" +#include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/base/base_parser.h" +#include "engines/wintermute/base/base_sprite.h" #include "engines/wintermute/base/base_surface_storage.h" -#include "engines/wintermute/ui/ui_button.h" -#include "engines/wintermute/ui/ui_window.h" -#include "engines/wintermute/base/base_dynamic_buffer.h" #include "engines/wintermute/base/font/base_font_storage.h" #include "engines/wintermute/base/font/base_font.h" -#include "engines/wintermute/ad/ad_response.h" +#include "engines/wintermute/base/gfx/base_renderer.h" #include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/scriptables/script_stack.h" -#include "engines/wintermute/base/base_sprite.h" -#include "engines/wintermute/base/base_file_manager.h" +#include "engines/wintermute/ui/ui_button.h" +#include "engines/wintermute/ui/ui_window.h" #include "engines/wintermute/utils/utils.h" #include "engines/wintermute/platform_osystem.h" #include "engines/wintermute/wintermute.h" diff --git a/engines/wintermute/ad/ad_rot_level.cpp b/engines/wintermute/ad/ad_rot_level.cpp index ca7ed693ad..fb9a4a47b9 100644 --- a/engines/wintermute/ad/ad_rot_level.cpp +++ b/engines/wintermute/ad/ad_rot_level.cpp @@ -27,11 +27,11 @@ */ #include "engines/wintermute/ad/ad_rot_level.h" -#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_dynamic_buffer.h" +#include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/base/base_game.h" +#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_sprite.h" -#include "engines/wintermute/base/base_file_manager.h" namespace Wintermute { diff --git a/engines/wintermute/ad/ad_scale_level.cpp b/engines/wintermute/ad/ad_scale_level.cpp index 8b68cc5d32..4e9293d875 100644 --- a/engines/wintermute/ad/ad_scale_level.cpp +++ b/engines/wintermute/ad/ad_scale_level.cpp @@ -28,9 +28,9 @@ #include "engines/wintermute/ad/ad_scale_level.h" #include "engines/wintermute/base/base_parser.h" -#include "engines/wintermute/base/base_dynamic_buffer.h" -#include "engines/wintermute/base/base_game.h" #include "engines/wintermute/base/base_file_manager.h" +#include "engines/wintermute/base/base_game.h" +#include "engines/wintermute/base/base_dynamic_buffer.h" namespace Wintermute { diff --git a/engines/wintermute/ad/ad_scene.cpp b/engines/wintermute/ad/ad_scene.cpp index e47acc63c9..8e9beca0c0 100644 --- a/engines/wintermute/ad/ad_scene.cpp +++ b/engines/wintermute/ad/ad_scene.cpp @@ -52,6 +52,7 @@ #include "engines/wintermute/base/base_scriptable.h" #include "engines/wintermute/base/base_sprite.h" #include "engines/wintermute/base/base_viewport.h" +#include "engines/wintermute/base/gfx/base_renderer.h" #include "engines/wintermute/base/scriptables/script_stack.h" #include "engines/wintermute/base/scriptables/script_value.h" #include "engines/wintermute/base/scriptables/script.h" @@ -1808,13 +1809,13 @@ bool AdScene::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, ////////////////////////////////////////////////////////////////////////// -ScValue *AdScene::scGetProperty(const char *name) { +ScValue *AdScene::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("scene"); return _scValue; } @@ -1822,7 +1823,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NumLayers (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NumLayers") == 0) { + else if (name == "NumLayers") { _scValue->setInt(_layers.size()); return _scValue; } @@ -1830,7 +1831,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NumWaypointGroups (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NumWaypointGroups") == 0) { + else if (name == "NumWaypointGroups") { _scValue->setInt(_waypointGroups.size()); return _scValue; } @@ -1838,7 +1839,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // MainLayer (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "MainLayer") == 0) { + else if (name == "MainLayer") { if (_mainLayer) { _scValue->setNative(_mainLayer, true); } else { @@ -1851,7 +1852,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // NumFreeNodes (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "NumFreeNodes") == 0) { + else if (name == "NumFreeNodes") { _scValue->setInt(_objects.size()); return _scValue; } @@ -1859,7 +1860,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // MouseX (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "MouseX") == 0) { + else if (name == "MouseX") { int viewportX; getViewportOffset(&viewportX); @@ -1870,7 +1871,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // MouseY (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "MouseY") == 0) { + else if (name == "MouseY") { int viewportY; getViewportOffset(NULL, &viewportY); @@ -1881,7 +1882,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // AutoScroll ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "AutoScroll") == 0) { + else if (name == "AutoScroll") { _scValue->setBool(_autoScroll); return _scValue; } @@ -1889,7 +1890,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // PersistentState ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "PersistentState") == 0) { + else if (name == "PersistentState") { _scValue->setBool(_persistentState); return _scValue; } @@ -1897,7 +1898,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // PersistentStateSprites ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "PersistentStateSprites") == 0) { + else if (name == "PersistentStateSprites") { _scValue->setBool(_persistentStateSprites); return _scValue; } @@ -1905,7 +1906,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ScrollPixelsX ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ScrollPixelsX") == 0) { + else if (name == "ScrollPixelsX") { _scValue->setInt(_scrollPixelsH); return _scValue; } @@ -1913,7 +1914,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ScrollPixelsY ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ScrollPixelsY") == 0) { + else if (name == "ScrollPixelsY") { _scValue->setInt(_scrollPixelsV); return _scValue; } @@ -1922,7 +1923,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ScrollSpeedX ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ScrollSpeedX") == 0) { + else if (name == "ScrollSpeedX") { _scValue->setInt(_scrollTimeH); return _scValue; } @@ -1930,7 +1931,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // ScrollSpeedY ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "ScrollSpeedY") == 0) { + else if (name == "ScrollSpeedY") { _scValue->setInt(_scrollTimeV); return _scValue; } @@ -1938,7 +1939,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // OffsetX ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "OffsetX") == 0) { + else if (name == "OffsetX") { _scValue->setInt(_offsetLeft); return _scValue; } @@ -1946,7 +1947,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // OffsetY ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "OffsetY") == 0) { + else if (name == "OffsetY") { _scValue->setInt(_offsetTop); return _scValue; } @@ -1954,7 +1955,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Width (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Width") == 0) { + else if (name == "Width") { if (_mainLayer) { _scValue->setInt(_mainLayer->_width); } else { @@ -1966,7 +1967,7 @@ ScValue *AdScene::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Height (RO) ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Height") == 0) { + else if (name == "Height") { if (_mainLayer) { _scValue->setInt(_mainLayer->_height); } else { diff --git a/engines/wintermute/ad/ad_scene.h b/engines/wintermute/ad/ad_scene.h index c9c0e413bf..3b482403b5 100644 --- a/engines/wintermute/ad/ad_scene.h +++ b/engines/wintermute/ad/ad_scene.h @@ -156,7 +156,7 @@ public: int getPointsDist(BasePoint p1, BasePoint p2, BaseObject *requester = NULL); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ad/ad_scene_state.cpp b/engines/wintermute/ad/ad_scene_state.cpp index c09e6a259c..6b34f1af53 100644 --- a/engines/wintermute/ad/ad_scene_state.cpp +++ b/engines/wintermute/ad/ad_scene_state.cpp @@ -26,9 +26,9 @@ * Copyright (c) 2011 Jan Nedoma */ -#include "engines/wintermute/persistent.h" #include "engines/wintermute/ad/ad_scene_state.h" #include "engines/wintermute/ad/ad_node_state.h" +#include "engines/wintermute/persistent.h" #include "engines/wintermute/platform_osystem.h" #include "common/str.h" diff --git a/engines/wintermute/ad/ad_sentence.cpp b/engines/wintermute/ad/ad_sentence.cpp index 1f09d3ae0f..cfe4191b07 100644 --- a/engines/wintermute/ad/ad_sentence.cpp +++ b/engines/wintermute/ad/ad_sentence.cpp @@ -26,17 +26,18 @@ * Copyright (c) 2011 Jan Nedoma */ +#include "engines/wintermute/ad/ad_game.h" +#include "engines/wintermute/ad/ad_scene.h" #include "engines/wintermute/ad/ad_sentence.h" #include "engines/wintermute/ad/ad_talk_def.h" #include "engines/wintermute/ad/ad_talk_node.h" -#include "engines/wintermute/ad/ad_game.h" #include "engines/wintermute/utils/path_util.h" #include "engines/wintermute/base/base_game.h" -#include "engines/wintermute/base/sound/base_sound.h" -#include "engines/wintermute/ad/ad_scene.h" -#include "engines/wintermute/base/font/base_font.h" #include "engines/wintermute/base/base_sprite.h" #include "engines/wintermute/base/base_file_manager.h" +#include "engines/wintermute/base/font/base_font.h" +#include "engines/wintermute/base/gfx/base_renderer.h" +#include "engines/wintermute/base/sound/base_sound.h" namespace Wintermute { diff --git a/engines/wintermute/ad/ad_sprite_set.cpp b/engines/wintermute/ad/ad_sprite_set.cpp index c8cdec03c3..345b483a8f 100644 --- a/engines/wintermute/ad/ad_sprite_set.cpp +++ b/engines/wintermute/ad/ad_sprite_set.cpp @@ -27,10 +27,10 @@ */ #include "engines/wintermute/ad/ad_sprite_set.h" -#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_dynamic_buffer.h" #include "engines/wintermute/base/base_game.h" #include "engines/wintermute/base/base_file_manager.h" +#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_sprite.h" namespace Wintermute { diff --git a/engines/wintermute/ad/ad_talk_def.cpp b/engines/wintermute/ad/ad_talk_def.cpp index 8cb489509b..a85cd7f986 100644 --- a/engines/wintermute/ad/ad_talk_def.cpp +++ b/engines/wintermute/ad/ad_talk_def.cpp @@ -26,13 +26,13 @@ * Copyright (c) 2011 Jan Nedoma */ +#include "engines/wintermute/ad/ad_sprite_set.h" #include "engines/wintermute/ad/ad_talk_def.h" #include "engines/wintermute/ad/ad_talk_node.h" #include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_game.h" #include "engines/wintermute/base/base_dynamic_buffer.h" #include "engines/wintermute/base/base_sprite.h" -#include "engines/wintermute/ad/ad_sprite_set.h" #include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/utils/utils.h" diff --git a/engines/wintermute/ad/ad_talk_holder.cpp b/engines/wintermute/ad/ad_talk_holder.cpp index 1e4ec26459..cca4fdc2cb 100644 --- a/engines/wintermute/ad/ad_talk_holder.cpp +++ b/engines/wintermute/ad/ad_talk_holder.cpp @@ -28,13 +28,13 @@ #include "engines/wintermute/ad/ad_talk_holder.h" #include "engines/wintermute/base/base_dynamic_buffer.h" +#include "engines/wintermute/base/base_engine.h" +#include "engines/wintermute/base/base_game.h" +#include "engines/wintermute/base/base_sprite.h" #include "engines/wintermute/base/scriptables/script_value.h" #include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/scriptables/script_stack.h" -#include "engines/wintermute/base/base_game.h" -#include "engines/wintermute/base/base_sprite.h" #include "engines/wintermute/platform_osystem.h" -#include "engines/wintermute/base/base_engine.h" #include "common/str.h" namespace Wintermute { @@ -334,13 +334,13 @@ bool AdTalkHolder::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisS ////////////////////////////////////////////////////////////////////////// -ScValue *AdTalkHolder::scGetProperty(const char *name) { +ScValue *AdTalkHolder::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type (RO) ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("talk-holder"); return _scValue; } else { diff --git a/engines/wintermute/ad/ad_talk_holder.h b/engines/wintermute/ad/ad_talk_holder.h index ce10364b3d..d52ebf63c0 100644 --- a/engines/wintermute/ad/ad_talk_holder.h +++ b/engines/wintermute/ad/ad_talk_holder.h @@ -45,7 +45,7 @@ public: virtual ~AdTalkHolder(); // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); diff --git a/engines/wintermute/ad/ad_talk_node.cpp b/engines/wintermute/ad/ad_talk_node.cpp index b43a2b288e..c909ee27ff 100644 --- a/engines/wintermute/ad/ad_talk_node.cpp +++ b/engines/wintermute/ad/ad_talk_node.cpp @@ -26,12 +26,12 @@ * Copyright (c) 2011 Jan Nedoma */ +#include "engines/wintermute/ad/ad_sprite_set.h" #include "engines/wintermute/ad/ad_talk_node.h" #include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_dynamic_buffer.h" #include "engines/wintermute/base/base_game.h" #include "engines/wintermute/base/base_sprite.h" -#include "engines/wintermute/ad/ad_sprite_set.h" #include "engines/wintermute/utils/utils.h" namespace Wintermute { @@ -264,9 +264,9 @@ bool AdTalkNode::loadSprite() { bool AdTalkNode::isInTimeInterval(uint32 time, TDirection dir) { if (time >= _startTime) { if (_playToEnd) { - if ((_spriteFilename && _sprite == NULL) || (_sprite && _sprite->_finished == false)) { + if ((_spriteFilename && _sprite == NULL) || (_sprite && _sprite->isFinished() == false)) { return true; - } else if ((_spriteSetFilename && _spriteSet == NULL) || (_spriteSet && _spriteSet->getSprite(dir) && _spriteSet->getSprite(dir)->_finished == false)) { + } else if ((_spriteSetFilename && _spriteSet == NULL) || (_spriteSet && _spriteSet->getSprite(dir) && _spriteSet->getSprite(dir)->isFinished() == false)) { return true; } else { return false; diff --git a/engines/wintermute/ad/ad_waypoint_group.cpp b/engines/wintermute/ad/ad_waypoint_group.cpp index 984ed75aeb..81493ce769 100644 --- a/engines/wintermute/ad/ad_waypoint_group.cpp +++ b/engines/wintermute/ad/ad_waypoint_group.cpp @@ -27,12 +27,12 @@ */ #include "engines/wintermute/ad/ad_waypoint_group.h" -#include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_dynamic_buffer.h" -#include "engines/wintermute/base/scriptables/script_value.h" #include "engines/wintermute/base/base_game.h" -#include "engines/wintermute/base/base_region.h" #include "engines/wintermute/base/base_file_manager.h" +#include "engines/wintermute/base/base_parser.h" +#include "engines/wintermute/base/base_region.h" +#include "engines/wintermute/base/scriptables/script_value.h" #include <limits.h> namespace Wintermute { @@ -206,13 +206,13 @@ bool AdWaypointGroup::persist(BasePersistenceManager *persistMgr) { ////////////////////////////////////////////////////////////////////////// -ScValue *AdWaypointGroup::scGetProperty(const char *name) { +ScValue *AdWaypointGroup::scGetProperty(const Common::String &name) { _scValue->setNULL(); ////////////////////////////////////////////////////////////////////////// // Type ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Type") == 0) { + if (name == "Type") { _scValue->setString("waypoint-group"); return _scValue; } @@ -220,7 +220,7 @@ ScValue *AdWaypointGroup::scGetProperty(const char *name) { ////////////////////////////////////////////////////////////////////////// // Active ////////////////////////////////////////////////////////////////////////// - else if (strcmp(name, "Active") == 0) { + else if (name == "Active") { _scValue->setBool(_active); return _scValue; } else { diff --git a/engines/wintermute/ad/ad_waypoint_group.h b/engines/wintermute/ad/ad_waypoint_group.h index 5cf6da1d1a..13d6bbadd7 100644 --- a/engines/wintermute/ad/ad_waypoint_group.h +++ b/engines/wintermute/ad/ad_waypoint_group.h @@ -49,7 +49,7 @@ public: virtual ~AdWaypointGroup(); BaseArray<BasePoint *> _points; int _editorSelectedPoint; - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); }; |