Skip to content

Commit

Permalink
feat(tests): update engine-samples.voxels test to use new palette sav…
Browse files Browse the repository at this point in the history
…ing/loading methods
  • Loading branch information
Dacops committed Mar 16, 2024
1 parent 1ca21e6 commit b9a9e15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Binary file modified engine/samples/voxels/assets/main.pal
Binary file not shown.
8 changes: 2 additions & 6 deletions tools/quadrados/src/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ static bool loadPalette(const fs::path& path, VoxelPalette& palette)
}

auto stream = memory::StandardStream(file, true);
auto deserializer = data::old::BinaryDeserializer(stream);
deserializer.read(palette);
if (deserializer.failed())
if (!palette.loadFrom(stream))
{
std::cerr << "Failed to deserialize palette." << std::endl;
return false;
Expand Down Expand Up @@ -368,9 +366,7 @@ static bool savePalette(const fs::path& path, const VoxelPalette& palette)
}

auto stream = memory::StandardStream(file, true);
auto serializer = data::old::BinarySerializer(stream);
serializer.write(palette, nullptr);
if (serializer.failed())
if (!palette.writeTo(stream))
{
std::cerr << "Failed to serialize palette." << std::endl;
return false;
Expand Down

0 comments on commit b9a9e15

Please sign in to comment.