aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-12-18 07:23:18 +0100
committerStrangerke2014-12-18 07:23:18 +0100
commit3fca9d42f3ff6d19eba40d09754cc794f8e17585 (patch)
tree00f68c019030c0d98e67cf26ed529512b24ca7ef
parent7895c5408c37c54dcb5c30ddf7ae09f91052d768 (diff)
downloadscummvm-rg350-3fca9d42f3ff6d19eba40d09754cc794f8e17585.tar.gz
scummvm-rg350-3fca9d42f3ff6d19eba40d09754cc794f8e17585.tar.bz2
scummvm-rg350-3fca9d42f3ff6d19eba40d09754cc794f8e17585.zip
ACCESS: Use Common::String to display bubble box text
-rw-r--r--engines/access/bubble_box.cpp10
-rw-r--r--engines/access/bubble_box.h2
-rw-r--r--engines/access/scripts.cpp10
3 files changed, 11 insertions, 11 deletions
diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp
index 572567c3a3..e37a8142e8 100644
--- a/engines/access/bubble_box.cpp
+++ b/engines/access/bubble_box.cpp
@@ -29,7 +29,7 @@ namespace Access {
BubbleBox::BubbleBox(AccessEngine *vm) : Manager(vm) {
_type = TYPE_2;
_bounds = Common::Rect(64, 32, 64 + 130, 32 + 122);
- _bubblePtr = nullptr;
+ _bubbleDisplStr = "";
_fieldD = 0;
_fieldE = 0;
_fieldF = 0;
@@ -43,7 +43,7 @@ void BubbleBox::load(Common::SeekableReadStream *stream) {
while ((v = stream->readByte()) != 0)
_bubbleTitle += (char)v;
- _bubblePtr = _bubbleTitle.c_str();
+ _bubbleDisplStr = _bubbleTitle;
}
void BubbleBox::clearBubbles() {
@@ -90,7 +90,7 @@ void BubbleBox::calcBubble(const Common::String &msg) {
if (_type == TYPE_4) {
_vm->_fonts._printMaxX = 110;
} else {
- _vm->_fonts._printMaxX = _vm->_fonts._font2.stringWidth(_bubblePtr);
+ _vm->_fonts._printMaxX = _vm->_fonts._font2.stringWidth(_bubbleDisplStr);
}
// Start of with a rect with the given starting x and y
@@ -257,13 +257,13 @@ void BubbleBox::doBox(int item, int box) {
}
// Handle drawing title
- int titleWidth = _vm->_fonts._font2.stringWidth(_bubblePtr);
+ int titleWidth = _vm->_fonts._font2.stringWidth(_bubbleDisplStr);
Font &font2 = _vm->_fonts._font2;
font2._fontColors[0] = 0;
font2._fontColors[1] = 3;
font2._fontColors[2] = 2;
font2._fontColors[3] = 1;
- font2.drawString(_vm->_screen, _bubblePtr, Common::Point(
+ font2.drawString(_vm->_screen, _bubbleDisplStr, Common::Point(
_bounds.left + (_bounds.width() / 2) - (titleWidth / 2), _bounds.top + 1));
// Restore positional state
diff --git a/engines/access/bubble_box.h b/engines/access/bubble_box.h
index 2c05d096c3..0130344c7e 100644
--- a/engines/access/bubble_box.h
+++ b/engines/access/bubble_box.h
@@ -48,7 +48,7 @@ public:
Common::Rect _bounds;
Common::StringArray _nameIndex;
Common::String _bubbleTitle;
- const char *_bubblePtr;
+ Common::String _bubbleDisplStr;
int _fieldD;
int _fieldE;
int _fieldF;
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index ac10fe38d9..99f52c0ff8 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -621,7 +621,7 @@ void Scripts::cmdTexSpeak() {
while ((v = _data->readByte()) != 0)
tmpStr += (char)v;
- _vm->_bubbleBox->_bubblePtr = Common::String("JASON").c_str();
+ _vm->_bubbleBox->_bubbleDisplStr = Common::String("JASON");
_vm->_bubbleBox->placeBubble1(tmpStr);
findNull();
}
@@ -645,7 +645,7 @@ void Scripts::cmdTexChoice() {
_vm->_screen->_printStart = _texsOrg;
_vm->_bubbleBox->clearBubbles();
- _vm->_bubbleBox->_bubblePtr = Common::String("RESPONSE 1").c_str();
+ _vm->_bubbleBox->_bubbleDisplStr = Common::String("RESPONSE 1");
byte v;
Common::String tmpStr = "";
@@ -666,7 +666,7 @@ void Scripts::cmdTexChoice() {
tmpStr += (char)v;
if (tmpStr.size() != 0) {
- _vm->_bubbleBox->_bubblePtr = Common::String("RESPONSE 2").c_str();
+ _vm->_bubbleBox->_bubbleDisplStr = Common::String("RESPONSE 2");
_vm->_bubbleBox->calcBubble(tmpStr);
_vm->_bubbleBox->printBubble(tmpStr);
responseCoords.push_back(_vm->_bubbleBox->_bounds);
@@ -681,7 +681,7 @@ void Scripts::cmdTexChoice() {
tmpStr += (char)v;
if (tmpStr.size() != 0) {
- _vm->_bubbleBox->_bubblePtr = Common::String("RESPONSE 3").c_str();
+ _vm->_bubbleBox->_bubbleDisplStr = Common::String("RESPONSE 3");
_vm->_bubbleBox->calcBubble(tmpStr);
_vm->_bubbleBox->printBubble(tmpStr);
responseCoords.push_back(_vm->_bubbleBox->_bounds);
@@ -698,7 +698,7 @@ void Scripts::cmdTexChoice() {
charLoop();
- _vm->_bubbleBox->_bubblePtr = _vm->_bubbleBox->_bubbleTitle.c_str();
+ _vm->_bubbleBox->_bubbleDisplStr = _vm->_bubbleBox->_bubbleTitle;
if (_vm->_events->_leftButton) {
if (_vm->_events->_mouseRow >= 22) {
_vm->_events->debounceLeft();