add support to SDLBackend for rendering 24bit data
[openc2e.git] / ser / s_creaturesImage.h
blob096a7ef57358263d1f149780995ecdff66a8038a
1 #ifndef S_CREATURESIMAGE_H
2 #define S_CREATURESIMAGE_H 1
4 #include "serialization.h"
5 #include "creaturesImage.h"
6 #include "World.h"
8 typedef creaturesImage *p_img;
10 namespace boost {
11 namespace serialization {
12 template <class Archive>
13 inline void save(Archive &ar, const p_img &obj, const int version) {
14 bool isNull = (obj == NULL);
15 ar & isNull;
16 if (!isNull) {
17 std::string name = obj->getName();
18 ar & name;
22 template <class Archive>
23 inline void load(Archive &ar, p_img &obj, const int version) {
24 bool isNull;
25 ar & isNull;
26 if (isNull)
27 obj = NULL;
28 else {
29 std::string name;
30 ar & name;
31 obj = world.gallery.getImage(name);
37 BOOST_SERIALIZATION_SPLIT_FREE(creaturesImage *);
38 BOOST_CLASS_IMPLEMENTATION(creaturesImage *, boost::serialization::primitive_type);
40 #endif