diff --git a/src/java/com/threerings/presents/tools/ActionScriptSource.java b/src/java/com/threerings/presents/tools/ActionScriptSource.java index a358adb9a..ab8470732 100644 --- a/src/java/com/threerings/presents/tools/ActionScriptSource.java +++ b/src/java/com/threerings/presents/tools/ActionScriptSource.java @@ -278,6 +278,11 @@ public class ActionScriptSource return "int"; } + if (Float.TYPE.equals(type) || + Double.TYPE.equals(type)) { + return "Number"; + } + if (Long.TYPE.equals(type)) { return "Long"; } @@ -649,6 +654,7 @@ public class ActionScriptSource Member curmem = null; while ((line = bin.readLine()) != null) { line = line.replaceAll("\\s+$", ""); + // System.err.println(" " + mode + " : " + line); switch (mode) { case PREAMBLE: // look for the package declaration @@ -667,6 +673,10 @@ public class ActionScriptSource imports = accum.toString(); accum.setLength(0); mode = Mode.CLASSCOMMENT; + } else if (line.startsWith("public ")) { + imports = accum.toString(); + accum.setLength(0); + mode = line.endsWith("{") ? Mode.CLASSBODY : Mode.CLASSDECL; } accum.append(line).append("\n"); break; diff --git a/src/java/com/threerings/presents/tools/GenActionScriptTask.java b/src/java/com/threerings/presents/tools/GenActionScriptTask.java index 25cd6455d..1ec82f01d 100644 --- a/src/java/com/threerings/presents/tools/GenActionScriptTask.java +++ b/src/java/com/threerings/presents/tools/GenActionScriptTask.java @@ -295,6 +295,12 @@ public class GenActionScriptTask extends Task } else if (type.equals(Long.TYPE)) { return "new Long(ins.readInt(), ins.readInt())"; + } else if (type.equals(Float.TYPE)) { + return "ins.readFloat()"; + + } else if (type.equals(Double.TYPE)) { + return "ins.readDouble()"; + } else if (type.isArray()) { if (Byte.TYPE.equals(type.getComponentType())) { return "(ins.readObject() as ByteArray)"; @@ -331,6 +337,12 @@ public class GenActionScriptTask extends Task " out.writeInt(" + name + " == null ? 0 : " + name + ".high)"; + } else if (type.equals("float")) { + return "writeFloat(" + name + ")"; + + } else if (type.equals("double")) { + return "writeDouble(" + name + ")"; + } else if (type.equals("java.lang.String")) { return "writeField(" + name + ")";