aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo
diff options
context:
space:
mode:
authorArnaud Boutonné2011-01-08 17:26:39 +0000
committerArnaud Boutonné2011-01-08 17:26:39 +0000
commit896d4947daa722b16e7734c0ec8a59b616a812be (patch)
treea38734cb3c4f12ca5266e2089d5a1fc5d0ff3ef3 /engines/hugo
parent2665194e6feb99af15937003d2e89e9e0f87b446 (diff)
downloadscummvm-rg350-896d4947daa722b16e7734c0ec8a59b616a812be.tar.gz
scummvm-rg350-896d4947daa722b16e7734c0ec8a59b616a812be.tar.bz2
scummvm-rg350-896d4947daa722b16e7734c0ec8a59b616a812be.zip
HUGO: Fix an assert when mouse hit the top of the screen
svn-id: r55168
Diffstat (limited to 'engines/hugo')
-rw-r--r--engines/hugo/display.cpp9
-rw-r--r--engines/hugo/display.h4
2 files changed, 8 insertions, 5 deletions
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index c3223c70c5..0c580c15cc 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -83,7 +83,7 @@ void Screen::initDisplay() {
/**
* Move an image from source to destination
*/
-void Screen::moveImage(image_pt srcImage, uint16 x1, uint16 y1, uint16 dx, uint16 dy, uint16 width1, image_pt dstImage, uint16 x2, uint16 y2, uint16 width2) {
+void Screen::moveImage(image_pt srcImage, int16 x1, int16 y1, int16 dx, int16 dy, int16 width1, image_pt dstImage, int16 x2, int16 y2, int16 width2) {
debugC(3, kDebugDisplay, "moveImage(srcImage, %d, %d, %d, %d, %d, dstImage, %d, %d, %d)", x1, y1, dx, dy, width1, x2, y2, width2);
int16 wrap_src = width1 - dx; // Wrap to next src row
@@ -112,7 +112,10 @@ void Screen::displayBackground() {
void Screen::displayRect(int16 x, int16 y, int16 dx, int16 dy) {
debugC(3, kDebugDisplay, "displayRect(%d, %d, %d, %d)", x, y, dx, dy);
- g_system->copyRectToScreen(&_frontBuffer[x + y * 320], 320, x, y, CLIP<int16>(dx, 0, 320 - x), CLIP<int16>(dy, 0, 200 - y));
+ int16 xClip, yClip;
+ xClip = CLIP<int16>(x, 0, 320);
+ yClip = CLIP<int16>(y, 0, 200);
+ g_system->copyRectToScreen(&_frontBuffer[x + y * 320], 320, xClip, yClip, CLIP<int16>(dx, 0, 320 - x), CLIP<int16>(dy, 0, 200 - y));
}
/**
@@ -492,7 +495,7 @@ void Screen::drawShape(int x, int y, int color1, int color2) {
}
}
-void Screen::drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint16 y2, int color) {
+void Screen::drawRectangle(bool filledFl, int16 x1, int16 y1, int16 x2, int16 y2, int color) {
assert(x1 <= x2);
assert(y1 <= y2);
diff --git a/engines/hugo/display.h b/engines/hugo/display.h
index b042ac35fb..9e86399e14 100644
--- a/engines/hugo/display.h
+++ b/engines/hugo/display.h
@@ -92,7 +92,7 @@ public:
void displayFrame(int sx, int sy, seq_t *seq, bool foreFl);
void displayList(dupdate_t update, ...);
void displayRect(int16 x, int16 y, int16 dx, int16 dy);
- void drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint16 y2, int color);
+ void drawRectangle(bool filledFl, int16 x1, int16 y1, int16 x2, int16 y2, int color);
void drawShape(int x, int y, int color1, int color2);
void drawStatusText();
void freeFonts();
@@ -101,7 +101,7 @@ public:
void initDisplay();
void initNewScreenDisplay();
void loadPalette(Common::File &in);
- void moveImage(image_pt srcImage, uint16 x1, uint16 y1, uint16 dx, uint16 dy, uint16 width1, image_pt dstImage, uint16 x2, uint16 y2, uint16 width2);
+ void moveImage(image_pt srcImage, int16 x1, int16 y1, int16 dx, int16 dy, int16 width1, image_pt dstImage, int16 x2, int16 y2, int16 width2);
void remapPal(uint16 oldIndex, uint16 newIndex);
void resetInventoryObjId();
void restorePal(Common::SeekableReadStream *f);