Skip to content

Commit

Permalink
Use PortableBinary archives
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed Mar 6, 2014
1 parent b031fb4 commit 1448df2
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 5 deletions.
15 changes: 13 additions & 2 deletions Makefile
Expand Up @@ -3,10 +3,21 @@ default: compile run

compile:
mkdir -p build
cd build && cmake .. && make -j$(shell nproc)
cd build && \
cmake .. && \
make -j$(shell nproc)

run:
bin/arachnonoia

win64:
mkdir -p build-win64
cd build-win64 && \
x86_64-w64-mingw32-cmake \
-DCMAKE_CXX_FLAGS="-DSFML_STATIC -DFLT_EPSILON=__FLT_EPSILON__" \
-DGLM_INCLUDE_DIR=/usr/include/ \
.. && \
make -j$(shell nproc) -j1 VERBOSE=1

clean:
rm -r build bin
rm -rf build build-win64 bin
Binary file modified levels/jump-1.dat
Binary file not shown.
Binary file modified levels/jump-2.dat
Binary file not shown.
Binary file modified levels/pairs.dat
Binary file not shown.
Binary file modified levels/spawn.dat
Binary file not shown.
Binary file modified levels/upside-down.dat
Binary file not shown.
Binary file modified levels/walls.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion src/CerealTypes.cpp
Expand Up @@ -5,6 +5,7 @@
#include "Marker.hpp"

#include <cereal/archives/binary.hpp>
#include <cereal/archives/portable_binary.hpp>
#include <cereal/archives/xml.hpp>
#include <cereal/archives/json.hpp>

Expand All @@ -15,4 +16,3 @@ CEREAL_REGISTER_TYPE(Wall)
CEREAL_REGISTER_TYPE(Pair)
CEREAL_REGISTER_TYPE(CollisionShape)
CEREAL_REGISTER_TYPE(Marker)

5 changes: 3 additions & 2 deletions src/State.cpp
Expand Up @@ -6,6 +6,7 @@
#include <fstream>
#include <cereal/archives/json.hpp>
#include <cereal/archives/binary.hpp>
#include <cereal/archives/portable_binary.hpp>
#include <cereal/types/vector.hpp>
#include <cereal/types/memory.hpp>

Expand Down Expand Up @@ -223,7 +224,7 @@ void State::loadFromFile(const std::string& filename) {
cereal::JSONInputArchive ar(stream);
ar(cereal::make_nvp("entities", m_entities));
} else {
cereal::BinaryInputArchive ar(stream);
cereal::PortableBinaryInputArchive ar(stream);
ar(cereal::make_nvp("entities", m_entities));
}
stream.close();
Expand All @@ -245,7 +246,7 @@ void State::saveToFile(const std::string& filename) {
cereal::JSONOutputArchive ar(stream);
ar(cereal::make_nvp("entities", m_entities));
} else {
cereal::BinaryOutputArchive ar(stream);
cereal::PortableBinaryOutputArchive ar(stream);
ar(cereal::make_nvp("entities", m_entities));
}

Expand Down

0 comments on commit 1448df2

Please sign in to comment.