mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-22 07:37:59 -05:00
Implement/match LegoTextureInfo::FUN_10066010 (#815)
This commit is contained in:
parent
7d0957aa3c
commit
97b502362d
1 changed files with 28 additions and 3 deletions
|
@ -184,9 +184,34 @@ BOOL LegoTextureInfo::GetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo*& p_text
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10066010
|
||||
// FUNCTION: LEGO1 0x10066010
|
||||
LegoResult LegoTextureInfo::FUN_10066010(LegoU8* p_bits)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
if (m_surface != NULL && m_texture != NULL) {
|
||||
DDSURFACEDESC desc;
|
||||
memset(&desc, 0, sizeof(desc));
|
||||
desc.dwSize = sizeof(desc);
|
||||
|
||||
if (m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) {
|
||||
MxU8* surface = (MxU8*) desc.lpSurface;
|
||||
LegoU8* bits = p_bits;
|
||||
|
||||
if (desc.dwWidth == desc.lPitch) {
|
||||
memcpy(desc.lpSurface, p_bits, desc.dwWidth * desc.dwHeight);
|
||||
}
|
||||
else {
|
||||
for (MxS32 i = 0; i < desc.dwHeight; i++) {
|
||||
memcpy(surface, bits, desc.dwWidth);
|
||||
surface += desc.lPitch;
|
||||
bits += desc.dwWidth;
|
||||
}
|
||||
}
|
||||
|
||||
m_surface->Unlock(desc.lpSurface);
|
||||
m_texture->Changed(TRUE, FALSE);
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return FAILURE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue