diff options
author | Joseph-Eugene Winzer | 2017-08-24 15:09:38 +0200 |
---|---|---|
committer | Thierry Crozat | 2018-01-23 01:47:01 +0000 |
commit | 316aeeabd597c4e0f241673ca000bc16b90771fb (patch) | |
tree | 02cb977cf352e7b80588a1d2e60992c1323de026 | |
parent | 026bd79a6d434ac07fe006b58d3dcf27b97beafb (diff) | |
download | scummvm-rg350-316aeeabd597c4e0f241673ca000bc16b90771fb.tar.gz scummvm-rg350-316aeeabd597c4e0f241673ca000bc16b90771fb.tar.bz2 scummvm-rg350-316aeeabd597c4e0f241673ca000bc16b90771fb.zip |
SUPERNOVA: Converts Object name and description to Strings
-rw-r--r-- | engines/supernova/msn_def.h | 5 | ||||
-rw-r--r-- | engines/supernova/rooms.cpp | 4 | ||||
-rw-r--r-- | engines/supernova/state.cpp | 14 |
3 files changed, 11 insertions, 12 deletions
diff --git a/engines/supernova/msn_def.h b/engines/supernova/msn_def.h index 884b467350..cf85efce0c 100644 --- a/engines/supernova/msn_def.h +++ b/engines/supernova/msn_def.h @@ -514,9 +514,8 @@ struct Object { return false; } - // TODO: convert name and description to String - const char *_name; - const char *_description; + Common::String _name; + Common::String _description; ObjectID _id; ObjectType _type; byte _click; diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp index a301d20735..f5b0ffa4a1 100644 --- a/engines/supernova/rooms.cpp +++ b/engines/supernova/rooms.cpp @@ -687,7 +687,7 @@ bool ShipHold::interact(Action verb, Object &obj1, Object &obj2) { if ((verb == ACTION_LOOK) && (obj1._id == SCRAP_LK) && (obj1._description != beschr2)) { - _vm->renderMessage(obj1._description); + _vm->renderMessage(obj1._description.c_str()); obj1._description = beschr2; _gm->takeObject(*getObject(2)); } else if (((verb == ACTION_OPEN) || (verb == ACTION_CLOSE)) && @@ -746,7 +746,7 @@ void ShipHold::onEntrance() { bool ShipLandingModule::interact(Action verb, Object &obj1, Object &obj2) { Room *r; if ((verb == ACTION_PRESS) && (obj1._id == LANDINGMOD_BUTTON)) - _vm->renderMessage(obj1._description); + _vm->renderMessage(obj1._description.c_str()); else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, PEN, LANDINGMOD_BUTTON)) { if (_gm->_state._landingModuleEnergy) { r = _gm->_rooms[GENERATOR]; diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp index 14d6df2786..3ce044e56c 100644 --- a/engines/supernova/state.cpp +++ b/engines/supernova/state.cpp @@ -458,7 +458,7 @@ void GameManager::processInput() { } /* normal item */ else { - for (int i = 0; (_currentRoom->getObject(i)->_name[0] != '\0') && (field == -1) && i < kMaxObject; i++) { + for (int i = 0; (_currentRoom->getObject(i)->_name.c_str()[0] != '\0') && (field == -1) && i < kMaxObject; i++) { click = _currentRoom->getObject(i)->_click; if (click != 255) { MSNImageDecoder::ClickField *clickField = _vm->_currentImage->_clickField; @@ -747,7 +747,7 @@ void GameManager::drawInventory() { _guiInventory[i].width(), _guiInventory[i].height(), _guiInventory[i]._bgColor); - _vm->renderText(_inventory.get(i + _inventoryScroll)->_name, + _vm->renderText(_inventory.get(i + _inventoryScroll)->_name.c_str(), _guiInventory[i]._textPosition.x, _guiInventory[i]._textPosition.y, _guiInventory[i]._textColor); @@ -1091,16 +1091,16 @@ void GameManager::drawStatus() { _vm->renderText(guiStatusCommand_DE[index], 1, 141, kColorDarkGreen); if (Object::isNullObject(_inputObject[0])) { - _vm->renderText(_currentInputObject->_name); + _vm->renderText(_currentInputObject->_name.c_str()); } else { - _vm->renderText(_inputObject[0]->_name); + _vm->renderText(_inputObject[0]->_name.c_str()); if (_inputVerb == ACTION_GIVE) { _vm->renderText(" an "); } else if (_inputVerb == ACTION_USE) { _vm->renderText(" mit "); } - _vm->renderText(_currentInputObject->_name); + _vm->renderText(_currentInputObject->_name.c_str()); } } @@ -1238,7 +1238,7 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) { drawMapExits(); _vm->renderMessage("Hmm, irgendwie komme|ich mir verarscht vor."); } else if ((verb == ACTION_LOOK) && (obj1._id == KEYCARD2)) { - _vm->renderMessage(obj1._description); + _vm->renderMessage(obj1._description.c_str()); obj1._description = "Es ist die Keycard des Commanders."; } else if ((verb == ACTION_LOOK) && (obj1._id == WATCH)) { _vm->renderMessage(Common::String::format( @@ -1456,7 +1456,7 @@ void GameManager::handleInput() { if (!validCommand) { switch (_inputVerb) { case ACTION_LOOK: - _vm->renderMessage(_inputObject[0]->_description); + _vm->renderMessage(_inputObject[0]->_description.c_str()); break; case ACTION_WALK: |