Example #1
0
        void OnOpenGBSP(object sender, EventArgs ea)
        {
            string fileName = sender as string;

            if (fileName == null || fileName == "")
            {
                mOForm.Print("Bad filename\n");
                return;
            }

            mMap = new Map();

            mMap.LoadGBSPFile(fileName);

            List <Vector3> verts = new List <Vector3>();
            List <UInt16>  inds  = new List <UInt16>();
            List <Vector3> norms = new List <Vector3>();
            List <Color>   cols  = new List <Color>();

            mMap.GetTriangles(verts, norms, cols, inds, Map.DebugDrawChoice.GFXFaces);

            if (mDBDraw == null)
            {
                mDBDraw = new DebugDraw(mGD, mSK);
            }
            else
            {
                mDBDraw.FreeAll();
            }

            mDBDraw.MakeDrawStuff(mGD.GD, verts, norms, cols, inds);

            string expFile = FileUtil.StripExtension(fileName);

            expFile += ".LightExplore";

            FileStream fs = new FileStream(expFile, FileMode.Open, FileAccess.Read);

            if (fs == null)
            {
                mOForm.Print("Couldn't find light explore file: " + expFile + "\n");
                return;
            }

            BinaryReader br = new BinaryReader(fs);

            if (br == null)
            {
                fs.Close();
                mOForm.Print("Couldn't open light explore file: " + expFile + "\n");
                return;
            }

            mLD = new LightData(br, mMap, mOForm);

            mOForm.Print(expFile + " loaded...\n");

            br.Close();
            fs.Close();

            if (mDS == null)
            {
                mDS = new DrawStuff(mGD, mSK);
            }

            BuildFaceDrawData();

            mEForm.DataLoaded(expFile);

            mOForm.Print("\nUse PageUp / PageDown to change face index.\n");
            mOForm.Print("Hold shift to fly faster and skip faces by 100s.\n");
            mOForm.Print("E will snap the face index to the aimed at face.");
        }
Example #2
0
        internal void MakeDrawStuff(GraphicsDevice gd, DrawStuff ds, int index)
        {
            Debug.Assert(index >= 0 && index < mLightPoints.Length);

            ds.MakeDrawStuff(gd.GD, mLightPoints[index], mInSolid[index], mPlanes[index], mNumSamples);
        }