浏览代码

Merge pull request #1174 from Areloch/UpfrontLoadFixesPR

Upfront Loading Changes
Brian Roberts 1 年之前
父节点
当前提交
78b56688d3

+ 3 - 1
Engine/source/gui/controls/guiBitmapCtrl.cpp

@@ -81,7 +81,9 @@ void GuiBitmapCtrl::initPersistFields()
    docsURL;
    addGroup( "Bitmap" );
 
-   INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiBitmapCtrl, The bitmap file to display in the control);
+      addField("Bitmap", TypeImageFilename, Offset(mBitmapName, GuiBitmapCtrl), assetDoc(Bitmap, docs), AbstractClassRep::FIELD_HideInInspectors);
+      addField("BitmapAsset", TypeImageAssetId, Offset(mBitmapAssetId, GuiBitmapCtrl), assetDoc(Bitmap, asset docs.));
+
       addField("color", TypeColorI, Offset(mColor, GuiBitmapCtrl),"color mul");
       addField( "wrap",   TypeBool,     Offset( mWrap, GuiBitmapCtrl ),
          "If true, the bitmap is tiled inside the control rather than stretched to fit." );

+ 11 - 2
Engine/source/materials/materialManager.cpp

@@ -297,10 +297,19 @@ BaseMatInstance *MaterialManager::getMeshDebugMatInstance(const LinearColorF &me
 
 void MaterialManager::mapMaterial(const String & textureName, const String & materialName)
 {
-   if (getMapEntry(textureName).isNotEmpty())
+   String currentMapEntry = getMapEntry(textureName);
+   if (currentMapEntry.isNotEmpty())
    {
       if (!textureName.equal("unmapped_mat", String::NoCase))
-         Con::warnf(ConsoleLogEntry::General, "Warning, overwriting material for: %s", textureName.c_str());
+      {
+         SimObject* originalMat;
+         SimObject* newMat;
+
+         if (Sim::findObject(currentMapEntry, originalMat) && Sim::findObject(materialName, newMat))
+            Con::warnf(ConsoleLogEntry::General, "Warning, overwriting material for: \"%s\" in %s by %s", textureName.c_str(), originalMat->getFilename(), newMat->getFilename());
+         else
+            Con::warnf(ConsoleLogEntry::General, "Warning, overwriting material for: %s", textureName.c_str());
+      }
    }
 
    mMaterialMap[String::ToLower(textureName)] = materialName;

+ 2 - 0
Engine/source/persistence/taml/binary/tamlBinaryReader.cpp

@@ -147,6 +147,8 @@ SimObject* TamlBinaryReader::parseElement( Stream& stream, const U32 versionId )
     if ( pSimObject == NULL )
         return NULL;
 
+    pSimObject->setFilename(mpTaml->getFilePathBuffer());
+
     // Find Taml callbacks.
     TamlCallbacks* pCallbacks = dynamic_cast<TamlCallbacks*>( pSimObject );
 

+ 2 - 0
Engine/source/persistence/taml/xml/tamlXmlReader.cpp

@@ -119,6 +119,8 @@ SimObject* TamlXmlReader::parseElement( tinyxml2::XMLElement* pXmlElement )
     if ( pSimObject == NULL )
         return NULL;
 
+    pSimObject->setFilename(mpTaml->getFilePathBuffer());
+
     // Find Taml callbacks.
     TamlCallbacks* pCallbacks = dynamic_cast<TamlCallbacks*>( pSimObject );