public ZoneConfiguration(string zoneId, int mapSize) { m_zoneId = zoneId; // Get expansion from zones.xml m_expansion = DataWrapper.GetExpansionByZone(zoneId); // Zone Directory m_zoneDirectory = this.GetZoneDirectory(); // Some mpk files m_datMpk = string.Format("{0}\\dat{1}.mpk", m_zoneDirectory, m_zoneId); m_cvsMpk = string.Format("{0}\\csv{1}.mpk", m_zoneDirectory, m_zoneId); m_lodMpk = string.Format("{0}\\lod{1}.mpk", m_zoneDirectory, m_zoneId); m_terMpk = string.Format("{0}\\ter{1}.mpk", m_zoneDirectory, m_zoneId); m_texMpk = string.Format("{0}\\tex{1}.mpk", m_zoneDirectory, m_zoneId); // Check if the zone gets its data from an other zone // Check if file exists, else map to datXXX.mpk if (!File.Exists(m_cvsMpk)) { m_cvsMpk = m_datMpk; } if (!File.Exists(m_lodMpk)) { m_lodMpk = m_datMpk; } if (!File.Exists(m_terMpk)) { m_terMpk = m_datMpk; } if (!File.Exists(m_texMpk)) { m_texMpk = m_datMpk; } // Useful for everything, so open it m_sectorDatStreamReader = MpkWrapper.GetFileFromMpk(m_datMpk, "sector.dat"); // for math m_targetMapSize = mapSize; m_mapScale = m_targetMapSize / 256.0; m_locsPerPixel = zoneMaxCoordinate / mapSize; m_locScale = m_targetMapSize / zoneMaxCoordinate; // Heightmap this.m_heightmap = new MapHeightmap(this); // Prepare river heights array m_riverHeights = new double[m_targetMapSize, m_targetMapSize]; }
public ZoneConfiguration(string zoneId, int mapSize) { m_zoneId = zoneId; // Get expansion from zones.xml m_expansion = DataWrapper.GetExpansionByZone(zoneId); // Zone Directory m_zoneDirectory = this.GetZoneDirectory(); // Some mpk files m_datMpk = string.Format("{0}\\dat{1}.mpk", m_zoneDirectory, m_zoneId); m_cvsMpk = string.Format("{0}\\csv{1}.mpk", m_zoneDirectory, m_zoneId); m_lodMpk = string.Format("{0}\\lod{1}.mpk", m_zoneDirectory, m_zoneId); m_terMpk = string.Format("{0}\\ter{1}.mpk", m_zoneDirectory, m_zoneId); m_texMpk = string.Format("{0}\\tex{1}.mpk", m_zoneDirectory, m_zoneId); // Check if the zone gets its data from an other zone // Check if file exists, else map to datXXX.mpk if (!File.Exists(m_cvsMpk)) m_cvsMpk = m_datMpk; if (!File.Exists(m_lodMpk)) m_lodMpk = m_datMpk; if (!File.Exists(m_terMpk)) m_terMpk = m_datMpk; if (!File.Exists(m_texMpk)) m_texMpk = m_datMpk; // Useful for everything, so open it m_sectorDatStreamReader = MpkWrapper.GetFileFromMpk(m_datMpk, "sector.dat"); // for math m_targetMapSize = mapSize; m_mapScale = m_targetMapSize / 256.0; m_locsPerPixel = zoneMaxCoordinate / mapSize; m_locScale = m_targetMapSize / zoneMaxCoordinate; // Heightmap this.m_heightmap = new MapHeightmap(this); // Prepare river heights array m_riverHeights = new double[m_targetMapSize, m_targetMapSize]; }