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

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

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

revision 160 by william, Thu Jul 22 10:20:55 2010 UTC revision 166 by william, Thu Jul 22 14:24:07 2010 UTC
# Line 23  namespace gr2lib.core.coretypes.implemen Line 23  namespace gr2lib.core.coretypes.implemen
23          private int _Width;          private int _Width;
24          private int _Height;          private int _Height;
25          private NameValuePair<string, granny_texture_encoding> _Encoding;          private NameValuePair<string, granny_texture_encoding> _Encoding;
26          private int _SubFormat;          private NameValuePair<string, granny_pixel_layout> _SubFormat;
27          private Layout _Layout;          private Layout _Layout;
28          private List<Image> _Images;          private List<Image> _Images;
29    
# Line 39  namespace gr2lib.core.coretypes.implemen Line 39  namespace gr2lib.core.coretypes.implemen
39          public Texture()// : base("Textures")          public Texture()// : base("Textures")
40          {          {
41              this.FromFileName = "";              this.FromFileName = "";
42              this.TextureType = new NameValuePair<string, granny_texture_type>(coreapi.GetGrannyTextureTypeString(granny_texture_type.GrannyColorMapTextureType), granny_texture_type.GrannyColorMapTextureType);              this.TextureType = new NameValuePair<string, granny_texture_type>(coreapi.GetGrannyEnumTypeString<granny_texture_type>(granny_texture_type.GrannyColorMapTextureType), granny_texture_type.GrannyColorMapTextureType);
43              this.Width = 0;              this.Width = 0;
44              this.Height = 0;              this.Height = 0;
45              this.Encoding = new NameValuePair<string, granny_texture_encoding>(coreapi.GetGrannyTextureEncodingString(granny_texture_encoding.GrannyBinkTextureEncoding), granny_texture_encoding.GrannyBinkTextureEncoding);              this.Encoding = new NameValuePair<string, granny_texture_encoding>(coreapi.GetGrannyEnumTypeString<granny_texture_encoding>(granny_texture_encoding.GrannyBinkTextureEncoding), granny_texture_encoding.GrannyBinkTextureEncoding);
46              this.SubFormat = 0;              this.SubFormat = new NameValuePair<string, granny_pixel_layout>(coreapi.GetGrannyEnumTypeString<granny_pixel_layout>(granny_pixel_layout.GrannyBGRA8888PixelFormat), granny_pixel_layout.GrannyBGRA8888PixelFormat);
47              this.Layout = new Layout();              this.Layout = new Layout();
48              this.Images = new List<Image>();              this.Images = new List<Image>();
49              //this.ExtendedData = new IntPtr();              //this.ExtendedData = new IntPtr();
# Line 53  namespace gr2lib.core.coretypes.implemen Line 53  namespace gr2lib.core.coretypes.implemen
53          public Texture(int index)          public Texture(int index)
54          {          {
55              this.FromFileName = "";              this.FromFileName = "";
56              this.TextureType = new NameValuePair<string, granny_texture_type>(coreapi.GetGrannyTextureTypeString(granny_texture_type.GrannyColorMapTextureType), granny_texture_type.GrannyColorMapTextureType);              this.TextureType = new NameValuePair<string, granny_texture_type>(coreapi.GetGrannyEnumTypeString<granny_texture_type>(granny_texture_type.GrannyColorMapTextureType), granny_texture_type.GrannyColorMapTextureType);
57              this.Width = 0;              this.Width = 0;
58              this.Height = 0;              this.Height = 0;
59              this.Encoding = new NameValuePair<string, granny_texture_encoding>(coreapi.GetGrannyTextureEncodingString(granny_texture_encoding.GrannyBinkTextureEncoding), granny_texture_encoding.GrannyBinkTextureEncoding);              this.Encoding = new NameValuePair<string, granny_texture_encoding>(coreapi.GetGrannyEnumTypeString<granny_texture_encoding>(granny_texture_encoding.GrannyBinkTextureEncoding), granny_texture_encoding.GrannyBinkTextureEncoding);
60              this.SubFormat = 0;              this.SubFormat = new NameValuePair<string, granny_pixel_layout>(coreapi.GetGrannyEnumTypeString<granny_pixel_layout>(granny_pixel_layout.GrannyBGRA8888PixelFormat), granny_pixel_layout.GrannyBGRA8888PixelFormat);
61              this.Layout = new Layout();              this.Layout = new Layout();
62              this.Images = new List<Image>();              this.Images = new List<Image>();
63              //this.ExtendedData = new IntPtr();              //this.ExtendedData = new IntPtr();
# Line 109  namespace gr2lib.core.coretypes.implemen Line 109  namespace gr2lib.core.coretypes.implemen
109              {              {
110                  Texture managed = new Texture();                  Texture managed = new Texture();
111                  managed.FromFileName = native.FromFileName;                  managed.FromFileName = native.FromFileName;
112                  managed.TextureType = new NameValuePair<string, granny_texture_type>(coreapi.GetGrannyTextureTypeString((granny_texture_type)native.TextureType), (granny_texture_type)native.TextureType);                  managed.TextureType = new NameValuePair<string, granny_texture_type>(coreapi.GetGrannyEnumTypeString<granny_texture_type>((granny_texture_type)native.TextureType), (granny_texture_type)native.TextureType);
113                  managed.Width = native.Width;                  managed.Width = native.Width;
114                  managed.Height = native.Height;                  managed.Height = native.Height;
115                  managed.Encoding = new NameValuePair<string, granny_texture_encoding>(coreapi.GetGrannyTextureEncodingString((granny_texture_encoding)native.Encoding), (granny_texture_encoding)native.Encoding);                  managed.Encoding = new NameValuePair<string, granny_texture_encoding>(coreapi.GetGrannyEnumTypeString<granny_texture_encoding>((granny_texture_encoding)native.Encoding), (granny_texture_encoding)native.Encoding);
116                  managed.SubFormat = native.SubFormat;                  managed.SubFormat = new NameValuePair<string, granny_pixel_layout>(coreapi.GetGrannyEnumTypeString<granny_pixel_layout>((granny_pixel_layout)native.SubFormat), (granny_pixel_layout)native.SubFormat);
117                  managed.Layout = Layout.ReadFromNative(native.Layout);                  managed.Layout = Layout.ReadFromNative(native.Layout);
118                  IntPtr[] images = Helpers.ReadPtrArrayFromMemory<native.Image>(native.Images);                  IntPtr[] images = Helpers.ReadPtrArrayFromMemory<native.Image>(native.Images);
119                  int length = images.Length;                  int length = images.Length;
# Line 206  namespace gr2lib.core.coretypes.implemen Line 206  namespace gr2lib.core.coretypes.implemen
206          [Editor(typeof(UIComboValueSelector<granny_texture_encoding, int>), typeof(UITypeEditor))]          [Editor(typeof(UIComboValueSelector<granny_texture_encoding, int>), typeof(UITypeEditor))]
207          public NameValuePair<string, granny_texture_encoding> Encoding { get { return _Encoding; } set { _Encoding = value; } }          public NameValuePair<string, granny_texture_encoding> Encoding { get { return _Encoding; } set { _Encoding = value; } }
208          [RefreshPropertiesAttribute(RefreshProperties.All)]          [RefreshPropertiesAttribute(RefreshProperties.All)]
209          public int SubFormat { get { return _SubFormat; } set { _SubFormat = value; } }          [Editor(typeof(UIComboValueSelector<granny_pixel_layout, int>), typeof(UITypeEditor))]
210            public NameValuePair<string, granny_pixel_layout> SubFormat { get { return _SubFormat; } set { _SubFormat = value; } }
211          [RefreshPropertiesAttribute(RefreshProperties.All)]          [RefreshPropertiesAttribute(RefreshProperties.All)]
212          [Browsable(true)]          [Browsable(true)]
213          public Layout Layout { get { return _Layout; } set { _Layout = value; } }          public Layout Layout { get { return _Layout; } set { _Layout = value; } }

Legend:
Removed from v.160  
changed lines
  Added in v.166

  ViewVC Help
Powered by ViewVC 1.1.22