aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/dialogue_menu.cpp
diff options
context:
space:
mode:
authorPeter Kohaut2017-08-26 11:58:14 +0200
committerPeter Kohaut2017-08-26 11:58:14 +0200
commit91f67a10ae3db0727db24b29eb5e53fb1b0212b5 (patch)
treef98e4d7ae74ef448ced3ec8d3bd2d68e403370fd /engines/bladerunner/dialogue_menu.cpp
parent77b904ef8d866d50e362697850ecbc0f3a54d184 (diff)
downloadscummvm-rg350-91f67a10ae3db0727db24b29eb5e53fb1b0212b5.tar.gz
scummvm-rg350-91f67a10ae3db0727db24b29eb5e53fb1b0212b5.tar.bz2
scummvm-rg350-91f67a10ae3db0727db24b29eb5e53fb1b0212b5.zip
BLADERUNNER: Transparent background in dialogue menu
Diffstat (limited to 'engines/bladerunner/dialogue_menu.cpp')
-rw-r--r--engines/bladerunner/dialogue_menu.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/bladerunner/dialogue_menu.cpp b/engines/bladerunner/dialogue_menu.cpp
index 40ec3aee00..e13e69cbd0 100644
--- a/engines/bladerunner/dialogue_menu.cpp
+++ b/engines/bladerunner/dialogue_menu.cpp
@@ -394,11 +394,17 @@ void DialogueMenu::reset() {
}
void DialogueMenu::darkenRect(Graphics::Surface &s, int x1, int y1, int x2, int y2) {
- for (int y = y1; y != y2; ++y) {
- for (int x = x1; x != x2; ++x) {
- // TODO(madmoose)
- uint16 *p = (uint16*)s.getBasePtr(x, y);
- *p = 0;
+ x1 = MAX(x1, 0);
+ y1 = MAX(y1, 0);
+ x2 = MIN(x2, 640);
+ y2 = MIN(y2, 480);
+
+ if (x1 < x2 && y1 < y2) {
+ for (int y = y1; y != y2; ++y) {
+ for (int x = x1; x != x2; ++x) {
+ uint16 *p = (uint16*)s.getBasePtr(x, y);
+ *p = (*p & 0x739C) >> 1; // 0 11100 11100 11100
+ }
}
}
}