Merge remote-tracking branch 'isle/master' into fix-textures

This commit is contained in:
Christian Semmler 2025-07-02 17:07:47 -07:00
commit bda3cb80ac
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C

View File

@ -713,14 +713,14 @@ void WriteDefaultTexture(LegoStorage* p_storage, const char* p_name)
if (image != NULL) {
if (desc.dwWidth == desc.lPitch) {
memcpy(desc.lpSurface, image->GetBits(), desc.dwWidth * desc.dwHeight);
memcpy(image->GetBits(), desc.lpSurface, desc.dwWidth * desc.dwHeight);
}
else {
MxU8* surface = (MxU8*) desc.lpSurface;
const LegoU8* bits = image->GetBits();
LegoU8* bits = image->GetBits();
for (MxS32 i = 0; i < desc.dwHeight; i++) {
memcpy(surface, bits, desc.dwWidth);
memcpy(bits, surface, desc.dwWidth);
surface += desc.lPitch;
bits += desc.dwWidth;
}