Пример #1
0
        public static baaSectionHeaderInfo baa_GetSectionHeaderInfo(jBAAIncludeRecord inc)
        {
            var ret = new baaSectionHeaderInfo();

            switch (inc.hash)
            {
            case libJAudio.Loaders.JA_BAALoader.WS:
            case libJAudio.Loaders.JA_BAALoader.BMS:
                ret.size = 3;
                break;

            case libJAudio.Loaders.JA_BAALoader.BSFT:
            case libJAudio.Loaders.JA_BAALoader.BFCA:
                ret.size = 1;
                break;

            case libJAudio.Loaders.JA_BAALoader.BST:
            case libJAudio.Loaders.JA_BAALoader.BSTN:
            case libJAudio.Loaders.JA_BAALoader.BAAC:
            case libJAudio.Loaders.JA_BAALoader.BNK:
            case libJAudio.Loaders.JA_BAALoader.BSC:
                ret.size = 2;
                break;

            default:
                cmdarg.assert($"cannot pack section type {inc.hash:X5}");
                return(null);
            }
            return(ret);
        }
Пример #2
0
        public static void baa_PackSection(int start, int end, jBAAIncludeRecord inc, BeBinaryWriter blockWrite)
        {
            blockWrite.Write(inc.hash); // sprawl out hash
            switch (inc.hash)
            {
            case libJAudio.Loaders.JA_BAALoader.WS:
                blockWrite.Write(inc.uid);
                blockWrite.Write(start);
                blockWrite.Write(inc.flags);
                break;

            case libJAudio.Loaders.JA_BAALoader.BNK:
                blockWrite.Write(inc.uid);
                blockWrite.Write(start);
                break;

            case libJAudio.Loaders.JA_BAALoader.BSFT:
            case libJAudio.Loaders.JA_BAALoader.BFCA:
                blockWrite.Write(start);
                break;

            case libJAudio.Loaders.JA_BAALoader.BST:
            case libJAudio.Loaders.JA_BAALoader.BSTN:
            case libJAudio.Loaders.JA_BAALoader.BAAC:

            case libJAudio.Loaders.JA_BAALoader.BSC:
                blockWrite.Write(start);
                blockWrite.Write(end);
                break;

            case libJAudio.Loaders.JA_BAALoader.BMS:
                blockWrite.Write(inc.uid);
                blockWrite.Write(start);
                blockWrite.Write(end);
                break;

            default:
                cmdarg.assert($"cannot pack section type {inc.hash:X5}");
                break;
            }
        }