コード例 #1
0
ファイル: LTexture.cs プロジェクト: zx8326123/LGame
        public LTexture(string resName,
                        Format format, bool multipyAlpha)
        {
            LTextureData data = GLLoader.GetTextureData(resName);

            data.SetMultipyAlpha(multipyAlpha);
            this.Init(data, format);
        }
コード例 #2
0
ファイル: LTexture.cs プロジェクト: zx8326123/LGame
 private void Init(LTextureData d, Format format)
 {
     this.isExt       = d.isExt;
     this.format      = format;
     this.imageData   = d;
     this.texWidth    = d.texWidth;
     this.texHeight   = d.texHeight;
     this.width       = d.width;
     this.height      = d.height;
     this.widthRatio  = (float)width / (texWidth < 1 ? width : texWidth);
     this.heightRatio = (float)height
                        / (texHeight < 1 ? height : texHeight);
 }
コード例 #3
0
ファイル: LTexture.cs プロジェクト: zx8326123/LGame
 public LTexture(LTexture texture)
 {
     if (texture == null)
     {
         throw new RuntimeException("texture is Null !");
     }
     this.imageData = texture.imageData;
     this.parent    = texture.parent;
     this.format    = texture.format;
     if (texture.colors != null)
     {
         this.colors = (LColor[])CollectionUtils.CopyOf(texture.colors);
     }
     if (texture.dataCords != null)
     {
         this.dataCords = (float[])CollectionUtils
                          .CopyOf(texture.dataCords);
     }
     this.hasAlpha    = texture.hasAlpha;
     this.textureID   = texture.textureID;
     this.bufferID    = texture.bufferID;
     this.width       = texture.width;
     this.height      = texture.height;
     this.parent      = texture.parent;
     this.childs      = texture.childs;
     this.texWidth    = texture.texWidth;
     this.texHeight   = texture.texHeight;
     this.xOff        = texture.xOff;
     this.yOff        = texture.yOff;
     this.widthRatio  = texture.widthRatio;
     this.heightRatio = texture.heightRatio;
     this.replace     = texture.replace;
     this.isLoaded    = texture.isLoaded;
     this.isClose     = texture.isClose;
     this.isStatic    = texture.isStatic;
     this.isVisible   = texture.isVisible;
     Array.Copy(texture.crops, 0, crops, 0, crops.Length);
 }
コード例 #4
0
ファイル: GLLoader.cs プロジェクト: keppelcao/LGame
 private GLLoader(LTextureData data, bool newCopy)
 {
     this.width = data.width;
     this.height = data.height;
     this.texWidth = data.texWidth;
     this.texHeight = data.texHeight;
     this.isExt = data.isExt;
     this.hasAlpha = data.hasAlpha;
     if (newCopy)
     {
         Color[] colors = new Color[width * height];
         data.buffer.GetData<Color>(colors);
         Texture2D texture = new Texture2D(GL.device, width, height);
         texture.SetData<Color>(colors);
         this.buffer = texture;
         colors = null;
     }
     else
     {
         this.buffer = data.buffer;
     }
     this.fileName = data.fileName;
 }
コード例 #5
0
ファイル: GLLoader.cs プロジェクト: zhwk022/LGame
 private GLLoader(LTextureData data, bool newCopy)
 {
     this.width     = data.width;
     this.height    = data.height;
     this.texWidth  = data.texWidth;
     this.texHeight = data.texHeight;
     this.isExt     = data.isExt;
     this.hasAlpha  = data.hasAlpha;
     if (newCopy)
     {
         Color[] colors = new Color[width * height];
         data.buffer.GetData <Color>(colors);
         Texture2D texture = new Texture2D(GL.device, width, height);
         texture.SetData <Color>(colors);
         this.buffer = texture;
         colors      = null;
     }
     else
     {
         this.buffer = data.buffer;
     }
     this.fileName = data.fileName;
 }
コード例 #6
0
ファイル: LTexture.cs プロジェクト: zx8326123/LGame
 public LTexture(LTextureData d, Format format)
 {
     this.Init(d, format);
 }
コード例 #7
0
ファイル: LTexture.cs プロジェクト: zx8326123/LGame
 public LTexture(LTextureData data)
     : this(data, Format.DEFAULT)
 {
 }
コード例 #8
0
ファイル: LTexture.cs プロジェクト: zx8326123/LGame
 private LTexture()
 {
     format    = Format.DEFAULT;
     imageData = null;
     CheckReplace();
 }
コード例 #9
0
ファイル: LTexture.cs プロジェクト: darragh-murphy/LGame
 private void Init(LTextureData d, Format format)
 {
     this.isExt = d.isExt;
     this.format = format;
     this.imageData = d;
     this.texWidth = d.texWidth;
     this.texHeight = d.texHeight;
     this.width = d.width;
     this.height = d.height;
     this.widthRatio = (float)width / (texWidth < 1 ? width : texWidth);
     this.heightRatio = (float)height
             / (texHeight < 1 ? height : texHeight);
 }
コード例 #10
0
ファイル: LTexture.cs プロジェクト: darragh-murphy/LGame
 public LTexture(LTextureData d, Format format)
 {
     this.Init(d, format);
 }
コード例 #11
0
ファイル: LTexture.cs プロジェクト: darragh-murphy/LGame
        public LTexture(LTextureData data)
            : this(data, Format.DEFAULT)
        {

        }
コード例 #12
0
ファイル: LTexture.cs プロジェクト: darragh-murphy/LGame
 private LTexture()
 {
     format = Format.DEFAULT;
     imageData = null;
     CheckReplace();
 }
コード例 #13
0
ファイル: LTexture.cs プロジェクト: darragh-murphy/LGame
 public LTexture(LTexture texture)
 {
     if (texture == null)
     {
         throw new RuntimeException("texture is Null !");
     }
     this.imageData = texture.imageData;
     this.parent = texture.parent;
     this.format = texture.format;
     if (texture.colors != null)
     {
         this.colors = (LColor[])CollectionUtils.CopyOf(texture.colors);
     }
     if (texture.dataCords != null)
     {
         this.dataCords = (float[])CollectionUtils
                 .CopyOf(texture.dataCords);
     }
     this.hasAlpha = texture.hasAlpha;
     this.textureID = texture.textureID;
     this.bufferID = texture.bufferID;
     this.width = texture.width;
     this.height = texture.height;
     this.parent = texture.parent;
     this.childs = texture.childs;
     this.texWidth = texture.texWidth;
     this.texHeight = texture.texHeight;
     this.xOff = texture.xOff;
     this.yOff = texture.yOff;
     this.widthRatio = texture.widthRatio;
     this.heightRatio = texture.heightRatio;
     this.replace = texture.replace;
     this.isLoaded = texture.isLoaded;
     this.isClose = texture.isClose;
     this.isStatic = texture.isStatic;
     this.isVisible = texture.isVisible;
     Array.Copy(texture.crops, 0, crops, 0, crops.Length);
 }