wowserhq / wowser

World of Warcraft in the browser using JavaScript and WebGL
MIT License
241 stars 63 forks source link

All pipeline resources are constructed at least twice #70

Open timkurvers opened 8 years ago

timkurvers commented 8 years ago

Currently all constructors for M2s, ADTs and WMOs are invoked twice, once to populate the cache, then once more to provide a fresh unique copy.

There's bound to be a better way to do this.

static load(path) {
  // ...
  return this.cache[path].then((m2) => {
    return m2.clone();
  });
}