mirror of
https://github.com/minetest/minetest.git
synced 2024-10-31 23:50:17 +01:00
adding function to get texture size
This commit is contained in:
parent
4fccc03f1c
commit
31f7071ec0
|
@ -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);
|
||||
|
||||
/*
|
||||
|
|
16
src/tile.cpp
16
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="<<id
|
||||
<<" >= m_atlaspointer_cache.size()="
|
||||
<<m_atlaspointer_cache.size()<<std::endl;
|
||||
return "";
|
||||
}
|
||||
|
||||
return v2s32(m_atlaspointer_cache[id].getSize().Height(),
|
||||
m_atlaspointer_cache[id].getSize().Width());
|
||||
}
|
||||
|
||||
|
||||
AtlasPointer TextureSource::getTexture(u32 id)
|
||||
{
|
||||
|
|
|
@ -121,6 +121,7 @@ public:
|
|||
virtual u32 getTextureId(const std::string &name){return 0;}
|
||||
virtual u32 getTextureIdDirect(const std::string &name){return 0;}
|
||||
virtual std::string getTextureName(u32 id){return "";}
|
||||
virtual v2s32 getTextureSize(u32 id);
|
||||
virtual AtlasPointer getTexture(u32 id){return AtlasPointer(0);}
|
||||
virtual AtlasPointer getTexture(const std::string &name)
|
||||
{return AtlasPointer(0);}
|
||||
|
|
Loading…
Reference in New Issue
Block a user