[prev in list] [next in list] [prev in thread] [next in thread] 

List:       osflash-sandy
Subject:    [Sandy] [sandy commit] r756 - trunk/sandy/as3/trunk/src/sandy/parser
From:       codesite-noreply () google ! com (codesite-noreply at google ! com)
Date:       2008-08-30 20:23:37
Message-ID: 0015175cde6628888a0455b32515 () google ! com
[Download RAW message or body]

Author: makc.the.great
Date: Sat Aug 30 13:23:28 2008
New Revision: 756

Modified:
    trunk/sandy/as3/trunk/src/sandy/parser/Parser3DS.as

Log:
somewhat better handling of multiple materials, should work as long as  
there is one shape per material. not perfect yet, but I'm trying :)

Modified: trunk/sandy/as3/trunk/src/sandy/parser/Parser3DS.as
==============================================================================
--- trunk/sandy/as3/trunk/src/sandy/parser/Parser3DS.as	(original)
+++ trunk/sandy/as3/trunk/src/sandy/parser/Parser3DS.as	Sat Aug 30 13:23:28  
2008
@@ -56,7 +56,7 @@
  		private var endFrame:uint;
  		private var lastRotation:Quaternion;

-		private var textureFileName:String;
+		private var textureFileNames:Array;

  		/**
  		 * Creates a new Parser3DS instance.
@@ -69,7 +69,7 @@
  		public function Parser3DS( p_sUrl:String, p_nScale:Number = 1,  
p_sTextureExtension:String = null )
  		{
  			super( p_sUrl, p_nScale, p_sTextureExtension );
-			m_sDataFormat = URLLoaderDataFormat.BINARY;
+			m_sDataFormat = URLLoaderDataFormat.BINARY; textureFileNames = [];
  		}

  		/**
@@ -131,7 +131,7 @@
  						break;
  					case Parser3DSChunkTypes.MAT_TEXFLNM:
  						// texture file name
-						textureFileName = readString ();
+						textureFileNames.push (readString ());
  						break;

  				    case Parser3DSChunkTypes.EDIT_OBJECT:
@@ -143,8 +143,8 @@
  					        if( l_oMatrix ) _applyMatrixToShape( l_oShape, l_oMatrix );
  							m_oGroup.addChild( l_oShape );
  						// untested, may not work... but should
-						if (textureFileName != null)
-							applyTextureToShape (l_oShape, textureFileName);
+						if (textureFileNames.length > 0)
+							applyTextureToShape (l_oShape, textureFileNames.shift ());
  					    }
  					    // --
  					    var str:String = readString();
@@ -504,8 +504,8 @@
  			if( l_oMatrix ) _applyMatrixToShape( l_oShape, l_oMatrix );
  			m_oGroup.addChild( l_oShape );
  			// -- Parsing is finished
-			if (textureFileName != null)
-				applyTextureToShape (l_oShape, textureFileName);
+			if (textureFileNames.length > 0)
+				applyTextureToShape (l_oShape, textureFileNames.shift ());
  			dispatchInitEvent ();
  		}



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic