2015-08-17 22:05:00 +00:00
|
|
|
#include "CMapWorldInfo.hpp"
|
2016-09-30 22:43:19 +00:00
|
|
|
#include "GameGlobalObjects.hpp"
|
|
|
|
#include "CMemoryCardSys.hpp"
|
2015-08-17 22:05:00 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-17 22:05:00 +00:00
|
|
|
{
|
|
|
|
|
2016-09-25 01:58:20 +00:00
|
|
|
CMapWorldInfo::CMapWorldInfo(CBitStreamReader& reader, const CSaveWorld& saveWorld, ResId mlvlId)
|
|
|
|
{
|
|
|
|
/* TODO: implement */
|
2016-09-30 22:43:19 +00:00
|
|
|
|
|
|
|
const auto& memWorlds = g_MemoryCardSys->GetMemoryWorlds();
|
|
|
|
auto saveWorldMem = std::find_if(memWorlds.cbegin(), memWorlds.cend(),
|
|
|
|
[&](const auto& test) -> bool { return test.first == mlvlId; });
|
|
|
|
|
|
|
|
if (saveWorldMem != memWorlds.cend())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-09-25 01:58:20 +00:00
|
|
|
}
|
|
|
|
|
2017-01-07 01:58:05 +00:00
|
|
|
void CMapWorldInfo::PutTo(CBitStreamWriter& writer, const CSaveWorld& savw, ResId mlvlId) const
|
2016-10-09 21:41:23 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-04-22 20:22:45 +00:00
|
|
|
void CMapWorldInfo::SetDoorVisited(TEditorId eid, bool visited)
|
|
|
|
{
|
|
|
|
x14_[eid] = visited;
|
|
|
|
}
|
|
|
|
|
2016-08-14 03:00:58 +00:00
|
|
|
bool CMapWorldInfo::IsAreaVisted(TAreaId aid)
|
|
|
|
{
|
|
|
|
x4_visitedAreas.resize((aid + 31) / 32);
|
|
|
|
return (x4_visitedAreas[aid / 32] >> (aid % 32)) & 0x1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMapWorldInfo::SetAreaVisited(TAreaId aid, bool visited)
|
|
|
|
{
|
|
|
|
x4_visitedAreas.resize((aid + 31) / 32);
|
|
|
|
if (visited)
|
|
|
|
x4_visitedAreas[aid / 32] |= 1 << (aid % 32);
|
|
|
|
else
|
|
|
|
x4_visitedAreas[aid / 32] &= ~(1 << (aid % 32));
|
|
|
|
}
|
|
|
|
|
2015-08-17 22:05:00 +00:00
|
|
|
}
|