mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add TIdentifier specialization for OrcaStream
This commit is contained in:
parent
63702fcc6f
commit
f704358cb3
|
@ -12,6 +12,7 @@
|
|||
#include "../world/Location.hpp"
|
||||
#include "Crypt.h"
|
||||
#include "FileStream.h"
|
||||
#include "Identifier.hpp"
|
||||
#include "MemoryStream.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -312,6 +313,21 @@ namespace OpenRCT2
|
|||
}
|
||||
}
|
||||
|
||||
template<typename T, T TNullValue, typename TTag> void ReadWrite(TIdentifier<T, TNullValue, TTag>& value)
|
||||
{
|
||||
if (_mode == Mode::READING)
|
||||
{
|
||||
T temp{};
|
||||
ReadWrite(temp);
|
||||
value = TIdentifier<T, TNullValue, TTag>::FromUnderlying(temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto temp = value.ToUnderlying();
|
||||
ReadWrite(temp);
|
||||
}
|
||||
}
|
||||
|
||||
void ReadWrite(bool& value)
|
||||
{
|
||||
uint8_t value8 = value ? 1 : 0;
|
||||
|
|
Loading…
Reference in New Issue