From 496451c164af0b2e90c5b7a155a101ed55472e52 Mon Sep 17 00:00:00 2001 From: Jonathan Neuschäfer Date: Wed, 8 Feb 2012 11:49:23 +0100 Subject: itemdef: handle the !render-to-target case --- src/itemdef.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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]); + } } /* -- cgit v1.2.3 From abab3db23d3d6e6fd3d51555ab355110a6e0540f Mon Sep 17 00:00:00 2001 From: Jonathan Neuschäfer Date: Wed, 8 Feb 2012 11:49:22 +0100 Subject: tile: don't duplicate std::string::find_last_of --- src/tile.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/tile.cpp b/src/tile.cpp index bc4c49cb1..0fa2e1029 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="< Date: Wed, 8 Feb 2012 11:49:22 +0100 Subject: tile: remove redundant warning about failing render-to-target --- src/tile.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/tile.cpp b/src/tile.cpp index 0fa2e1029..c39a65511 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -1483,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"< Date: Wed, 8 Feb 2012 11:49:21 +0100 Subject: mesh: warn only once about render-to-target not being supported --- src/mesh.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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."<