PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
options.hpp
Go to the documentation of this file.
1 #ifndef OPTIONS_HPP
2 #define OPTIONS_HPP
3 
4 #include <cereal/archives/json.hpp>
5 
6 namespace pk
7 {
8 
9 namespace options
10 {
11 
18 {
24 };
25 
31 template<class Archive>
32 void save(Archive & archive, optionsCereal const & ops)
33 {
34  archive( cereal::make_nvp("Music Volume", ops.d_musicVolume), cereal::make_nvp("Sound Effect Volume", ops.d_soundEffectVolume),
35  cereal::make_nvp("Fullscreen", ops.d_fullscreen), cereal::make_nvp("Resolution X", ops.d_resolutionX),
36  cereal::make_nvp( "Resolution Y", ops.d_resolutionY ));
37 }
38 
44 template<class Archive>
45 void load(Archive & archive, optionsCereal & ops)
46 {
47  archive( cereal::make_nvp("Music Volume", ops.d_musicVolume), cereal::make_nvp("Sound Effect Volume", ops.d_soundEffectVolume),
48  cereal::make_nvp("Fullscreen", ops.d_fullscreen), cereal::make_nvp("Resolution X", ops.d_resolutionX),
49  cereal::make_nvp( "Resolution Y", ops.d_resolutionY ));
50 }
51 
52 }
53 
54 }
55 
56 #endif // OPTIONS_HPP
int d_resolutionX
Definition: options.hpp:22
Definition: Game.hpp:7
The data structure holding all of the options settings.
Definition: options.hpp:17
int d_resolutionY
Definition: options.hpp:23
void save(Archive &archive, optionsCereal const &ops)
Save operation for the options data. Serialized to json.
Definition: options.hpp:32
int d_musicVolume
Definition: options.hpp:19
int d_soundEffectVolume
Definition: options.hpp:20
bool d_fullscreen
Definition: options.hpp:21
void load(Archive &archive, optionsCereal &ops)
Load operation for the json serialized options data.
Definition: options.hpp:45