summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/SubclumpShape.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/scape/SubclumpShape.java')
-rw-r--r--NET/worlds/scape/SubclumpShape.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/NET/worlds/scape/SubclumpShape.java b/NET/worlds/scape/SubclumpShape.java
new file mode 100644
index 0000000..000786f
--- /dev/null
+++ b/NET/worlds/scape/SubclumpShape.java
@@ -0,0 +1,47 @@
+package NET.worlds.scape;
+
+public class SubclumpShape extends Shape implements ShapeLoaderListener {
+ private Material pendingMaterial = null;
+ private static final boolean debug = false;
+
+ @Override
+ public void setMaterial(Material m) {
+ SuperRoot parentObj = this.getOwner();
+ if (!(parentObj instanceof Shape)) {
+ super.setMaterial(m);
+ } else {
+ Shape parent = (Shape)parentObj;
+ if (!parent.isFullyLoaded()) {
+ parent.addLoadListener(this);
+ this.pendingMaterial = m;
+ } else {
+ super.setMaterial(m);
+ }
+ }
+ }
+
+ @Override
+ protected synchronized void addRwChildren(WObject container) {
+ SuperRoot o = this.getOwner();
+ if (o instanceof Shape) {
+ Shape parent = (Shape)o;
+ if (!parent.isFullyLoaded()) {
+ this.setState(LOADING, null);
+ parent.addLoadListener(this);
+ }
+ }
+
+ super.addRwChildren(container);
+ }
+
+ @Override
+ public void notifyShapeLoaded(Shape s) {
+ this.setState(NORMAL, null);
+ this.shapeRedraw();
+ if (this.pendingMaterial != null) {
+ super.setMaterial(this.pendingMaterial);
+ }
+
+ this.pendingMaterial = null;
+ }
+}