mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Saveload: Add gamma functions to header
This commit is contained in:
parent
3c53e9a920
commit
5aa1c2ee04
@ -685,7 +685,7 @@ size_t SlGetBytesWritten()
|
||||
* x = ((x & 0x7F) << 8) + SlReadByte();
|
||||
* @return Return the value of the index
|
||||
*/
|
||||
static uint SlReadSimpleGamma()
|
||||
uint SlReadSimpleGamma()
|
||||
{
|
||||
uint i = SlReadByte();
|
||||
if (HasBit(i, 7)) {
|
||||
@ -727,7 +727,7 @@ static uint SlReadSimpleGamma()
|
||||
* @param i Index being written
|
||||
*/
|
||||
|
||||
static void SlWriteSimpleGamma(size_t i)
|
||||
void SlWriteSimpleGamma(size_t i)
|
||||
{
|
||||
if (i >= (1 << 7)) {
|
||||
if (i >= (1 << 14)) {
|
||||
@ -752,7 +752,7 @@ static void SlWriteSimpleGamma(size_t i)
|
||||
}
|
||||
|
||||
/** Return how many bytes used to encode a gamma value */
|
||||
static inline uint SlGetGammaLength(size_t i)
|
||||
uint SlGetGammaLength(size_t i)
|
||||
{
|
||||
return 1 + (i >= (1 << 7)) + (i >= (1 << 14)) + (i >= (1 << 21)) + (i >= (1 << 28));
|
||||
}
|
||||
|
@ -984,6 +984,10 @@ void SlSetLength(size_t length);
|
||||
size_t SlCalcObjMemberLength(const void *object, const SaveLoad &sld);
|
||||
size_t SlCalcObjLength(const void *object, const SaveLoadTable &slt);
|
||||
|
||||
uint SlReadSimpleGamma();
|
||||
void SlWriteSimpleGamma(size_t i);
|
||||
uint SlGetGammaLength(size_t i);
|
||||
|
||||
/**
|
||||
* Run proc, automatically prepending the written length
|
||||
* @param proc The callback procedure that is called
|
||||
|
Loading…
Reference in New Issue
Block a user