Переглянути джерело

added hl api versioning (with -D hl_ver / default set in hl/hl_version)

ncannasse 6 роки тому
батько
коміт
3733699a57
3 змінених файлів з 12 додано та 2 видалено
  1. 1 0
      src/compiler/main.ml
  2. 10 2
      std/hl/Format.hx
  3. 1 0
      std/hl/hl_version

+ 1 - 0
src/compiler/main.ml

@@ -269,6 +269,7 @@ module Initialize = struct
 				"python"
 			| Hl ->
 				add_std "hl";
+				if not (Common.raw_defined com "hl_ver") then Define.raw_define_value com.defines "hl_ver" (try Std.input_file (Common.find_file com "hl/hl_version") with Not_found -> assert false);
 				"hl"
 			| Eval ->
 				add_std "eval";

+ 10 - 2
std/hl/Format.hx

@@ -57,6 +57,16 @@ class Format {
 		return false;
 	}
 
+	/**
+		Decode any image data into ARGB pixels
+	**/
+	#if (hl_ver >= ~/1.10/)
+	@:hlNative("fmt","img_decode")
+	public static function decodeIMG( src : hl.Bytes, srcLen : Int, dst : hl.Bytes, width : Int, height : Int ) : Bool {
+		return false;
+	}
+	#end
+
 	/**
 		Upscale/downscale an image.
 		Currently supported flag bits: 1 = bilinear filtering
@@ -76,7 +86,6 @@ class Format {
 
 }
 
-#if !hl_disable_mikkt
 class Mikktspace {
 	public var buffer : hl.BytesAccess<Single>;
 	public var stride : Int;
@@ -99,4 +108,3 @@ class Mikktspace {
 		return false;
 	}
 }
-#end

+ 1 - 0
std/hl/hl_version

@@ -0,0 +1 @@
+1.10