From 4a34d6d2fd585357a806e183a82f813fbd129763 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 11 Jul 2007 01:20:36 +0000 Subject: [PATCH] Have the actionscript-generating stuff understand TypedArray. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4751 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/presents/tools/GenUtil.java | 8 ++++++-- src/java/com/threerings/presents/tools/marshaller_as.tmpl | 1 + .../threerings/presents/tools/marshaller_listener_as.tmpl | 1 + src/java/com/threerings/presents/tools/service_as.tmpl | 1 + .../threerings/presents/tools/service_listener_as.tmpl | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/presents/tools/GenUtil.java b/src/java/com/threerings/presents/tools/GenUtil.java index 4ab3834c8..67274f91d 100644 --- a/src/java/com/threerings/presents/tools/GenUtil.java +++ b/src/java/com/threerings/presents/tools/GenUtil.java @@ -55,10 +55,14 @@ public class GenUtil extends com.samskivert.util.GenUtil public static String simpleASName (Class clazz) { if (clazz.isArray()) { - if (Byte.TYPE.equals(clazz.getComponentType())) { + Class compoType = clazz.getComponentType(); + if (Byte.TYPE.equals(compoType)) { return "ByteArray"; + } else if (Object.class.equals(compoType)) { + return "Array"; + } else { + return "TypedArray /* of " + compoType + " */"; } - return "Array"; } else if (clazz == Boolean.TYPE) { return "Boolean"; } else if (clazz == Byte.TYPE || clazz == Character.TYPE || diff --git a/src/java/com/threerings/presents/tools/marshaller_as.tmpl b/src/java/com/threerings/presents/tools/marshaller_as.tmpl index 770c7ee97..8f8b3c7e7 100644 --- a/src/java/com/threerings/presents/tools/marshaller_as.tmpl +++ b/src/java/com/threerings/presents/tools/marshaller_as.tmpl @@ -2,6 +2,7 @@ package $package { import flash.utils.ByteArray; import com.threerings.util.*; // for Float, Integer, etc. +import com.threerings.io.TypedArray; #foreach ($import in $imports) import $import; diff --git a/src/java/com/threerings/presents/tools/marshaller_listener_as.tmpl b/src/java/com/threerings/presents/tools/marshaller_listener_as.tmpl index a7ea42fa0..d42c67cc1 100644 --- a/src/java/com/threerings/presents/tools/marshaller_listener_as.tmpl +++ b/src/java/com/threerings/presents/tools/marshaller_listener_as.tmpl @@ -2,6 +2,7 @@ package $package { import flash.utils.ByteArray; import com.threerings.util.*; // for Float, Integer, etc. +import com.threerings.io.TypedArray; #foreach ($import in $imports) import $import; diff --git a/src/java/com/threerings/presents/tools/service_as.tmpl b/src/java/com/threerings/presents/tools/service_as.tmpl index fa997ea94..25e0db67f 100644 --- a/src/java/com/threerings/presents/tools/service_as.tmpl +++ b/src/java/com/threerings/presents/tools/service_as.tmpl @@ -1,6 +1,7 @@ package $package { import flash.utils.ByteArray; +import com.threerings.io.TypedArray; #foreach ($import in $imports) import $import; #end diff --git a/src/java/com/threerings/presents/tools/service_listener_as.tmpl b/src/java/com/threerings/presents/tools/service_listener_as.tmpl index 3af9d0b67..6ede9abb0 100644 --- a/src/java/com/threerings/presents/tools/service_listener_as.tmpl +++ b/src/java/com/threerings/presents/tools/service_listener_as.tmpl @@ -2,6 +2,7 @@ package $package { import flash.utils.ByteArray; import com.threerings.util.*; // for Float, Integer, etc. +import com.threerings.io.TypedArray; #foreach ($import in $imports) import $import;