Пример #1
0
		/*** Functions for loading/checking the different pub/map files ***/

		//tries to load the map that MainPlayer.ActiveCharacter is hanging out on
		private bool _tryLoadMap(int mapID, bool forceReload)
		{
			try
			{
				if (mapID < 0)
					mapID = MainPlayer.ActiveCharacter.CurrentMap;

				string mapFile = Path.Combine("maps", string.Format("{0,5:D5}.emf", mapID));

				if(!MapCache.ContainsKey(mapID))
					MapCache.Add(mapID, new MapFile(mapFile));
				else if(forceReload)
					MapCache[mapID] = new MapFile(mapFile);

				//map renderer construction moved to be more closely coupled to loading of the map
				if (m_mapRender == null)
					m_mapRender = new MapRenderer(EOGame.Instance, m_api);
			}
			catch
			{
				return false;
			}

			return true;
		}
Пример #2
0
		public void ResetGameElements()
		{
			if (m_mapRender != null)
			{
				m_mapRender.Dispose();
				m_mapRender = null;
			}

			if (m_charRender != null)
			{
				m_charRender.Dispose();
				m_charRender = null;
			}

			if(MapCache != null) MapCache.Clear();
		}
Пример #3
0
		public MiniMapRenderer(MapRenderer parentRenderer)
		{
			Map = parentRenderer.MapRef;
			_spriteBatch = new SpriteBatch(EOGame.Instance.GraphicsDevice);
			_parentRenderer = parentRenderer;
		}