aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.js')
-rw-r--r--src/modules.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/modules.js b/src/modules.js
index f1f5f487..dc4a296d 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -171,22 +171,26 @@ var Functions = {
};
var LibraryManager = {
- ready: false,
+ library: null,
- init: function() {
- this.ready = true;
+ load: function() {
+ assert(!this.library);
+
+ for (suffix in set('', '_sdl', '_gl', '_browser')) {
+ eval(processMacros(preprocess(read('library' + suffix + '.js'), CONSTANTS)));
+ }
},
// Given an ident, see if it is an alias for something, and so forth, returning
// the earliest ancestor (the root)
getRootIdent: function(ident) {
- if (!this.ready) return null;
- var ret = Library[ident];
+ if (!this.library) return null;
+ var ret = LibraryManager.library[ident];
if (!ret) return null;
var last = ident;
while (typeof ret === 'string') {
last = ret;
- ret = Library[ret];
+ ret = LibraryManager.library[ret];
}
return last;
}