mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-19 15:25:39 +00:00
(svn r4360) - CodeChange: add shortcut to SlGetArrayLength of the gamma-function along the lines of the Write/Read functions
This commit is contained in:
parent
38417f1794
commit
aa4f6605ad
@ -282,6 +282,7 @@ static inline void SlWriteSparseIndex(uint index) {SlWriteSimpleGamma(index);}
|
||||
|
||||
static inline uint SlReadArrayLength(void) {return SlReadSimpleGamma();}
|
||||
static inline void SlWriteArrayLength(uint length) {SlWriteSimpleGamma(length);}
|
||||
static inline uint SlGetArrayLength(uint length) {return SlGetGammaLength(length);}
|
||||
|
||||
void SlSetArrayIndex(uint index)
|
||||
{
|
||||
@ -351,7 +352,7 @@ void SlSetLength(size_t length)
|
||||
SlWriteArrayLength(length + 1);
|
||||
break;
|
||||
case CH_SPARSE_ARRAY:
|
||||
SlWriteArrayLength(length + 1 + SlGetGammaLength(_sl.array_index)); // Also include length of sparse index.
|
||||
SlWriteArrayLength(length + 1 + SlGetArrayLength(_sl.array_index)); // Also include length of sparse index.
|
||||
SlWriteSparseIndex(_sl.array_index);
|
||||
break;
|
||||
default: NOT_REACHED();
|
||||
|
Loading…
Reference in New Issue
Block a user