aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2007-08-07 13:54:29 +0000
committerNicola Mettifogo2007-08-07 13:54:29 +0000
commit4d83622af7771d616e7722c058ef6b075a5cbf1c (patch)
treede808eb847b46905d2b5d0161e8b355f6087a44b
parent797f114aacbd34195d8fd58cb989ac0f5daa655d (diff)
downloadscummvm-rg350-4d83622af7771d616e7722c058ef6b075a5cbf1c.tar.gz
scummvm-rg350-4d83622af7771d616e7722c058ef6b075a5cbf1c.tar.bz2
scummvm-rg350-4d83622af7771d616e7722c058ef6b075a5cbf1c.zip
Location comments are now displayed by a single Gfx function.
svn-id: r28481
-rw-r--r--engines/parallaction/callables_ns.cpp13
-rw-r--r--engines/parallaction/graphics.cpp19
-rw-r--r--engines/parallaction/graphics.h1
-rw-r--r--engines/parallaction/location.cpp13
4 files changed, 22 insertions, 24 deletions
diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp
index e603f8c7a5..20535fc388 100644
--- a/engines/parallaction/callables_ns.cpp
+++ b/engines/parallaction/callables_ns.cpp
@@ -338,18 +338,7 @@ void Parallaction_ns::_c_setMask(void *parm) {
void Parallaction_ns::_c_endComment(void *param) {
- int16 w = 0, h = 0;
- _gfx->getStringExtent(_location._endComment, 130, &w, &h);
-
- Common::Rect r(w+5, h+5);
- r.moveTo(5, 5);
- _gfx->floodFill(Gfx::kBitFront, r, 0);
- r.grow(-2);
- _gfx->floodFill(Gfx::kBitFront, r, 1);
-
- _gfx->setFont(kFontDialogue);
- _gfx->displayWrappedString(_location._endComment, 3, 5, 0, 130);
- _gfx->updateScreen();
+ _gfx->showLocationComment(_location._endComment, true);
Gfx::Palette pal;
_gfx->makeGrayscalePalette(pal);
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index fe8d3722cc..e948fa7f26 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -96,6 +96,25 @@ void Gfx::drawBalloon(const Common::Rect& r, uint16 winding) {
return;
}
+void Gfx::showLocationComment(const char *text, bool end) {
+
+ setFont(kFontDialogue);
+
+ int16 w, h;
+ getStringExtent(const_cast<char*>(text), 130, &w, &h);
+
+ Common::Rect r(w + (end ? 5 : 10), h + 5);
+ r.moveTo(5, 5);
+
+ floodFill(kBitFront, r, 0);
+ r.grow(-2);
+ floodFill(kBitFront, r, 1);
+ displayWrappedString(const_cast<char*>(text), 3, 5, 0, 130);
+
+ updateScreen();
+
+ return;
+}
void Gfx::setPalette(Palette pal, uint32 first, uint32 num) {
// printf("setPalette(%i, %i)\n", first, num);
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 499b3a4834..d3eba695dc 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -221,6 +221,7 @@ public:
int16 queryMask(int16 v);
void intGrottaHackMask();
void restoreBackground(const Common::Rect& r);
+ void showLocationComment(const char *text, bool end = false);
// intro hacks for Nippon Safes
void fillMaskRect(const Common::Rect& r, byte color);
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp
index 9ab62eb40c..cd14e0efa2 100644
--- a/engines/parallaction/location.cpp
+++ b/engines/parallaction/location.cpp
@@ -431,21 +431,10 @@ void Parallaction::doLocationEnterTransition() {
jobEraseAnimations(NULL, NULL);
jobDisplayAnimations(NULL, NULL);
- _gfx->setFont(kFontDialogue);
_gfx->swapBuffers();
_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
- int16 w, h;
- _gfx->getStringExtent(_location._comment, 130, &w, &h);
-
- Common::Rect r(10 + w, 5 + h);
- r.moveTo(5, 5);
- _gfx->floodFill(Gfx::kBitFront, r, 0);
- r.grow(-2);
- _gfx->floodFill(Gfx::kBitFront, r, 1);
- _gfx->displayWrappedString(_location._comment, 3, 5, 0, 130);
-
- _gfx->updateScreen();
+ _gfx->showLocationComment(_location._comment);
waitUntilLeftClick();
_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront );