diff options
Diffstat (limited to 'engines/wintermute/ui/ui_edit.cpp')
-rw-r--r-- | engines/wintermute/ui/ui_edit.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp index a3283d5a01..7fddf59898 100644 --- a/engines/wintermute/ui/ui_edit.cpp +++ b/engines/wintermute/ui/ui_edit.cpp @@ -56,12 +56,12 @@ IMPLEMENT_PERSISTENT(UIEdit, false) UIEdit::UIEdit(BaseGame *inGame) : UIObject(inGame) { _type = UI_EDIT; - _fontSelected = NULL; + _fontSelected = nullptr; _selStart = _selEnd = 10000; _scrollOffset = 0; - _cursorChar = NULL; + _cursorChar = nullptr; setCursorChar("|"); _cursorBlinkRate = 600; @@ -88,14 +88,14 @@ UIEdit::~UIEdit() { } delete[] _cursorChar; - _cursorChar = NULL; + _cursorChar = nullptr; } ////////////////////////////////////////////////////////////////////////// bool UIEdit::loadFile(const char *filename) { byte *buffer = BaseFileManager::getEngineInstance()->readWholeFile(filename); - if (buffer == NULL) { + if (buffer == nullptr) { _gameRef->LOG(0, "UIEdit::LoadFile failed for file '%s'", filename); return STATUS_FAILED; } @@ -194,7 +194,7 @@ bool UIEdit::loadBuffer(byte *buffer, bool complete) { _back = new UITiledImage(_gameRef); if (!_back || DID_FAIL(_back->loadFile((char *)params))) { delete _back; - _back = NULL; + _back = nullptr; cmd = PARSERR_GENERIC; } break; @@ -204,7 +204,7 @@ bool UIEdit::loadBuffer(byte *buffer, bool complete) { _image = new BaseSprite(_gameRef); if (!_image || DID_FAIL(_image->loadFile((char *)params))) { delete _image; - _image = NULL; + _image = nullptr; cmd = PARSERR_GENERIC; } break; @@ -231,7 +231,7 @@ bool UIEdit::loadBuffer(byte *buffer, bool complete) { case TOKEN_TEXT: setText((char *)params); - _gameRef->_stringTable->expand(&_text); + _gameRef->expandStringByStringTable(&_text); break; case TOKEN_X: @@ -263,7 +263,7 @@ bool UIEdit::loadBuffer(byte *buffer, bool complete) { _cursor = new BaseSprite(_gameRef); if (!_cursor || DID_FAIL(_cursor->loadFile((char *)params))) { delete _cursor; - _cursor = NULL; + _cursor = nullptr; cmd = PARSERR_GENERIC; } break; @@ -388,7 +388,7 @@ bool UIEdit::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, _gameRef->_fontStorage->removeFont(_fontSelected); } _fontSelected = _gameRef->_fontStorage->addFont(stack->pop()->getString()); - stack->pushBool(_fontSelected != NULL); + stack->pushBool(_fontSelected != nullptr); return STATUS_OK; } else { @@ -579,7 +579,7 @@ bool UIEdit::display(int offsetX, int offsetY) { _back->display(offsetX + _posX, offsetY + _posY, _width, _height); } if (_image) { - _image->draw(offsetX + _posX, offsetY + _posY, NULL); + _image->draw(offsetX + _posX, offsetY + _posY, nullptr); } // prepare fonts @@ -589,7 +589,7 @@ bool UIEdit::display(int offsetX, int offsetY) { if (_font) { font = _font; } else { - font = _gameRef->_systemFont; + font = _gameRef->getSystemFont(); } if (_fontSelected) { @@ -726,7 +726,7 @@ bool UIEdit::display(int offsetX, int offsetY) { } - _gameRef->_renderer->addRectToList(new BaseActiveRect(_gameRef, this, NULL, offsetX + _posX, offsetY + _posY, _width, _height, 100, 100, false)); + _gameRef->_renderer->addRectToList(new BaseActiveRect(_gameRef, this, nullptr, offsetX + _posX, offsetY + _posY, _width, _height, 100, 100, false)); _gameRef->_textEncoding = OrigEncoding; |