mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 17:44:56 +00:00
Buffer access fixes
This commit is contained in:
@@ -188,10 +188,14 @@ class DLReader
|
|||||||
{
|
{
|
||||||
case GX::DIRECT:
|
case GX::DIRECT:
|
||||||
case GX::INDEX8:
|
case GX::INDEX8:
|
||||||
|
if ((m_cur - m_dl.get()) >= intptr_t(m_dlSize))
|
||||||
|
return 0;
|
||||||
retval = *m_cur;
|
retval = *m_cur;
|
||||||
++m_cur;
|
++m_cur;
|
||||||
break;
|
break;
|
||||||
case GX::INDEX16:
|
case GX::INDEX16:
|
||||||
|
if ((m_cur - m_dl.get() + 1) >= intptr_t(m_dlSize))
|
||||||
|
return 0;
|
||||||
retval = HECL::SBig(*(atUint16*)m_cur);
|
retval = HECL::SBig(*(atUint16*)m_cur);
|
||||||
m_cur += 2;
|
m_cur += 2;
|
||||||
break;
|
break;
|
||||||
@@ -207,7 +211,7 @@ public:
|
|||||||
}
|
}
|
||||||
operator bool()
|
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()
|
GX::Primitive readPrimitive()
|
||||||
{
|
{
|
||||||
@@ -215,7 +219,9 @@ public:
|
|||||||
}
|
}
|
||||||
atUint16 readVertCount()
|
atUint16 readVertCount()
|
||||||
{
|
{
|
||||||
return readVal(GX::INDEX16);
|
atUint16 retval = HECL::SBig(*(atUint16*)m_cur);
|
||||||
|
m_cur += 2;
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
struct DLPrimVert
|
struct DLPrimVert
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -348,9 +348,10 @@ public:
|
|||||||
if (extractor.weight != w)
|
if (extractor.weight != w)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
HECL::SystemStringView bestName(getBestEntryName(*item.second));
|
std::string bestName = getBestEntryName(*item.second);
|
||||||
|
HECL::SystemStringView bestNameView(bestName);
|
||||||
float thisFac = ++count / fsz;
|
float thisFac = ++count / fsz;
|
||||||
progress(bestName.sys_str().c_str(), thisFac);
|
progress(bestNameView.sys_str().c_str(), thisFac);
|
||||||
|
|
||||||
HECL::ProjectPath cooked = getCooked(item.second);
|
HECL::ProjectPath cooked = getCooked(item.second);
|
||||||
if (force || cooked.getPathType() == HECL::ProjectPath::PT_NONE)
|
if (force || cooked.getPathType() == HECL::ProjectPath::PT_NONE)
|
||||||
|
|||||||
2
hecl
2
hecl
Submodule hecl updated: 1684298143...0935dad69f
Reference in New Issue
Block a user