[nostalgia/developer-handbook] Update serialization notes
All checks were successful
Build / build (push) Successful in 2m32s
All checks were successful
Build / build (push) Successful in 2m32s
This commit is contained in:
parent
07ecbde112
commit
d20bfc7795
@ -546,19 +546,13 @@ a wrapper around the bare formats.
|
||||
```cpp
|
||||
#include <ox/mc/read.hpp>
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette1(const Buffer &buff) noexcept {
|
||||
ox::Result<NostalgiaPalette> loadPalette1(ox::Buffer const&buff) noexcept {
|
||||
return ox::readMC<NostalgiaPalette>(buff);
|
||||
}
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette2(const Buffer &buff) noexcept {
|
||||
return ox::readMC<NostalgiaPalette>(buff.data(), buff.size());
|
||||
}
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette3(const Buffer &buff) noexcept {
|
||||
ox::Result<NostalgiaPalette> loadPalette2(ox::Buffer const&buff) noexcept {
|
||||
NostalgiaPalette pal;
|
||||
std::size_t sz = 0;
|
||||
oxReturnError(ox::readMC(buff.data(), buff.size(), &pal, &sz));
|
||||
buffer.resize(sz);
|
||||
oxReturnError(ox::readMC(buff, pal));
|
||||
return pal;
|
||||
}
|
||||
```
|
||||
@ -588,17 +582,13 @@ ox::Result<ox::Buffer> writeSpritePalette2(NostalgiaPalette *pal) noexcept {
|
||||
```cpp
|
||||
#include <ox/oc/read.hpp>
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette1(const Buffer &buff) noexcept {
|
||||
ox::Result<NostalgiaPalette> loadPalette1(ox::Buffer const&buff) noexcept {
|
||||
return ox::readOC<NostalgiaPalette>(buff);
|
||||
}
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette2(const Buffer &buff) noexcept {
|
||||
return ox::readOC<NostalgiaPalette>(buff.data(), buff.size());
|
||||
}
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette3(const Buffer &buff) noexcept {
|
||||
ox::Result<NostalgiaPalette> loadPalette2(ox::Buffer const&buff) noexcept {
|
||||
NostalgiaPalette pal;
|
||||
oxReturnError(ox::readOC(buff.data(), buff.size(), &pal));
|
||||
oxReturnError(ox::readOC(buff, &pal));
|
||||
return pal;
|
||||
}
|
||||
```
|
||||
@ -608,13 +598,13 @@ ox::Result<NostalgiaPalette> loadPalette3(const Buffer &buff) noexcept {
|
||||
```cpp
|
||||
#include <ox/oc/write.hpp>
|
||||
|
||||
ox::Result<ox::Buffer> writeSpritePalette1(NostalgiaPalette *pal) noexcept {
|
||||
ox::Result<ox::Buffer> writeSpritePalette1(NostalgiaPalette const&pal) noexcept {
|
||||
ox::Buffer buffer(ox::units::MB);
|
||||
oxReturnError(ox::writeOC(buffer.data(), buffer.size(), pal));
|
||||
return buffer;
|
||||
}
|
||||
|
||||
ox::Result<ox::Buffer> writeSpritePalette2(NostalgiaPalette *pal) noexcept {
|
||||
ox::Result<ox::Buffer> writeSpritePalette2(NostalgiaPalette const&pal) noexcept {
|
||||
return ox::writeOC(pal);
|
||||
}
|
||||
```
|
||||
@ -626,17 +616,13 @@ ox::Result<ox::Buffer> writeSpritePalette2(NostalgiaPalette *pal) noexcept {
|
||||
```cpp
|
||||
#include <ox/claw/read.hpp>
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette1(const Buffer &buff) noexcept {
|
||||
ox::Result<NostalgiaPalette> loadPalette1(ox::Buffer const&buff) noexcept {
|
||||
return ox::readClaw<NostalgiaPalette>(buff);
|
||||
}
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette2(const Buffer &buff) noexcept {
|
||||
return ox::readClaw<NostalgiaPalette>(buff.data(), buff.size());
|
||||
}
|
||||
|
||||
ox::Result<NostalgiaPalette> loadPalette3(const Buffer &buff) noexcept {
|
||||
ox::Result<NostalgiaPalette> loadPalette2(ox::Buffer const&buff) noexcept {
|
||||
NostalgiaPalette pal;
|
||||
oxReturnError(ox::readClaw(buff.data(), buff.size(), &pal));
|
||||
oxReturnError(ox::readClaw(buff, pal));
|
||||
return pal;
|
||||
}
|
||||
```
|
||||
@ -646,8 +632,8 @@ ox::Result<NostalgiaPalette> loadPalette3(const Buffer &buff) noexcept {
|
||||
```cpp
|
||||
#include <ox/claw/write.hpp>
|
||||
|
||||
ox::Result<ox::Buffer> writeSpritePalette(NostalgiaPalette *pal) noexcept {
|
||||
return ox::writeClaw(&pal);
|
||||
ox::Result<ox::Buffer> writeSpritePalette(NostalgiaPalette const&pal) noexcept {
|
||||
return ox::writeClaw(pal);
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user