mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-09-23 03:55:44 -04:00
Fix image serialization bugs (#238)
This commit is contained in:
parent
0b8a7a758d
commit
8e55368615
@ -754,14 +754,13 @@ void WriteDefaultTexture(LegoStorage* p_storage, const char* p_name)
|
|||||||
paletteEntries[i].SetBlue(entries[i].peBlue);
|
paletteEntries[i].SetBlue(entries[i].peBlue);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Palette* newPalette = SDL_CreatePalette(i);
|
image->SetPalette(SDL_CreatePalette(i));
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
for (MxS32 j = 0; j < i; j++) {
|
for (MxS32 j = 0; j < i; j++) {
|
||||||
image->SetPaletteEntry(j, paletteEntries[j]);
|
image->SetPaletteEntry(j, paletteEntries[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
image->SetPalette(newPalette);
|
|
||||||
|
|
||||||
LegoTexture texture;
|
LegoTexture texture;
|
||||||
texture.SetImage(image);
|
texture.SetImage(image);
|
||||||
|
@ -162,7 +162,7 @@ LegoResult LegoImage::Write(LegoStorage* p_storage)
|
|||||||
if ((result = p_storage->Write(&m_surface->h, sizeof(int))) != SUCCESS) {
|
if ((result = p_storage->Write(&m_surface->h, sizeof(int))) != SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if ((result = p_storage->Write(&m_surface->h, sizeof(int))) != SUCCESS) {
|
if ((result = p_storage->Write(&m_palette->ncolors, sizeof(int))) != SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (m_palette) {
|
if (m_palette) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user