aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-02-28 21:47:15 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-02-28 21:47:15 +0200
commit14a71590c361b5417938c79e53879bbb931949f3 (patch)
tree8b804b44d5ff12e1af9aeb6b2491f929ac22cbe9 /src
parenta5f6d65c3788da7811c5655110cc6deb95f20999 (diff)
parent806f10524f6a2cdcc1f15e12b9991ad726876d27 (diff)
downloadminetest-14a71590c361b5417938c79e53879bbb931949f3.tar.gz
minetest-14a71590c361b5417938c79e53879bbb931949f3.tar.bz2
minetest-14a71590c361b5417938c79e53879bbb931949f3.zip
Merge remote-tracking branch 'jn/random-fixes'
Diffstat (limited to 'src')
-rw-r--r--src/itemdef.cpp8
-rw-r--r--src/mesh.cpp9
-rw-r--r--src/tile.cpp14
3 files changed, 17 insertions, 14 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index aa888bbdf..22ca9f088 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -417,7 +417,13 @@ public:
light_position,
light_color,
light_radius);
- // Note: might have returned NULL
+
+ // render-to-target didn't work
+ if(def->inventory_texture == NULL)
+ {
+ def->inventory_texture =
+ tsrc->getTextureRaw(f.tname_tiles[0]);
+ }
}
/*
diff --git a/src/mesh.cpp b/src/mesh.cpp
index 5afb4af59..d0d8b0a6e 100644
--- a/src/mesh.cpp
+++ b/src/mesh.cpp
@@ -422,8 +422,13 @@ video::ITexture *generateTextureFromMesh(scene::IMesh *mesh,
video::IVideoDriver *driver = device->getVideoDriver();
if(driver->queryFeature(video::EVDF_RENDER_TO_TARGET) == false)
{
- errorstream<<"generateTextureFromMesh(): EVDF_RENDER_TO_TARGET"
- " not supported."<<std::endl;
+ static bool warned = false;
+ if(!warned)
+ {
+ errorstream<<"generateTextureFromMesh(): EVDF_RENDER_TO_TARGET"
+ " not supported."<<std::endl;
+ warned = true;
+ }
return NULL;
}
diff --git a/src/tile.cpp b/src/tile.cpp
index bc4c49cb1..c39a65511 100644
--- a/src/tile.cpp
+++ b/src/tile.cpp
@@ -1023,15 +1023,9 @@ video::IImage* generate_image_from_scratch(std::string name,
char separator = '^';
// Find last meta separator in name
- s32 last_separator_position = -1;
- for(s32 i=name.size()-1; i>=0; i--)
- {
- if(name[i] == separator)
- {
- last_separator_position = i;
- break;
- }
- }
+ s32 last_separator_position = name.find_last_of(separator);
+ //if(last_separator_position == std::npos)
+ // last_separator_position = -1;
/*infostream<<"generate_image_from_scratch(): "
<<"last_separator_position="<<last_separator_position
@@ -1489,8 +1483,6 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg,
if(rtt == NULL)
{
- errorstream<<"generate_image(): render to texture failed."
- " Creating fallback image"<<std::endl;
baseimg = generate_image_from_scratch(
imagename_top, device, sourcecache);
return true;