diff options
Diffstat (limited to 'engines/wintermute/ui/ui_edit.cpp')
-rw-r--r-- | engines/wintermute/ui/ui_edit.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp index d9c6c6586a..b2e7b29284 100644 --- a/engines/wintermute/ui/ui_edit.cpp +++ b/engines/wintermute/ui/ui_edit.cpp @@ -100,8 +100,7 @@ bool UIEdit::loadFile(const char *filename) { bool ret;
- _filename = new char [strlen(filename) + 1];
- strcpy(_filename, filename);
+ setFilename(filename);
if (DID_FAIL(ret = loadBuffer(buffer, true))) _gameRef->LOG(0, "Error parsing EDIT file '%s'", filename);
@@ -308,19 +307,19 @@ bool UIEdit::saveAsText(BaseDynamicBuffer *buffer, int indent) { buffer->putTextIndent(indent + 2, "\n");
- if (_back && _back->_filename)
- buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
+ if (_back && _back->getFilename())
+ buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->getFilename());
- if (_image && _image->_filename)
- buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
+ if (_image && _image->getFilename())
+ buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->getFilename());
- if (_font && _font->_filename)
- buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
- if (_fontSelected && _fontSelected->_filename)
- buffer->putTextIndent(indent + 2, "FONT_SELECTED=\"%s\"\n", _fontSelected->_filename);
+ if (_font && _font->getFilename())
+ buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->getFilename());
+ if (_fontSelected && _fontSelected->getFilename())
+ buffer->putTextIndent(indent + 2, "FONT_SELECTED=\"%s\"\n", _fontSelected->getFilename());
- if (_cursor && _cursor->_filename)
- buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
+ if (_cursor && _cursor->getFilename())
+ buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->getFilename());
buffer->putTextIndent(indent + 2, "\n");
|