Exemplo n.º 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;
        }
        public virtual void testMethods()
        {
            String str          = "This is a string";
            String chrString    = AsString.charAt(str, 0);
            float  chrCode      = AsString.charCodeAt(str, 0);
            String fromCharCode = AsString.fromCharCode(0);
            int    indexOf      = AsString.indexOf(str, "string");

            indexOf = AsString.indexOf(str, "string", 0);
            String replace = AsString.replace(str, "string", "foo");
            String slice   = AsString.slice(str, 0);

            slice = AsString.slice(str, 0, 10);
            AsArray split  = AsString.split(str, " ");
            String  substr = AsString.substr(str, 0);

            substr = AsString.substring(str, 0, 10);
            String substring = AsString.substring(str, 0);

            substring = AsString.substring(str, 0, 10);
            String toLocalLowerCase = AsString.toLocaleLowerCase(str);
            String toLocalUpperCase = AsString.toLocaleUpperCase(str);
            String toLowerCase      = AsString.toLowerCase(str);
            String toUpperCase      = AsString.toUpperCase(str);
            String toString         = str.ToString();
            String valueOf          = AsString.valueOf(str);
        }