From 31f7071ec0725a9bc81d91be942ef36cb2d4db38 Mon Sep 17 00:00:00 2001 From: Sascha Heylik Date: Wed, 5 Sep 2012 17:45:12 +0200 Subject: [PATCH] adding function to get texture size --- src/main.cpp | 2 +- src/tile.cpp | 16 ++++++++++++++++ src/tile.h | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 63918a60d..d062aa163 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1292,7 +1292,7 @@ int main(int argc, char *argv[]) video::IVideoDriver* driver = device->getVideoDriver(); - // Disable mipmaps (because some of them look ugly) + // enable mipmaps (because some of them look ugly) driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); /* diff --git a/src/tile.cpp b/src/tile.cpp index 6dbe4c63a..e68009059 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -732,6 +732,22 @@ std::string TextureSource::getTextureName(u32 id) return m_atlaspointer_cache[id].name; } +v2s32 TextureSource::getTextureSize(u32 id) +{ + JMutexAutoLock lock(m_atlaspointer_cache_mutex); + + id (id >= m_atlaspointer_cache.size()) + { + errorstream<<"TextureSource::getTextureName(): id="<= m_atlaspointer_cache.size()=" + <