aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wintermute/ad/ad_actor.cpp16
-rw-r--r--engines/wintermute/ad/ad_actor.h2
-rw-r--r--engines/wintermute/ad/ad_entity.cpp16
-rw-r--r--engines/wintermute/ad/ad_entity.h2
-rw-r--r--engines/wintermute/ad/ad_game.cpp36
-rw-r--r--engines/wintermute/ad/ad_game.h2
-rw-r--r--engines/wintermute/ad/ad_item.cpp20
-rw-r--r--engines/wintermute/ad/ad_item.h2
-rw-r--r--engines/wintermute/ad/ad_layer.cpp16
-rw-r--r--engines/wintermute/ad/ad_layer.h2
-rw-r--r--engines/wintermute/ad/ad_object.cpp26
-rw-r--r--engines/wintermute/ad/ad_object.h2
-rw-r--r--engines/wintermute/ad/ad_region.cpp14
-rw-r--r--engines/wintermute/ad/ad_region.h2
-rw-r--r--engines/wintermute/ad/ad_scene.cpp38
-rw-r--r--engines/wintermute/ad/ad_scene.h2
-rw-r--r--engines/wintermute/ad/ad_talk_holder.cpp4
-rw-r--r--engines/wintermute/ad/ad_talk_holder.h2
-rw-r--r--engines/wintermute/ad/ad_waypoint_group.cpp6
-rw-r--r--engines/wintermute/ad/ad_waypoint_group.h2
-rw-r--r--engines/wintermute/base/base_frame.cpp18
-rw-r--r--engines/wintermute/base/base_frame.h2
-rw-r--r--engines/wintermute/base/base_game.cpp96
-rw-r--r--engines/wintermute/base/base_game.h2
-rw-r--r--engines/wintermute/base/base_keyboard_state.cpp16
-rw-r--r--engines/wintermute/base/base_keyboard_state.h2
-rw-r--r--engines/wintermute/base/base_object.cpp48
-rw-r--r--engines/wintermute/base/base_object.h2
-rw-r--r--engines/wintermute/base/base_region.cpp10
-rw-r--r--engines/wintermute/base/base_region.h2
-rw-r--r--engines/wintermute/base/base_script_holder.cpp8
-rw-r--r--engines/wintermute/base/base_script_holder.h2
-rw-r--r--engines/wintermute/base/base_scriptable.cpp4
-rw-r--r--engines/wintermute/base/base_scriptable.h2
-rw-r--r--engines/wintermute/base/base_sprite.cpp18
-rw-r--r--engines/wintermute/base/base_sprite.h2
-rw-r--r--engines/wintermute/base/base_sub_frame.cpp22
-rw-r--r--engines/wintermute/base/base_sub_frame.h2
-rw-r--r--engines/wintermute/base/particles/part_emitter.cpp72
-rw-r--r--engines/wintermute/base/particles/part_emitter.h2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_array.cpp8
-rw-r--r--engines/wintermute/base/scriptables/script_ext_array.h2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_date.cpp6
-rw-r--r--engines/wintermute/base/scriptables/script_ext_date.h2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.cpp14
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.h2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_math.cpp6
-rw-r--r--engines/wintermute/base/scriptables/script_ext_math.h2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp6
-rw-r--r--engines/wintermute/base/scriptables/script_ext_mem_buffer.h2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_string.cpp8
-rw-r--r--engines/wintermute/base/scriptables/script_ext_string.h2
-rw-r--r--engines/wintermute/ui/ui_button.cpp12
-rw-r--r--engines/wintermute/ui/ui_button.h2
-rw-r--r--engines/wintermute/ui/ui_edit.cpp18
-rw-r--r--engines/wintermute/ui/ui_edit.h2
-rw-r--r--engines/wintermute/ui/ui_entity.cpp6
-rw-r--r--engines/wintermute/ui/ui_entity.h2
-rw-r--r--engines/wintermute/ui/ui_object.cpp24
-rw-r--r--engines/wintermute/ui/ui_object.h2
-rw-r--r--engines/wintermute/ui/ui_text.cpp8
-rw-r--r--engines/wintermute/ui/ui_text.h2
-rw-r--r--engines/wintermute/ui/ui_window.cpp22
-rw-r--r--engines/wintermute/ui/ui_window.h2
64 files changed, 353 insertions, 353 deletions
diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp
index fa06bb12e8..d175855d1e 100644
--- a/engines/wintermute/ad/ad_actor.cpp
+++ b/engines/wintermute/ad/ad_actor.cpp
@@ -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 {
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 f97284ae1d..9af7e034ca 100644
--- a/engines/wintermute/ad/ad_entity.cpp
+++ b/engines/wintermute/ad/ad_entity.cpp
@@ -829,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;
}
@@ -843,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 {
@@ -856,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 {
@@ -869,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;
}
@@ -877,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;
}
@@ -885,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;
}
@@ -893,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 ec6c5dca31..4481b774c1 100644
--- a/engines/wintermute/ad/ad_game.cpp
+++ b/engines/wintermute/ad/ad_game.cpp
@@ -876,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 {
@@ -901,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);
@@ -914,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;
}
@@ -929,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;
}
@@ -937,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 {
@@ -950,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;
}
@@ -958,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 {
@@ -970,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 {
@@ -982,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 {
@@ -994,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 {
@@ -1006,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 {
@@ -1019,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;
}
@@ -1027,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;
}
@@ -1035,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;
}
@@ -1043,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_item.cpp b/engines/wintermute/ad/ad_item.cpp
index 55ccca8d0a..427b1c7db4 100644
--- a/engines/wintermute/ad/ad_item.cpp
+++ b/engines/wintermute/ad/ad_item.cpp
@@ -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 bc64b21208..209c12b7a2 100644
--- a/engines/wintermute/ad/ad_layer.cpp
+++ b/engines/wintermute/ad/ad_layer.cpp
@@ -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 013ce498e0..7b91daab2e 100644
--- a/engines/wintermute/ad/ad_object.cpp
+++ b/engines/wintermute/ad/ad_object.cpp
@@ -659,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;
}
@@ -673,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;
}
@@ -681,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;
}
@@ -689,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;
}
@@ -697,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;
}
@@ -705,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;
}
@@ -713,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;
}
@@ -721,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;
}
@@ -729,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;
}
@@ -737,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;
}
@@ -745,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 {
@@ -758,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 2b90b479bf..c9f1553c9a 100644
--- a/engines/wintermute/ad/ad_region.cpp
+++ b/engines/wintermute/ad/ad_region.cpp
@@ -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_scene.cpp b/engines/wintermute/ad/ad_scene.cpp
index 8c4bff02ac..8e9beca0c0 100644
--- a/engines/wintermute/ad/ad_scene.cpp
+++ b/engines/wintermute/ad/ad_scene.cpp
@@ -1809,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;
}
@@ -1823,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;
}
@@ -1831,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;
}
@@ -1839,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 {
@@ -1852,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;
}
@@ -1860,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);
@@ -1871,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);
@@ -1882,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;
}
@@ -1890,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;
}
@@ -1898,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;
}
@@ -1906,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;
}
@@ -1914,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;
}
@@ -1923,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;
}
@@ -1931,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;
}
@@ -1939,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;
}
@@ -1947,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;
}
@@ -1955,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 {
@@ -1967,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_talk_holder.cpp b/engines/wintermute/ad/ad_talk_holder.cpp
index 1422d8683c..cca4fdc2cb 100644
--- a/engines/wintermute/ad/ad_talk_holder.cpp
+++ b/engines/wintermute/ad/ad_talk_holder.cpp
@@ -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_waypoint_group.cpp b/engines/wintermute/ad/ad_waypoint_group.cpp
index f80fa7e45d..81493ce769 100644
--- a/engines/wintermute/ad/ad_waypoint_group.cpp
+++ b/engines/wintermute/ad/ad_waypoint_group.cpp
@@ -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);
};
diff --git a/engines/wintermute/base/base_frame.cpp b/engines/wintermute/base/base_frame.cpp
index 3e67c29d2f..7c64144480 100644
--- a/engines/wintermute/base/base_frame.cpp
+++ b/engines/wintermute/base/base_frame.cpp
@@ -624,7 +624,7 @@ bool BaseFrame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStac
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseFrame::scGetProperty(const char *name) {
+ScValue *BaseFrame::scGetProperty(const Common::String &name) {
if (!_scValue) {
_scValue = new ScValue(_gameRef);
}
@@ -633,7 +633,7 @@ ScValue *BaseFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("frame");
return _scValue;
}
@@ -641,7 +641,7 @@ ScValue *BaseFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Delay
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Delay") == 0) {
+ else if (name == "Delay") {
_scValue->setInt(_delay);
return _scValue;
}
@@ -649,7 +649,7 @@ ScValue *BaseFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Keyframe
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Keyframe") == 0) {
+ else if (name == "Keyframe") {
_scValue->setBool(_keyframe);
return _scValue;
}
@@ -657,7 +657,7 @@ ScValue *BaseFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// KillSounds
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "KillSounds") == 0) {
+ else if (name == "KillSounds") {
_scValue->setBool(_killSound);
return _scValue;
}
@@ -665,7 +665,7 @@ ScValue *BaseFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MoveX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MoveX") == 0) {
+ else if (name == "MoveX") {
_scValue->setInt(_moveX);
return _scValue;
}
@@ -673,7 +673,7 @@ ScValue *BaseFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MoveY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MoveY") == 0) {
+ else if (name == "MoveY") {
_scValue->setInt(_moveY);
return _scValue;
}
@@ -681,7 +681,7 @@ ScValue *BaseFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// NumSubframes (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "NumSubframes") == 0) {
+ else if (name == "NumSubframes") {
_scValue->setInt(_subframes.size());
return _scValue;
}
@@ -689,7 +689,7 @@ ScValue *BaseFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// NumEvents (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "NumEvents") == 0) {
+ else if (name == "NumEvents") {
_scValue->setInt(_applyEvent.size());
return _scValue;
}
diff --git a/engines/wintermute/base/base_frame.h b/engines/wintermute/base/base_frame.h
index 60887210f4..7c5d893e70 100644
--- a/engines/wintermute/base/base_frame.h
+++ b/engines/wintermute/base/base_frame.h
@@ -60,7 +60,7 @@ public:
BaseArray<const char *> _applyEvent;
// 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/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index 7b0024414e..f0b1171ca4 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -2241,27 +2241,27 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseGame::scGetProperty(const char *name) {
+ScValue *BaseGame::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("game");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Name") == 0) {
+ else if (name == "Name") {
_scValue->setString(getName());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Hwnd (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Hwnd") == 0) {
+ else if (name == "Hwnd") {
_scValue->setInt((int)_renderer->_window);
return _scValue;
}
@@ -2269,7 +2269,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// CurrentTime (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "CurrentTime") == 0) {
+ else if (name == "CurrentTime") {
_scValue->setInt((int)_timer);
return _scValue;
}
@@ -2277,7 +2277,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// WindowsTime (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "WindowsTime") == 0) {
+ else if (name == "WindowsTime") {
_scValue->setInt((int)g_system->getMillis());
return _scValue;
}
@@ -2285,7 +2285,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// WindowedMode (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "WindowedMode") == 0) {
+ else if (name == "WindowedMode") {
_scValue->setBool(_renderer->_windowed);
return _scValue;
}
@@ -2293,7 +2293,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MouseX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MouseX") == 0) {
+ else if (name == "MouseX") {
_scValue->setInt(_mousePos.x);
return _scValue;
}
@@ -2301,7 +2301,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MouseY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MouseY") == 0) {
+ else if (name == "MouseY") {
_scValue->setInt(_mousePos.y);
return _scValue;
}
@@ -2309,7 +2309,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MainObject
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MainObject") == 0) {
+ else if (name == "MainObject") {
_scValue->setNative(_mainObject, true);
return _scValue;
}
@@ -2317,7 +2317,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// ActiveObject (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ActiveObject") == 0) {
+ else if (name == "ActiveObject") {
_scValue->setNative(_activeObject, true);
return _scValue;
}
@@ -2325,7 +2325,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// ScreenWidth (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ScreenWidth") == 0) {
+ else if (name == "ScreenWidth") {
_scValue->setInt(_renderer->_width);
return _scValue;
}
@@ -2333,7 +2333,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// ScreenHeight (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ScreenHeight") == 0) {
+ else if (name == "ScreenHeight") {
_scValue->setInt(_renderer->_height);
return _scValue;
}
@@ -2341,7 +2341,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Interactive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Interactive") == 0) {
+ else if (name == "Interactive") {
_scValue->setBool(_interactive);
return _scValue;
}
@@ -2349,7 +2349,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// DebugMode (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "DebugMode") == 0) {
+ else if (name == "DebugMode") {
_scValue->setBool(_debugDebugMode);
return _scValue;
}
@@ -2357,7 +2357,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SoundAvailable (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SoundAvailable") == 0) {
+ else if (name == "SoundAvailable") {
_scValue->setBool(_soundMgr->_soundAvailable);
return _scValue;
}
@@ -2365,7 +2365,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SFXVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SFXVolume") == 0) {
+ else if (name == "SFXVolume") {
_gameRef->LOG(0, "**Warning** The SFXVolume attribute is obsolete");
_scValue->setInt(_soundMgr->getVolumePercent(Audio::Mixer::kSFXSoundType));
return _scValue;
@@ -2374,7 +2374,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SpeechVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SpeechVolume") == 0) {
+ else if (name == "SpeechVolume") {
_gameRef->LOG(0, "**Warning** The SpeechVolume attribute is obsolete");
_scValue->setInt(_soundMgr->getVolumePercent(Audio::Mixer::kSpeechSoundType));
return _scValue;
@@ -2383,7 +2383,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MusicVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MusicVolume") == 0) {
+ else if (name == "MusicVolume") {
_gameRef->LOG(0, "**Warning** The MusicVolume attribute is obsolete");
_scValue->setInt(_soundMgr->getVolumePercent(Audio::Mixer::kMusicSoundType));
return _scValue;
@@ -2392,7 +2392,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MasterVolume
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MasterVolume") == 0) {
+ else if (name == "MasterVolume") {
_gameRef->LOG(0, "**Warning** The MasterVolume attribute is obsolete");
_scValue->setInt(_soundMgr->getMasterVolumePercent());
return _scValue;
@@ -2401,7 +2401,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Keyboard (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Keyboard") == 0) {
+ else if (name == "Keyboard") {
if (_keyboardState) {
_scValue->setNative(_keyboardState, true);
} else {
@@ -2414,7 +2414,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Subtitles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Subtitles") == 0) {
+ else if (name == "Subtitles") {
_scValue->setBool(_subtitles);
return _scValue;
}
@@ -2422,14 +2422,14 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SubtitlesSpeed
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SubtitlesSpeed") == 0) {
+ else if (name == "SubtitlesSpeed") {
_scValue->setInt(_subtitlesSpeed);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// VideoSubtitles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "VideoSubtitles") == 0) {
+ else if (name == "VideoSubtitles") {
_scValue->setBool(_videoSubtitles);
return _scValue;
}
@@ -2437,7 +2437,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// FPS (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "FPS") == 0) {
+ else if (name == "FPS") {
_scValue->setInt(_fps);
return _scValue;
}
@@ -2445,7 +2445,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AcceleratedMode / Accelerated (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AcceleratedMode") == 0 || strcmp(name, "Accelerated") == 0) {
+ else if (name == "AcceleratedMode" || name == "Accelerated") {
_scValue->setBool(_useD3D);
return _scValue;
}
@@ -2453,7 +2453,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// TextEncoding
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "TextEncoding") == 0) {
+ else if (name == "TextEncoding") {
_scValue->setInt(_textEncoding);
return _scValue;
}
@@ -2461,7 +2461,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// TextRTL
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "TextRTL") == 0) {
+ else if (name == "TextRTL") {
_scValue->setBool(_textRTL);
return _scValue;
}
@@ -2469,7 +2469,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SoundBufferSize
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SoundBufferSize") == 0) {
+ else if (name == "SoundBufferSize") {
_scValue->setInt(_soundBufferSizeSec);
return _scValue;
}
@@ -2477,7 +2477,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SuspendedRendering
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SuspendedRendering") == 0) {
+ else if (name == "SuspendedRendering") {
_scValue->setBool(_suspendedRendering);
return _scValue;
}
@@ -2485,7 +2485,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SuppressScriptErrors
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SuppressScriptErrors") == 0) {
+ else if (name == "SuppressScriptErrors") {
_scValue->setBool(_suppressScriptErrors);
return _scValue;
}
@@ -2494,7 +2494,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Frozen
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Frozen") == 0) {
+ else if (name == "Frozen") {
_scValue->setBool(_state == GAME_FROZEN);
return _scValue;
}
@@ -2502,7 +2502,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccTTSEnabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccTTSEnabled") == 0) {
+ else if (name == "AccTTSEnabled") {
_scValue->setBool(false);
return _scValue;
}
@@ -2510,7 +2510,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccTTSTalk
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccTTSTalk") == 0) {
+ else if (name == "AccTTSTalk") {
_scValue->setBool(false);
return _scValue;
}
@@ -2518,7 +2518,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccTTSCaptions
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccTTSCaptions") == 0) {
+ else if (name == "AccTTSCaptions") {
_scValue->setBool(false);
return _scValue;
}
@@ -2526,7 +2526,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccTTSKeypress
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccTTSKeypress") == 0) {
+ else if (name == "AccTTSKeypress") {
_scValue->setBool(false);
return _scValue;
}
@@ -2534,7 +2534,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccKeyboardEnabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccKeyboardEnabled") == 0) {
+ else if (name == "AccKeyboardEnabled") {
_scValue->setBool(false);
return _scValue;
}
@@ -2542,7 +2542,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccKeyboardCursorSkip
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccKeyboardCursorSkip") == 0) {
+ else if (name == "AccKeyboardCursorSkip") {
_scValue->setBool(false);
return _scValue;
}
@@ -2550,7 +2550,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccKeyboardPause
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccKeyboardPause") == 0) {
+ else if (name == "AccKeyboardPause") {
_scValue->setBool(false);
return _scValue;
}
@@ -2558,7 +2558,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AutorunDisabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AutorunDisabled") == 0) {
+ else if (name == "AutorunDisabled") {
_scValue->setBool(_autorunDisabled);
return _scValue;
}
@@ -2566,7 +2566,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SaveDirectory (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SaveDirectory") == 0) {
+ else if (name == "SaveDirectory") {
AnsiString dataDir = "saves/"; // TODO: This is just to avoid telling the engine actual paths.
_scValue->setString(dataDir.c_str());
return _scValue;
@@ -2575,7 +2575,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AutoSaveOnExit
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AutoSaveOnExit") == 0) {
+ else if (name == "AutoSaveOnExit") {
_scValue->setBool(_autoSaveOnExit);
return _scValue;
}
@@ -2583,7 +2583,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AutoSaveSlot
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AutoSaveSlot") == 0) {
+ else if (name == "AutoSaveSlot") {
_scValue->setInt(_autoSaveSlot);
return _scValue;
}
@@ -2591,7 +2591,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// CursorHidden
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "CursorHidden") == 0) {
+ else if (name == "CursorHidden") {
_scValue->setBool(_cursorHidden);
return _scValue;
}
@@ -2599,7 +2599,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Platform (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Platform") == 0) {
+ else if (name == "Platform") {
_scValue->setString(BasePlatform::getPlatformName().c_str());
return _scValue;
}
@@ -2607,7 +2607,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// DeviceType (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "DeviceType") == 0) {
+ else if (name == "DeviceType") {
_scValue->setString(getDeviceType().c_str());
return _scValue;
}
@@ -2615,7 +2615,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MostRecentSaveSlot (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MostRecentSaveSlot") == 0) {
+ else if (name == "MostRecentSaveSlot") {
if (!ConfMan.hasKey("most_recent_saveslot")) {
_scValue->setInt(-1);
} else {
@@ -2627,7 +2627,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Store (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Store") == 0) {
+ else if (name == "Store") {
_scValue->setNULL();
error("Request for a SXStore-object, which is not supported by ScummVM");
diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h
index 8c337e82e9..0f764b3d03 100644
--- a/engines/wintermute/base/base_game.h
+++ b/engines/wintermute/base/base_game.h
@@ -164,7 +164,7 @@ public:
virtual bool externalCall(ScScript *script, ScStack *stack, ScStack *thisStack, char *name);
// 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/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp
index fd5f2b0e1d..da7baafd2d 100644
--- a/engines/wintermute/base/base_keyboard_state.cpp
+++ b/engines/wintermute/base/base_keyboard_state.cpp
@@ -103,13 +103,13 @@ bool BaseKeyboardState::scCallMethod(ScScript *script, ScStack *stack, ScStack *
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseKeyboardState::scGetProperty(const char *name) {
+ScValue *BaseKeyboardState::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("keyboard");
return _scValue;
}
@@ -117,7 +117,7 @@ ScValue *BaseKeyboardState::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Key
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Key") == 0) {
+ else if (name == "Key") {
if (_currentPrintable) {
char key[2];
key[0] = (char)_currentCharCode;
@@ -133,7 +133,7 @@ ScValue *BaseKeyboardState::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Printable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Printable") == 0) {
+ else if (name == "Printable") {
_scValue->setBool(_currentPrintable);
return _scValue;
}
@@ -141,7 +141,7 @@ ScValue *BaseKeyboardState::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// KeyCode
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "KeyCode") == 0) {
+ else if (name == "KeyCode") {
_scValue->setInt(_currentCharCode);
return _scValue;
}
@@ -149,7 +149,7 @@ ScValue *BaseKeyboardState::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// IsShift
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "IsShift") == 0) {
+ else if (name == "IsShift") {
_scValue->setBool(_currentShift);
return _scValue;
}
@@ -157,7 +157,7 @@ ScValue *BaseKeyboardState::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// IsAlt
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "IsAlt") == 0) {
+ else if (name == "IsAlt") {
_scValue->setBool(_currentAlt);
return _scValue;
}
@@ -165,7 +165,7 @@ ScValue *BaseKeyboardState::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// IsControl
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "IsControl") == 0) {
+ else if (name == "IsControl") {
_scValue->setBool(_currentControl);
return _scValue;
} else {
diff --git a/engines/wintermute/base/base_keyboard_state.h b/engines/wintermute/base/base_keyboard_state.h
index ebc0c83ee1..dfd0efdec0 100644
--- a/engines/wintermute/base/base_keyboard_state.h
+++ b/engines/wintermute/base/base_keyboard_state.h
@@ -59,7 +59,7 @@ public:
static bool isAltDown();
// 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/base/base_object.cpp b/engines/wintermute/base/base_object.cpp
index b6a6887624..eba8416485 100644
--- a/engines/wintermute/base/base_object.cpp
+++ b/engines/wintermute/base/base_object.cpp
@@ -531,13 +531,13 @@ bool BaseObject::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseObject::scGetProperty(const char *name) {
+ScValue *BaseObject::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("object");
return _scValue;
}
@@ -545,7 +545,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Caption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Caption") == 0) {
+ else if (name == "Caption") {
_scValue->setString(getCaption(1));
return _scValue;
}
@@ -553,7 +553,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "X") == 0) {
+ else if (name == "X") {
_scValue->setInt(_posX);
return _scValue;
}
@@ -561,7 +561,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Y") == 0) {
+ else if (name == "Y") {
_scValue->setInt(_posY);
return _scValue;
}
@@ -569,7 +569,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Height (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Height") == 0) {
+ else if (name == "Height") {
_scValue->setInt(getHeight());
return _scValue;
}
@@ -577,7 +577,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Ready (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Ready") == 0) {
+ else if (name == "Ready") {
_scValue->setBool(_ready);
return _scValue;
}
@@ -585,7 +585,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Movable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Movable") == 0) {
+ else if (name == "Movable") {
_scValue->setBool(_movable);
return _scValue;
}
@@ -593,7 +593,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Registrable/Interactive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Registrable") == 0 || strcmp(name, "Interactive") == 0) {
+ else if (name == "Registrable" || name == "Interactive") {
_scValue->setBool(_registrable);
return _scValue;
}
@@ -601,21 +601,21 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Zoomable/Scalable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Zoomable") == 0 || strcmp(name, "Scalable") == 0) {
+ else if (name == "Zoomable" || name == "Scalable") {
_scValue->setBool(_zoomable);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Rotatable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Rotatable") == 0) {
+ else if (name == "Rotatable") {
_scValue->setBool(_rotatable);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AlphaColor") == 0) {
+ else if (name == "AlphaColor") {
_scValue->setInt((int)_alphaColor);
return _scValue;
}
@@ -623,7 +623,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// BlendMode
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "BlendMode") == 0) {
+ else if (name == "BlendMode") {
_scValue->setInt((int)_blendMode);
return _scValue;
}
@@ -631,7 +631,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Scale
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Scale") == 0) {
+ else if (name == "Scale") {
if (_scale < 0) {
_scValue->setNULL();
} else {
@@ -643,7 +643,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// ScaleX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ScaleX") == 0) {
+ else if (name == "ScaleX") {
if (_scaleX < 0) {
_scValue->setNULL();
} else {
@@ -655,7 +655,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// ScaleY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ScaleY") == 0) {
+ else if (name == "ScaleY") {
if (_scaleY < 0) {
_scValue->setNULL();
} else {
@@ -667,7 +667,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// RelativeScale
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "RelativeScale") == 0) {
+ else if (name == "RelativeScale") {
_scValue->setFloat((double)_relativeScale);
return _scValue;
}
@@ -675,7 +675,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Rotate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Rotate") == 0) {
+ else if (name == "Rotate") {
if (!_rotateValid) {
_scValue->setNULL();
} else {
@@ -687,7 +687,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// RelativeRotate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "RelativeRotate") == 0) {
+ else if (name == "RelativeRotate") {
_scValue->setFloat((double)_relativeRotate);
return _scValue;
}
@@ -695,14 +695,14 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Colorable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Colorable") == 0) {
+ else if (name == "Colorable") {
_scValue->setBool(_shadowable);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// SoundPanning
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SoundPanning") == 0) {
+ else if (name == "SoundPanning") {
_scValue->setBool(_autoSoundPanning);
return _scValue;
}
@@ -710,7 +710,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SaveState
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SaveState") == 0) {
+ else if (name == "SaveState") {
_scValue->setBool(_saveState);
return _scValue;
}
@@ -718,7 +718,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// NonIntMouseEvents
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "NonIntMouseEvents") == 0) {
+ else if (name == "NonIntMouseEvents") {
_scValue->setBool(_nonIntMouseEvents);
return _scValue;
}
@@ -726,7 +726,7 @@ ScValue *BaseObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccCaption
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccCaption") == 0) {
+ else if (name == "AccCaption") {
_scValue->setNULL();
return _scValue;
} else {
diff --git a/engines/wintermute/base/base_object.h b/engines/wintermute/base/base_object.h
index 34adbdb585..d7d91a25f6 100644
--- a/engines/wintermute/base/base_object.h
+++ b/engines/wintermute/base/base_object.h
@@ -136,7 +136,7 @@ public:
public:
// 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/base/base_region.cpp b/engines/wintermute/base/base_region.cpp
index e332ffe9ff..0bc5975e51 100644
--- a/engines/wintermute/base/base_region.cpp
+++ b/engines/wintermute/base/base_region.cpp
@@ -327,13 +327,13 @@ bool BaseRegion::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseRegion::scGetProperty(const char *name) {
+ScValue *BaseRegion::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("region");
return _scValue;
}
@@ -341,7 +341,7 @@ ScValue *BaseRegion::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Name") == 0) {
+ else if (name == "Name") {
_scValue->setString(getName());
return _scValue;
}
@@ -349,7 +349,7 @@ ScValue *BaseRegion::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Active
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Active") == 0) {
+ else if (name == "Active") {
_scValue->setBool(_active);
return _scValue;
}
@@ -357,7 +357,7 @@ ScValue *BaseRegion::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// NumPoints
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "NumPoints") == 0) {
+ else if (name == "NumPoints") {
_scValue->setInt(_points.size());
return _scValue;
} else {
diff --git a/engines/wintermute/base/base_region.h b/engines/wintermute/base/base_region.h
index 51989de630..464f25be2f 100644
--- a/engines/wintermute/base/base_region.h
+++ b/engines/wintermute/base/base_region.h
@@ -55,7 +55,7 @@ public:
virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent, const char *nameOverride);
// 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/base/base_script_holder.cpp b/engines/wintermute/base/base_script_holder.cpp
index d3e6078d43..c5d5e82f76 100644
--- a/engines/wintermute/base/base_script_holder.cpp
+++ b/engines/wintermute/base/base_script_holder.cpp
@@ -219,13 +219,13 @@ bool BaseScriptHolder::scCallMethod(ScScript *script, ScStack *stack, ScStack *t
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseScriptHolder::scGetProperty(const char *name) {
+ScValue *BaseScriptHolder::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("script_holder");
return _scValue;
}
@@ -233,7 +233,7 @@ ScValue *BaseScriptHolder::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Name") == 0) {
+ else if (name == "Name") {
_scValue->setString(getName());
return _scValue;
}
@@ -241,7 +241,7 @@ ScValue *BaseScriptHolder::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Filename (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Filename") == 0) {
+ else if (name == "Filename") {
_scValue->setString(_filename);
return _scValue;
} else {
diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h
index 0c3d7a1a70..5fd0dbec9c 100644
--- a/engines/wintermute/base/base_script_holder.h
+++ b/engines/wintermute/base/base_script_holder.h
@@ -59,7 +59,7 @@ public:
BaseArray<ScScript *> _scripts;
// 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/base/base_scriptable.cpp b/engines/wintermute/base/base_scriptable.cpp
index 143934402b..a2dd8b00e7 100644
--- a/engines/wintermute/base/base_scriptable.cpp
+++ b/engines/wintermute/base/base_scriptable.cpp
@@ -76,12 +76,12 @@ bool BaseScriptable::scCallMethod(ScScript *script, ScStack *stack, ScStack *thi
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseScriptable::scGetProperty(const char *name) {
+ScValue *BaseScriptable::scGetProperty(const Common::String &name) {
if (!_scProp) {
_scProp = new ScValue(_gameRef);
}
if (_scProp) {
- return _scProp->getProp(name);
+ return _scProp->getProp(name.c_str()); // TODO: Change to Common::String
} else {
return NULL;
}
diff --git a/engines/wintermute/base/base_scriptable.h b/engines/wintermute/base/base_scriptable.h
index b006e6e07c..fbe14fc299 100644
--- a/engines/wintermute/base/base_scriptable.h
+++ b/engines/wintermute/base/base_scriptable.h
@@ -50,7 +50,7 @@ public:
// high level scripting interface
virtual bool canHandleMethod(const char *eventMethod);
virtual bool scSetProperty(const char *name, ScValue *value);
- virtual ScValue *scGetProperty(const char *name);
+ virtual ScValue *scGetProperty(const Common::String &name);
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
virtual void *scToMemBuffer();
diff --git a/engines/wintermute/base/base_sprite.cpp b/engines/wintermute/base/base_sprite.cpp
index 0baa25af22..468af1bd75 100644
--- a/engines/wintermute/base/base_sprite.cpp
+++ b/engines/wintermute/base/base_sprite.cpp
@@ -693,13 +693,13 @@ bool BaseSprite::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseSprite::scGetProperty(const char *name) {
+ScValue *BaseSprite::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("sprite");
return _scValue;
}
@@ -707,7 +707,7 @@ ScValue *BaseSprite::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// NumFrames (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "NumFrames") == 0) {
+ else if (name == "NumFrames") {
_scValue->setInt(_frames.size());
return _scValue;
}
@@ -715,7 +715,7 @@ ScValue *BaseSprite::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// CurrentFrame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "CurrentFrame") == 0) {
+ else if (name == "CurrentFrame") {
_scValue->setInt(_currentFrame);
return _scValue;
}
@@ -723,7 +723,7 @@ ScValue *BaseSprite::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "PixelPerfect") == 0) {
+ else if (name == "PixelPerfect") {
_scValue->setBool(_precise);
return _scValue;
}
@@ -731,7 +731,7 @@ ScValue *BaseSprite::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Looping
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Looping") == 0) {
+ else if (name == "Looping") {
_scValue->setBool(_looping);
return _scValue;
}
@@ -739,7 +739,7 @@ ScValue *BaseSprite::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Owner (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Owner") == 0) {
+ else if (name == "Owner") {
if (_owner == NULL) {
_scValue->setNULL();
} else {
@@ -751,7 +751,7 @@ ScValue *BaseSprite::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Finished (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Finished") == 0) {
+ else if (name == "Finished") {
_scValue->setBool(_finished);
return _scValue;
}
@@ -759,7 +759,7 @@ ScValue *BaseSprite::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Paused (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Paused") == 0) {
+ else if (name == "Paused") {
_scValue->setBool(_paused);
return _scValue;
} else {
diff --git a/engines/wintermute/base/base_sprite.h b/engines/wintermute/base/base_sprite.h
index cef874b254..1d244c3a52 100644
--- a/engines/wintermute/base/base_sprite.h
+++ b/engines/wintermute/base/base_sprite.h
@@ -64,7 +64,7 @@ public:
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/base/base_sub_frame.cpp b/engines/wintermute/base/base_sub_frame.cpp
index fd7ee50eda..77cc522ae7 100644
--- a/engines/wintermute/base/base_sub_frame.cpp
+++ b/engines/wintermute/base/base_sub_frame.cpp
@@ -446,7 +446,7 @@ bool BaseSubFrame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisS
//////////////////////////////////////////////////////////////////////////
-ScValue *BaseSubFrame::scGetProperty(const char *name) {
+ScValue *BaseSubFrame::scGetProperty(const Common::String &name) {
if (!_scValue) {
_scValue = new ScValue(_gameRef);
}
@@ -455,7 +455,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("subframe");
return _scValue;
}
@@ -463,7 +463,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AlphaColor") == 0) {
+ else if (name == "AlphaColor") {
_scValue->setInt((int)_alpha);
return _scValue;
@@ -472,7 +472,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// TransparentColor (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "TransparentColor") == 0) {
+ else if (name == "TransparentColor") {
_scValue->setInt((int)_transparent);
return _scValue;
}
@@ -480,7 +480,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Is2DOnly
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Is2DOnly") == 0) {
+ else if (name == "Is2DOnly") {
_scValue->setBool(_2DOnly);
return _scValue;
}
@@ -488,7 +488,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Is3DOnly
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Is3DOnly") == 0) {
+ else if (name == "Is3DOnly") {
_scValue->setBool(_3DOnly);
return _scValue;
}
@@ -496,7 +496,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MirrorX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MirrorX") == 0) {
+ else if (name == "MirrorX") {
_scValue->setBool(_mirrorX);
return _scValue;
}
@@ -504,7 +504,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MirrorY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MirrorY") == 0) {
+ else if (name == "MirrorY") {
_scValue->setBool(_mirrorY);
return _scValue;
}
@@ -512,7 +512,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Decoration
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Decoration") == 0) {
+ else if (name == "Decoration") {
_scValue->setBool(_decoration);
return _scValue;
}
@@ -520,7 +520,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// HotspotX
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "HotspotX") == 0) {
+ else if (name == "HotspotX") {
_scValue->setInt(_hotspotX);
return _scValue;
}
@@ -528,7 +528,7 @@ ScValue *BaseSubFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// HotspotY
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "HotspotY") == 0) {
+ else if (name == "HotspotY") {
_scValue->setInt(_hotspotY);
return _scValue;
} else {
diff --git a/engines/wintermute/base/base_sub_frame.h b/engines/wintermute/base/base_sub_frame.h
index 0be77c544a..c173ae69d1 100644
--- a/engines/wintermute/base/base_sub_frame.h
+++ b/engines/wintermute/base/base_sub_frame.h
@@ -81,7 +81,7 @@ public:
BaseSurface *_surface;
// 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/base/particles/part_emitter.cpp b/engines/wintermute/base/particles/part_emitter.cpp
index 4e3fc2239e..bab4d4609e 100644
--- a/engines/wintermute/base/particles/part_emitter.cpp
+++ b/engines/wintermute/base/particles/part_emitter.cpp
@@ -604,41 +604,41 @@ bool PartEmitter::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSt
}
//////////////////////////////////////////////////////////////////////////
-ScValue *PartEmitter::scGetProperty(const char *name) {
+ScValue *PartEmitter::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("particle-emitter");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "X") == 0) {
+ else if (name == "X") {
_scValue->setInt(_posX);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Y
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Y") == 0) {
+ else if (name == "Y") {
_scValue->setInt(_posY);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Width
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Width") == 0) {
+ else if (name == "Width") {
_scValue->setInt(_width);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Height
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Height") == 0) {
+ else if (name == "Height") {
_scValue->setInt(_height);
return _scValue;
}
@@ -646,21 +646,21 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Scale1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Scale1") == 0) {
+ else if (name == "Scale1") {
_scValue->setFloat(_scale1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Scale2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Scale2") == 0) {
+ else if (name == "Scale2") {
_scValue->setFloat(_scale2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ScaleZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ScaleZBased") == 0) {
+ else if (name == "ScaleZBased") {
_scValue->setBool(_scaleZBased);
return _scValue;
}
@@ -668,21 +668,21 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Velocity1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Velocity1") == 0) {
+ else if (name == "Velocity1") {
_scValue->setFloat(_velocity1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Velocity2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Velocity2") == 0) {
+ else if (name == "Velocity2") {
_scValue->setFloat(_velocity2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// VelocityZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "VelocityZBased") == 0) {
+ else if (name == "VelocityZBased") {
_scValue->setBool(_velocityZBased);
return _scValue;
}
@@ -690,21 +690,21 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// LifeTime1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "LifeTime1") == 0) {
+ else if (name == "LifeTime1") {
_scValue->setInt(_lifeTime1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LifeTime2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "LifeTime2") == 0) {
+ else if (name == "LifeTime2") {
_scValue->setInt(_lifeTime2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// LifeTimeZBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "LifeTimeZBased") == 0) {
+ else if (name == "LifeTimeZBased") {
_scValue->setBool(_lifeTimeZBased);
return _scValue;
}
@@ -712,14 +712,14 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Angle1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Angle1") == 0) {
+ else if (name == "Angle1") {
_scValue->setInt(_angle1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Angle2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Angle2") == 0) {
+ else if (name == "Angle2") {
_scValue->setInt(_angle2);
return _scValue;
}
@@ -727,14 +727,14 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AngVelocity1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AngVelocity1") == 0) {
+ else if (name == "AngVelocity1") {
_scValue->setFloat(_angVelocity1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AngVelocity2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AngVelocity2") == 0) {
+ else if (name == "AngVelocity2") {
_scValue->setFloat(_angVelocity2);
return _scValue;
}
@@ -742,14 +742,14 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Rotation1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Rotation1") == 0) {
+ else if (name == "Rotation1") {
_scValue->setFloat(_rotation1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Rotation2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Rotation2") == 0) {
+ else if (name == "Rotation2") {
_scValue->setFloat(_rotation2);
return _scValue;
}
@@ -757,21 +757,21 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Alpha1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Alpha1") == 0) {
+ else if (name == "Alpha1") {
_scValue->setInt(_alpha1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Alpha2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Alpha2") == 0) {
+ else if (name == "Alpha2") {
_scValue->setInt(_alpha2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// AlphaTimeBased
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AlphaTimeBased") == 0) {
+ else if (name == "AlphaTimeBased") {
_scValue->setBool(_alphaTimeBased);
return _scValue;
}
@@ -779,14 +779,14 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MaxParticles
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MaxParticles") == 0) {
+ else if (name == "MaxParticles") {
_scValue->setInt(_maxParticles);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumLiveParticles (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "NumLiveParticles") == 0) {
+ else if (name == "NumLiveParticles") {
int numAlive = 0;
for (uint32 i = 0; i < _particles.size(); i++) {
if (_particles[i] && !_particles[i]->_isDead) {
@@ -800,21 +800,21 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// GenerationInterval
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "GenerationInterval") == 0) {
+ else if (name == "GenerationInterval") {
_scValue->setInt(_genInterval);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// GenerationAmount
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "GenerationAmount") == 0) {
+ else if (name == "GenerationAmount") {
_scValue->setInt(_genAmount);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// MaxBatches
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MaxBatches") == 0) {
+ else if (name == "MaxBatches") {
_scValue->setInt(_maxBatches);
return _scValue;
}
@@ -822,14 +822,14 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// FadeInTime
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "FadeInTime") == 0) {
+ else if (name == "FadeInTime") {
_scValue->setInt(_fadeInTime);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// FadeOutTime
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "FadeOutTime") == 0) {
+ else if (name == "FadeOutTime") {
_scValue->setInt(_fadeOutTime);
return _scValue;
}
@@ -837,21 +837,21 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// GrowthRate1
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "GrowthRate1") == 0) {
+ else if (name == "GrowthRate1") {
_scValue->setFloat(_growthRate1);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// GrowthRate2
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "GrowthRate2") == 0) {
+ else if (name == "GrowthRate2") {
_scValue->setFloat(_growthRate2);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// ExponentialGrowth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ExponentialGrowth") == 0) {
+ else if (name == "ExponentialGrowth") {
_scValue->setBool(_exponentialGrowth);
return _scValue;
}
@@ -859,7 +859,7 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// UseRegion
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "UseRegion") == 0) {
+ else if (name == "UseRegion") {
_scValue->setBool(_useRegion);
return _scValue;
}
@@ -867,7 +867,7 @@ ScValue *PartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// EmitEvent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "EmitEvent") == 0) {
+ else if (name == "EmitEvent") {
if (!_emitEvent) {
_scValue->setNULL();
} else {
diff --git a/engines/wintermute/base/particles/part_emitter.h b/engines/wintermute/base/particles/part_emitter.h
index 9a35cd9bbc..f2c8f139f1 100644
--- a/engines/wintermute/base/particles/part_emitter.h
+++ b/engines/wintermute/base/particles/part_emitter.h
@@ -63,7 +63,7 @@ public:
BaseArray<PartForce *> _forces;
// 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/base/scriptables/script_ext_array.cpp b/engines/wintermute/base/scriptables/script_ext_array.cpp
index 5ed07f0da6..613cbd0758 100644
--- a/engines/wintermute/base/scriptables/script_ext_array.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_array.cpp
@@ -140,13 +140,13 @@ bool SXArray::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
-ScValue *SXArray::scGetProperty(const char *name) {
+ScValue *SXArray::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("array");
return _scValue;
}
@@ -154,7 +154,7 @@ ScValue *SXArray::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Length") == 0) {
+ else if (name == "Length") {
_scValue->setInt(_length);
return _scValue;
}
@@ -164,7 +164,7 @@ ScValue *SXArray::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
else {
char paramName[20];
- if (validNumber(name, paramName)) {
+ if (validNumber(name.c_str(), paramName)) { // TODO: Change to Common::String
return _values->getProp(paramName);
} else {
return _scValue;
diff --git a/engines/wintermute/base/scriptables/script_ext_array.h b/engines/wintermute/base/scriptables/script_ext_array.h
index d9805ef94f..284c547a27 100644
--- a/engines/wintermute/base/scriptables/script_ext_array.h
+++ b/engines/wintermute/base/scriptables/script_ext_array.h
@@ -41,7 +41,7 @@ public:
SXArray(BaseGame *inGame, ScStack *stack);
SXArray(BaseGame *inGame);
virtual ~SXArray();
- ScValue *scGetProperty(const char *name);
+ ScValue *scGetProperty(const Common::String &name);
bool scSetProperty(const char *name, ScValue *value);
bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
diff --git a/engines/wintermute/base/scriptables/script_ext_date.cpp b/engines/wintermute/base/scriptables/script_ext_date.cpp
index 11eead3b9c..5aa069d0b2 100644
--- a/engines/wintermute/base/scriptables/script_ext_date.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_date.cpp
@@ -203,13 +203,13 @@ bool SXDate::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
-ScValue *SXDate::scGetProperty(const char *name) {
+ScValue *SXDate::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("date");
return _scValue;
} else {
@@ -224,7 +224,7 @@ bool SXDate::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Name")==0){
+ if (name == "Name")==0){
setName(value->getString());
return STATUS_OK;
}
diff --git a/engines/wintermute/base/scriptables/script_ext_date.h b/engines/wintermute/base/scriptables/script_ext_date.h
index f6f04dd7e6..062b7c55c7 100644
--- a/engines/wintermute/base/scriptables/script_ext_date.h
+++ b/engines/wintermute/base/scriptables/script_ext_date.h
@@ -40,7 +40,7 @@ public:
DECLARE_PERSISTENT(SXDate, BaseScriptable)
SXDate(BaseGame *inGame, ScStack *Stack);
virtual ~SXDate();
- ScValue *scGetProperty(const char *name);
+ ScValue *scGetProperty(const Common::String &name);
bool scSetProperty(const char *name, ScValue *value);
bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp
index 2dc385b015..a1d39c5d0a 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_file.cpp
@@ -640,13 +640,13 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
-ScValue *SXFile::scGetProperty(const char *name) {
+ScValue *SXFile::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("file");
return _scValue;
}
@@ -654,7 +654,7 @@ ScValue *SXFile::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Filename (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Filename") == 0) {
+ if (name == "Filename") {
_scValue->setString(_filename);
return _scValue;
}
@@ -662,7 +662,7 @@ ScValue *SXFile::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Position (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Position") == 0) {
+ else if (name == "Position") {
_scValue->setInt(getPos());
return _scValue;
}
@@ -670,7 +670,7 @@ ScValue *SXFile::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Length (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Length") == 0) {
+ else if (name == "Length") {
_scValue->setInt(getLength());
return _scValue;
}
@@ -678,7 +678,7 @@ ScValue *SXFile::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// TextMode (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "TextMode") == 0) {
+ else if (name == "TextMode") {
_scValue->setBool(_textMode);
return _scValue;
}
@@ -686,7 +686,7 @@ ScValue *SXFile::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// AccessMode (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "AccessMode") == 0) {
+ else if (name == "AccessMode") {
_scValue->setInt(_mode);
return _scValue;
} else {
diff --git a/engines/wintermute/base/scriptables/script_ext_file.h b/engines/wintermute/base/scriptables/script_ext_file.h
index b91a53e695..f7c72fcfb3 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.h
+++ b/engines/wintermute/base/scriptables/script_ext_file.h
@@ -40,7 +40,7 @@ class BaseFile;
class SXFile : public BaseScriptable {
public:
DECLARE_PERSISTENT(SXFile, BaseScriptable)
- ScValue *scGetProperty(const char *name);
+ ScValue *scGetProperty(const Common::String &name);
bool scSetProperty(const char *name, ScValue *value);
bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
diff --git a/engines/wintermute/base/scriptables/script_ext_math.cpp b/engines/wintermute/base/scriptables/script_ext_math.cpp
index 598b80cff3..d816fbec65 100644
--- a/engines/wintermute/base/scriptables/script_ext_math.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_math.cpp
@@ -250,13 +250,13 @@ bool SXMath::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
-ScValue *SXMath::scGetProperty(const char *name) {
+ScValue *SXMath::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("math");
return _scValue;
}
@@ -264,7 +264,7 @@ ScValue *SXMath::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// PI
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "PI") == 0) {
+ else if (name == "PI") {
_scValue->setFloat(M_PI);
return _scValue;
} else {
diff --git a/engines/wintermute/base/scriptables/script_ext_math.h b/engines/wintermute/base/scriptables/script_ext_math.h
index f86d59fe7b..48c43ea7e8 100644
--- a/engines/wintermute/base/scriptables/script_ext_math.h
+++ b/engines/wintermute/base/scriptables/script_ext_math.h
@@ -39,7 +39,7 @@ public:
DECLARE_PERSISTENT(SXMath, BaseScriptable)
SXMath(BaseGame *inGame);
virtual ~SXMath();
- virtual ScValue *scGetProperty(const char *name);
+ virtual ScValue *scGetProperty(const Common::String &name);
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
private:
diff --git a/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp b/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
index 5ed9bd5313..8f05b7bff6 100644
--- a/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
@@ -447,13 +447,13 @@ bool SXMemBuffer::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSt
//////////////////////////////////////////////////////////////////////////
-ScValue *SXMemBuffer::scGetProperty(const char *name) {
+ScValue *SXMemBuffer::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("membuffer");
return _scValue;
}
@@ -461,7 +461,7 @@ ScValue *SXMemBuffer::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Size (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Size") == 0) {
+ if (name == "Size") {
_scValue->setInt(_size);
return _scValue;
} else {
diff --git a/engines/wintermute/base/scriptables/script_ext_mem_buffer.h b/engines/wintermute/base/scriptables/script_ext_mem_buffer.h
index d2662b3036..1527a323dc 100644
--- a/engines/wintermute/base/scriptables/script_ext_mem_buffer.h
+++ b/engines/wintermute/base/scriptables/script_ext_mem_buffer.h
@@ -38,7 +38,7 @@ class SXMemBuffer : public BaseScriptable {
public:
virtual int scCompare(BaseScriptable *Val);
DECLARE_PERSISTENT(SXMemBuffer, BaseScriptable)
- ScValue *scGetProperty(const char *name);
+ ScValue *scGetProperty(const Common::String &name);
bool scSetProperty(const char *name, ScValue *value);
bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp
index 8d87a92dc1..5f7da1c2dd 100644
--- a/engines/wintermute/base/scriptables/script_ext_string.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_string.cpp
@@ -343,20 +343,20 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
-ScValue *SXString::scGetProperty(const char *name) {
+ScValue *SXString::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("string");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Length (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Length") == 0) {
+ else if (name == "Length") {
if (_gameRef->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::utf8ToWide(_string);
_scValue->setInt(wstr.size());
@@ -369,7 +369,7 @@ ScValue *SXString::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Capacity
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Capacity") == 0) {
+ else if (name == "Capacity") {
_scValue->setInt(_capacity);
return _scValue;
} else {
diff --git a/engines/wintermute/base/scriptables/script_ext_string.h b/engines/wintermute/base/scriptables/script_ext_string.h
index 255b9c57eb..00bffab3a9 100644
--- a/engines/wintermute/base/scriptables/script_ext_string.h
+++ b/engines/wintermute/base/scriptables/script_ext_string.h
@@ -38,7 +38,7 @@ class SXString : public BaseScriptable {
public:
virtual int scCompare(BaseScriptable *Val);
DECLARE_PERSISTENT(SXString, BaseScriptable)
- ScValue *scGetProperty(const char *name);
+ ScValue *scGetProperty(const Common::String &name);
bool scSetProperty(const char *name, ScValue *value);
bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
void scSetString(const char *val);
diff --git a/engines/wintermute/ui/ui_button.cpp b/engines/wintermute/ui/ui_button.cpp
index d4acd3019f..7967d566f9 100644
--- a/engines/wintermute/ui/ui_button.cpp
+++ b/engines/wintermute/ui/ui_button.cpp
@@ -1082,13 +1082,13 @@ bool UIButton::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
-ScValue *UIButton::scGetProperty(const char *name) {
+ScValue *UIButton::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("button");
return _scValue;
}
@@ -1096,7 +1096,7 @@ ScValue *UIButton::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// TextAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "TextAlign") == 0) {
+ else if (name == "TextAlign") {
_scValue->setInt(_align);
return _scValue;
}
@@ -1104,21 +1104,21 @@ ScValue *UIButton::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Focusable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Focusable") == 0) {
+ else if (name == "Focusable") {
_scValue->setBool(_canFocus);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Pressed
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Pressed") == 0) {
+ else if (name == "Pressed") {
_scValue->setBool(_stayPressed);
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// PixelPerfect
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "PixelPerfect") == 0) {
+ else if (name == "PixelPerfect") {
_scValue->setBool(_pixelPerfect);
return _scValue;
} else {
diff --git a/engines/wintermute/ui/ui_button.h b/engines/wintermute/ui/ui_button.h
index 9342f766cc..93333a2534 100644
--- a/engines/wintermute/ui/ui_button.h
+++ b/engines/wintermute/ui/ui_button.h
@@ -69,7 +69,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/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp
index 1352a0d942..a3283d5a01 100644
--- a/engines/wintermute/ui/ui_edit.cpp
+++ b/engines/wintermute/ui/ui_edit.cpp
@@ -398,13 +398,13 @@ bool UIEdit::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
-ScValue *UIEdit::scGetProperty(const char *name) {
+ScValue *UIEdit::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("editor");
return _scValue;
}
@@ -412,7 +412,7 @@ ScValue *UIEdit::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SelStart
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SelStart") == 0) {
+ else if (name == "SelStart") {
_scValue->setInt(_selStart);
return _scValue;
}
@@ -420,7 +420,7 @@ ScValue *UIEdit::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SelEnd
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SelEnd") == 0) {
+ else if (name == "SelEnd") {
_scValue->setInt(_selEnd);
return _scValue;
}
@@ -428,7 +428,7 @@ ScValue *UIEdit::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// CursorBlinkRate
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "CursorBlinkRate") == 0) {
+ else if (name == "CursorBlinkRate") {
_scValue->setInt(_cursorBlinkRate);
return _scValue;
}
@@ -436,7 +436,7 @@ ScValue *UIEdit::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// CursorChar
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "CursorChar") == 0) {
+ else if (name == "CursorChar") {
_scValue->setString(_cursorChar);
return _scValue;
}
@@ -444,7 +444,7 @@ ScValue *UIEdit::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// FrameWidth
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "FrameWidth") == 0) {
+ else if (name == "FrameWidth") {
_scValue->setInt(_frameWidth);
return _scValue;
}
@@ -452,7 +452,7 @@ ScValue *UIEdit::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// MaxLength
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "MaxLength") == 0) {
+ else if (name == "MaxLength") {
_scValue->setInt(_maxLength);
return _scValue;
}
@@ -460,7 +460,7 @@ ScValue *UIEdit::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Text
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Text") == 0) {
+ else if (name == "Text") {
if (_gameRef->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::ansiToWide(_text);
_scValue->setString(StringUtil::wideToUtf8(wstr).c_str());
diff --git a/engines/wintermute/ui/ui_edit.h b/engines/wintermute/ui/ui_edit.h
index 610629afb3..5bb31422b6 100644
--- a/engines/wintermute/ui/ui_edit.h
+++ b/engines/wintermute/ui/ui_edit.h
@@ -61,7 +61,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/ui/ui_entity.cpp b/engines/wintermute/ui/ui_entity.cpp
index c49cb5a240..1cb4e0926b 100644
--- a/engines/wintermute/ui/ui_entity.cpp
+++ b/engines/wintermute/ui/ui_entity.cpp
@@ -305,13 +305,13 @@ bool UIEntity::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
-ScValue *UIEntity::scGetProperty(const char *name) {
+ScValue *UIEntity::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("entity container");
return _scValue;
}
@@ -319,7 +319,7 @@ ScValue *UIEntity::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Freezable
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Freezable") == 0) {
+ else if (name == "Freezable") {
if (_entity) {
_scValue->setBool(_entity->_freezable);
} else {
diff --git a/engines/wintermute/ui/ui_entity.h b/engines/wintermute/ui/ui_entity.h
index 3bf8068fd5..b5f4450071 100644
--- a/engines/wintermute/ui/ui_entity.h
+++ b/engines/wintermute/ui/ui_entity.h
@@ -48,7 +48,7 @@ public:
bool setEntity(const char *filename);
// 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/ui/ui_object.cpp b/engines/wintermute/ui/ui_object.cpp
index 772561247d..8e5bae993c 100644
--- a/engines/wintermute/ui/ui_object.cpp
+++ b/engines/wintermute/ui/ui_object.cpp
@@ -360,13 +360,13 @@ bool UIObject::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
-ScValue *UIObject::scGetProperty(const char *name) {
+ScValue *UIObject::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("ui_object");
return _scValue;
}
@@ -374,7 +374,7 @@ ScValue *UIObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Name") == 0) {
+ else if (name == "Name") {
_scValue->setString(getName());
return _scValue;
}
@@ -382,7 +382,7 @@ ScValue *UIObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Parent (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Parent") == 0) {
+ else if (name == "Parent") {
_scValue->setNative(_parent, true);
return _scValue;
}
@@ -390,7 +390,7 @@ ScValue *UIObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// ParentNotify
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ParentNotify") == 0) {
+ else if (name == "ParentNotify") {
_scValue->setBool(_parentNotify);
return _scValue;
}
@@ -398,7 +398,7 @@ ScValue *UIObject::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 *UIObject::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 *UIObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Visible
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Visible") == 0) {
+ else if (name == "Visible") {
_scValue->setBool(_visible);
return _scValue;
}
@@ -422,7 +422,7 @@ ScValue *UIObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Disabled
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Disabled") == 0) {
+ else if (name == "Disabled") {
_scValue->setBool(_disable);
return _scValue;
}
@@ -430,7 +430,7 @@ ScValue *UIObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Text
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Text") == 0) {
+ else if (name == "Text") {
_scValue->setString(_text);
return _scValue;
}
@@ -438,13 +438,13 @@ ScValue *UIObject::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// NextSibling (RO) / PrevSibling (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "NextSibling") == 0 || strcmp(name, "PrevSibling") == 0) {
+ else if (name == "NextSibling" || name == "PrevSibling") {
_scValue->setNULL();
if (_parent && _parent->_type == UI_WINDOW) {
UIWindow *win = (UIWindow *)_parent;
for (uint32 i = 0; i < win->_widgets.size(); i++) {
if (win->_widgets[i] == this) {
- if (strcmp(name, "NextSibling") == 0) {
+ if (name == "NextSibling") {
if (i < win->_widgets.size() - 1) {
_scValue->setNative(win->_widgets[i + 1], true);
}
diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h
index 81c025d33b..ec2ea33de1 100644
--- a/engines/wintermute/ui/ui_object.h
+++ b/engines/wintermute/ui/ui_object.h
@@ -74,7 +74,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/ui/ui_text.cpp b/engines/wintermute/ui/ui_text.cpp
index 1844b640d0..2c10f176c7 100644
--- a/engines/wintermute/ui/ui_text.cpp
+++ b/engines/wintermute/ui/ui_text.cpp
@@ -431,13 +431,13 @@ bool UIText::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
-ScValue *UIText::scGetProperty(const char *name) {
+ScValue *UIText::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("static");
return _scValue;
}
@@ -445,7 +445,7 @@ ScValue *UIText::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// TextAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "TextAlign") == 0) {
+ else if (name == "TextAlign") {
_scValue->setInt(_textAlign);
return _scValue;
}
@@ -453,7 +453,7 @@ ScValue *UIText::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// VerticalAlign
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "VerticalAlign") == 0) {
+ else if (name == "VerticalAlign") {
_scValue->setInt(_verticalAlign);
return _scValue;
} else {
diff --git a/engines/wintermute/ui/ui_text.h b/engines/wintermute/ui/ui_text.h
index d2f116b44b..da4d113500 100644
--- a/engines/wintermute/ui/ui_text.h
+++ b/engines/wintermute/ui/ui_text.h
@@ -49,7 +49,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/ui/ui_window.cpp b/engines/wintermute/ui/ui_window.cpp
index 1f652bf64d..9606486efb 100644
--- a/engines/wintermute/ui/ui_window.cpp
+++ b/engines/wintermute/ui/ui_window.cpp
@@ -1014,13 +1014,13 @@ bool UIWindow::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
-ScValue *UIWindow::scGetProperty(const char *name) {
+ScValue *UIWindow::scGetProperty(const Common::String &name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Type") == 0) {
+ if (name == "Type") {
_scValue->setString("window");
return _scValue;
}
@@ -1028,7 +1028,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// NumWidgets / NumControls (RO)
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "NumWidgets") == 0 || strcmp(name, "NumControls") == 0) {
+ else if (name == "NumWidgets" || name == "NumControls") {
_scValue->setInt(_widgets.size());
return _scValue;
}
@@ -1036,7 +1036,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Exclusive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Exclusive") == 0) {
+ else if (name == "Exclusive") {
_scValue->setBool(_mode == WINDOW_EXCLUSIVE);
return _scValue;
}
@@ -1044,7 +1044,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// SystemExclusive
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "SystemExclusive") == 0) {
+ else if (name == "SystemExclusive") {
_scValue->setBool(_mode == WINDOW_SYSTEM_EXCLUSIVE);
return _scValue;
}
@@ -1052,7 +1052,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Menu
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Menu") == 0) {
+ else if (name == "Menu") {
_scValue->setBool(_isMenu);
return _scValue;
}
@@ -1060,7 +1060,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// InGame
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "InGame") == 0) {
+ else if (name == "InGame") {
_scValue->setBool(_inGame);
return _scValue;
}
@@ -1068,7 +1068,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// PauseMusic
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "PauseMusic") == 0) {
+ else if (name == "PauseMusic") {
_scValue->setBool(_pauseMusic);
return _scValue;
}
@@ -1076,7 +1076,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// ClipContents
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ClipContents") == 0) {
+ else if (name == "ClipContents") {
_scValue->setBool(_clipContents);
return _scValue;
}
@@ -1084,7 +1084,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// Transparent
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "Transparent") == 0) {
+ else if (name == "Transparent") {
_scValue->setBool(_transparent);
return _scValue;
}
@@ -1092,7 +1092,7 @@ ScValue *UIWindow::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
// FadeColor
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "FadeColor") == 0) {
+ else if (name == "FadeColor") {
_scValue->setInt((int)_fadeColor);
return _scValue;
} else {
diff --git a/engines/wintermute/ui/ui_window.h b/engines/wintermute/ui/ui_window.h
index cbd417a7d9..ae035c65c7 100644
--- a/engines/wintermute/ui/ui_window.h
+++ b/engines/wintermute/ui/ui_window.h
@@ -83,7 +83,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();