/// <summary>
        /// Creates info classes for a structure BSP
        /// </summary>
        void GenerateInfoListBsp()
        {
            string bsp_name = Path.GetFileNameWithoutExtension(tagManager.Name);

            int vertex_count, triangle_count;

            BSPInfoInternal bsp_info_internal;

            // create an info object representing the render mesh
            vertex_count   = BSP.GetVertexCount(tagManager, BSPObjectType.RenderMesh);
            triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.RenderMesh);

            bsp_info_internal = new BSPInfoInternal();
            bsp_info_internal.SetType(BSPObjectType.RenderMesh);
            BSP.AddShaderDatums(bsp_info_internal, tagManager);
            internalInfoList.Add(bsp_info_internal);

            Add(new ColladaHalo1BSPInfo(internalInfoList.Count - 1,
                                        bsp_name,
                                        vertex_count,
                                        triangle_count,
                                        BSPObjectType.RenderMesh));

            // create an info object representing the portals mesh
            vertex_count   = BSP.GetVertexCount(tagManager, BSPObjectType.Portals);
            triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.Portals);

            if ((vertex_count > 0) && (triangle_count > 0))
            {
                bsp_info_internal = new BSPInfoInternal();
                bsp_info_internal.SetType(BSPObjectType.Portals);
                internalInfoList.Add(bsp_info_internal);

                Add(new ColladaHalo1BSPInfo(internalInfoList.Count - 1,
                                            bsp_name,
                                            vertex_count,
                                            triangle_count,
                                            BSPObjectType.Portals));
            }

            // create an info object representing the fogplane mesh
            vertex_count   = BSP.GetVertexCount(tagManager, BSPObjectType.FogPlanes);
            triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.FogPlanes);

            if ((vertex_count > 0) && (triangle_count > 0))
            {
                bsp_info_internal = new BSPInfoInternal();
                bsp_info_internal.SetType(BSPObjectType.FogPlanes);
                internalInfoList.Add(bsp_info_internal);

                Add(new ColladaHalo1BSPInfo(internalInfoList.Count - 1,
                                            bsp_name,
                                            vertex_count,
                                            triangle_count,
                                            BSPObjectType.FogPlanes));
            }
        }
        /// <summary>
        /// Creates info classes for a structure lightmap
        /// </summary>
        void GenerateInfoListBSP()
        {
            string name = Path.GetFileNameWithoutExtension(tagManager.Name);

            int vertex_count, triangle_count;

            BSPInfoInternal info_internal;

            vertex_count   = BSP.GetVertexCount(tagManager, BSPObjectType.RenderMesh);
            triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.RenderMesh);

            if ((vertex_count > 0) && (triangle_count > 0))
            {
                info_internal = new BSPInfoInternal();
                info_internal.SetType(BSPObjectType.RenderMesh);

                BSP.AddShaderDatums(info_internal, tagManager);

                internalInfoList.Add(info_internal);

                Add(new ColladaHalo2BSPInfo(internalInfoList.Count - 1,
                                            name,
                                            vertex_count,
                                            triangle_count,
                                            BSPObjectType.RenderMesh));
            }

            vertex_count   = BSP.GetVertexCount(tagManager, BSPObjectType.Portals);
            triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.Portals);

            if ((vertex_count > 0) && (triangle_count > 0))
            {
                info_internal = new BSPInfoInternal();
                info_internal.SetType(BSPObjectType.Portals);

                internalInfoList.Add(info_internal);

                Add(new ColladaHalo2BSPInfo(internalInfoList.Count - 1,
                                            name,
                                            vertex_count,
                                            triangle_count,
                                            BSPObjectType.Portals));
            }
        }
        void ExportBSP(string file_name)
        {
            BSPInfoInternal bsp_info = new BSPInfoInternal();

            BSPObjectType bsp_type = BSPObjectType.None;

            // create an info object with all of the registered infos combined
            foreach (int index in registeredInfos)
            {
                BSPInfoInternal info = internalInfoList[index] as BSPInfoInternal;

                if (info.IncludeRenderMesh())
                {
                    bsp_type |= BSPObjectType.RenderMesh;
                }
                if (info.IncludePortalsMesh())
                {
                    bsp_type |= BSPObjectType.Portals;
                }
                if (info.IncludeFogPlanesMesh())
                {
                    bsp_type |= BSPObjectType.FogPlanes;
                }

                for (int i = 0; i < info.GetShaderCount(); i++)
                {
                    bsp_info.AddShaderDatum(info.GetShaderDatum(i), info.GetShaderName(i));
                }
            }

            bsp_info.SetType(bsp_type);

            ColladaExportArgs arguments = new ColladaExportArgs(Overwrite, RelativeFilePath, BitmapFormat);
            var exporter = new Halo1.ColladaBSPExporter(arguments, bsp_info, tagIndex, tagManager);

            ExportSave(exporter, RelativeFilePath + file_name + ".dae");
        }
Пример #4
0
		void ExportBSP(string file_name)
		{
			BSPInfoInternal bsp_info = new BSPInfoInternal();

			BSPObjectType bsp_type = BSPObjectType.None;

			// create an info object with all of the registered infos combined
			foreach (int index in registeredInfos)
			{
				BSPInfoInternal info = internalInfoList[index] as BSPInfoInternal;

				if (info.IncludeRenderMesh()) { bsp_type |= BSPObjectType.RenderMesh; }
				if (info.IncludePortalsMesh()) { bsp_type |= BSPObjectType.Portals; }
				if (info.IncludeFogPlanesMesh()) { bsp_type |= BSPObjectType.FogPlanes; }

				for (int i = 0; i < info.GetShaderCount(); i++)
					bsp_info.AddShaderDatum(info.GetShaderDatum(i), info.GetShaderName(i));
			}

			bsp_info.SetType(bsp_type);

			ColladaExportArgs arguments = new ColladaExportArgs(Overwrite, RelativeFilePath, BitmapFormat);
			var exporter = new Halo1.ColladaBSPExporter(arguments, bsp_info, tagIndex, tagManager);

			ExportSave(exporter, RelativeFilePath + file_name + ".dae");
		}
Пример #5
0
		/// <summary>
		/// Creates info classes for a structure BSP
		/// </summary>
		void GenerateInfoListBsp()
		{
			string bsp_name = Path.GetFileNameWithoutExtension(tagManager.Name);

			int vertex_count, triangle_count;

			BSPInfoInternal bsp_info_internal;

			// create an info object representing the render mesh
			vertex_count = BSP.GetVertexCount(tagManager, BSPObjectType.RenderMesh);
			triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.RenderMesh);

			bsp_info_internal = new BSPInfoInternal();
			bsp_info_internal.SetType(BSPObjectType.RenderMesh);
			BSP.AddShaderDatums(bsp_info_internal, tagManager);
			internalInfoList.Add(bsp_info_internal);

			Add(new ColladaHalo1BSPInfo(internalInfoList.Count - 1,
				bsp_name,
				vertex_count,
				triangle_count,
				BSPObjectType.RenderMesh));

			// create an info object representing the portals mesh
			vertex_count = BSP.GetVertexCount(tagManager, BSPObjectType.Portals);
			triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.Portals);

			if ((vertex_count > 0) && (triangle_count > 0))
			{
				bsp_info_internal = new BSPInfoInternal();
				bsp_info_internal.SetType(BSPObjectType.Portals);
				internalInfoList.Add(bsp_info_internal);

				Add(new ColladaHalo1BSPInfo(internalInfoList.Count - 1,
					bsp_name,
					vertex_count,
					triangle_count,
					BSPObjectType.Portals));
			}

			// create an info object representing the fogplane mesh
			vertex_count = BSP.GetVertexCount(tagManager, BSPObjectType.FogPlanes);
			triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.FogPlanes);

			if ((vertex_count > 0) && (triangle_count > 0))
			{
				bsp_info_internal = new BSPInfoInternal();
				bsp_info_internal.SetType(BSPObjectType.FogPlanes);
				internalInfoList.Add(bsp_info_internal);

				Add(new ColladaHalo1BSPInfo(internalInfoList.Count - 1,
					bsp_name,
					vertex_count,
					triangle_count,
					BSPObjectType.FogPlanes));
			}
		}
Пример #6
0
		/// <summary>
		/// Creates info classes for a structure lightmap
		/// </summary>
		void GenerateInfoListBSP()
		{
			string name = Path.GetFileNameWithoutExtension(tagManager.Name);

			int vertex_count, triangle_count;

			BSPInfoInternal info_internal;

			vertex_count = BSP.GetVertexCount(tagManager, BSPObjectType.RenderMesh);
			triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.RenderMesh);

			if ((vertex_count > 0) && (triangle_count > 0))
			{
				info_internal = new BSPInfoInternal();
				info_internal.SetType(BSPObjectType.RenderMesh);

				BSP.AddShaderDatums(info_internal, tagManager);

				internalInfoList.Add(info_internal);

				Add(new ColladaHalo2BSPInfo(internalInfoList.Count - 1,
					name,
					vertex_count,
					triangle_count,
					BSPObjectType.RenderMesh));
			}

			vertex_count = BSP.GetVertexCount(tagManager, BSPObjectType.Portals);
			triangle_count = BSP.GetTriangleCount(tagManager, BSPObjectType.Portals);

			if ((vertex_count > 0) && (triangle_count > 0))
			{
				info_internal = new BSPInfoInternal();
				info_internal.SetType(BSPObjectType.Portals);

				internalInfoList.Add(info_internal);

				Add(new ColladaHalo2BSPInfo(internalInfoList.Count - 1,
					name,
					vertex_count,
					triangle_count,
					BSPObjectType.Portals));
			}
		}