fix: set systemId for audio assets unless specified#133
Open
Conversation
xnv
commented
Oct 8, 2019
| if (conf.duration === undefined) | ||
| conf.duration = 0; | ||
| if (!conf.systemId || !audioSystemConfMap[conf.systemId]) | ||
| conf.systemId = this.game.defaultAudioSystemId; |
Member
Author
There was a problem hiding this comment.
normalize の過程で、ない systemId も補完してしまうことにします。
xnv
commented
Oct 8, 2019
| conf.systemId = this.game.defaultAudioSystemId; | ||
| const audioSystemConf = audioSystemConfMap[conf.systemId]; | ||
| if (!audioSystemConf) | ||
| throw ExceptionFactory.createAssertionError("AssetManager#_normalize: unknown systemId for the audio asset: " + p); |
xnv
commented
Oct 8, 2019
Comment on lines
-334
to
+338
| var system = conf.systemId ? this.game.audio[conf.systemId] : this.game.audio[this.game.defaultAudioSystemId]; | ||
| var system = this.game.audio[conf.systemId] || this.game.audio[this.game.defaultAudioSystemId]; |
Member
Author
There was a problem hiding this comment.
- いずれにせよ異常系ですが、最悪の場合
conf.systemId && !this.game.audio[conf.systemId]が成立しうるので、より安全になるようにしておきます。 - 一見「 normalize の段階で
!!this.game.audio[conf.systemId]が確実に成り立つ = この||は不要」に見えますが、この箇所は外部リソースアセット (game.json に記述がないものを読み込む) でも使うので必要です。
|
|
||
| 機能追加 | ||
| * `g.Font` をインタフェースから抽象クラスに変更 | ||
|
|
ShinobuTakahashi
approved these changes
Oct 9, 2019
Contributor
|
1点、不要な改行のコメントつけましたがapprovedです |
kamakiri01
approved these changes
Oct 10, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
このpull requestが解決する内容
オーディオアセットの systemId は、省略された場合
"sound"相当として扱われます (仕様) が、hintオプションの値が"sound"と食い違っていました。この食い違いが遠因となり、一部環境で「systemId が省略されたアセット」のロードに失敗することがありました。これを修正します。
ユニットテストを追加した他、手元で akashic serve に組み込んで当該コンテンツのロード時の引数が修正されることを確認しています。
破壊的な変更を含んでいるか?