summaryrefslogtreecommitdiff
path: root/src/mapblock_mesh.cpp
diff options
context:
space:
mode:
authorAaron Suen <warr1024@gmail.com>2015-03-30 20:04:19 -0400
committerCraig Robbins <kde.psych@gmail.com>2015-03-31 16:56:33 +1000
commitdb32e6c5aa3bf79c23fa51f9297440fcaf09215d (patch)
tree7d840ddc94da602c8fda5009feedbec06f91ac1a /src/mapblock_mesh.cpp
parent862d4ea328ed30d79f4e28eb9119e21e275295d9 (diff)
downloadminetest-db32e6c5aa3bf79c23fa51f9297440fcaf09215d.tar.gz
minetest-db32e6c5aa3bf79c23fa51f9297440fcaf09215d.tar.bz2
minetest-db32e6c5aa3bf79c23fa51f9297440fcaf09215d.zip
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.
Diffstat (limited to 'src/mapblock_mesh.cpp')
-rw-r--r--src/mapblock_mesh.cpp12
1 files changed, 6 insertions, 6 deletions
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<<basename<<crack;
u32 new_texture_id = 0;
video::ITexture *new_texture =
- tsrc->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"));
}
}
}