This commit is contained in:
Jack Andersen 2017-02-08 23:23:59 -10:00
commit c806f4a612
6 changed files with 55 additions and 19 deletions

View File

@ -20,13 +20,10 @@ bool MLVL::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
MLVL mlvl; MLVL mlvl;
mlvl.read(rs); mlvl.read(rs);
const nod::Node* node; const nod::Node* node;
const typename PAKRouter<PAKBridge>::EntryType* texEntry = pakRouter.lookupEntry(mlvl.saveWorldId, &node); const typename PAKRouter<PAKBridge>::EntryType* savwEntry = pakRouter.lookupEntry(mlvl.saveWorldId, &node);
hecl::ProjectPath savwPath = pakRouter.getWorking(texEntry);
SAVW savw; SAVW savw;
if (!savwPath.isNone())
{ {
savwPath.makeDirChain(false); PAKEntryReadStream rs = savwEntry->beginReadStream(*node);
PAKEntryReadStream rs = texEntry->beginReadStream(*node);
savw.read(rs); savw.read(rs);
} }

View File

@ -165,7 +165,12 @@ bool CMemoryCardSys::InitializePump()
} }
if (done) if (done)
{
std::sort(x20_scanStates.begin(), x20_scanStates.end(), [&](const auto& a, const auto& b) ->bool{
return g_ResFactory->TranslateNewToOriginal(a.first) < g_ResFactory->TranslateNewToOriginal(b.first);
});
x1c_worldInter = std::experimental::nullopt; x1c_worldInter = std::experimental::nullopt;
}
return false; return false;
} }

View File

@ -203,8 +203,8 @@ CPlayerState::EPlayerSuit CPlayerState::GetCurrentSuit() const
bool CPlayerState::CanVisorSeeFog(const CStateManager& stateMgr) const bool CPlayerState::CanVisorSeeFog(const CStateManager& stateMgr) const
{ {
u32 activeVisor = u32(GetActiveVisor(stateMgr)); EPlayerVisor activeVisor = GetActiveVisor(stateMgr);
if (activeVisor == 0 || activeVisor == 2) if (activeVisor == EPlayerVisor::Combat || activeVisor == EPlayerVisor::Scan)
return true; return true;
return true; return true;
} }
@ -222,9 +222,26 @@ void CPlayerState::UpdateStaticInterference(CStateManager& stateMgr, const float
x188_staticIntf.Update(stateMgr, dt); x188_staticIntf.Update(stateMgr, dt);
} }
void CPlayerState::IncreaseScanTime(u32 time, float val) void CPlayerState::SetScanTime(ResId res, float time)
{ {
auto it = std::find_if(x170_scanTimes.begin(), x170_scanTimes.end(), [&](const auto& test) -> bool{
return test.first == res;
});
if (it != x170_scanTimes.end())
it->second = time;
}
float CPlayerState::GetScanTime(ResId res) const
{
const auto it = std::find_if(x170_scanTimes.cbegin(), x170_scanTimes.cend(), [&](const auto& test) -> bool{
return test.first == res;
});
if (it == x170_scanTimes.end())
return 0.f;
return it->second;
} }
bool CPlayerState::GetIsVisorTransitioning() const bool CPlayerState::GetIsVisorTransitioning() const

View File

@ -145,8 +145,8 @@ public:
EPlayerVisor GetActiveVisor(const CStateManager& stateMgr) const; EPlayerVisor GetActiveVisor(const CStateManager& stateMgr) const;
void UpdateStaticInterference(CStateManager& stateMgr, const float& dt); void UpdateStaticInterference(CStateManager& stateMgr, const float& dt);
void IncreaseScanTime(u32 time, float val); void IncreaseScanTime(u32 time, float val);
void SetScanTime(u32 time, float val); void SetScanTime(ResId time, float val);
float GetScanTime(u32 time, float val); float GetScanTime(ResId time) const;
bool GetIsVisorTransitioning() const; bool GetIsVisorTransitioning() const;
float GetVisorTransitionFactor() const; float GetVisorTransitionFactor() const;
void UpdateVisorTransition(float dt); void UpdateVisorTransition(float dt);

View File

@ -31,7 +31,7 @@ CRasterFont::CRasterFont(urde::CInputStream& in, urde::IObjectStore& store)
u32 tmp3 = in.readUint32Big(); u32 tmp3 = in.readUint32Big();
u32 tmp4 = in.readUint32Big(); u32 tmp4 = in.readUint32Big();
std::string name= in.readString(); std::string name= in.readString();
u32 txtrId = in.readUint32Big(); u32 txtrId = (version == 5 ? in.readUint64Big() : in.readUint32Big());
x30_fontInfo = CFontInfo(tmp1, tmp2, tmp3, tmp4, name.c_str()); x30_fontInfo = CFontInfo(tmp1, tmp2, tmp3, tmp4, name.c_str());
x80_texture = store.GetObj({FOURCC('TXTR'), txtrId}); x80_texture = store.GetObj({FOURCC('TXTR'), txtrId});
x2c_mode = EColorType(in.readUint32Big()); x2c_mode = EColorType(in.readUint32Big());
@ -46,15 +46,31 @@ CRasterFont::CRasterFont(urde::CInputStream& in, urde::IObjectStore& store)
float startV = in.readFloatBig(); float startV = in.readFloatBig();
float endU = in.readFloatBig(); float endU = in.readFloatBig();
float endV = in.readFloatBig(); float endV = in.readFloatBig();
s32 a = in.readInt32Big(); s32 layer = 0;
s32 b = in.readInt32Big(); s32 a, b, c, cellWidth, cellHeight, baseline, kernStart;
s32 c = in.readInt32Big(); if (version < 4)
s32 cellWidth = in.readInt32Big(); {
s32 cellHeight = in.readInt32Big(); a = in.readInt32Big();
s32 baseline = in.readInt32Big(); b = in.readInt32Big();
s32 kernStart = in.readInt32Big(); c = in.readInt32Big();
cellWidth = in.readInt32Big();
cellHeight = in.readInt32Big();
baseline = in.readInt32Big();
kernStart = in.readInt32Big();
}
else
{
layer = in.readByte();
a = in.readByte();
b = in.readByte();
c = in.readByte();
cellWidth = in.readByte();
cellHeight = in.readByte();
baseline = in.readByte();
kernStart = in.readInt16Big();
}
xc_glyphs.push_back(std::make_pair(chr, CGlyph(a, b, c, startU, startV, endU, endV, xc_glyphs.push_back(std::make_pair(chr, CGlyph(a, b, c, startU, startV, endU, endV,
cellWidth, cellHeight, baseline, kernStart))); cellWidth, cellHeight, baseline, kernStart, layer)));
} }
std::sort(xc_glyphs.begin(), xc_glyphs.end(), [=](auto& a, auto& b) -> bool{ std::sort(xc_glyphs.begin(), xc_glyphs.end(), [=](auto& a, auto& b) -> bool{

View File

@ -523,6 +523,7 @@ void CFrontEndUI::SNewFileSelectFrame::SetupFrameContents()
{ {
auto pt = std::div(data->x0_playTime, 3600); auto pt = std::div(data->x0_playTime, 3600);
str = hecl::Char16Format(L"%02d:%02d", pt.quot, pt.rem / 60); str = hecl::Char16Format(L"%02d:%02d", pt.quot, pt.rem / 60);
break;
} }
str = g_MainStringTable->GetString(52); str = g_MainStringTable->GetString(52);
break; break;