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; }
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)); }
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); }
public Altitude(GAT gat) { this.gat = gat; init(gat); }
private void init(GAT gat) { GenerateNodes(); Core.PathFinding.LoadMap(this); }
public Altitude(ROIO.Utils.MemoryStreamReader stream) { gat = AltitudeLoader.Load(stream); init(gat); }
/// <summary> /// receive parsed gat /// </summary> /// <param name="gat"></param> private void OnAltitudeComplete(GAT gat) { altitudeCompleted = true; altitude = new Altitude(gat); }
public Altitude(BinaryReader stream) { gat = AltitudeLoader.Load(stream); init(gat); }
public Altitude(GAT gat) { this.gat = gat; //TODO init pathfinding }
public Altitude(BinaryReader stream) { gat = AltitudeLoader.Load(stream); //TODO init pathfinding }