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

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

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

revision 83 by william, Fri Jul 16 21:26:08 2010 UTC revision 86 by william, Fri Jul 16 23:35:21 2010 UTC
# Line 22  namespace gr2lib.core.coretypes.implemen Line 22  namespace gr2lib.core.coretypes.implemen
22    
23          internal static Skeleton ReadFromMemory(IntPtr pointer)          internal static Skeleton ReadFromMemory(IntPtr pointer)
24          {          {
25                try
26                {
27              if (pointer == IntPtr.Zero) return null;              if (pointer == IntPtr.Zero) return null;
28              native.Skeleton native = Helpers.ReadFromMemory<native.Skeleton>(pointer);              native.Skeleton native = Helpers.ReadFromMemory<native.Skeleton>(pointer);
29              Skeleton managed = ReadFromNative(native);              Skeleton managed = ReadFromNative(native);
30              managed.NativePointer = pointer;              managed.NativePointer = pointer;
31              return managed;              return managed;
32                }
33                catch (Exception ex)
34                {
35                    Console.WriteLine(ex.ToString());
36                    return default(Skeleton);
37                }
38          }          }
39    
40          internal static Skeleton ReadFromNative(native.Skeleton native)          internal static Skeleton ReadFromNative(native.Skeleton native)
41          {          {
42                try
43                {
44              Skeleton managed = new Skeleton();              Skeleton managed = new Skeleton();
45              managed.SkeletonName = string.IsNullOrEmpty(native.Name) ? "{null}" : native.Name;              managed.SkeletonName = string.IsNullOrEmpty(native.Name) ? "{null}" : native.Name;
46              IntPtr[] bones = Helpers.ReadPtrArrayFromMemory<native.Bone>(native.Bones);              IntPtr[] bones = Helpers.ReadPtrArrayFromMemory<native.Bone>(native.Bones);
# Line 48  namespace gr2lib.core.coretypes.implemen Line 58  namespace gr2lib.core.coretypes.implemen
58              managed.LodType = native.LodType;              managed.LodType = native.LodType;
59              managed.ExtendedData = native.ExtendedData;              managed.ExtendedData = native.ExtendedData;
60              return managed;              return managed;
61                }
62                catch (Exception ex)
63                {
64                    Console.WriteLine(ex.ToString());
65                    return default(Skeleton);
66                }
67          }          }
68    
69          #region ISkeleton Members          #region ISkeleton Members

Legend:
Removed from v.83  
changed lines
  Added in v.86

  ViewVC Help
Powered by ViewVC 1.1.22