Made actionscript code generation ByteArray-aware.
(ByteArray is a special class for dealing with bytes. It does not extend the normal Array). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4452 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -265,6 +265,9 @@ public class ActionScriptSource
|
|||||||
public static String toActionScriptType (Class type, boolean isField)
|
public static String toActionScriptType (Class type, boolean isField)
|
||||||
{
|
{
|
||||||
if (type.isArray()) {
|
if (type.isArray()) {
|
||||||
|
if (Byte.TYPE.equals(type.getComponentType())) {
|
||||||
|
return "ByteArray";
|
||||||
|
}
|
||||||
return isField ? "TypedArray" : "Array";
|
return isField ? "TypedArray" : "Array";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -296,7 +296,12 @@ public class GenActionScriptTask extends Task
|
|||||||
return "new Long(ins.readInt(), ins.readInt())";
|
return "new Long(ins.readInt(), ins.readInt())";
|
||||||
|
|
||||||
} else if (type.isArray()) {
|
} else if (type.isArray()) {
|
||||||
return "(ins.readObject() as TypedArray)";
|
if (Byte.TYPE.equals(type.getComponentType())) {
|
||||||
|
return "(ins.readObject() as ByteArray)";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return "(ins.readObject() as TypedArray)";
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return "(ins.readObject() as " +
|
return "(ins.readObject() as " +
|
||||||
|
|||||||
@@ -109,6 +109,9 @@ public class GenUtil
|
|||||||
public static String simpleASName (Class<?> clazz)
|
public static String simpleASName (Class<?> clazz)
|
||||||
{
|
{
|
||||||
if (clazz.isArray()) {
|
if (clazz.isArray()) {
|
||||||
|
if (Byte.TYPE.equals(clazz.getComponentType())) {
|
||||||
|
return "ByteArray";
|
||||||
|
}
|
||||||
return "Array";
|
return "Array";
|
||||||
} else if (clazz == Boolean.TYPE) {
|
} else if (clazz == Boolean.TYPE) {
|
||||||
return "Boolean";
|
return "Boolean";
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package $package {
|
package $package {
|
||||||
|
|
||||||
|
import flash.utils.ByteArray;
|
||||||
import com.threerings.util.*; // for Float, Integer, etc.
|
import com.threerings.util.*; // for Float, Integer, etc.
|
||||||
|
|
||||||
#foreach ($import in $imports)
|
#foreach ($import in $imports)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package $package {
|
package $package {
|
||||||
|
|
||||||
|
import flash.utils.ByteArray;
|
||||||
import com.threerings.util.*; // for Float, Integer, etc.
|
import com.threerings.util.*; // for Float, Integer, etc.
|
||||||
|
|
||||||
#foreach ($import in $imports)
|
#foreach ($import in $imports)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package $package {
|
package $package {
|
||||||
|
|
||||||
|
import flash.utils.ByteArray;
|
||||||
#foreach ($import in $imports)
|
#foreach ($import in $imports)
|
||||||
import $import;
|
import $import;
|
||||||
#end
|
#end
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package $package {
|
package $package {
|
||||||
|
|
||||||
|
import flash.utils.ByteArray;
|
||||||
import com.threerings.util.*; // for Float, Integer, etc.
|
import com.threerings.util.*; // for Float, Integer, etc.
|
||||||
|
|
||||||
#foreach ($import in $imports)
|
#foreach ($import in $imports)
|
||||||
|
|||||||
Reference in New Issue
Block a user