Exemplo n.º 1
0
        public void init()
        {
            TerrainGlobals.getLODVB().getLODVB(ref mVB, ref mNumVerts, 0);
            mNumPrims = (uint)((mNumVerts) / 3);

            mPositionsTexture = TerrainGlobals.getTerrain().giveEntireTerrainInTexture();

            loadShader();
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            Xceed.Zip.Licenser.LicenseKey = "ZIN23-BUSZZ-NND31-7WBA";

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("======Networked AO Gen client V" + cVersion + "=========");
            Console.ForegroundColor = ConsoleColor.White;



            if (!networkAOInterface.networkAccessAvailable())
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("ERROR : access to esfile\\phoenix not available");
                Console.ForegroundColor = ConsoleColor.White;
                return;
            }


            TerrainGlobals.mGameDir = computeGameDir();


            //create D3D as a static function
            PictureBox dumControl = new PictureBox();

            if (!BRenderDevice.createDevice(/*this*/ dumControl, 512, 512, false))
            {
                return;
            }

            TerrainGlobals.getLODVB().init();


            Console.WriteLine("Polling for work");

            //CLM General TRY-CATCH block here to grab anything else I've missed
            try
            {
                while (mStayAlive)
                {
                    pollManagerForAvailableJobs();
                    Thread.Sleep(1000);
                }
            }catch (Exception e)
            {
                //we've died somewhere. Write a crashlog with the exception and time.
                if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "crashlogs"))
                {
                    Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "crashlogs");
                }

                string       errorLogName = AppDomain.CurrentDomain.BaseDirectory + "crashlogs\\" + Guid.NewGuid().ToString() + ".txt";
                StreamWriter w            = new StreamWriter(errorLogName, true);
                w.WriteLine(DateTime.Now.ToString());
                w.WriteLine(e.ToString());
                w.Close();

                //send an e-mail to COLT MCANLIS
                sendCrashEmail(errorLogName);

                //now, respawn our app
                Process proc = new Process();
                proc.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory + "DistributedLightingClient.exe";
                proc.Start();

                // proc.WaitForExit(60000);
            }

            //another try block here, incase we can't shutdown..
            try
            {
                TerrainGlobals.getLODVB().destroy();
                BRenderDevice.destroyDevice();
            }catch (Exception e)
            {
            }
        }