[Scummvm-cvs-logs] SF.net SVN: scummvm:[47980] scummvm/trunk/engines/teenagent

megath at users.sourceforge.net megath at users.sourceforge.net
Sun Feb 7 19:05:55 CET 2010


Revision: 47980
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47980&view=rev
Author:   megath
Date:     2010-02-07 18:05:55 +0000 (Sun, 07 Feb 2010)

Log Message:
-----------
added background effect for the inventory items

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/inventory.cpp
    scummvm/trunk/engines/teenagent/inventory.h

Modified: scummvm/trunk/engines/teenagent/inventory.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/inventory.cpp	2010-02-07 17:57:51 UTC (rev 47979)
+++ scummvm/trunk/engines/teenagent/inventory.cpp	2010-02-07 18:05:55 UTC (rev 47980)
@@ -255,9 +255,21 @@
 	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()) {

Modified: scummvm/trunk/engines/teenagent/inventory.h
===================================================================
--- scummvm/trunk/engines/teenagent/inventory.h	2010-02-07 17:57:51 UTC (rev 47979)
+++ scummvm/trunk/engines/teenagent/inventory.h	2010-02-07 18:05:55 UTC (rev 47980)
@@ -70,6 +70,7 @@
 
 		Item() : hovered(false) {}
 		void free();
+		void backgroundEffect(Graphics::Surface *s);
 		void render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *surface, int delta);
 	} graphics[24];
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list