/[gr2lib]/trunk/gr2lib/core/coretypes/implementation/grnfileinfo.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/coretypes/implementation/grnfileinfo.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib/core/coretypes/implementation/grnfileinfo.cs	2010/07/15 19:29:52	78
+++ trunk/gr2lib/core/coretypes/implementation/grnfileinfo.cs	2010/07/15 21:50:56	79
@@ -2,28 +2,25 @@
 using System.Collections.Generic;
 using System.Text;
 using gr2lib.core.helpers;
+using gr2lib.core.interfaces;
 
 namespace gr2lib.core.coretypes.implementation
 {
-    public interface Igrnfileinfo
-    {
-        ArtToolInfo ArtToolInfo { get;set;}
-        ExporterInfo ExporterInfo { get; set; }
-        string FromFileName { get; set; }
-        List<Texture> Textures { get; set; }
-    }
+   
     public class grnfileinfo
     {
         private string fromFileName;
         private ArtToolInfo _ArtToolInfo;
         private ExporterInfo _ExporterInfo;
         private List<Texture> _Textures;
+        private List<Material> _Materials;
 
         #region Igrnfileinfo Members
         public ArtToolInfo ArtToolInfo { get { return _ArtToolInfo; } set { _ArtToolInfo = value; } }
         public ExporterInfo ExporterInfo { get { return _ExporterInfo; } set { _ExporterInfo = value; } }
         public string FromFileName { get { return fromFileName; } set { fromFileName = value; } }
         public List<Texture> Textures { get { return _Textures; } set { _Textures = value; } }
+        public List<Material> Materials { get { return _Materials; } set { _Materials = value; } }
         #endregion
 
         public IntPtr NativePointer;
@@ -80,7 +77,20 @@
                 }
             }
 
-
+            if (native.Materials.Pointer != IntPtr.Zero)
+            {
+                IntPtr[] materials = Helpers.ReadArrayFromMemory(native.Materials);
+                length = materials.Length;
+                managed.Materials = new List<Material>(length);
+                foreach (IntPtr ptr in materials)
+                {
+                    managed.Materials.Add(new Material());
+                }
+                for (int i = 0; i < length; i++)
+                {
+                    managed.Materials[i] = Material.ReadFromMemory(materials[i]);
+                }
+            }
             return managed;
         }
         public static grnfileinfo ReadFromFile(string fileName)

 

  ViewVC Help
Powered by ViewVC 1.1.22