mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-22 16:04:17 +00:00
Fix writing default texture (#1602)
This commit is contained in:

committed by
GitHub

parent
89fe7fa924
commit
4d8ba1986e
@@ -705,14 +705,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user