void OnGBSPSaveDone(object sender, EventArgs ea) { bool bSuccess = (bool)sender; mZoneForm.EnableFileIO(true); mBSPForm.EnableFileIO(true); mVisForm.EnableFileIO(true); mbWorking = false; if (bSuccess) { if (mbFullBuilding) { if (mBSPForm.BSPParameters.mbBuildAsBModel) { OnLight(mFullBuildFileName + ".gbsp", null); } else { OnVis(mFullBuildFileName + ".gbsp", null); } } } else { CoreEvents.Print("Halting full build due to a gbsp save failure.\n"); mbFullBuilding = false; } }
void OnVerbose(object sender, EventArgs e) { if (VerboseBSP.Checked) { CoreEvents.Print("Note that verbosity can adversely affect performance, especially in vis.\n"); } }
void OnLightDone(object sender, EventArgs ea) { bool bSuccess = (bool)sender; mZoneForm.EnableFileIO(true); mBSPForm.EnableFileIO(true); mVisForm.EnableFileIO(true); mbWorking = false; if (bSuccess) { if (mbFullBuilding) { mbWorking = true; OnMaterialVis(mFullBuildFileName + ".gbsp", null); OnZoneGBSP(mFullBuildFileName + ".gbsp", null); mbFullBuilding = false; mbWorking = false; } } else { CoreEvents.Print("Halting full build due to a light failure.\n"); mbFullBuilding = false; } }
void OnBuildDone(object sender, EventArgs ea) { bool bSuccess = (bool)sender; mBSPForm.SetSaveEnabled(true); mBSPForm.SetBuildEnabled(false); mZoneForm.EnableFileIO(true); mBSPForm.EnableFileIO(true); mVisForm.EnableFileIO(true); mbWorking = false; if (bSuccess) { if (mbFullBuilding) { OnSaveGBSP(mFullBuildFileName + ".gbsp", null); } else { } } else { CoreEvents.Print("Halting full build due to a bsp build failure.\n"); mbFullBuilding = false; } }
void OnDumpTextures(object sender, EventArgs e) { mAllTextures.Sort(); foreach (string tex in mAllTextures) { CoreEvents.Print("\t" + tex + "\n"); } }
void OnSaveGBSP(object sender, EventArgs e) { mSFD.DefaultExt = "*.gbsp"; mSFD.Filter = "GBSP files (*.gbsp)|*.gbsp|All files (*.*)|*.*"; DialogResult dr = mSFD.ShowDialog(); if (dr == DialogResult.Cancel) { return; } CoreEvents.Print("Saving gbsp " + mSFD.FileName + "\n"); Misc.SafeInvoke(eSave, mSFD.FileName); }
void OnOpenMap(object sender, EventArgs e) { mOFD.DefaultExt = "*.map"; mOFD.Filter = "QuArK map files (*.map)|*.map|All files (*.*)|*.*"; DialogResult dr = mOFD.ShowDialog(); if (dr == DialogResult.Cancel) { return; } CoreEvents.Print("Opening map " + mOFD.FileName + "\n"); CoreEvents.Print("Map is a " + BSPParameters.mMapType + " map.\n"); Misc.SafeInvoke(eOpenMap, mOFD.FileName); }
void OnOpenGBSP(object sender, EventArgs e) { mOFD.DefaultExt = "*.gbsp"; mOFD.Filter = "GBSP files (*.gbsp)|*.gbsp|All files (*.*)|*.*"; DialogResult dr = mOFD.ShowDialog(); if (dr == DialogResult.Cancel) { return; } CoreEvents.Print("Exploring gbsp " + mOFD.FileName + "\n"); Misc.SafeInvoke(eOpenGBSP, mOFD.FileName); GBSPFileName.Text = FileUtil.StripPath(mOFD.FileName); }
void OnVisDone(object sender, EventArgs ea) { bool bSuccess = (bool)sender; mOutForm.UpdateProgress(0, 0, 0); mbWorking = false; mZoneForm.EnableFileIO(true); mBSPForm.EnableFileIO(true); mVisForm.EnableFileIO(true); if (bSuccess) { if (mbFullBuilding) { OnLight(mFullBuildFileName + ".gbsp", null); } } else { CoreEvents.Print("Halting full build due to a vis failure.\n"); mbFullBuilding = false; } }
void OnZoneGBSP(object sender, EventArgs ea) { string fileName = sender as string; if (fileName != null) { Action <System.Windows.Forms.Form> setText = frm => frm.Text = fileName; SharedForms.FormExtensions.Invoke(mZoneForm, setText); mZoneForm.EnableFileIO(false); mBSPForm.EnableFileIO(false); mVisForm.EnableFileIO(false); mMap = new Map(); GFXHeader hdr = mMap.LoadGBSPFile(fileName); if (hdr == null) { CoreEvents.Print("Load failed\n"); } else { mVisMap = new VisMap(); mVisMap.SetMap(mMap); mVisMap.LoadVisData(fileName); mMatLib.NukeAllMaterials(); mMap.MakeMaterials(mGD, mMatLib, fileName); bool bPerPlaneAlpha = false; mZoneDraw.BuildLM(mGD, mSKeeper, mZoneForm.GetLightAtlasSize(), mMap.BuildLMRenderData, mMap.GetPlanes(), bPerPlaneAlpha); mZoneDraw.BuildVLit(mGD, mSKeeper, mMap.BuildVLitRenderData, mMap.GetPlanes()); mZoneDraw.BuildAlpha(mGD, mSKeeper, mMap.BuildAlphaRenderData, mMap.GetPlanes()); mZoneDraw.BuildFullBright(mGD, mSKeeper, mMap.BuildFullBrightRenderData, mMap.GetPlanes()); mZoneDraw.BuildMirror(mGD, mSKeeper, mMap.BuildMirrorRenderData, mMap.GetPlanes()); mZoneDraw.BuildSky(mGD, mSKeeper, mMap.BuildSkyRenderData, mMap.GetPlanes()); mZoneDraw.FinishAtlas(mGD, mSKeeper); mZoneDraw.FixAlphaDrawCalls(); mModelMats = mMap.GetModelTransforms(); mMatForm.RefreshMaterials(); HideParametersByMaterial(); mVisMap.SetMaterialVisBytes(mMatLib.GetMaterialNames().Count); mMatLib.SetLightMapsToAtlas(); } mZoneForm.EnableFileIO(true); mBSPForm.EnableFileIO(true); mVisForm.EnableFileIO(true); mZoneForm.SetZoneSaveEnabled(true); mOutForm.Print("Zoning complete.\n"); // BuildDebugDraw(Map.DebugDrawChoice.GFXFaces); } }