Beispiel #1
0
        protected override void LoadContent()
        {
            Batch = new SpriteBatch(GraphicsDevice);
            font  = Content.Load <SpriteFont>("Arial");
            view  = new Vector2(graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height);

            watch = Stopwatch.StartNew();
            GND.GraphicsDevice = GraphicsDevice;
            Gnd = new GND(@"C:\Dokumente und Einstellungen\Administrator\Desktop\alberta.gnd", @"D:\Spiele\Data Crap\Content_Texture\");
            Debug.WriteLine("GND.Read() needed " + watch.ElapsedMilliseconds + " ms");

            watch = Stopwatch.StartNew();
            Gnd.ExportTextureMap(@"C:\Dokumente und Einstellungen\Administrator\Desktop\alberta.bmp");
            Debug.WriteLine("GND.ExportTextureMap() needed " + watch.ElapsedMilliseconds + " ms");

            watch = Stopwatch.StartNew();
            Gat   = new GAT(@"C:\Dokumente und Einstellungen\Administrator\Desktop\alberta.gat");
            Debug.WriteLine("GAT.Read() needed " + watch.ElapsedMilliseconds + " ms");

            watch.Stop();

            timer          = new Timer(1000);
            timer.Elapsed += new ElapsedEventHandler(timer_tick);
            timer.Enabled  = true;
        }
Beispiel #2
0
        public IEnumerator Load(string mapname, Action <string, string, object> callback)
        {
            Progress = 0;

            RSW world    = LoadWorld(mapname, callback);
            GAT altitude = LoadAltitude(mapname, callback);
            GND ground   = LoadGround(mapname, world, callback);

            yield return(LoadModels(mapname, world.modelDescriptors, callback));
        }
Beispiel #3
0
        private GAT LoadAltitude(string mapname, Action <string, string, object> callback)
        {
            string gatPath  = "data/" + GetFilePath(WorldLoader.files.gat);
            GAT    altitude = FileManager.Load(gatPath) as GAT;

            if (altitude == null)
            {
                throw new Exception("Could not load gat for " + mapname);
            }

            Progress += 1;
            callback.Invoke(mapname, "MAP_ALTITUDE", altitude);

            return(altitude);
        }
Beispiel #4
0
    public Altitude(GAT gat)
    {
        this.gat = gat;

        init(gat);
    }
Beispiel #5
0
 private void init(GAT gat)
 {
     GenerateNodes();
     Core.PathFinding.LoadMap(this);
 }
Beispiel #6
0
    public Altitude(ROIO.Utils.MemoryStreamReader stream)
    {
        gat = AltitudeLoader.Load(stream);

        init(gat);
    }
Beispiel #7
0
 /// <summary>
 /// receive parsed gat
 /// </summary>
 /// <param name="gat"></param>
 private void OnAltitudeComplete(GAT gat)
 {
     altitudeCompleted = true;
     altitude          = new Altitude(gat);
 }
Beispiel #8
0
    public Altitude(BinaryReader stream)
    {
        gat = AltitudeLoader.Load(stream);

        init(gat);
    }
Beispiel #9
0
    public Altitude(GAT gat)
    {
        this.gat = gat;

        //TODO init pathfinding
    }
Beispiel #10
0
    public Altitude(BinaryReader stream)
    {
        gat = AltitudeLoader.Load(stream);

        //TODO init pathfinding
    }