Bladeren bron

Merge pull request #347 from vloppin/master

Collada : Add missing parsing <image> into <effect><profile> markup
Alexander Gessler 11 jaren geleden
bovenliggende
commit
dbf001b81c
1 gewijzigde bestanden met toevoegingen van 13 en 0 verwijderingen
  1. 13 0
      code/ColladaParser.cpp

+ 13 - 0
code/ColladaParser.cpp

@@ -1163,6 +1163,19 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
 				// just syntactic sugar
 				// just syntactic sugar
 			}
 			}
 
 
+			else if( mFormat == FV_1_4_n && IsElement( "image"))
+			{
+				// read ID. Another entry which is "optional" by design but obligatory in reality
+				int attrID = GetAttribute( "id");
+				std::string id = mReader->getAttributeValue( attrID);
+
+				// create an entry and store it in the library under its ID
+				mImageLibrary[id] = Image();
+
+				// read on from there
+				ReadImage( mImageLibrary[id]);
+			}
+
 			/* Shading modes */
 			/* Shading modes */
 			else if( IsElement( "phong"))
 			else if( IsElement( "phong"))
 				pEffect.mShadeType = Shade_Phong;
 				pEffect.mShadeType = Shade_Phong;