aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Menshakov2010-02-07 18:05:55 +0000
committerVladimir Menshakov2010-02-07 18:05:55 +0000
commit049436313c24a1d564e2613b16f9c5de439760c8 (patch)
tree9aaddfea2c8f85d93a56ec68abf448e844eb9409
parent024e762bdb3afee3add1704d2dfb4c1206f9bc8a (diff)
downloadscummvm-rg350-049436313c24a1d564e2613b16f9c5de439760c8.tar.gz
scummvm-rg350-049436313c24a1d564e2613b16f9c5de439760c8.tar.bz2
scummvm-rg350-049436313c24a1d564e2613b16f9c5de439760c8.zip
added background effect for the inventory items
svn-id: r47980
-rw-r--r--engines/teenagent/inventory.cpp12
-rw-r--r--engines/teenagent/inventory.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index 97a0c3c6fd..b28b005158 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -255,9 +255,21 @@ void Inventory::Item::free() {
surface.free();
}
+void Inventory::Item::backgroundEffect(Graphics::Surface *s) {
+ uint w = rect.right - rect.left, h = rect.bottom - rect.top;
+ byte *line = (byte *)s->getBasePtr(rect.left, rect.top);
+ for(uint y = 0; y < h; ++y, line += s->pitch) {
+ byte *dst = line;
+ for(uint x = 0; x < w; ++x, ++dst) {
+ *dst = (*dst == 232)? 214: 224;
+ }
+ }
+}
+
void Inventory::Item::render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *dst, int delta) {
Resources *res = Resources::instance();
+ backgroundEffect(dst);
rect.render(dst, hovered ? 233 : 234);
if (obj->animated) {
if (animation.empty()) {
diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h
index 1514ef326d..6092a66475 100644
--- a/engines/teenagent/inventory.h
+++ b/engines/teenagent/inventory.h
@@ -70,6 +70,7 @@ private:
Item() : hovered(false) {}
void free();
+ void backgroundEffect(Graphics::Surface *s);
void render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *surface, int delta);
} graphics[24];