diff options
author | Filippos Karapetis | 2017-03-22 03:02:58 +0200 |
---|---|---|
committer | Filippos Karapetis | 2017-03-22 03:02:58 +0200 |
commit | a2b4d637dbd70f084e1bda94d67f5b197a5d2a21 (patch) | |
tree | db9a086bc64b6b77816fa55b79dce2fa158e32ec /engines | |
parent | e069605d25f0d6d3206c92367f57c57e0885d5dc (diff) | |
download | scummvm-rg350-a2b4d637dbd70f084e1bda94d67f5b197a5d2a21.tar.gz scummvm-rg350-a2b4d637dbd70f084e1bda94d67f5b197a5d2a21.tar.bz2 scummvm-rg350-a2b4d637dbd70f084e1bda94d67f5b197a5d2a21.zip |
FULLPIPE: Change _staticsName to be a Common::String
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/statics.cpp | 14 | ||||
-rw-r--r-- | engines/fullpipe/statics.h | 2 |
2 files changed, 5 insertions, 11 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index bc66ebf40b..e87cf02a42 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -420,7 +420,7 @@ Statics *StaticANIObject::getStaticsById(int itemId) { Statics *StaticANIObject::getStaticsByName(char *name) { for (uint i = 0; i < _staticsList.size(); i++) - if (!strcmp(_staticsList[i]->_staticsName, name)) + if (_staticsList[i]->_staticsName == name) return _staticsList[i]; return 0; @@ -1430,12 +1430,10 @@ Common::Point *StaticANIObject::calcStepLen(Common::Point *p) { Statics::Statics() { _staticsId = 0; _picture = 0; - _staticsName = 0; } Statics::~Statics() { delete _picture; - free(_staticsName); } Statics::Statics(Statics *src, bool reverse) : DynamicPhase(src, reverse) { @@ -1443,13 +1441,9 @@ Statics::Statics(Statics *src, bool reverse) : DynamicPhase(src, reverse) { if (reverse) { _staticsId ^= 0x4000; - int newlen = strlen(src->_staticsName) + strlen(sO_MirroredTo) + 1; - _staticsName = (char *)calloc(newlen, 1); - - snprintf(_staticsName, newlen, "%s%s", sO_MirroredTo, src->_staticsName); + _staticsName = sO_MirroredTo + src->_staticsName; } else { - _staticsName = (char *)calloc(strlen(src->_staticsName) + 1, 1); - strncpy(_staticsName, src->_staticsName, strlen(src->_staticsName) + 1); + _staticsName = src->_staticsName; } _memfilename = (char *)calloc(strlen(src->_memfilename) + 1, 1); @@ -1466,7 +1460,7 @@ bool Statics::load(MfcArchive &file) { _staticsId = file.readUint16LE(); _staticsName = file.readPascalString(); - debugC(7, kDebugLoading, "statics: <%s> id: %d (%x)", transCyrillic((byte *)_staticsName), _staticsId, _staticsId); + debugC(7, kDebugLoading, "statics: <%s> id: %d (%x)", transCyrillic((byte *)_staticsName.c_str()), _staticsId, _staticsId); _picture = new Picture(); _picture->load(file); diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 9c7cab5448..1bf95ec3b4 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -89,7 +89,7 @@ class DynamicPhase : public StaticPhase { class Statics : public DynamicPhase { public: int16 _staticsId; - char *_staticsName; + Common::String _staticsName; Picture *_picture; public: |