bool SMDFile::LoadMap(FILE *fp, std::string & mapName, bool bLoadWarpsAndRegeneEvents) { m_MapName = mapName; LoadTerrain(fp); m_N3ShapeMgr->Create((m_nMapSize - 1)*m_fUnitDist, (m_nMapSize-1)*m_fUnitDist); if (!m_N3ShapeMgr->LoadCollisionData(fp) || (m_nMapSize - 1) * m_fUnitDist != m_N3ShapeMgr->Width() || (m_nMapSize - 1) * m_fUnitDist != m_N3ShapeMgr->Height()) return false; int mapwidth = (int)m_N3ShapeMgr->Width(); m_nXRegion = (int)(mapwidth / VIEW_DISTANCE) + 1; m_nZRegion = (int)(mapwidth / VIEW_DISTANCE) + 1; LoadObjectEvent(fp); LoadMapTile(fp); if (bLoadWarpsAndRegeneEvents) { LoadRegeneEvent(fp); LoadWarpList(fp); } return true; }
bool SMDFile::LoadMap(FILE *fp) { LoadTerrain(fp); m_N3ShapeMgr->Create((m_nMapSize - 1)*m_fUnitDist, (m_nMapSize-1)*m_fUnitDist); if (!m_N3ShapeMgr->LoadCollisionData(fp) || (m_nMapSize - 1) * m_fUnitDist != m_N3ShapeMgr->Width() || (m_nMapSize - 1) * m_fUnitDist != m_N3ShapeMgr->Height()) return false; int mapwidth = (int)m_N3ShapeMgr->Width(); m_nXRegion = (int)(mapwidth / VIEW_DISTANCE) + 1; m_nZRegion = (int)(mapwidth / VIEW_DISTANCE) + 1; LoadObjectEvent(fp); LoadMapTile(fp); #if defined(EBENEZER) LoadRegeneEvent(fp); LoadWarpList(fp); #endif return true; }