mirror of https://github.com/AxioDL/metaforce.git
Buffer access fixes
This commit is contained in:
parent
83252ea611
commit
23f89ee747
|
@ -188,10 +188,14 @@ class DLReader
|
|||
{
|
||||
case GX::DIRECT:
|
||||
case GX::INDEX8:
|
||||
if ((m_cur - m_dl.get()) >= intptr_t(m_dlSize))
|
||||
return 0;
|
||||
retval = *m_cur;
|
||||
++m_cur;
|
||||
break;
|
||||
case GX::INDEX16:
|
||||
if ((m_cur - m_dl.get() + 1) >= intptr_t(m_dlSize))
|
||||
return 0;
|
||||
retval = HECL::SBig(*(atUint16*)m_cur);
|
||||
m_cur += 2;
|
||||
break;
|
||||
|
@ -207,7 +211,7 @@ public:
|
|||
}
|
||||
operator bool()
|
||||
{
|
||||
return *m_cur && ((m_cur - m_dl.get()) < intptr_t(m_dlSize));
|
||||
return ((m_cur - m_dl.get()) < intptr_t(m_dlSize)) && *m_cur;
|
||||
}
|
||||
GX::Primitive readPrimitive()
|
||||
{
|
||||
|
@ -215,7 +219,9 @@ public:
|
|||
}
|
||||
atUint16 readVertCount()
|
||||
{
|
||||
return readVal(GX::INDEX16);
|
||||
atUint16 retval = HECL::SBig(*(atUint16*)m_cur);
|
||||
m_cur += 2;
|
||||
return retval;
|
||||
}
|
||||
struct DLPrimVert
|
||||
{
|
||||
|
|
|
@ -348,9 +348,10 @@ public:
|
|||
if (extractor.weight != w)
|
||||
continue;
|
||||
|
||||
HECL::SystemStringView bestName(getBestEntryName(*item.second));
|
||||
std::string bestName = getBestEntryName(*item.second);
|
||||
HECL::SystemStringView bestNameView(bestName);
|
||||
float thisFac = ++count / fsz;
|
||||
progress(bestName.sys_str().c_str(), thisFac);
|
||||
progress(bestNameView.sys_str().c_str(), thisFac);
|
||||
|
||||
HECL::ProjectPath cooked = getCooked(item.second);
|
||||
if (force || cooked.getPathType() == HECL::ProjectPath::PT_NONE)
|
||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit 168429814320c39b063cfee37c85261dc01c3305
|
||||
Subproject commit 0935dad69fb8ac18556d280b9886aad11fafec78
|
Loading…
Reference in New Issue