From 25bb92f8100115e78dda9066278733f86ac8f1d3 Mon Sep 17 00:00:00 2001
From: Robert Long <robert@robertlong.me>
Date: Tue, 13 Mar 2018 13:09:27 -0700
Subject: [PATCH] AFRAME.quality -> AFRAME.AGLTFEntity.quality

---
 src/elements/a-gltf-entity.js       | 5 +++--
 src/elements/a-progressive-asset.js | 4 ++--
 src/room.js                         | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/elements/a-gltf-entity.js b/src/elements/a-gltf-entity.js
index 1335770ac..3903447c2 100644
--- a/src/elements/a-gltf-entity.js
+++ b/src/elements/a-gltf-entity.js
@@ -1,6 +1,7 @@
 const GLTFCache = {};
 
 AFRAME.AGLTFEntity = {
+  quality: "low",
   defaultInflator(el, componentName, componentData) {
     if (AFRAME.components[componentName].multiple && Array.isArray(componentData)) {
       for (let i = 0; i < componentData.length; i++) {
@@ -159,9 +160,9 @@ AFRAME.registerElement("a-gltf-entity", {
           const highSrc = assetEl.getAttribute("high-src");
           const lowSrc = assetEl.getAttribute("low-src");
 
-          if (highSrc && AFRAME.quality === "high") {
+          if (highSrc && AFRAME.AGLTFEntity.quality === "high") {
             src = highSrc;
-          } else if (lowSrc && AFRAME.quality === "low") {
+          } else if (lowSrc && AFRAME.AGLTFEntity.quality === "low") {
             src = lowSrc;
           } else {
             src = fallbackSrc;
diff --git a/src/elements/a-progressive-asset.js b/src/elements/a-progressive-asset.js
index d34cd0022..e6deeea75 100644
--- a/src/elements/a-progressive-asset.js
+++ b/src/elements/a-progressive-asset.js
@@ -22,9 +22,9 @@ AFRAME.registerElement("a-progressive-asset", {
 
         let src = fallbackSrc;
 
-        if (AFRAME.quality === "high") {
+        if (AFRAME.AGLTFEntity.quality === "high") {
           src = highSrc;
-        } else if (AFRAME.quality === "low") {
+        } else if (AFRAME.AGLTFEntity.quality === "low") {
           src = lowSrc;
         }
 
diff --git a/src/room.js b/src/room.js
index 4c595b350..eebb4ad09 100644
--- a/src/room.js
+++ b/src/room.js
@@ -47,9 +47,9 @@ const qs = queryString.parse(location.search);
 const isMobile = AFRAME.utils.device.isMobile();
 
 if (qs.quality) {
-  AFRAME.quality = qs.quality;
+  AFRAME.AGLTFEntity.quality = qs.quality;
 } else {
-  AFRAME.quality = isMobile ? "low" : "high";
+  AFRAME.AGLTFEntity.quality = isMobile ? "low" : "high";
 }
 
 import "./elements/a-progressive-asset";
-- 
GitLab