remove ogg test
This commit is contained in:
parent
235a282d1e
commit
1fffb5fc13
@ -155,7 +155,6 @@ var assets = {
|
|||||||
"bgm_result.mp3",
|
"bgm_result.mp3",
|
||||||
"bgm_setsume.mp3"
|
"bgm_setsume.mp3"
|
||||||
],
|
],
|
||||||
"audioOgg": "note_ka.ogg",
|
|
||||||
"fonts": [
|
"fonts": [
|
||||||
"Kozuka",
|
"Kozuka",
|
||||||
"TnT"
|
"TnT"
|
||||||
|
@ -90,7 +90,7 @@ class Loader{
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
this.afterJSCount =
|
this.afterJSCount =
|
||||||
[assets.audioOgg, "blurPerformance", "P2Connection"].length +
|
["blurPerformance", "P2Connection"].length +
|
||||||
assets.fonts.length +
|
assets.fonts.length +
|
||||||
assets.audioSfx.length +
|
assets.audioSfx.length +
|
||||||
assets.audioMusic.length +
|
assets.audioMusic.length +
|
||||||
@ -113,88 +113,80 @@ class Loader{
|
|||||||
)
|
)
|
||||||
snd.sfxLoudGain.setVolume(1.2)
|
snd.sfxLoudGain.setVolume(1.2)
|
||||||
|
|
||||||
this.afterJSCount--
|
this.afterJSCount = 0
|
||||||
|
|
||||||
this.addPromise(snd.buffer.load(gameConfig.assets_baseurl + "audio/" + assets.audioOgg).then(() => {
|
assets.fonts.forEach(name => {
|
||||||
this.oggNotSupported = false
|
this.addPromise(new Promise(resolve => {
|
||||||
}, () => {
|
FontDetect.onFontLoaded(name, resolve, resolve, {msTimeout: Infinity})
|
||||||
this.oggNotSupported = true
|
|
||||||
}).then(() => {
|
|
||||||
|
|
||||||
this.afterJSCount = 0
|
|
||||||
|
|
||||||
assets.fonts.forEach(name => {
|
|
||||||
this.addPromise(new Promise(resolve => {
|
|
||||||
FontDetect.onFontLoaded(name, resolve, resolve, {msTimeout: Infinity})
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
|
|
||||||
assets.audioSfx.forEach(name => {
|
|
||||||
this.addPromise(this.loadSound(name, snd.sfxGain))
|
|
||||||
})
|
|
||||||
assets.audioMusic.forEach(name => {
|
|
||||||
this.addPromise(this.loadSound(name, snd.musicGain))
|
|
||||||
})
|
|
||||||
assets.audioSfxLR.forEach(name => {
|
|
||||||
this.addPromise(this.loadSound(name, snd.sfxGain).then(sound => {
|
|
||||||
var id = this.getFilename(name)
|
|
||||||
assets.sounds[id + "_p1"] = assets.sounds[id].copy(snd.sfxGainL)
|
|
||||||
assets.sounds[id + "_p2"] = assets.sounds[id].copy(snd.sfxGainR)
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
assets.audioSfxLoud.forEach(name => {
|
|
||||||
this.addPromise(this.loadSound(name, snd.sfxLoudGain))
|
|
||||||
})
|
|
||||||
|
|
||||||
this.canvasTest = new CanvasTest()
|
|
||||||
this.addPromise(this.canvasTest.blurPerformance().then(result => {
|
|
||||||
perf.blur = result
|
|
||||||
if(result > 1000 / 50){
|
|
||||||
// Less than 50 fps with blur enabled
|
|
||||||
disableBlur = true
|
|
||||||
}
|
|
||||||
}))
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
p2 = new P2Connection()
|
assets.audioSfx.forEach(name => {
|
||||||
if(location.hash.length === 6){
|
this.addPromise(this.loadSound(name, snd.sfxGain))
|
||||||
p2.hashLock = true
|
})
|
||||||
this.addPromise(new Promise(resolve => {
|
assets.audioMusic.forEach(name => {
|
||||||
p2.open()
|
this.addPromise(this.loadSound(name, snd.musicGain))
|
||||||
pageEvents.add(p2, "message", response => {
|
})
|
||||||
if(response.type === "session"){
|
assets.audioSfxLR.forEach(name => {
|
||||||
resolve()
|
this.addPromise(this.loadSound(name, snd.sfxGain).then(sound => {
|
||||||
}else if(response.type === "gameend"){
|
var id = this.getFilename(name)
|
||||||
p2.hash("")
|
assets.sounds[id + "_p1"] = assets.sounds[id].copy(snd.sfxGainL)
|
||||||
p2.hashLock = false
|
assets.sounds[id + "_p2"] = assets.sounds[id].copy(snd.sfxGainR)
|
||||||
resolve()
|
}))
|
||||||
}
|
})
|
||||||
})
|
assets.audioSfxLoud.forEach(name => {
|
||||||
p2.send("invite", location.hash.slice(1).toLowerCase())
|
this.addPromise(this.loadSound(name, snd.sfxLoudGain))
|
||||||
setTimeout(() => {
|
})
|
||||||
if(p2.socket.readyState !== 1){
|
|
||||||
p2.hash("")
|
this.canvasTest = new CanvasTest()
|
||||||
p2.hashLock = false
|
this.addPromise(this.canvasTest.blurPerformance().then(result => {
|
||||||
resolve()
|
perf.blur = result
|
||||||
}
|
if(result > 1000 / 50){
|
||||||
}, 10000)
|
// Less than 50 fps with blur enabled
|
||||||
}).then(() => {
|
disableBlur = true
|
||||||
pageEvents.remove(p2, "message")
|
|
||||||
}))
|
|
||||||
}else{
|
|
||||||
p2.hash("")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.all(this.promises).then(() => {
|
|
||||||
this.canvasTest.drawAllImages().then(result => {
|
|
||||||
perf.allImg = result
|
|
||||||
perf.load = Date.now() - this.startTime
|
|
||||||
this.canvasTest.clean()
|
|
||||||
this.clean()
|
|
||||||
this.callback()
|
|
||||||
})
|
|
||||||
}, this.errorMsg.bind(this))
|
|
||||||
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
p2 = new P2Connection()
|
||||||
|
if(location.hash.length === 6){
|
||||||
|
p2.hashLock = true
|
||||||
|
this.addPromise(new Promise(resolve => {
|
||||||
|
p2.open()
|
||||||
|
pageEvents.add(p2, "message", response => {
|
||||||
|
if(response.type === "session"){
|
||||||
|
resolve()
|
||||||
|
}else if(response.type === "gameend"){
|
||||||
|
p2.hash("")
|
||||||
|
p2.hashLock = false
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
p2.send("invite", location.hash.slice(1).toLowerCase())
|
||||||
|
setTimeout(() => {
|
||||||
|
if(p2.socket.readyState !== 1){
|
||||||
|
p2.hash("")
|
||||||
|
p2.hashLock = false
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
}, 10000)
|
||||||
|
}).then(() => {
|
||||||
|
pageEvents.remove(p2, "message")
|
||||||
|
}))
|
||||||
|
}else{
|
||||||
|
p2.hash("")
|
||||||
|
}
|
||||||
|
|
||||||
|
Promise.all(this.promises).then(() => {
|
||||||
|
this.canvasTest.drawAllImages().then(result => {
|
||||||
|
perf.allImg = result
|
||||||
|
perf.load = Date.now() - this.startTime
|
||||||
|
this.canvasTest.clean()
|
||||||
|
this.clean()
|
||||||
|
this.callback()
|
||||||
|
})
|
||||||
|
}, this.errorMsg.bind(this))
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -203,9 +195,6 @@ class Loader{
|
|||||||
promise.then(this.assetLoaded.bind(this))
|
promise.then(this.assetLoaded.bind(this))
|
||||||
}
|
}
|
||||||
loadSound(name, gain){
|
loadSound(name, gain){
|
||||||
if(this.oggNotSupported && name.endsWith(".ogg")){
|
|
||||||
name = name.slice(0, -4) + ".wav"
|
|
||||||
}
|
|
||||||
var id = this.getFilename(name)
|
var id = this.getFilename(name)
|
||||||
return gain.load(gameConfig.assets_baseurl + "audio/" + name).then(sound => {
|
return gain.load(gameConfig.assets_baseurl + "audio/" + name).then(sound => {
|
||||||
assets.sounds[id] = sound
|
assets.sounds[id] = sound
|
||||||
|
Loading…
Reference in New Issue
Block a user