From 9f939d9af99ad01cb7962a241ff62de5d064972d Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 12 Aug 2003 11:44:41 +0000 Subject: added TILED option --- src/FbTk/Texture.cc | 5 ++++- src/FbTk/Texture.hh | 7 ++++--- src/FbTk/TextureRender.cc | 7 +++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/FbTk/Texture.cc b/src/FbTk/Texture.cc index ae4710d..4c451cb 100644 --- a/src/FbTk/Texture.cc +++ b/src/FbTk/Texture.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Texture.cc,v 1.5 2002/12/01 13:42:14 rathnor Exp $ +// $Id: Texture.cc,v 1.6 2003/08/12 11:44:19 fluxgen Exp $ #include "Texture.hh" @@ -89,6 +89,9 @@ void Texture::setFromString(const char * const texture_str) { if (strstr(ts, "interlaced")) addType(Texture::INTERLACED); + + if (strstr(ts, "tiled")) + addType(Texture::TILED); } delete [] ts; diff --git a/src/FbTk/Texture.hh b/src/FbTk/Texture.hh index 333e12d..9c1df6f 100644 --- a/src/FbTk/Texture.hh +++ b/src/FbTk/Texture.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Texture.hh,v 1.3 2003/04/28 22:23:41 fluxgen Exp $ +// $Id: Texture.hh,v 1.4 2003/08/12 11:44:19 fluxgen Exp $ #ifndef FBTK_TEXTURE_HH #define FBTK_TEXTURE_HH @@ -64,9 +64,10 @@ public: enum { BEVEL1 = 0x04000, BEVEL2 = 0x08000, // bevel types - INVERT = 0x010000, //inverted image + INVERT = 0x10000, ///< inverted image PARENTRELATIVE = 0x20000, - INTERLACED = 0x40000 + INTERLACED = 0x40000, + TILED = 0x80000 ///< tiled pixmap }; Texture():m_type(0) { } diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc index 1f7d29f..40a7e72 100644 --- a/src/FbTk/TextureRender.cc +++ b/src/FbTk/TextureRender.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: TextureRender.cc,v 1.3 2003/04/28 22:27:29 fluxgen Exp $ +// $Id: TextureRender.cc,v 1.4 2003/08/12 11:44:41 fluxgen Exp $ #include "TextureRender.hh" @@ -264,7 +264,10 @@ Pixmap TextureRender::renderPixmap(const FbTk::Texture &src_texture) { // copy src_texture's pixmap and // scale to fit our size FbPixmap new_pm(src_texture.pixmap()); - new_pm.scale(width, height); + // if not tiled then scale it + if (! (src_texture.type() & Texture::TILED)) + new_pm.scale(width, height); + return new_pm.release(); } // return copy of pixmap -- cgit v0.11.2