summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/engine')
-rw-r--r--public/assets/javascripts/rectangles/engine/rooms/builder.js4
-rw-r--r--public/assets/javascripts/rectangles/engine/rooms/grouper.js13
2 files changed, 10 insertions, 7 deletions
diff --git a/public/assets/javascripts/rectangles/engine/rooms/builder.js b/public/assets/javascripts/rectangles/engine/rooms/builder.js
index f321f71..5396ced 100644
--- a/public/assets/javascripts/rectangles/engine/rooms/builder.js
+++ b/public/assets/javascripts/rectangles/engine/rooms/builder.js
@@ -165,7 +165,6 @@
room.mx_ceiling.push(el)
}
}.bind(this))
-
}
else {
// render floor and ceiling for the entire rectangle
@@ -282,7 +281,6 @@
el.side = CEILING
return el
}
-
this.make_wall = function (klass) {
var el = new MX.Object3D(".face" + (klass || ""))
el.width = el.height = el.scaleX = el.scaleY = el.scaleZ = 1
@@ -293,7 +291,7 @@
el.side = 0
el.rect = null
el.destroy = function(){
- this.el = this.rect = this.face = null
+ this.el = this.rect = this.face = null
}
// possible if walls are opaque
diff --git a/public/assets/javascripts/rectangles/engine/rooms/grouper.js b/public/assets/javascripts/rectangles/engine/rooms/grouper.js
index cde9fbb..2ec1ee7 100644
--- a/public/assets/javascripts/rectangles/engine/rooms/grouper.js
+++ b/public/assets/javascripts/rectangles/engine/rooms/grouper.js
@@ -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()