aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/tony/font.cpp26
-rw-r--r--engines/tony/font.h8
-rw-r--r--engines/tony/loc.cpp3
-rw-r--r--engines/tony/loc.h2
4 files changed, 18 insertions, 21 deletions
diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp
index f83677373f..a3d253a52c 100644
--- a/engines/tony/font.cpp
+++ b/engines/tony/font.cpp
@@ -134,11 +134,11 @@ void RMFont::close() {
unload();
}
-int RMFont::stringLen(const RMString &text) {
- int len, i;
+int RMFont::stringLen(const Common::String &text) {
+ uint len, i;
len = 0;
- for (i = 0; i < text.length() - 1; i++)
+ for (i = 0; i < text.size() - 1; i++)
len += letterLength(text[i], text[i + 1]);
len += letterLength(text[i]);
@@ -1901,7 +1901,7 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
// Measure the length of the line
x = 0;
- j = font->stringLen(RMString(line.c_str()));
+ j = font->stringLen(line);
switch (_aHorType) {
case HLEFT:
@@ -2025,15 +2025,15 @@ void RMTextDialog::hide(CORO_PARAM) {
_bShowed = false;
}
-void RMTextDialog::writeText(const RMString &text, int font, int *time) {
- RMText::writeText(Common::String(text), font, &_time);
+void RMTextDialog::writeText(const Common::String &text, int font, int *time) {
+ RMText::writeText(text, font, &_time);
if (time != NULL)
*time = _time;
}
-void RMTextDialog::writeText(const RMString &text, RMFontColor *font, int *time) {
- RMText::writeText(Common::String(text), font, &_time);
+void RMTextDialog::writeText(const Common::String &text, RMFontColor *font, int *time) {
+ RMText::writeText(text, font, &_time);
if (time != NULL)
*time = _time;
@@ -2230,7 +2230,7 @@ void RMTextItemName::doFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &
uint32 hThread;
CORO_END_CONTEXT(_ctx);
- RMString itemName;
+ Common::String itemName;
CORO_BEGIN_CODE(_ctx);
@@ -2249,14 +2249,12 @@ void RMTextItemName::doFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &
else
_item = loc.whichItemIsIn(_mpos);
- itemName = "";
-
// If there an item, get its name
if (_item != NULL)
_item->getName(itemName);
// Write it
- writeText(Common::String(itemName), 1);
+ writeText(itemName, 1);
// Handle the change If the selected item is different from the previous one
if (_ctx->lastItem != _item) {
@@ -2387,10 +2385,10 @@ void RMDialogChoice::setNumChoices(int num) {
}
}
-void RMDialogChoice::addChoice(const RMString &string) {
+void RMDialogChoice::addChoice(const Common::String &string) {
// Draw the string
assert(_curAdded < _numChoices);
- _drawedStrings[_curAdded++].writeText(Common::String(string), 0);
+ _drawedStrings[_curAdded++].writeText(string, 0);
}
void RMDialogChoice::prepare(CORO_PARAM) {
diff --git a/engines/tony/font.h b/engines/tony/font.h
index e6543ef5d7..97434b9770 100644
--- a/engines/tony/font.h
+++ b/engines/tony/font.h
@@ -100,7 +100,7 @@ public:
RMGfxPrimitive *makeLetterPrimitive(byte bChar, int &nLength);
// Length in pixels of a string with the current font
- int stringLen(const RMString &text);
+ int stringLen(const Common::String &text);
int stringLen(char bChar, char bNext = 0);
};
@@ -256,8 +256,8 @@ public:
virtual ~RMTextDialog();
// Write the text
- void writeText(const RMString &text, int font, int *time = NULL);
- void writeText(const RMString &text, RMFontColor *font, int *time = NULL);
+ void writeText(const Common::String &text, int font, int *time = NULL);
+ void writeText(const Common::String &text, RMFontColor *font, int *time = NULL);
// Overloaded function to decide when you delete the object from the OT list
virtual void removeThis(CORO_PARAM, bool &result);
@@ -376,7 +376,7 @@ public:
void setNumChoices(int num);
// Adds a string with the choice
- void addChoice(const RMString &string);
+ void addChoice(const Common::String &string);
// Show and hide the selection, with possible animations.
// NOTE: If no parameter is passed to Show(), it is the obligation of
diff --git a/engines/tony/loc.cpp b/engines/tony/loc.cpp
index dedac199fa..9fba2dd51a 100644
--- a/engines/tony/loc.cpp
+++ b/engines/tony/loc.cpp
@@ -736,7 +736,7 @@ void RMItem::setPattern(int nPattern, bool bPlayP0) {
}
}
-bool RMItem::getName(RMString &name) {
+bool RMItem::getName(Common::String &name) {
char buf[256];
mpalQueryItemName(_mpalCode, buf);
@@ -1818,7 +1818,6 @@ RMGameBoxes::~RMGameBoxes() {
void RMGameBoxes::init() {
int i;
- RMString fn;
RMDataStream ds;
// Load boxes from disk
diff --git a/engines/tony/loc.h b/engines/tony/loc.h
index 35f07fe637..f8a795cc42 100644
--- a/engines/tony/loc.h
+++ b/engines/tony/loc.h
@@ -276,7 +276,7 @@ public:
RMPoint hotspot() {
return _hot;
}
- bool getName(RMString &name);
+ bool getName(Common::String &name);
int mpalCode() {
return _mpalCode;
}