From db32e6c5aa3bf79c23fa51f9297440fcaf09215d Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Mon, 30 Mar 2015 20:04:19 -0400 Subject: Move texture_min_size even further down the pipe. Now, textures are JIT-upscaled using an image transformation, right at the time they're added to a mesh or particle; images used in 2D elements are left unscaled. This should fix any remaining issues with HUD elements. --- src/mapblock_mesh.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mapblock_mesh.cpp') diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index d95b8d286..d1637891a 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -1130,7 +1130,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset): os<<":"<<(u32)p.tile.animation_frame_count<<":"; m_crack_materials.insert(std::make_pair(i, os.str())); // Replace tile texture with the cracked one - p.tile.texture = tsrc->getTexture( + p.tile.texture = tsrc->getTextureForMesh( os.str()+"0", &p.tile.texture_id); } @@ -1204,9 +1204,9 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset): p.tile.applyMaterialOptionsWithShaders(material); if (p.tile.normal_texture) { material.setTexture(1, p.tile.normal_texture); - material.setTexture(2, tsrc->getTexture("enable_img.png")); + material.setTexture(2, tsrc->getTextureForMesh("enable_img.png")); } else { - material.setTexture(2, tsrc->getTexture("disable_img.png")); + material.setTexture(2, tsrc->getTextureForMesh("disable_img.png")); } } else { p.tile.applyMaterialOptions(material); @@ -1298,7 +1298,7 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat os<getTexture(os.str(), &new_texture_id); + tsrc->getTextureForMesh(os.str(), &new_texture_id); buf->getMaterial().setTexture(0, new_texture); // If the current material is also animated, @@ -1341,9 +1341,9 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat if (m_enable_shaders) { if (animation_frame.normal_texture) { buf->getMaterial().setTexture(1, animation_frame.normal_texture); - buf->getMaterial().setTexture(2, tsrc->getTexture("enable_img.png")); + buf->getMaterial().setTexture(2, tsrc->getTextureForMesh("enable_img.png")); } else { - buf->getMaterial().setTexture(2, tsrc->getTexture("disable_img.png")); + buf->getMaterial().setTexture(2, tsrc->getTextureForMesh("disable_img.png")); } } } -- cgit v1.2.3