Beispiel #1
0
        void OnProgress(object sender, EventArgs ea)
        {
            ProgressEventArgs pea = ea as ProgressEventArgs;

            if (pea != null)
            {
                mOutForm.UpdateProgress(pea.mMin, pea.mMax, pea.mCurrent);
            }
        }
Beispiel #2
0
        internal LightData(BinaryReader br, Map map, SharedForms.Output outForm)
        {
            mNumSamples = br.ReadInt32();
            int numFaces = br.ReadInt32();

            mLightPoints = new Vector3[numFaces][];
            mInSolid     = new bool[numFaces][];
            mPlanes      = new GFXPlane[numFaces];
            mFInfos      = new FInfo[numFaces];

            outForm.Print("Reading " + numFaces + " faces...\n");
            outForm.UpdateProgress(0, numFaces, 0);

            int numPointsTotal = 0;

            for (int i = 0; i < numFaces; i++)
            {
                int numPoints = br.ReadInt32();

                mLightPoints[i] = new Vector3[numPoints];
                mInSolid[i]     = new bool[numPoints];

                for (int j = 0; j < numPoints; j++)
                {
                    mLightPoints[i][j] = FileUtil.ReadVector3(br);
                    mInSolid[i][j]     = map.IsPointInSolidSpace(mLightPoints[i][j]);
                    numPointsTotal++;
                }

                mPlanes[i] = new GFXPlane();
                mPlanes[i].Read(br);

                bool bFInfo = br.ReadBoolean();
                if (bFInfo)
                {
                    mFInfos[i] = new FInfo();
                    mFInfos[i].ReadVecs(br);
                }
                outForm.UpdateProgress(0, numFaces, i);
            }

            outForm.UpdateProgress(0, numFaces, 0);
            outForm.Print("Read " + numPointsTotal + " total points.\n");
        }