Skip to content

Commit

Permalink
disable scene 'include' functionality
Browse files Browse the repository at this point in the history
(merging for the rest of the changes in anticipation of this feature)
  • Loading branch information
bcamper committed Sep 18, 2015
1 parent b56a33f commit 702da01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion demos/scene.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: transit.yaml
# include: transit.yaml

cameras:
perspective:
Expand Down
38 changes: 19 additions & 19 deletions src/scene_loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Utils from './utils/utils';
import GLSL from './gl/glsl';
import {mergeObjects} from './styles/rule';
// import {mergeObjects} from './styles/rule';
import {StyleManager} from './styles/style_manager';

var SceneLoader;
Expand Down Expand Up @@ -30,29 +30,29 @@ export default SceneLoader = {
then(styles => StyleManager.loadShaderBlocks(styles, path)). // TODO: deprecate remote shader blocks?
then(() => {
// accept single-string or array
if (typeof config.include === 'string') {
config.include = [config.include];
}
// if (typeof config.include === 'string') {
// config.include = [config.include];
// }

if (!Array.isArray(config.include)) {
// if (!Array.isArray(config.include)) {
SceneLoader.normalize(config, path);
return config;
}
// }

// Collect URLs of scenes to include
let includes = [];
for (let url of config.include) {
includes.push(Utils.addBaseURL(url, path));
}
delete config.include; // don't want to merge this property

return Promise.
all(includes.map(url => SceneLoader.loadSceneRecursive(url))).
then(configs => {
config = mergeObjects({}, ...configs, config);
SceneLoader.normalize(config, path);
return config;
});
// let includes = [];
// for (let url of config.include) {
// includes.push(Utils.addBaseURL(url, path));
// }
// delete config.include; // don't want to merge this property

// return Promise.
// all(includes.map(url => SceneLoader.loadSceneRecursive(url))).
// then(configs => {
// config = mergeObjects({}, ...configs, config);
// SceneLoader.normalize(config, path);
// return config;
// });
});
});
},
Expand Down

0 comments on commit 702da01

Please sign in to comment.