mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-09-24 04:26:55 -04:00
Fix writing default texture (#1602)
This commit is contained in:
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user