Add null support to ignore default, missing, and white base64 images in TextureManager

This commit is contained in:
Zeke Chan 2024-07-04 15:24:39 +08:00
parent 97455bcedd
commit 7450ff9dff

View file

@ -184,9 +184,21 @@ var TextureManager = new Class({
var config = this.game.config;
this.addBase64('__DEFAULT', config.defaultImage);
this.addBase64('__MISSING', config.missingImage);
this.addBase64('__WHITE', config.whiteImage);
if (config.defaultImage !== null)
{
this.addBase64('__DEFAULT', config.defaultImage);
}
if (config.missingImage !== null)
{
this.addBase64('__MISSING', config.missingImage);
}
if (config.whiteImage !== null)
{
this.addBase64('__WHITE', config.whiteImage);
}
if (this.game.renderer && this.game.renderer.gl)
{
this.addUint8Array('__NORMAL', new Uint8Array([ 127, 127, 255, 255 ]), 1, 1);