public LTexture(string resName, Format format, bool multipyAlpha) { LTextureData data = GLLoader.GetTextureData(resName); data.SetMultipyAlpha(multipyAlpha); this.Init(data, format); }
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); }
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); }
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; }
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; }
public LTexture(LTextureData d, Format format) { this.Init(d, format); }
public LTexture(LTextureData data) : this(data, Format.DEFAULT) { }
private LTexture() { format = Format.DEFAULT; imageData = null; CheckReplace(); }