private PMDFormat.EnglishHeader ReadEnglishHeader()
    {
        PMDFormat.EnglishHeader result = new PMDFormat.EnglishHeader();
        result.english_name_compatibility = binary_reader_.ReadByte();

        if (result.english_name_compatibility != 0)
        {
            // 英語名対応あり
            result.model_name_eg = ConvertByteToString(binary_reader_.ReadBytes(20), "");
            result.comment_eg    = ConvertByteToString(binary_reader_.ReadBytes(256), System.Environment.NewLine);
        }
        return(result);
    }
    private static PMXFormat.Header ConvertHeader(PMDFormat.Header pmd_header, PMDFormat.EnglishHeader pmd_english_header, PMDFormat pmd)
    {
        PMXFormat.Header result = new PMXFormat.Header();
        result.magic   = pmd_header.magic;
        result.version = pmd_header.version;

        result.dataSize           = 0;
        result.encodeMethod       = PMXFormat.Header.StringCode.Utf16le;
        result.additionalUV       = 0;
        result.vertexIndexSize    = PMXFormat.Header.IndexSize.Byte1;
        result.textureIndexSize   = PMXFormat.Header.IndexSize.Byte1;
        result.materialIndexSize  = PMXFormat.Header.IndexSize.Byte1;
        result.boneIndexSize      = PMXFormat.Header.IndexSize.Byte1;
        result.morphIndexSize     = PMXFormat.Header.IndexSize.Byte1;
        result.rigidbodyIndexSize = PMXFormat.Header.IndexSize.Byte1;
        if (null != pmd)
        {
            result.vertexIndexSize    = GetIndexSize(pmd.vertex_list.vertex.Length);
            result.textureIndexSize   = GetIndexSize(pmd.toon_texture_list.toon_texture_file.Length);
            result.materialIndexSize  = GetIndexSize(pmd.material_list.material.Length);
            result.boneIndexSize      = GetIndexSize(pmd.bone_list.bone.Length);
            result.morphIndexSize     = GetIndexSize(pmd.skin_list.skin_data.Length);
            result.rigidbodyIndexSize = GetIndexSize(pmd.rigidbody_list.rigidbody.Length);
        }

        result.model_name         = pmd_header.model_name;
        result.comment            = pmd_header.comment;
        result.model_english_name = "";
        result.english_comment    = "";
        if (null != pmd_english_header)
        {
            result.model_english_name = pmd_english_header.model_name_eg;
            result.english_comment    = pmd_english_header.comment_eg;
        }
        else if (null != pmd)
        {
            result.model_english_name = pmd.eg_head.model_name_eg;
            result.english_comment    = pmd.eg_head.comment_eg;
        }
        return(result);
    }
Exemplo n.º 3
0
	private PMDFormat.EnglishHeader ReadEnglishHeader() {
		PMDFormat.EnglishHeader result = new PMDFormat.EnglishHeader();
		result.english_name_compatibility = binary_reader_.ReadByte();
		
		if (result.english_name_compatibility != 0) {
			// 英語名対応あり
			result.model_name_eg = ConvertByteToString(binary_reader_.ReadBytes(20), "");
			result.comment_eg = ConvertByteToString(binary_reader_.ReadBytes(256), System.Environment.NewLine);
		}
		return result;
	}