/[Sims3RigEditor]/trunk/gr2lib_typedefs/typedefs/TextureCreator/bink_texture_creator.cs
ViewVC logotype

Contents of /trunk/gr2lib_typedefs/typedefs/TextureCreator/bink_texture_creator.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 49 - (show annotations) (download)
Sun Aug 8 07:43:37 2010 UTC (10 years, 6 months ago) by william
File size: 2667 byte(s)
continue support for ST3C textures...

Have BGR ST3C Texture Colors somwhate correct.
BGRA, still having problems with colors & alpha bein applied when there is no alpha

1 //#define IS_NOT_BINDABLE // when defined, will always return false for An IBindableTexture
2 using System;
3 using System.Collections.Generic;
4 using System.Text;
5 using gr2lib_typedefs.typedefs.TextureCreator.interfaces;
6 using System.IO;
7 using gr2lib.core.typedefs;
8 using gr2lib.core.ui.helpers;
9
10 namespace gr2lib_typedefs.typedefs.TextureCreator
11 {
12 public class bink_texture_creator : ATextureResource
13 {
14 //public override granny_texture_encoding EncodingType { get { return granny_texture_encoding.GrannyBinkTextureEncoding; } }
15 public override string TextureCreatorName { get { return "Bink Texture Creator"; } }
16 #region Constructors
17 public bink_texture_creator() : base() { }
18 public bink_texture_creator(string filename) : base(filename) { }
19 public bink_texture_creator(byte[] data) : base(data) { }
20 public bink_texture_creator(MemoryStream ms) : base(ms) { }
21 #region IBindableTexture Members
22 public new static bool IsBindable { get { return false; } }
23 #endregion
24 #endregion
25
26 #region ATextureResource Members
27 protected override void Parse()
28 {
29 try
30 {
31 throw new NotImplementedException("bink texture creation has not been implemented");
32 //this.Stream.Seek(0, SeekOrigin.Begin);
33 //this.TextureCreatorType = TextureCreators.bink;
34 //this.TextureEncodingType = granny_texture_encoding.GrannyBinkTextureEncoding;
35
36 }
37 catch (Exception ex)
38 {
39 this.HaveBindableTexture = false;
40 //Debug.WriteLine(ex.ToString());
41 throw new InvalidOperationException("Failed to read texture using: " + new bink_texture_creator().TextureCreatorName, ex);
42 }
43
44 }
45 protected override MemoryStream UnParse()
46 {
47 throw new NotImplementedException("bink texture creation has not been implemented");
48 }
49 #endregion
50
51 #region RessourceHandler for Bink Textures
52 public class ResourceHandler : ATextureResourceHandler, IBindableTexture
53 {
54 #region IBindableTexture Members
55 public bool IsBindable { get { return bink_texture_creator.IsBindable; } }
56 #endregion
57 public ResourceHandler()
58 {
59 // add magic values for each supported texture type
60 this.Add(typeof(bink_texture_creator), new List<string>(new string[] { }));
61 }
62 }
63 #endregion
64 }
65 }

  ViewVC Help
Powered by ViewVC 1.1.22