예제 #1
0
        void Build(string path, string listingName, string outputPath)
        {
            if (string.IsNullOrWhiteSpace(outputPath))
            {
                outputPath = path;
            }

            var builderOptions = new Collections.BitVector32();
            {
                if (mBuildFlagAlwaysUseXmlOverXmb)
                {
                    Console.WriteLine("PKG:Builder: Switch enabled - {0}", "Use XML over XMB");
                    builderOptions.Set(KSoft.Phoenix.Resource.PKG.CaPackageFileBuilderOptions.AlwaysUseXmlOverXmb);
                }
            }

            StreamWriter debug_output = false            //options.Test(KSoft.Phoenix.Resource.EraFileUtilOptions.DumpDebugInfo)
                                ? new StreamWriter("debug_builder.txt")
                                : null;

            string listing_path = Path.Combine(path, listingName) + KSoft.Phoenix.Resource.EraFileBuilder.kNameExtension;

            using (var builder = new KSoft.Phoenix.Resource.PKG.CaPackageFileBuilder(listing_path))
            {
                builder.BuilderOptions = builderOptions;
                builder.ProgressOutput = Console.Out;
                builder.VerboseOutput  = Console.Out;
                builder.DebugOutput    = debug_output;

                if (builder.Read())
                {
#if false // #TODO
                    if (builder.Build(path, listingName, outputPath))
                    {
                        builder.ProgressOutput.WriteLine("Success!");
                    }
                    else
#endif
                    builder.ProgressOutput.WriteLine("Failed!");
                }
            }

            if (debug_output != null)
            {
                debug_output.Close();
            }
        }
예제 #2
0
        static void BuildParseSwitches(string switches,
                                       out Collections.BitVector32 options,
                                       out Collections.BitVector32 builderOptions)
        {
            options        = new Collections.BitVector32();
            builderOptions = new Collections.BitVector32();
            bool dump_dbg_info = false, is_32bit = false, encrypt = false;

            if (switches == null)
            {
                switches = "";
            }

            int index = 0;

            ParseSwitch(switches, index++, ref dump_dbg_info);
            ParseSwitch(switches, index++, ref is_32bit);
            ParseSwitch(switches, index++, ref encrypt);

            if (encrypt)
            {
                Console.WriteLine("Era:Builder: Switch enabled - {0}", "ERA will be encrypted before saved to disk");
                builderOptions.Set(KSoft.Phoenix.Resource.EraFileBuilderOptions.Encrypt);
            }

            if (!is_32bit)
            {
                Console.WriteLine("Era:Builder: Treating ERA as 64-bit (Definitive Edition)");
                options.Set(KSoft.Phoenix.Resource.EraFileUtilOptions.x64);
            }
            else
            {
                Console.WriteLine("Era:Builder: Switch enabled - {0}", "Treat ERA as 32-bit (Xbox360)");
            }
            if (dump_dbg_info)
            {
                Console.WriteLine("Era:Builder: Switch enabled - {0}", "Dump debug info");
                options.Set(KSoft.Phoenix.Resource.EraFileUtilOptions.DumpDebugInfo);
            }
        }
예제 #3
0
        static void ExpandParseSwitches(string switches,
                                        out Collections.BitVector32 options,
                                        out Collections.BitVector32 expanderOptions)
        {
            options         = new Collections.BitVector32();
            expanderOptions = new Collections.BitVector32();
            bool only_dump_listing = false, dont_overwrite = false, dont_trans_xmb = false, decompress_ui_files = false,
                 trans_gfx = false, is_32bit = false, decrypt = false, dont_load_into_memory = false,
                 skip_verification = false, dump_dbg_info = false, dont_remove_xml_xmb = false;

            if (switches == null)
            {
                switches = "";
            }

            int index = 0;

            ParseSwitch(switches, index++, ref only_dump_listing);
            ParseSwitch(switches, index++, ref dont_overwrite);
            ParseSwitch(switches, index++, ref dont_trans_xmb);
            ParseSwitch(switches, index++, ref decompress_ui_files);
            ParseSwitch(switches, index++, ref trans_gfx);
            ParseSwitch(switches, index++, ref is_32bit);
            ParseSwitch(switches, index++, ref skip_verification);
            ParseSwitch(switches, index++, ref decrypt);
            ParseSwitch(switches, index++, ref dont_load_into_memory);
            ParseSwitch(switches, index++, ref dump_dbg_info);
            ParseSwitch(switches, index++, ref dont_remove_xml_xmb);

            if (only_dump_listing)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Only dumping listing file");
                expanderOptions.Set(KSoft.Phoenix.Resource.EraFileExpanderOptions.OnlyDumpListing);
            }
            if (dont_overwrite)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Not overwriting existing files");
                expanderOptions.Set(KSoft.Phoenix.Resource.EraFileExpanderOptions.DontOverwriteExistingFiles);
            }
            if (dont_trans_xmb)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Not translating XMB files");
                expanderOptions.Set(KSoft.Phoenix.Resource.EraFileExpanderOptions.DontTranslateXmbFiles);
            }
            if (decompress_ui_files)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Decompressing Scaleform data");
                expanderOptions.Set(KSoft.Phoenix.Resource.EraFileExpanderOptions.DecompressUIFiles);
            }
            if (trans_gfx)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Translate GFX files to SWF");
                expanderOptions.Set(KSoft.Phoenix.Resource.EraFileExpanderOptions.TranslateGfxFiles);
            }
            if (decrypt)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "ERA will be loaded into memory and decrypted in place");
                expanderOptions.Set(KSoft.Phoenix.Resource.EraFileExpanderOptions.Decrypt);
                dont_load_into_memory = false;
            }
            if (dont_load_into_memory)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Not loading entire ERA into memory");
                expanderOptions.Set(KSoft.Phoenix.Resource.EraFileExpanderOptions.DontLoadEntireEraIntoMemory);
            }
            if (dont_remove_xml_xmb)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Not skipping XML or XMB counterparts");
                expanderOptions.Set(KSoft.Phoenix.Resource.EraFileExpanderOptions.DontRemoveXmlOrXmbFiles);
            }

            if (!is_32bit)
            {
                Console.WriteLine("Era:Expander: Treating ERA as 64-bit (Definitive Edition)");
                options.Set(KSoft.Phoenix.Resource.EraFileUtilOptions.x64);
            }
            else
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Treat ERA as 32-bit (Xbox360)");
            }

            if (skip_verification)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Skip verification");
                options.Set(KSoft.Phoenix.Resource.EraFileUtilOptions.SkipVerification);
            }
            if (dump_dbg_info)
            {
                Console.WriteLine("Era:Expander: Switch enabled - {0}", "Dump debug info");
                options.Set(KSoft.Phoenix.Resource.EraFileUtilOptions.DumpDebugInfo);
            }
        }
예제 #4
0
 public GameLanguageTable()
 {
     mBuildHandle = Engine.EngineBuildHandle.None;
     mOptionalEngineLanguageFlags = new Collections.BitVector32();
     mOptionalGameLanguageFlags   = new Collections.BitVector32();
 }