浏览代码

Fixes unwanted drawcalls when spritemanagers are empty

David Catuhe 6 年之前
父节点
当前提交
a798d98118
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/Sprites/spriteManager.ts

+ 2 - 1
src/Sprites/spriteManager.ts

@@ -303,7 +303,8 @@ export class SpriteManager implements ISpriteManager {
      */
     public render(): void {
         // Check
-        if (!this._effectBase.isReady() || !this._effectFog.isReady() || !this._spriteTexture || !this._spriteTexture.isReady()) {
+        if (!this._effectBase.isReady() || !this._effectFog.isReady() || !this._spriteTexture
+            || !this._spriteTexture.isReady() || !this.sprites.length) {
             return;
         }