Skip to content

Commit d60b1d6

Browse files
committed
Remove Task priorities
1 parent 6651ae9 commit d60b1d6

File tree

11 files changed

+14
-18
lines changed

11 files changed

+14
-18
lines changed

Sources/GateEngine/ECS/PlatformSystems/AudioSystem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ extension AudioSystem {
203203
func update(_ deltaTime: Float) {
204204
guard buffer.state == .ready else { return }
205205
if accumulatedTime == 0 {
206-
Task(priority: .medium) {
206+
Task {
207207
track.setBuffer(buffer)
208208
track.play()
209209
}
@@ -410,7 +410,7 @@ extension AudioSystem {
410410
@MainActor func update(_ deltaTime: Float, context: ECSContext) {
411411
guard buffer.state == .ready else { return }
412412
if accumulatedTime == 0 {
413-
Task(priority: .medium) {
413+
Task {
414414
source.setBuffer(buffer)
415415
source.play()
416416
}

Sources/GateEngine/Resources/Geometry/MutableGeometry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class MutableGeometry: Geometry {
2929
cache.geometryBackend = await Game.shared.resourceManager.geometryBackend(
3030
from: rawGeometry
3131
)
32-
Task(priority: .high) { @MainActor in
32+
Task { @MainActor in
3333
cache.state = .ready
3434
}
3535
}

Sources/GateEngine/Resources/Geometry/MutableLines.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class MutableLines: Lines {
2626
cache.geometryBackend = await Game.shared.resourceManager.geometryBackend(
2727
from: rawLines
2828
)
29-
Task(priority: .high) { @MainActor in
29+
Task { @MainActor in
3030
cache.state = .ready
3131
}
3232
}

Sources/GateEngine/Resources/Geometry/MutablePoints.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class MutablePoints: Points {
2626
cache.geometryBackend = await Game.shared.resourceManager.geometryBackend(
2727
from: rawPoints
2828
)
29-
Task(priority: .high) { @MainActor in
29+
Task { @MainActor in
3030
cache.state = .ready
3131
}
3232
}

Sources/GateEngine/Resources/Text/Font.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public final class Font: OldResource {
7575
#if DEBUG
7676
self._backend.configure(withOwner: self)
7777
#endif
78-
Task(priority: .utility) {
78+
Task.detached {
7979
do {
8080
let backend = try await ImageFont(regular: regular)
8181
Task { @MainActor in

Sources/GateEngine/Resources/Text/Text.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public final class Text {
3939
public var size: Size2 {
4040
if needsUpdateGeometry, font.state == .ready {
4141
needsUpdateGeometry = false
42-
Task(priority: .high) { @MainActor in
42+
Task { @MainActor in
4343
self.updateGeometry()
4444
}
4545
}

Sources/GateEngine/System/Audio/Platforms/Backends/CoreAudio/CABufferReference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal final class CABufferReference: AudioBufferBackend {
3636

3737
required init(path: String, context: AudioContext, audioBuffer: AudioBuffer) {
3838
self.audioBuffer = audioBuffer
39-
Task(priority: .utility) {
39+
Task.detached {
4040
do {
4141
guard let located = await Game.shared.platform.locateResource(from: path) else {
4242
throw GateEngineError.failedToLocate

Sources/GateEngine/System/Audio/Platforms/Backends/OpenAL/OABufferReference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal class OABufferReference: AudioBufferBackend {
2020

2121
required init(path: String, context: AudioContext, audioBuffer: AudioBuffer) {
2222
self.audioBuffer = audioBuffer
23-
Task(priority: .utility) {
23+
Task.detached {
2424
do {
2525
guard let path = await Game.shared.platform.locateResource(from: path) else {
2626
throw GateEngineError.failedToLocate

Sources/GateEngine/System/Audio/Platforms/Backends/WebAudio/WABufferReference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal class WABufferReference: AudioBufferBackend {
1818

1919
required init(path: String, context: AudioContext, audioBuffer: AudioBuffer) {
2020
self.audioBuffer = audioBuffer
21-
Task(priority: .utility) {
21+
Task.detached {
2222
let platform: WASIPlatform = await Game.shared.platform
2323
let context = (context.reference as! WAContextReference).ctx
2424

Sources/GateEngine/System/Audio/Sound.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ extension Entity {
131131

132132
This will default to the active camera and will automatically reset to the active camera if the Entity being tracked disappears.
133133
*/
134-
public func becomeListener() {
135-
Task(priority: .medium) { @MainActor in
136-
Game.shared.system(ofType: AudioSystem.self).listenerID = self.id
137-
}
134+
@MainActor public func becomeListener() {
135+
Game.shared.system(ofType: AudioSystem.self).listenerID = self.id
138136
}
139137

140138
@MainActor

0 commit comments

Comments
 (0)