aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/scriptables/script_ext_string.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-11-26 02:24:03 -0800
committerJohannes Schickel2013-11-26 02:24:03 -0800
commite718719f918a4941fd72d3b245922a834bc5a5d2 (patch)
treee91975113b6cf31aa9b701e7474df4a588f41888 /engines/wintermute/base/scriptables/script_ext_string.cpp
parentcabbc7161badffb3b63f386f4a16ac28d7a09898 (diff)
parentabe6d30f36cdfaef3c7ce7a5c8a48f4d4986d718 (diff)
downloadscummvm-rg350-e718719f918a4941fd72d3b245922a834bc5a5d2.tar.gz
scummvm-rg350-e718719f918a4941fd72d3b245922a834bc5a5d2.tar.bz2
scummvm-rg350-e718719f918a4941fd72d3b245922a834bc5a5d2.zip
Merge pull request #411 from lordhoto/unicode
Add UTF-32 support to Graphics::Font and Wintermute.
Diffstat (limited to 'engines/wintermute/base/scriptables/script_ext_string.cpp')
-rw-r--r--engines/wintermute/base/scriptables/script_ext_string.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp
index b6d284442d..65bec03bc1 100644
--- a/engines/wintermute/base/scriptables/script_ext_string.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_string.cpp
@@ -298,21 +298,13 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
uint32 start = 0;
for(uint32 i = 0; i < str.size() + 1; i++) {
- char ch = str.c_str()[i];
- if(ch=='\0' || delims.contains(ch))
- {
- char *part = new char[i - start + 1];
- if(i != start) {
- Common::strlcpy(part, str.c_str() + start, i - start + 1);
- part[i - start] = '\0';
+ uint32 ch = str[i];
+ if (ch =='\0' || delims.contains(ch)) {
+ if (i != start) {
+ parts.push_back(WideString(str.c_str() + start, i - start + 1));
} else {
- part[0] = '\0';
+ parts.push_back(WideString());
}
- val = new ScValue(_gameRef, part);
- array->push(val);
- delete[] part;
- delete val;
- val = nullptr;
start = i + 1;
}
}