diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-08-29 22:34:54 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-08-29 22:34:54 -0400 |
| commit | 01755335859b19756f6d64a2f8a10ae98abceb5f (patch) | |
| tree | d5ba0258769f85fff5512498b04c3c037daecf79 /public/assets/javascripts/rectangles/engine/rooms/grouper.js | |
| parent | 2235c34e498499b8141e835998b962067583a0ce (diff) | |
| parent | 851ddfd46abb7f944c1a6b7f198b5fd8cabd4c13 (diff) | |
merge
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/rooms/grouper.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/rooms/grouper.js | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/public/assets/javascripts/rectangles/engine/rooms/grouper.js b/public/assets/javascripts/rectangles/engine/rooms/grouper.js index cde9fbb..ba510e1 100644 --- a/public/assets/javascripts/rectangles/engine/rooms/grouper.js +++ b/public/assets/javascripts/rectangles/engine/rooms/grouper.js @@ -52,8 +52,8 @@ base.group(walls, collections, BACK) base.group(walls, collections, LEFT) base.group(walls, collections, RIGHT) - Rooms.walls = walls - base.bind() + Walls.assign( walls ) + Walls.bind() } base.collect = function(){ var collections = {} @@ -83,7 +83,10 @@ collection.sort( useX ? sort.compare_zx : sort.compare_xz ) collection.forEach(function(mx){ - if (last_mx && last_mx.rect.eq(mx.rect)) { + if (mx.culled) { + return + } + if (last_mx && mx && last_mx.rect.eq(mx.rect)) { // culls half-walls if (last_mx.rect.id == mx.rect.id) { last_mx.height += mx.height/2 @@ -91,9 +94,11 @@ last_mx.face.y.b += mx.height/2 } last_mx.side = side - mx.culled = true - mx.destroy() - scene.remove(mx) + if (! mx.culled) { + scene.remove(mx) + mx.destroy() + mx.culled = true + } return } widthVec = mx.rect[useX ? 'x' : 'y'].clone() @@ -142,7 +147,6 @@ } } wall = new Wall ({ - id: base.uid(), side: side, mx: [ mx ], surface: new Surface( mx.face ), @@ -155,13 +159,6 @@ return walls } - - base.bind = function(){ - Rooms.walls.forEach(function(wall){ - wall.bind() - wall.randomize_colors() - }) - } } |
