aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/base')
-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
32 files changed, 196 insertions, 196 deletions
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);