Added persistent logging methods
This commit is contained in:
parent
6ec0e9631a
commit
909ef9d242
@ -20,4 +20,20 @@ export default class Logging {
|
|||||||
console.log(message)
|
console.log(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static warn(message) {
|
||||||
|
if (ipc) {
|
||||||
|
ipc.send('warn', message)
|
||||||
|
} else {
|
||||||
|
console.warn(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static error(message) {
|
||||||
|
if (ipc) {
|
||||||
|
ipc.send('error', message)
|
||||||
|
} else {
|
||||||
|
console.error(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,13 +198,30 @@ export default class Tile extends PIXI.Sprite {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specialized renderWebGL to avoid freezing system
|
||||||
|
*
|
||||||
|
* @param {*} renderer
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
renderWebGL(renderer) {
|
||||||
|
try {
|
||||||
|
super.renderWebGL(renderer)
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
// We want persistent logging here
|
||||||
|
Logging.error("Error in Tile.renderWebGL: " + e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Texture received too late. We do not need it.
|
* Texture received too late. We do not need it.
|
||||||
* @param {*} url
|
* @param {*} url
|
||||||
* @param {*} texture
|
* @param {*} texture
|
||||||
*/
|
*/
|
||||||
static lateTexture(url, texture) {
|
static lateTexture(url, texture) {
|
||||||
let destroyBase = !registeredTiles.has(url)
|
let destroyBase = Tile.isObsolete(url)
|
||||||
|
console.log("Tile.lateTexture", destroyBase)
|
||||||
texture.destroy(destroyBase)
|
texture.destroy(destroyBase)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user