|
|
@ -367,14 +367,21 @@ namespace INVENTORIES
|
|
|
|
bms.serial( _SlotIndex, CInventoryCategoryTemplate::SlotBitSize );
|
|
|
|
bms.serial( _SlotIndex, CInventoryCategoryTemplate::SlotBitSize );
|
|
|
|
|
|
|
|
|
|
|
|
uint i;
|
|
|
|
uint i;
|
|
|
|
// SHEET, QUALITY, QUANTITY, USER_COLOR, CREATE_TIME and SERIAL never require compression
|
|
|
|
// SHEET, QUALITY, QUANTITY, and USER_COLOR never require compression
|
|
|
|
for (i = 0; i < 6; ++i)
|
|
|
|
for (i = 0; i < 4; ++i)
|
|
|
|
bms.serial((uint32&)_ItemProp[i], DataBitSize[i]);
|
|
|
|
bms.serial((uint32&)_ItemProp[i], DataBitSize[i]);
|
|
|
|
|
|
|
|
|
|
|
|
// For all other the compression is simple the first bit indicates if the value is zero
|
|
|
|
// For all other the compression is simple the first bit indicates if the value is zero
|
|
|
|
if (bms.isReading())
|
|
|
|
if (bms.isReading())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (; i < NbItemPropId; ++i)
|
|
|
|
for (; i < NbItemPropId; ++i)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (DataBitSize[i] < 3)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Don't compress 1 or 2 bits either
|
|
|
|
|
|
|
|
bms.serial((uint32&)_ItemProp[i], DataBitSize[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool b;
|
|
|
|
bool b;
|
|
|
|
bms.serialBit(b);
|
|
|
|
bms.serialBit(b);
|
|
|
@ -384,9 +391,17 @@ namespace INVENTORIES
|
|
|
|
bms.serial((uint32 &)_ItemProp[i], DataBitSize[i]);
|
|
|
|
bms.serial((uint32 &)_ItemProp[i], DataBitSize[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (; i != NbItemPropId; ++i)
|
|
|
|
for (; i != NbItemPropId; ++i)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (DataBitSize[i] < 3)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Don't compress 1 or 2 bits either
|
|
|
|
|
|
|
|
bms.serial((uint32&)_ItemProp[i], DataBitSize[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool b = (_ItemProp[i] == 0);
|
|
|
|
bool b = (_ItemProp[i] == 0);
|
|
|
|
bms.serialBit(b);
|
|
|
|
bms.serialBit(b);
|
|
|
@ -395,6 +410,7 @@ namespace INVENTORIES
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Serial from/to bit stream
|
|
|
|
/// Serial from/to bit stream
|
|
|
|
template <class CInventoryCategoryTemplate>
|
|
|
|
template <class CInventoryCategoryTemplate>
|
|
|
|