diff options
author | frogbotherer <therealchriswest@hotmail.com> | 2012-07-08 16:16:41 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-07-08 22:56:06 +0200 |
commit | 2b9d1cd128bf49181203f7936c34b0e5858a4202 (patch) | |
tree | 9e8a1c72942e1db28d472c866782e9aad4f317af /crawl-ref/source/tiletex.cc | |
parent | f79dc8e539c9217bc918c026ce3bdbb2cf20dde4 (diff) | |
download | crawl-ref-2b9d1cd128bf49181203f7936c34b0e5858a4202.tar.gz crawl-ref-2b9d1cd128bf49181203f7936c34b0e5858a4202.zip |
more efficient font rendering using glTexSubImage2D
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 478af454b1..712dd4ac60 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) |