From 27299e6cc687313ff40f5ff74ee5521aabb5399d Mon Sep 17 00:00:00 2001 From: auria Date: Tue, 1 Jan 2013 19:46:53 +0000 Subject: [PATCH] Better detection of deprecated textures git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12320 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/material.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graphics/material.cpp b/src/graphics/material.cpp index e9838e387..6365f6cdf 100644 --- a/src/graphics/material.cpp +++ b/src/graphics/material.cpp @@ -318,8 +318,9 @@ public: Material::Material(const XMLNode *node, int index, bool deprecated) { m_deprecated = deprecated; - + node->get("name", &m_texname); + if (m_texname=="") { throw std::runtime_error("[Material] No texture name specified " @@ -629,7 +630,7 @@ void Material::init(unsigned int index) //----------------------------------------------------------------------------- void Material::install(bool is_full_path, bool complain_if_not_found) -{ +{ const std::string &full_path = is_full_path ? m_texname : file_manager->getTextureFile(m_texname); @@ -858,8 +859,7 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m // materials.xml, if you want to set flags for all surfaces, see // 'MaterialManager::setAllMaterialFlags' - - if (m_deprecated) + if (m_deprecated || (m->getTexture(0) != NULL && ((core::stringc)m->getTexture(0)->getName()).find("deprecated") != -1)) { fprintf(stderr, "WARNING: track uses deprecated texture <%s>\n", m_texname.c_str()); }