Просмотр исходного кода

Fixes unwanted drawcalls when spritemanagers are empty

David Catuhe 6 лет назад
Родитель
Сommit
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;
         }