diff options
author | Strangerke | 2015-12-21 01:27:50 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:35:32 +0100 |
commit | fa222f0ca878b3bf55b439ccf0e1e0849cecfe63 (patch) | |
tree | d83274c8d89d1c62a286804475fa81966882dea1 /engines/lab/processroom.cpp | |
parent | 2eeb027604a470b8e5410751962734b677d605f1 (diff) | |
download | scummvm-rg350-fa222f0ca878b3bf55b439ccf0e1e0849cecfe63.tar.gz scummvm-rg350-fa222f0ca878b3bf55b439ccf0e1e0849cecfe63.tar.bz2 scummvm-rg350-fa222f0ca878b3bf55b439ccf0e1e0849cecfe63.zip |
LAB: Make string check more readable, remove a useless c_str()
Diffstat (limited to 'engines/lab/processroom.cpp')
-rw-r--r-- | engines/lab/processroom.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index d467be9894..efabb8de7e 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -63,7 +63,7 @@ bool LabEngine::checkConditions(int16 *condition) { } ViewData *LabEngine::getViewData(uint16 roomNum, uint16 direction) { - if (_rooms[roomNum]._roomMsg == "") + if (!_rooms[roomNum]._roomMsg.empty()) _resource->readViews(roomNum); ViewData *view = _rooms[roomNum]._view[direction]; @@ -131,17 +131,15 @@ Common::String LabEngine::getPictName(CloseDataPtr *closePtrList) { } void LabEngine::drawDirection(CloseDataPtr closePtr) { - if (closePtr && closePtr->_message != "") { - _graphics->drawMessage(closePtr->_message.c_str()); + if (closePtr && !closePtr->_message.empty()) { + _graphics->drawMessage(closePtr->_message); return; } Common::String message; - if (_rooms[_roomNum]._roomMsg != "") { - message = Common::String(_rooms[_roomNum]._roomMsg).c_str(); - message += ", "; - } + if (!_rooms[_roomNum]._roomMsg.empty()) + message = _rooms[_roomNum]._roomMsg + ", "; if (_direction == NORTH) message += _resource->getStaticText(kTextFacingNorth); @@ -152,7 +150,7 @@ void LabEngine::drawDirection(CloseDataPtr closePtr) { else if (_direction == WEST) message += _resource->getStaticText(kTextFacingWest); - _graphics->drawMessage(message.c_str()); + _graphics->drawMessage(message); } uint16 LabEngine::processArrow(uint16 curDirection, uint16 arrow) { @@ -201,7 +199,7 @@ void LabEngine::setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, b else target = _utils->rectScale(closePtr->_x1, closePtr->_y1, closePtr->_x2, closePtr->_y2); - if (target.contains(pos) && closePtr->_graphicName != "") { + if (target.contains(pos) && !closePtr->_graphicName.empty()) { *closePtrList = closePtr; return; } @@ -267,7 +265,7 @@ void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) { break; case LOADDIFF: - if (actionList->_messages[0].size()) + if (!actionList->_messages[0].empty()) // Puts a file into memory _graphics->loadPict(actionList->_messages[0]); |