Merge pull request #250 from ItzWarty/cellPngDecDecodeData_optimizations

Optimize cellPngDecDecodeData's CELL_PNGDEC_ARGB case
This commit is contained in:
Hykem 2014-05-24 17:23:17 +01:00
commit 490d1059ac
4 changed files with 27 additions and 8 deletions

View file

@ -333,11 +333,11 @@ public:
return true;
}
bool CopyFromReal(u32 to, void* real, u32 count) // (4K pages) copy from real to virtual memory
bool CopyFromReal(u32 to, const void* real, u32 count) // (4K pages) copy from real to virtual memory
{
if (!count) return true;
u8* from = (u8*)real;
const u8* from = (const u8*)real;
if (u32 frag = to & 4095)
{
@ -795,6 +795,12 @@ public:
return this->m_addr;
}
u32 AppendRawBytes(const u8 * bytes, size_t count) {
Memory.CopyFromReal(this->m_addr, bytes, count);
this->m_addr += count;
return this->m_addr;
}
u32 Skip(const u32 offset) { return this->m_addr += offset; }
operator be_t<T>*() { return GetPtr(); }