[Scummvm-cvs-logs] SF.net SVN: scummvm:[42074] scummvm/branches/gsoc2009-draci/engines/draci
dkasak13 at users.sourceforge.net
dkasak13 at users.sourceforge.net
Fri Jul 3 21:02:09 CEST 2009
Revision: 42074
http://scummvm.svn.sourceforge.net/scummvm/?rev=42074&view=rev
Author: dkasak13
Date: 2009-07-03 19:02:08 +0000 (Fri, 03 Jul 2009)
Log Message:
-----------
Added Sprite::getRect() and Text::getRect().
Modified Paths:
--------------
scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp
scummvm/branches/gsoc2009-draci/engines/draci/sprite.h
Modified: scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp 2009-07-03 18:19:51 UTC (rev 42073)
+++ scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp 2009-07-03 19:02:08 UTC (rev 42074)
@@ -152,6 +152,10 @@
}
}
+Common::Rect Sprite::getRect() const {
+ return Common::Rect(_x, _y, _x + _width, _y + _height);
+}
+
Text::Text(const Common::String &str, Font *font, byte fontColour,
uint x, uint y, uint z, uint spacing) {
uint len = str.size();
@@ -201,7 +205,11 @@
void Text::draw(Surface *surface, bool markDirty) const {
_font->setColour(_colour);
_font->drawString(surface, _text, _length, _x, _y, _spacing);
-}
+}
+
+Common::Rect Text::getRect() const {
+ return Common::Rect(_x, _y, _x + _width, _y + _height);
+}
} // End of namespace Draci
Modified: scummvm/branches/gsoc2009-draci/engines/draci/sprite.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/sprite.h 2009-07-03 18:19:51 UTC (rev 42073)
+++ scummvm/branches/gsoc2009-draci/engines/draci/sprite.h 2009-07-03 19:02:08 UTC (rev 42074)
@@ -50,6 +50,8 @@
virtual void setX(uint x) { _x = x; }
virtual void setY(uint y) { _y = y; }
virtual void setZ(uint z) { _z = z; }
+
+ virtual Common::Rect getRect() const = 0;
private:
uint16 _width; //!< Width of the sprite
@@ -88,6 +90,8 @@
void setMirrorOn();
void setMirrorOff();
+
+ virtual Common::Rect getRect() const;
const byte *getBuffer() const { return _data; }
private:
@@ -108,6 +112,8 @@
void draw(Surface *surface, bool markDirty = true) const;
+ virtual Common::Rect getRect() const;
+
private:
byte *_text;
uint _length;
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