[Scummvm-cvs-logs] scummvm master -> 3664088f6f562f74bcaebb5d1006a33da29c5637

DrMcCoy drmccoy at drmccoy.de
Sun Mar 11 21:43:58 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3664088f6f GOB: Add a way to add sprite coordinates to CMP files


Commit: 3664088f6f562f74bcaebb5d1006a33da29c5637
    https://github.com/scummvm/scummvm/commit/3664088f6f562f74bcaebb5d1006a33da29c5637
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2012-03-11T13:39:14-07:00

Commit Message:
GOB: Add a way to add sprite coordinates to CMP files

Because the meter bar and icons for Penetration are not
even in the CMP's RXY.

Changed paths:
    engines/gob/cmpfile.cpp
    engines/gob/cmpfile.h
    engines/gob/rxyfile.cpp
    engines/gob/rxyfile.h



diff --git a/engines/gob/cmpfile.cpp b/engines/gob/cmpfile.cpp
index 62ac9f3..7b21c4c 100644
--- a/engines/gob/cmpfile.cpp
+++ b/engines/gob/cmpfile.cpp
@@ -230,4 +230,17 @@ void CMPFile::draw(Surface &dest, uint16 left, uint16 top, uint16 right, uint16
 	dest.blit(*_surface, left, top, right, bottom, x, y, transp);
 }
 
+uint16 CMPFile::addSprite(uint16 left, uint16 top, uint16 right, uint16 bottom) {
+	if (empty())
+		return 0;
+
+	const uint16 height = bottom - top  + 1;
+	const uint16 width  = right  - left + 1;
+
+	_maxWidth  = MAX(_maxWidth , width);
+	_maxHeight = MAX(_maxHeight, height);
+
+	return _coordinates->add(left, top, right, bottom);
+}
+
 } // End of namespace Gob
diff --git a/engines/gob/cmpfile.h b/engines/gob/cmpfile.h
index d409e15..2b669e4 100644
--- a/engines/gob/cmpfile.h
+++ b/engines/gob/cmpfile.h
@@ -68,6 +68,8 @@ public:
 	void draw(Surface &dest, uint16 left, uint16 top, uint16 right, uint16 bottom,
 	          uint16 x, uint16 y, int32 transp = -1) const;
 
+	uint16 addSprite(uint16 left, uint16 top, uint16 right, uint16 bottom);
+
 private:
 	GobEngine *_vm;
 
diff --git a/engines/gob/rxyfile.cpp b/engines/gob/rxyfile.cpp
index 06a07bd..9702dc8 100644
--- a/engines/gob/rxyfile.cpp
+++ b/engines/gob/rxyfile.cpp
@@ -88,4 +88,15 @@ void RXYFile::load(Common::SeekableReadStream &rxy) {
 	}
 }
 
+uint16 RXYFile::add(uint16 left, uint16 top, uint16 right, uint16 bottom) {
+	_coords.resize(_coords.size() + 1);
+
+	_coords.back().left   = left;
+	_coords.back().top    = top;
+	_coords.back().right  = right;
+	_coords.back().bottom = bottom;
+
+	return _coords.size() - 1;
+}
+
 } // End of namespace Gob
diff --git a/engines/gob/rxyfile.h b/engines/gob/rxyfile.h
index 3b4d3de..bc9600b 100644
--- a/engines/gob/rxyfile.h
+++ b/engines/gob/rxyfile.h
@@ -58,6 +58,8 @@ public:
 
 	const Coordinates &operator[](uint i) const;
 
+	uint16 add(uint16 left, uint16 top, uint16 right, uint16 bottom);
+
 private:
 	typedef Common::Array<Coordinates> CoordArray;
 






More information about the Scummvm-git-logs mailing list