Procházet zdrojové kódy

make some events not blocking

ncannasse před 7 roky
rodič
revize
8a06ba334a
2 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. 1 1
      hxd/System.hl.hx
  2. 4 4
      hxd/snd/Driver.hx

+ 1 - 1
hxd/System.hl.hx

@@ -301,7 +301,7 @@ class System {
 		#if !usesys
 		hl.Api.setErrorHandler(function(e) reportError(e)); // initialization error
 		sentinel = new hl.UI.Sentinel(30, function() throw "Program timeout (infinite loop?)");
-		haxe.MainLoop.add(timeoutTick);
+		haxe.MainLoop.add(timeoutTick, -1) #if (haxe_ver >= 4) .isBlocking = false #end;
 		#end
 	}
 

+ 4 - 4
hxd/snd/Driver.hx

@@ -160,7 +160,7 @@ class Driver {
 	public static function get() {
 		if( instance == null ) {
 			instance = new Driver();
-			haxe.MainLoop.add(soundUpdate);
+			haxe.MainLoop.add(soundUpdate) #if (haxe_ver >= 4) .isBlocking = false #end;
 		}
 		return instance;
 	}
@@ -194,7 +194,7 @@ class Driver {
 		AL.deleteBuffers(buffers.length, arrayBytes([for( b in buffers ) b.inst.toInt()]));
 		sources     = [];
 		buffers     = [];
-		
+
 		ALC.makeContextCurrent(null);
 		ALC.destroyContext(alContext);
 		ALC.closeDevice(alDevice);
@@ -377,7 +377,7 @@ class Driver {
 			if( c == null) continue;
 			syncSource(s);
 		}
-		
+
 		var c = channels;
 		while (c != null) {
 			var next = c.next;
@@ -675,7 +675,7 @@ class Driver {
 				prev = prev.next;
 			prev.next = c.next;
 		}
-		
+
 		for (e in c.effects) c.removeEffect(e);
 		if  (c.source != null) releaseSource(c.source);