Browse Source

minor fixes for custom build

Palmer-JC 8 years ago
parent
commit
cf218661f4
2 changed files with 11 additions and 16 deletions
  1. 7 7
      src/Materials/babylon.materialHelper.ts
  2. 4 9
      src/babylon.engine.ts

+ 7 - 7
src/Materials/babylon.materialHelper.ts

@@ -111,11 +111,11 @@
                     defines["DIRLIGHT" + lightIndex] = false;
 
                     var type;
-                    if (light.getClassName() === "SpotLight") {
+                    if (light.getTypeID() === 2) {
                         type = "SPOTLIGHT" + lightIndex;
-                    } else if (light.getClassName() === "HemisphericLight") {
+                    } else if (light.getTypeID() === 3) {
                         type = "HEMILIGHT" + lightIndex;
-                    } else if (light.getClassName() === "PointLight") {
+                    } else if (light.getTypeID() === 0) {
                         type = "POINTLIGHT" + lightIndex;
                     } else {
                         type = "DIRLIGHT" + lightIndex;
@@ -305,16 +305,16 @@
         }
 
         public static BindLightProperties(light: Light, effect: Effect, lightIndex: number): void {
-            if (light.getClassName() === "PointLight") {
+            if (light.getTypeID() === 0) {
                 // Point Light
                 light.transferToEffect(effect, "vLightData" + lightIndex);
-            } else if (light.getClassName() === "DirectionalLight") {
+            } else if (light.getTypeID() === 1) {
                 // Directional Light
                 light.transferToEffect(effect, "vLightData" + lightIndex);
-            } else if (light.getClassName() === "SpotLight") {
+            } else if (light.getTypeID() === 2) {
                 // Spot Light
                 light.transferToEffect(effect, "vLightData" + lightIndex, "vLightDirection" + lightIndex);
-            } else if (light.getClassName() === "HemisphericLight") {
+            } else if (light.getTypeID() === 3) {
                 // Hemispheric Light
                 light.transferToEffect(effect, "vLightData" + lightIndex, "vLightGround" + lightIndex);
             }

+ 4 - 9
src/babylon.engine.ts

@@ -3359,13 +3359,11 @@
 
         // Loading screen
         public displayLoadingUI(): void {
-            if (!this._loadingScreen) this._loadingScreen = new DefaultLoadingScreen(this._renderingCanvas)
-            this._loadingScreen.displayLoadingUI();
+            this.loadingScreen.displayLoadingUI();
         }
 
         public hideLoadingUI(): void {
-            if (!this._loadingScreen) this._loadingScreen = new DefaultLoadingScreen(this._renderingCanvas)
-            this._loadingScreen.hideLoadingUI();
+            this.loadingScreen.hideLoadingUI();
         }
 
         public get loadingScreen(): ILoadingScreen {
@@ -3374,18 +3372,15 @@
         }
 
         public set loadingScreen(loadingScreen: ILoadingScreen) {
-            if (!this._loadingScreen) this._loadingScreen = new DefaultLoadingScreen(this._renderingCanvas)
             this._loadingScreen = loadingScreen;
         }
 
         public set loadingUIText(text: string) {
-            if (!this._loadingScreen) this._loadingScreen = new DefaultLoadingScreen(this._renderingCanvas)
-            this._loadingScreen.loadingUIText = text;
+            this.loadingScreen.loadingUIText = text;
         }
 
         public set loadingUIBackgroundColor(color: string) {
-            if (!this._loadingScreen) this._loadingScreen = new DefaultLoadingScreen(this._renderingCanvas)
-            this._loadingScreen.loadingUIBackgroundColor = color;
+            this.loadingScreen.loadingUIBackgroundColor = color;
         }
 
         public attachContextLostEvent(callback: ((event: WebGLContextEvent) => void)): void {