Files
metin2-client/src/port/GameLib/MapBase.cpp
T
shenleiandClaude Opus 5.5 a46093104c layout: restructure into src/ tests/ android/ scripts/ tools/
- extension/src/{port,platform,codepage} -> src/; native_render -> src/host
  (+ dxt, shaders/); libgr2 -> src/gr2; extension/third_party -> third_party
- extension/tests -> tests/port, libgr2/tests -> tests/gr2
- android-native -> android (build.sh, push-client.sh moved in)
- script -> scripts; tools/40250 -> tools/server; oracle -> tools/granny-oracle;
  perf tools -> tools/perf
- all build trees under build/ (native, release, android, port-gate)
- xrender:: CMake aliases -> mt::; port-map ledger impl paths rewritten

No code changes. ctest 15/15, port_gate macos+android PASS, port_map check 0 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:08:19 +09:00

101 lines
2.6 KiB
C++

#include "StdAfx.h"
#include "MapBase.h"
CMapBase::CMapBase()
{
Clear();
}
CMapBase::~CMapBase()
{
Clear();
}
void CMapBase::Clear()
{
m_strName = "";
m_eType = MAPTYPE_INVALID;
mc_pEnvironmentData = NULL;
Leave();
}
bool CMapBase::Enter()
{
m_bReady = true;
return true;
}
bool CMapBase::Leave()
{
m_bReady = false;
return true;
}
void CMapBase::SetEnvironmentDataPtr(const TEnvironmentData * c_pEnvironmentData)
{
mc_pEnvironmentData = c_pEnvironmentData;
OnSetEnvironmentDataPtr();
}
void CMapBase::ResetEnvironmentDataPtr(const TEnvironmentData * c_pEnvironmentData)
{
mc_pEnvironmentData = c_pEnvironmentData;
OnResetEnvironmentDataPtr();
}
void CMapBase::Render()
{
if (IsReady())
OnRender();
}
bool CMapBase::LoadProperty()
{
std::string strFileName = GetName() + "\\MapProperty.txt";
CTokenVectorMap stTokenVectorMap;
if (!LoadMultipleTextData(strFileName.c_str(), stTokenVectorMap))
{
TraceError("CMapBase::LoadProperty(FileName=%s) - LoadMultipleTextData ERROR \306\304\300\317\300\314 \276\370\300\273 \260\241\264\311\274\272\300\314 \270\271\275\300\264\317\264\331.", strFileName.c_str());
return false;
}
if (stTokenVectorMap.end() == stTokenVectorMap.find("scripttype"))
{
TraceError("CMapBase::LoadProperty(FileName=%s) - FIND 'scripttype' - FAILED", strFileName.c_str());
return false;
}
if (stTokenVectorMap.end() == stTokenVectorMap.find("maptype"))
{
TraceError("CMapBase::LoadProperty(FileName=%s) - FIND 'maptype' - FAILED", strFileName.c_str());
return false;
}
// NOTE: 이미 존재하는 맵 데이터와 동일한 데이터를 사용하는 맵을 새로 추가할 때, 맵 배포 용량을 줄이기 위한 작업.
// MapProperty.txt 파일에 ParentMapName 값이 설정되어 있다면, 실제 모든 데이터는 ParentMap에서 읽어온다.
// 데이터의 부분공유(부분 오버라이트?) 기능은 필요 없대서, Parent Map에서 모든 데이터를 읽어옴.
if (stTokenVectorMap.end() != stTokenVectorMap.find("parentmapname"))
{
m_strParentMapName = stTokenVectorMap["parentmapname"][0];
}
const std::string & c_rstrType = stTokenVectorMap["scripttype"][0];
const std::string & c_rstrMapType = stTokenVectorMap["maptype"][0];
if (0 != c_rstrType.compare("MapProperty"))
{
TraceError("CMapBase::LoadProperty(FileName=%s) - Resourse Type ERROR", strFileName.c_str());
return false;
}
if (0 == c_rstrMapType.compare("Indoor"))
SetType(MAPTYPE_INDOOR);
else if (0 == c_rstrMapType.compare("Outdoor"))
SetType(MAPTYPE_OUTDOOR);
else if (0 == c_rstrMapType.compare("Invalid"))
SetType(MAPTYPE_OUTDOOR);
return true;
}