code cleanup: bge material conversion was creating STR_String just to check for empty...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 23 Feb 2013 07:15:37 +0000 (07:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 23 Feb 2013 07:15:37 +0000 (07:15 +0000)
source/gameengine/Converter/BL_BlenderDataConversion.cpp

index a4c7e8b0fa7f7274e01d70c58126718bd37f9c86..07f37d5a6e297021c433f98fef94ebbd9ed035ce 100644 (file)
@@ -618,14 +618,9 @@ static bool ConvertMaterial(
                                        else
                                        {
                                                mttmp = getImageFromMaterial( mat, i );
-                                               if (mttmp && mttmp->texco &TEXCO_UV)
-                                               {
-                                                       STR_String uvName = mttmp->uvname;
-
-                                                       if (!uvName.IsEmpty())
-                                                               material->mapping[i].uvCoName = mttmp->uvname;
-                                                       else
-                                                               material->mapping[i].uvCoName = "";
+                                               if (mttmp && (mttmp->texco & TEXCO_UV)) {
+                                                       /* string may be "" but thats detected as empty after */
+                                                       material->mapping[i].uvCoName = mttmp->uvname;
                                                }
                                                material->mapping[i].mapping |= USEUV;
                                        }
@@ -706,14 +701,9 @@ static bool ConvertMaterial(
                                                        material->mapping[i].mapping |= USEREFL;
                                                else if (mttmp->texco &(TEXCO_ORCO|TEXCO_GLOB))
                                                        material->mapping[i].mapping |= USEORCO;
-                                               else if (mttmp->texco &TEXCO_UV)
-                                               {
-                                                       STR_String uvName = mttmp->uvname;
-
-                                                       if (!uvName.IsEmpty())
-                                                               material->mapping[i].uvCoName = mttmp->uvname;
-                                                       else
-                                                               material->mapping[i].uvCoName = "";
+                                               else if (mttmp->texco & TEXCO_UV) {
+                                                       /* string may be "" but thats detected as empty after */
+                                                       material->mapping[i].uvCoName = mttmp->uvname;
                                                        material->mapping[i].mapping |= USEUV;
                                                }
                                                else if (mttmp->texco &TEXCO_NORM)