فهرست منبع

Add println for context Lost in directX driver
add stopByName() in snd manager

ShiroSmith 6 سال پیش
والد
کامیت
c0a95d0a01
2فایلهای تغییر یافته به همراه10 افزوده شده و 1 حذف شده
  1. 1 1
      h3d/impl/DirectXDriver.hx
  2. 9 0
      hxd/snd/Manager.hx

+ 1 - 1
h3d/impl/DirectXDriver.hx

@@ -280,7 +280,7 @@ class DirectXDriver extends h3d.impl.Driver {
 		if( old ) hxd.System.allowTimeout = true;
 
 		if( hasDeviceError ) {
-			//trace("OnContextLost");
+			Sys.println("----------- OnContextLost ----------");
 			hasDeviceError = false;
 			dispose();
 			reset();

+ 9 - 0
hxd/snd/Manager.hx

@@ -160,6 +160,15 @@ class Manager {
 		}
 	}
 
+	public function stopByName( name : String ) {
+		var c = channels;
+		while( c != null ) {
+			var n = c.next;
+			if( c.soundGroup != null && c.soundGroup.name == name ) c.stop();
+			c = n;
+		}
+	}
+
 	/**
 		Returns iterator with all active instances of a Sound at the call time.
 	**/