/[gr2lib]/trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs

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

--- trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs	2010/07/20 08:11:31	148
+++ trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs	2010/07/22 15:54:29	173
@@ -78,13 +78,15 @@
                     IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB555PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -117,13 +119,15 @@
                     IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB565PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -155,13 +159,15 @@
                     IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGBA5551PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -192,13 +198,15 @@
                     IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGBA4444PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -229,13 +237,15 @@
                     IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB888PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -271,6 +281,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -309,6 +320,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -347,6 +359,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -385,6 +398,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -423,6 +437,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -461,6 +476,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -499,6 +515,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -537,6 +554,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;

 

  ViewVC Help
Powered by ViewVC 1.1.22