Example #1
0
        // PAK�t�@�C���ϊ��W�J(�V�i���I�t�@�C��)
        private void convertScenario(String fileName)
        {
            _progressValue = 0;
            _progressMax = 0;
            LeafPack pak = new LeafPack();

            LeNSConvResult result;
            LeNSConvSCN conv_scn;

            // �R���o�[�^�I�u�W�F�N�g�𐶐�
            switch (Option.conv)
            {
                case LeNSConvMode.MODE_SZ:
                    conv_scn = new LeNSConvSCNSZ(Option);
                    break;
                case LeNSConvMode.MODE_KZ:
                    conv_scn = new LeNSConvSCNKZ(Option);
                    break;
                case LeNSConvMode.MODE_TH:
                    conv_scn = new LeNSConvSCNTH(Option);
                    break;
                default:
                    // �����ɂ͗��Ȃ��͂�
                    return;
            }

            conv_scn.SoundCache = soundCache;

            try
            {
                outputLog(fileName + "�̃V�i���I�t�@�C���ϊ�����݂܂�", false);
                conv_scn.CreateFile();
                _processingPack = fileName;
                _processingTask = "Extracting... " + fileName;
                pak.Open(Option.pakPath + "\\" + fileName, System.IO.FileMode.Open);
                _progressValue = 0;
                _progressMax = (int)pak.ScenarioNum;
                outputLog(fileName + " = " + _progressMax.ToString() + "files.");

                foreach (LeafPack.LeafFileInfo info in pak.Files.Values)
                {
                    String ext = Path.GetExtension(info.Name);

                    if (info.Type == LeafPack.LeNSFileType.ScenarioFile)
                    {
                        _processingTask = fileName + "@" + info.Name;
                        _progressValue++;

                        // �ϊ������R�[��
                        _processingTask += " -> " + conv_scn.GetSaveName(info.Name);
                        result = conv_scn.Conv(info, pak.Get(info.Name));
                    }
                    else
                    {
                        _processingTask = "searching...";
                    }
                }
            }
            finally
            {
                pak.Close();
                _processingPack = "";
                _progressValue = 0;
                _progressMax = 0;
            }
        }
Example #2
0
        // PAK�t�@�C���ϊ��W�J(�f�ރt�@�C��)
        private void convertOther(String fileName)
        {
            _progressValue = 0;
            _progressMax = 0;
            LeafPack pak = new LeafPack();

            LeNSConvResult result;
            LeNSConvLFG conv_lfg = new LeNSConvLFG(Option);
            LeNSConvSDT conv_sdt = new LeNSConvSDT(Option);
            LeNSConvP16 conv_p16 = new LeNSConvP16(Option);

            switch (Option.conv)
            {
                case LeNSConvMode.MODE_KZ:
                    conv_lfg.LoadPaletteMap("kizuato.pal");
                    break;
            }

            try
            {
                outputLog(fileName + "�̑f�ރt�@�C���ϊ�����݂܂�", false);
                _processingPack = fileName;
                _processingTask = "Extracting... " + fileName;
                pak.Open(Option.pakPath + "\\" + fileName, System.IO.FileMode.Open);
                _progressValue = 0;
                _progressMax = (int)pak.OtherNum;
                outputLog(fileName + " = " + _progressMax.ToString() + "files.");

                foreach (LeafPack.LeafFileInfo info in pak.Files.Values)
                {
                    String ext = Path.GetExtension(info.Name);

                    if (info.Type != LeafPack.LeNSFileType.ScenarioFile)
                    {
                        _processingTask = fileName + "@" + info.Name;
                        _progressValue++;

                        // �g���q���ƂɑΉ�����t�@�C���ւƃR���o�[�g����
                        if (info.Type == LeafPack.LeNSFileType.SpecialFile)
                        {
                            // ����t�@�C���ϊ�
                        }
                        else
                        {
                            switch (ext)
                            {
                                // �V�i���I�t�@�C���̓X�L�b�v
                                case ".SCN":
                                    break;
                                // �摜�t�@�C��(LFG)
                                case ".LFG":
                                    _processingTask += " -> " + conv_lfg.GetSaveName(info.Name);
                                    result = conv_lfg.Conv(info, pak.Get(info.Name));
                                    if (result == LeNSConvResult.warning)
                                    {
                                        outputLog(conv_lfg.Message, true);
                                    }

                                    break;
                                // �摜�t�@�C��(SDT)
                                case ".SDT":
                                    _processingTask += " -> " + conv_sdt.GetSaveName(info.Name);
                                    result = conv_sdt.Conv(info, pak.Get(info.Name));
                                    if (result == LeNSConvResult.warning)
                                    {
                                        outputLog(conv_sdt.Message, true);
                                    }

                                    break;
                                // �摜�t�@�C��(LF2)
                                case ".LF2":
                                    //outputLog(info.Name + ":�������쐬�ł�", true);
                                    _processingTask += " -> " + Path.GetFileNameWithoutExtension(info.Name) + ".PNG";
                                    break;
                                // �����t�@�C��
                                case ".P16":
                                    _processingTask += " -> " + conv_p16.GetSaveName(info.Name);
                                    result = conv_p16.Conv(info, pak.Get(info.Name));
                                    if (result == LeNSConvResult.warning) outputLog(conv_p16.Message, true);
                                    soundCache.Add(info.Name, info.PlayTime);

                                    // ������Đ����K�v�ȃt�@�C���𐶐�
                                    // �����ɏ�肢�������Ȃ��c�B
                                    switch (Option.conv)
                                    {
                                        case LeNSConvMode.MODE_KZ:
                                            switch(info.Name.ToUpper())
                                            {
                                                case "KZ_VD04.P16":
                                                    result = conv_p16.Conv(info, pak.Get(info.Name), 2);
                                                    if (result == LeNSConvResult.warning) outputLog(conv_p16.Message, true);
                                                    break;
                                                case "KZ_VD08.P16":
                                                    result = conv_p16.Conv(info, pak.Get(info.Name), 2);
                                                    if (result == LeNSConvResult.warning) outputLog(conv_p16.Message, true);
                                                    result = conv_p16.Conv(info, pak.Get(info.Name), 3);
                                                    if (result == LeNSConvResult.warning) outputLog(conv_p16.Message, true);
                                                    break;
                                                case "KZ_VD12.P16":
                                                    result = conv_p16.Conv(info, pak.Get(info.Name), 2);
                                                    if (result == LeNSConvResult.warning) outputLog(conv_p16.Message, true);
                                                    break;
                                                case "KZ_VD19.P16":
                                                    result = conv_p16.Conv(info, pak.Get(info.Name), 2);
                                                    if (result == LeNSConvResult.warning) outputLog(conv_p16.Message, true);
                                                    break;
                                            }
                                            break;
                                    }

                                    break;
                                // ����`
                                default:
                                    outputLog(info.Name + ":����`�t�@�C���`���̂��߃X�L�b�v����܂���", true);
                                    _processingTask += " : Undefined Type.";
                                    break;
                            }
                        }
                    }
                    else
                    {
                        _processingTask = "searching...";
                    }
                }
            }
            finally
            {
                pak.Close();
                _processingPack = "";
                _progressValue = 0;
                _progressMax = 0;
            }
        }