Update fountain and add writable flag to script slots.

This commit is contained in:
Jason Sams
2009-08-17 13:56:09 -07:00
parent 0ef135d5c7
commit 334ea0c98f
13 changed files with 167 additions and 117 deletions

View File

@@ -223,6 +223,52 @@ public class Element extends BaseObj {
return this;
}
public Builder addFloat(Element.DataKind dk) {
add(DataType.FLOAT, dk, false, 32, null);
return this;
}
public Builder addFloat(Element.DataKind dk, String name) {
add(DataType.FLOAT, dk, false, 32, name);
return this;
}
public Builder addFloatXY() {
add(DataType.FLOAT, DataKind.X, false, 32, null);
add(DataType.FLOAT, DataKind.Y, false, 32, null);
return this;
}
public Builder addFloatXYZ() {
add(DataType.FLOAT, DataKind.X, false, 32, null);
add(DataType.FLOAT, DataKind.Y, false, 32, null);
add(DataType.FLOAT, DataKind.Z, false, 32, null);
return this;
}
public Builder addFloatRGB() {
add(DataType.FLOAT, DataKind.RED, false, 32, null);
add(DataType.FLOAT, DataKind.GREEN, false, 32, null);
add(DataType.FLOAT, DataKind.BLUE, false, 32, null);
return this;
}
public Builder addFloatRGBA() {
add(DataType.FLOAT, DataKind.RED, false, 32, null);
add(DataType.FLOAT, DataKind.GREEN, false, 32, null);
add(DataType.FLOAT, DataKind.BLUE, false, 32, null);
add(DataType.FLOAT, DataKind.ALPHA, false, 32, null);
return this;
}
public Builder addUNorm8RGBA() {
add(DataType.UNSIGNED, DataKind.RED, true, 8, null);
add(DataType.UNSIGNED, DataKind.GREEN, true, 8, null);
add(DataType.UNSIGNED, DataKind.BLUE, true, 8, null);
add(DataType.UNSIGNED, DataKind.ALPHA, true, 8, null);
return this;
}
static synchronized Element internalCreate(RenderScript rs, Builder b) {
rs.nElementBegin();
for (int ct=0; ct < b.mEntryCount; ct++) {