mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +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 (image != NULL) {
|
||||||
if (desc.dwWidth == desc.lPitch) {
|
if (desc.dwWidth == desc.lPitch) {
|
||||||
memcpy(desc.lpSurface, image->GetBits(), desc.dwWidth * desc.dwHeight);
|
memcpy(image->GetBits(), desc.lpSurface, desc.dwWidth * desc.dwHeight);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MxU8* surface = (MxU8*) desc.lpSurface;
|
MxU8* surface = (MxU8*) desc.lpSurface;
|
||||||
const LegoU8* bits = image->GetBits();
|
LegoU8* bits = image->GetBits();
|
||||||
|
|
||||||
for (MxS32 i = 0; i < desc.dwHeight; i++) {
|
for (MxS32 i = 0; i < desc.dwHeight; i++) {
|
||||||
memcpy(surface, bits, desc.dwWidth);
|
memcpy(bits, surface, desc.dwWidth);
|
||||||
surface += desc.lPitch;
|
surface += desc.lPitch;
|
||||||
bits += desc.dwWidth;
|
bits += desc.dwWidth;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user