mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Hopefully fix map saving with RGB images
This commit is contained in:
parent
7bd3da6679
commit
c11044318e
|
@ -280,7 +280,12 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
|
|||
if(pImg->m_External)
|
||||
Item.m_ImageData = -1;
|
||||
else
|
||||
Item.m_ImageData = df.AddData(Item.m_Width*Item.m_Height*4, pImg->m_pData);
|
||||
{
|
||||
if(pImg->m_Format == CImageInfo::FORMAT_RGB)
|
||||
Item.m_ImageData = df.AddData(Item.m_Width*Item.m_Height*3, pImg->m_pData);
|
||||
else
|
||||
Item.m_ImageData = df.AddData(Item.m_Width*Item.m_Height*4, pImg->m_pData);
|
||||
}
|
||||
df.AddItem(MAPITEMTYPE_IMAGE, i, sizeof(Item), &Item);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue