Browse Source

added texture name

ncannasse 11 years ago
parent
commit
49d03db9bc
2 changed files with 11 additions and 2 deletions
  1. 10 1
      h3d/mat/Texture.hx
  2. 1 1
      hxd/res/Image.hx

+ 10 - 1
h3d/mat/Texture.hx

@@ -12,7 +12,8 @@ class Texture {
 	#if debug
 	var allocPos : h3d.impl.AllocPos;
 	#end
-	public var id(default,null) : Int;
+	public var id(default, null) : Int;
+	public var name(default, null) : String;
 	public var width(default, null) : Int;
 	public var height(default, null) : Int;
 	public var isCubic(default, null) : Bool;
@@ -45,6 +46,14 @@ class Texture {
 		this.wrap = Clamp;
 		bits &= 0x7FFF;
 	}
+	
+	function toString() {
+		return name+" "+width+"x"+height;
+	}
+	
+	public function setName(n) {
+		name = n;
+	}
 
 	function set_mipMap(m:MipMap) {
 		bits |= 0x80000;

+ 1 - 1
hxd/res/Image.hx

@@ -156,8 +156,8 @@ class Image extends Resource {
 				tex.height = th;
 			}
 		}
-		
 		loadTexture();
+		tex.setName(entry.path);
 		tex.onContextLost = function() {
 			needResize = false;
 			loadTexture();