Inheritance: bc.flash.AsObject
コード例 #1
0
 public AsAtfData(AsByteArray data)
 {
     String signature = AsString.fromCharCode((As_AS_REST)(data.getOwnProperty(0)), data.getOwnProperty(1), data.getOwnProperty(2));
     if(signature != "ATF")
     {
         throw new AsArgumentError("Invalid ATF data");
     }
     switch(data.getOwnProperty(6))
     {
         case 0:
         case 1:
         mFormat = AsContext3DTextureFormat.BGRA;
         break;
         case 2:
         case 3:
         mFormat = AsContext3DTextureFormat.COMPRESSED;
         break;
         case 4:
         case 5:
         mFormat = "compressedAlpha";
         break;
         default:
         throw new AsError("Invalid ATF format");
     }
     mWidth = (int)(AsMath.pow(2, (float)(data.getOwnProperty(7))));
     mHeight = (int)(AsMath.pow(2, (float)(data.getOwnProperty(8))));
     mNumTextures = (int)(data.getOwnProperty(9));
     mData = data;
 }
コード例 #2
0
 public static AsTexture getTexture()
 {
     AsBitmapData bmpData = new AsBitmapData(BITMAP_WIDTH, BITMAP_HEIGHT);
     AsByteArray bmpBytes = new AsByteArray();
     int numBytes = (int)(BITMAP_DATA.getLength());
     int i = 0;
     for (; i < numBytes; ++i)
     {
         bmpBytes.writeUnsignedInt((uint)(BITMAP_DATA[i]));
     }
     bmpBytes.uncompress();
     bmpData.setPixels(new AsRectangle(0, 0, BITMAP_WIDTH, BITMAP_HEIGHT), bmpBytes);
     return AsTexture.fromBitmapData(bmpData, false);
 }
コード例 #3
0
 public virtual void writeBytes(AsByteArray bytes)
 {
     writeBytes(bytes, (uint)(0), (uint)(0));
 }
コード例 #4
0
 public void uploadCompressedTextureFromByteArray(AsByteArray data, uint byteArrayOffset, bool async)
 {
 }
コード例 #5
0
 public virtual void writeBytes(AsByteArray bytes, uint offset)
 {
     writeBytes(bytes, offset, (uint)(0));
 }
コード例 #6
0
 public virtual void readBytes(AsByteArray bytes, uint offset)
 {
     readBytes(bytes, offset, (uint)(0));
 }
コード例 #7
0
 public virtual void loadBytes(AsByteArray bytes)
 {
     loadBytes(bytes, null);
 }
コード例 #8
0
 public virtual void uploadFromByteArray(AsByteArray data, int byteArrayOffset, int startVertex, int numVertices)
 {
     throw new AsNotImplementedError();
 }
コード例 #9
0
 public virtual void writeBytes(AsByteArray bytes)
 {
     writeBytes(bytes, (uint)(0), (uint)(0));
 }
コード例 #10
0
 public virtual void readBytes(AsByteArray bytes, uint offset, uint length)
 {
     throw new AsNotImplementedError();
 }
コード例 #11
0
 public virtual void readBytes(AsByteArray bytes)
 {
     readBytes(bytes, (uint)(0), (uint)(0));
 }
コード例 #12
0
 public void upload(AsByteArray vertexProgram, AsByteArray fragmentProgram)
 {
     throw new AsNotImplementedError();
 }
コード例 #13
0
 public void uploadFromByteArray(AsByteArray data, int byteArrayOffset, int startOffset, int count)
 {
     throw new AsNotImplementedError();
 }
コード例 #14
0
 public void uploadFromByteArray(AsByteArray data, uint byteArrayOffset)
 {
     uploadFromByteArray(data, byteArrayOffset, (uint)(0));
 }
コード例 #15
0
 public void uploadFromByteArray(AsByteArray data, uint byteArrayOffset, uint miplevel)
 {
     throw new AsNotImplementedError();
 }
コード例 #16
0
 public void uploadCompressedTextureFromByteArray(AsByteArray data, uint byteArrayOffset)
 {
     uploadCompressedTextureFromByteArray(data, byteArrayOffset, false);
 }
コード例 #17
0
 public void uploadCompressedTextureFromByteArray(AsByteArray data, uint byteArrayOffset, bool async)
 {
     throw new AsNotImplementedError();
 }
コード例 #18
0
 public void uploadFromByteArray(AsByteArray data, uint byteArrayOffset, uint side, uint miplevel)
 {
 }
コード例 #19
0
 public virtual void readBytes(AsByteArray bytes, uint offset)
 {
     readBytes(bytes, offset, (uint)(0));
 }
コード例 #20
0
 public static AsTexture fromAtfData(AsByteArray data)
 {
     return fromAtfData(data, 1);
 }
コード例 #21
0
 public void setPixels(AsRectangle rect, AsByteArray bytes)
 {
     throw new NotImplementedException();
 }
コード例 #22
0
 public static void uploadAtfData(bc.flash.display3D.textures.AsTexture nativeTexture, AsByteArray data, int offset)
 {
     nativeTexture.uploadCompressedTextureFromByteArray(data, (uint)(offset));
 }
コード例 #23
0
 public virtual void writeBytes(AsByteArray bytes, uint offset)
 {
     writeBytes(bytes, offset, (uint)(0));
 }
コード例 #24
0
 public static void uploadAtfData(bc.flash.display3D.textures.AsTexture nativeTexture, AsByteArray data)
 {
     uploadAtfData(nativeTexture, data, 0);
 }
コード例 #25
0
 public virtual void readBytes(AsByteArray bytes, uint offset, uint length)
 {
     throw new AsNotImplementedError();
 }
コード例 #26
0
 public static AsTexture fromAtfData(AsByteArray data, float scale)
 {
     AsContext3D context = AsStarling.getContext();
     if(context == null)
     {
         throw new AsMissingContextError();
     }
     AsAtfData atfData = new AsAtfData(data);
     bc.flash.display3D.textures.AsTexture nativeTexture = context.createTexture(atfData.getWidth(), atfData.getHeight(), atfData.getFormat(), false);
     uploadAtfData(nativeTexture, data);
     AsConcreteTexture concreteTexture = new AsConcreteTexture(nativeTexture, atfData.getFormat(), atfData.getWidth(), atfData.getHeight(), atfData.getNumTextures() > 1, false, false, scale);
     if(AsStarling.getHandleLostContext())
     {
         concreteTexture.restoreOnLostContext(atfData);
     }
     return concreteTexture;
 }
コード例 #27
0
 public virtual void readBytes(AsByteArray bytes)
 {
     readBytes(bytes, (uint)(0), (uint)(0));
 }
コード例 #28
0
 public virtual void setProgramConstantsFromByteArray(String programType, int firstRegister, int numRegisters, AsByteArray data, uint byteArrayOffset)
 {
     throw new AsNotImplementedError();
 }
コード例 #29
0
 public virtual void loadBytes(AsByteArray bytes, AsLoaderContext context)
 {
     throw new AsNotImplementedError();
 }
コード例 #30
0
 public virtual void registerProgram(String name, AsByteArray vertexProgram, AsByteArray fragmentProgram)
 {
     if(mPrograms.containsKey(name))
     {
         throw new AsError("Another program with this name is already registered");
     }
     AsProgram3D program = mContext.createProgram();
     program.upload(vertexProgram, fragmentProgram);
     mPrograms[name] = program;
 }