aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2007-07-02 07:32:06 +0000
committerNicola Mettifogo2007-07-02 07:32:06 +0000
commit99df4dd7e29541e1af7bee6ab67439af73c0c263 (patch)
tree7f4704fbb64d548a03f1be455aad31b6817854a1
parent3a0e0916d63e3d6e4c2fc00d48fad80cfaa6f028 (diff)
downloadscummvm-rg350-99df4dd7e29541e1af7bee6ab67439af73c0c263.tar.gz
scummvm-rg350-99df4dd7e29541e1af7bee6ab67439af73c0c263.tar.bz2
scummvm-rg350-99df4dd7e29541e1af7bee6ab67439af73c0c263.zip
Removed special displayBalloonString routine.
svn-id: r27850
-rw-r--r--engines/parallaction/callables.cpp2
-rw-r--r--engines/parallaction/dialogue.cpp19
-rw-r--r--engines/parallaction/graphics.cpp25
-rw-r--r--engines/parallaction/graphics.h5
-rw-r--r--engines/parallaction/location.cpp2
-rw-r--r--engines/parallaction/menu.cpp10
-rw-r--r--engines/parallaction/zone.cpp4
7 files changed, 28 insertions, 39 deletions
diff --git a/engines/parallaction/callables.cpp b/engines/parallaction/callables.cpp
index 1154250ffa..be92ca1daa 100644
--- a/engines/parallaction/callables.cpp
+++ b/engines/parallaction/callables.cpp
@@ -253,7 +253,7 @@ void _c_endComment(void *param) {
_vm->_gfx->floodFill(Gfx::kBitFront, r, 1);
_vm->_gfx->setFont(kFontDialogue);
- _vm->_gfx->displayWrappedString(_vm->_location._endComment, 3, 5, 130, 0);
+ _vm->_gfx->displayWrappedString(_vm->_location._endComment, 3, 5, 0, 130);
_vm->_gfx->updateScreen();
uint32 di = 0;
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 86fd8345d2..d64df465e7 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -179,7 +179,7 @@ char *Parallaction::parseDialogueString(Script &script) {
} while (strlen(vD0) == 0);
vD0[strlen(vD0)-1] = '\0'; // deletes the trailing '0xA'
- // this is critical for Gfx::displayBalloonString to work properly
+ // this is critical for Gfx::displayWrappedString to work properly
char *vCC = (char*)malloc(strlen(vD0)+1);
strcpy(vCC, vD0);
@@ -248,9 +248,10 @@ uint16 DialogueManager::askPassword() {
r.moveTo(_answerBalloonX[0], _answerBalloonY[0]);
_vm->_gfx->drawBalloon(r, 1);
- _vm->_gfx->displayWrappedString(_q->_answers[0]->_text, _answerBalloonX[0], _answerBalloonY[0], MAX_BALLOON_WIDTH, 3);
+ _vm->_gfx->displayWrappedString(_q->_answers[0]->_text, _answerBalloonX[0], _answerBalloonY[0], 3, MAX_BALLOON_WIDTH);
_vm->_gfx->flatBlitCnv(_answerer, 0, ANSWER_CHARACTER_X, ANSWER_CHARACTER_Y, Gfx::kBitFront);
- _vm->_gfx->displayBalloonString(_answerBalloonX[0] + 5, _answerBalloonY[0] + _answerBalloonH[0] - 15, "> ", 0);
+ _vm->_gfx->displayString(_answerBalloonX[0] + 5, _answerBalloonY[0] + _answerBalloonH[0] - 15, "> ", 0);
+ _vm->_gfx->updateScreen();
Common::Event e;
while (e.kbd.ascii != Common::KEYCODE_RETURN && passwordLen < MAX_PASSWORD_LENGTH) {
@@ -266,7 +267,7 @@ uint16 DialogueManager::askPassword() {
passwordLen++;
password[passwordLen] = '\0';
- _vm->_gfx->displayBalloonString(_answerBalloonX[0] + 10, _answerBalloonY[0] + _answerBalloonH[0] - 15, password, 0);
+ _vm->_gfx->displayString(_answerBalloonX[0] + 10, _answerBalloonY[0] + _answerBalloonH[0] - 15, password, 0);
_vm->_gfx->updateScreen();
g_system->delayMillis(20);
@@ -305,7 +306,7 @@ bool DialogueManager::displayAnswer(uint16 i) {
_vm->_gfx->drawBalloon(r, 1);
_answerBalloonY[i+1] = 10 + _answerBalloonY[i] + _answerBalloonH[i];
- _askPassword = _vm->_gfx->displayWrappedString(_q->_answers[i]->_text, _answerBalloonX[i], _answerBalloonY[i], MAX_BALLOON_WIDTH, 3);
+ _askPassword = _vm->_gfx->displayWrappedString(_q->_answers[i]->_text, _answerBalloonX[i], _answerBalloonY[i], 3, MAX_BALLOON_WIDTH);
return true;
}
@@ -347,7 +348,7 @@ void DialogueManager::displayQuestion() {
r.moveTo(QUESTION_BALLOON_X, QUESTION_BALLOON_Y);
_vm->_gfx->drawBalloon(r, _q->_mood & 0x10);
- _vm->_gfx->displayWrappedString(_q->_text, QUESTION_BALLOON_X, QUESTION_BALLOON_Y, MAX_BALLOON_WIDTH, 0);
+ _vm->_gfx->displayWrappedString(_q->_text, QUESTION_BALLOON_X, QUESTION_BALLOON_Y, 0, MAX_BALLOON_WIDTH);
_vm->_gfx->updateScreen();
waitUntilLeftClick();
@@ -423,7 +424,7 @@ int16 DialogueManager::selectAnswer() {
_answerBalloonY[i] = 2000;
if (numAvailableAnswers == 1) {
- _vm->_gfx->displayWrappedString(_q->_answers[_di]->_text, _answerBalloonX[_di], _answerBalloonY[_di], MAX_BALLOON_WIDTH, 0);
+ _vm->_gfx->displayWrappedString(_q->_answers[_di]->_text, _answerBalloonX[_di], _answerBalloonY[_di], 0, MAX_BALLOON_WIDTH);
_vm->_gfx->flatBlitCnv(_answerer, 0, ANSWER_CHARACTER_X, ANSWER_CHARACTER_Y, Gfx::kBitFront);
_vm->_gfx->updateScreen();
waitUntilLeftClick();
@@ -440,9 +441,9 @@ int16 DialogueManager::selectAnswer() {
if (_si != v2) {
if (v2 != -1)
- _vm->_gfx->displayWrappedString(_q->_answers[v2]->_text, _answerBalloonX[v2], _answerBalloonY[v2], MAX_BALLOON_WIDTH, 3);
+ _vm->_gfx->displayWrappedString(_q->_answers[v2]->_text, _answerBalloonX[v2], _answerBalloonY[v2], 3, MAX_BALLOON_WIDTH);
- _vm->_gfx->displayWrappedString(_q->_answers[_si]->_text, _answerBalloonX[_si], _answerBalloonY[_si], MAX_BALLOON_WIDTH, 0);
+ _vm->_gfx->displayWrappedString(_q->_answers[_si]->_text, _answerBalloonX[_si], _answerBalloonY[_si], 0, MAX_BALLOON_WIDTH);
_vm->_gfx->flatBlitCnv(_answerer, _q->_answers[_si]->_mood & 0xF, ANSWER_CHARACTER_X, ANSWER_CHARACTER_Y, Gfx::kBitFront);
}
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index ebdc4187f5..aca02a68bf 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -583,30 +583,19 @@ void Gfx::makeCnvFromString(StaticCnv *cnv, char *text) {
}
-void Gfx::displayString(uint16 x, uint16 y, const char *text) {
- assert(_font == _fonts[kFontMenu]);
-
+void Gfx::displayString(uint16 x, uint16 y, const char *text, byte color) {
byte *dst = _buffers[kBitFront] + x + y*SCREEN_WIDTH;
- _font->setColor(1);
+ _font->setColor(color);
_font->drawString(dst, SCREEN_WIDTH, text);
}
void Gfx::displayCenteredString(uint16 y, const char *text) {
uint16 x = (SCREEN_WIDTH - getStringWidth(text)) / 2;
- displayString(x, y, text);
-}
-
-void Gfx::displayBalloonString(uint16 x, uint16 y, const char *text, byte color) {
- assert(_font == _fonts[kFontDialogue]);
-
- byte *dst = _buffers[kBitFront] + x + y*SCREEN_WIDTH;
-
- _font->setColor(color);
- _font->drawString(dst, SCREEN_WIDTH, text);
+ displayString(x, y, text, 1);
}
-bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, uint16 maxwidth, byte color) {
-// printf("Gfx::displayWrappedString(%s, %i, %i, %i, %i)...", text, x, y, maxwidth, color);
+bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, byte color, uint16 wrapwidth) {
+// printf("Gfx::displayWrappedString(%s, %i, %i, %i, %i)...", text, x, y, color, wrapwidth);
uint16 lines = 0;
bool rv = false;
@@ -622,7 +611,7 @@ bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, uint16 maxwidth,
text = parseNextToken(text, token, 40, " ");
linewidth += getStringWidth(token);
- if (linewidth > maxwidth) {
+ if (linewidth > wrapwidth) {
// wrap line
lines++;
rx = x + 10; // x
@@ -636,7 +625,7 @@ bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, uint16 maxwidth,
if (!scumm_stricmp(token, "%p")) {
rv = true;
} else
- displayBalloonString(rx, ry, token, color);
+ displayString(rx, ry, token, color);
rx += getStringWidth(token) + getStringWidth(" ");
linewidth += getStringWidth(" ");
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 0cc78de393..d535d3cf05 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -165,10 +165,9 @@ public:
// dialogue and text
void drawBalloon(const Common::Rect& r, uint16 arg_8);
- void displayBalloonString(uint16 x, uint16 y, const char *text, byte color);
- void displayString(uint16 x, uint16 y, const char *text);
+ void displayString(uint16 x, uint16 y, const char *text, byte color);
void displayCenteredString(uint16 y, const char *text);
- bool displayWrappedString(char *text, uint16 x, uint16 y, uint16 maxwidth, byte color);
+ bool displayWrappedString(char *text, uint16 x, uint16 y, byte color, uint16 wrapwidth = SCREEN_WIDTH);
uint16 getStringWidth(const char *text);
void getStringExtent(char *text, uint16 maxwidth, int16* width, int16* height);
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp
index 4d8efa3255..2a5af2dc67 100644
--- a/engines/parallaction/location.cpp
+++ b/engines/parallaction/location.cpp
@@ -437,7 +437,7 @@ void Parallaction::doLocationEnterTransition() {
_gfx->floodFill(Gfx::kBitFront, r, 0);
r.grow(-1);
_gfx->floodFill(Gfx::kBitFront, r, 1);
- _gfx->displayWrappedString(_location._comment, 3, 5, 130, 0);
+ _gfx->displayWrappedString(_location._comment, 3, 5, 0, 130);
_gfx->updateScreen();
waitUntilLeftClick();
diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp
index b1b6fb44c8..427f24a467 100644
--- a/engines/parallaction/menu.cpp
+++ b/engines/parallaction/menu.cpp
@@ -201,7 +201,7 @@ uint16 Menu::chooseLanguage() {
_vm->_gfx->setPalette(_vm->_gfx->_palette);
_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
- _vm->_gfx->displayString(60, 30, "SELECT LANGUAGE");
+ _vm->_gfx->displayString(60, 30, "SELECT LANGUAGE", 1);
_vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
@@ -287,10 +287,10 @@ uint16 Menu::selectGame() {
if (_si != 0) {
// load a game
- _vm->_gfx->displayString(60, 30, loadGameMsg[_language]);
+ _vm->_gfx->displayString(60, 30, loadGameMsg[_language], 1);
} else {
// new game
- _vm->_gfx->displayString(60, 30, newGameMsg[_language]);
+ _vm->_gfx->displayString(60, 30, newGameMsg[_language], 1);
}
_vm->_gfx->updateScreen();
@@ -353,7 +353,7 @@ void Menu::selectCharacter() {
askPassword = false;
_di = 0;
- _vm->_gfx->displayString(60, 30, introMsg1[_language]); // displays message
+ _vm->_gfx->displayString(60, 30, introMsg1[_language], 1); // displays message
_vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
_donna_points = 0;
@@ -415,7 +415,7 @@ void Menu::selectCharacter() {
if (askPassword == false) break;
_vm->_gfx->copyScreen(Gfx::kBit2, Gfx::kBitFront);
- _vm->_gfx->displayString(60, 30, introMsg2[_language]);
+ _vm->_gfx->displayString(60, 30, introMsg2[_language], 1);
_vm->_gfx->updateScreen();
g_system->delayMillis(2000);
diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp
index 0536f890fa..d9bd36a1f5 100644
--- a/engines/parallaction/zone.cpp
+++ b/engines/parallaction/zone.cpp
@@ -303,7 +303,7 @@ void Parallaction::displayCharacterComment(ExamineData *data) {
Common::Rect r(v28, v26);
r.moveTo(140, 10);
_gfx->drawBalloon(r, 0);
- _gfx->displayWrappedString(data->_description, 140, 10, 130, 0);
+ _gfx->displayWrappedString(data->_description, 140, 10, 0, 130);
_gfx->updateScreen();
@@ -344,7 +344,7 @@ void Parallaction::displayItemComment(ExamineData *data) {
r.moveTo(0, 90);
_gfx->drawBalloon(r, 0);
_gfx->flatBlitCnv(_vm->_char._head, 100, 152, Gfx::kBitFront);
- _gfx->displayWrappedString(data->_description, 0, 90, 130, 0);
+ _gfx->displayWrappedString(data->_description, 0, 90, 0, 130);
jobEraseAnimations((void*)1, NULL);
_gfx->updateScreen();