aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/text32.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2011-10-19 20:27:43 +0300
committerFilippos Karapetis2011-10-19 20:29:05 +0300
commit513d0be10628574c98bb2588a7ef4567590228e2 (patch)
treefece4be1f2bc0224eccf799fe20879b95a1beea3 /engines/sci/graphics/text32.cpp
parent7a96bcb3eda703426d6d88a7392f520cae32bf88 (diff)
downloadscummvm-rg350-513d0be10628574c98bb2588a7ef4567590228e2.tar.gz
scummvm-rg350-513d0be10628574c98bb2588a7ef4567590228e2.tar.bz2
scummvm-rg350-513d0be10628574c98bb2588a7ef4567590228e2.zip
SCI: Merged all the code to get/set the NS rect
Diffstat (limited to 'engines/sci/graphics/text32.cpp')
-rw-r--r--engines/sci/graphics/text32.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index 49e6fe01b8..c7c9332313 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -32,6 +32,7 @@
#include "sci/engine/selector.h"
#include "sci/engine/state.h"
#include "sci/graphics/cache.h"
+#include "sci/graphics/compare.h"
#include "sci/graphics/font.h"
#include "sci/graphics/screen.h"
#include "sci/graphics/text32.h"
@@ -123,14 +124,14 @@ void GfxText32::drawTextBitmap(reg_t textObject) {
byte *surface = memoryPtr + BITMAP_HEADER_SIZE;
int curByte = 0;
- Common::Rect nsRect = getNSRect(textObject);
+ Common::Rect nsRect = g_sci->_gfxCompare->getNSRect(textObject);
Common::Rect planeRect = getPlaneRect(textObject);
uint16 x = readSelectorValue(_segMan, textObject, SELECTOR(x));
uint16 y = readSelectorValue(_segMan, textObject, SELECTOR(y));
uint16 textX = planeRect.left + x;
uint16 textY = planeRect.top + y;
- uint16 width = nsRect.width();
- uint16 height = nsRect.height();
+ uint16 width = nsRect.width() + 1;
+ uint16 height = nsRect.height() + 1;
// Upscale the coordinates/width if the fonts are already upscaled
if (_screen->fontIsUpscaled()) {
@@ -163,16 +164,6 @@ Common::Rect GfxText32::getPlaneRect(reg_t textObject) {
return planeRect;
}
-Common::Rect GfxText32::getNSRect(reg_t textObject) {
- Common::Rect nsRect;
- nsRect.top = readSelectorValue(_segMan, textObject, SELECTOR(nsTop));
- nsRect.left = readSelectorValue(_segMan, textObject, SELECTOR(nsLeft));
- nsRect.bottom = readSelectorValue(_segMan, textObject, SELECTOR(nsBottom)) + 1;
- nsRect.right = readSelectorValue(_segMan, textObject, SELECTOR(nsRight)) + 1;
-
- return nsRect;
-}
-
int16 GfxText32::GetLongest(const char *text, int16 maxWidth, GfxFont *font) {
uint16 curChar = 0;
int16 maxChars = 0, curCharCount = 0;