Nicolas Cannasse преди 8 години
родител
ревизия
af6e8b9e97
променени са 3 файла, в които са добавени 13 реда и са изтрити 6 реда
  1. 2 2
      hxd/snd/Driver.hx
  2. 2 2
      hxd/snd/effect/Spatialization.hx
  3. 9 2
      hxsl/HlslOut.hx

+ 2 - 2
hxd/snd/Driver.hx

@@ -1,6 +1,6 @@
 package hxd.snd;
 
-#if (hl && !psgl)
+#if hlopenal
 typedef AL = openal.AL;
 private typedef ALC = openal.ALC;
 private typedef ALSource = openal.AL.Source;
@@ -157,7 +157,7 @@ class Driver {
 		stopAll();
 
 		inline function arrayBytes(a:Array<Int>) {
-			#if (hl && !psgl)
+			#if hlopenal
 			return hl.Bytes.getArray(a);
 			#else
 			var b = haxe.io.Bytes.alloc(a.length * 4);

+ 2 - 2
hxd/snd/effect/Spatialization.hx

@@ -1,6 +1,6 @@
 package hxd.snd.effect;
 
-#if hlsdl
+#if hlopenal
 import openal.AL;
 #end
 
@@ -36,7 +36,7 @@ class Spatialization extends Effect {
 		return gain;
 	}
 
-	#if hlsdl
+	#if hlopenal
 	override function apply(channel : Channel, s : Driver.Source) {
 		AL.sourcei(s.inst,  AL.SOURCE_RELATIVE, AL.FALSE);
 

+ 9 - 2
hxsl/HlslOut.hx

@@ -203,7 +203,7 @@ class HlslOut {
 			var acc = varAccess.get(v.id);
 			if( acc != null ) add(acc);
 			ident(v);
-		case TCall({ e : TGlobal(Texture2D) }, args):
+		case TCall({ e : TGlobal(Texture2D|TextureCube) }, args):
 			switch( args[0].e ) {
 			case TArray(e,index):
 				addValue(e, tabs);
@@ -513,7 +513,14 @@ class HlslOut {
 		for( v in textures ) {
 			switch( v.type ) {
 			case TArray(t, size):
-				add("Texture2D ");
+				switch( t ) {
+				case TSampler2D:
+					add("Texture2D ");
+				case TSamplerCube:
+					add("TextureCube ");
+				default:
+					throw "Unsupported sampler " + t;
+				}
 				add(v.name+"Tex");
 				addArraySize(size);
 				add(";\n");