diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-07-11 17:33:42 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-07-11 17:36:22 +0200 |
commit | 9d32731bcc1e6c72d7618ca41cc98b6aba99505b (patch) | |
tree | 730ce3d8b308e69588b6c55d7df5430ebbe24947 /crawl-ref/source/tiletex.cc | |
parent | 28812c7f27d6cc6e24a38308d5b666cb24e11a59 (diff) | |
parent | adef487f6c1f76020ffa2bc7fb41d92f871415f0 (diff) | |
download | crawl-ref-9d32731bcc1e6c72d7618ca41cc98b6aba99505b.tar.gz crawl-ref-9d32731bcc1e6c72d7618ca41cc98b6aba99505b.zip |
Merge branch 'unicode-tiles'
It lacks an actual font yet, but I realized we need to check if drivers
people use actually support sub-textures -- and if not, there'll be some
rethinking needed.
Diffstat (limited to 'crawl-ref/source/tiletex.cc')
-rw-r--r-- | crawl-ref/source/tiletex.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/crawl-ref/source/tiletex.cc b/crawl-ref/source/tiletex.cc index 12235721e5..58c7b1adcb 100644 --- a/crawl-ref/source/tiletex.cc +++ b/crawl-ref/source/tiletex.cc @@ -48,17 +48,21 @@ bool GenericTexture::load_texture(const char *filename, bool GenericTexture::load_texture(unsigned char *pixels, unsigned int new_width, unsigned int new_height, - MipMapOptions mip_opt) + MipMapOptions mip_opt, + int offsetx, int offsety) { - if (!pixels || !new_width || !new_height) + if (!new_width || !new_height) return false; - m_width = new_width; - m_height = new_height; + if (offsetx == -1 && offsety == -1) + { + m_width = new_width; + m_height = new_height; + glmanager->generate_textures(1, &m_handle); + } - glmanager->generate_textures(1, &m_handle); bind(); - glmanager->load_texture(pixels, m_width, m_height, mip_opt); + glmanager->load_texture(pixels, new_width, new_height, mip_opt, offsetx, offsety); return true; } @@ -72,7 +76,6 @@ void GenericTexture::bind() const TilesTexture::TilesTexture() : GenericTexture(), m_tile_max(0), m_info_func(NULL) { - } void TilesTexture::set_info(int tile_max, tile_info_func *info_func) |