OSDN Git Service

Add version info to some classes.
authorDeskull <deskull@users.sourceforge.jp>
Thu, 17 Apr 2014 14:57:04 +0000 (23:57 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Thu, 17 Apr 2014 14:57:04 +0000 (23:57 +0900)
Deeangband/Authority.h
Deeangband/Color.h
Deeangband/Creature.h
Deeangband/GameElement.h
Deeangband/GameSurfaceSDL.cpp
Deeangband/GameSurfaceSDL.h
Deeangband/GameWorld.cpp
Deeangband/stdafx.h

index f79d650..ff03df0 100644 (file)
@@ -12,6 +12,8 @@
 #include "Deeangband.h"
 #include "CreatureTemplate.h"
 
+BOOST_CLASS_VERSION(Authority, 1);
+
 namespace Deeangband
 {
 
index e2f9711..9ba49bd 100644 (file)
@@ -11,6 +11,9 @@
 #include "stdafx.h"
 #include "Deeangband.h"
 
+class Color;
+BOOST_CLASS_VERSION(Color, 1);
+
 namespace Deeangband
 {
 
@@ -89,5 +92,4 @@ namespace Deeangband
                int Color::GetAlpha(void);
 
        };
-
-}
\ No newline at end of file
+}
index 3f1b11b..ff7b4c4 100644 (file)
 #include "SavingTable.h"
 #include "Species.h"
 
-BOOST_CLASS_VERSION(Creature, 1);
 
 namespace Deeangband
 {
 
+       /*
+       template<> struct version<Deeangband::Creature>
+{                                                                      
+    typedef mpl::int_<10> type;                                         
+    typedef mpl::integral_c_tag tag;                                   
+    BOOST_STATIC_CONSTANT(int, value = version::type::value);          
+    BOOST_MPL_ASSERT((boost::mpl::less<boost::mpl::int_<10>, boost::mpl::int_<256>>));                                                                
+};    */                                                                 
+
+
        /*!
        * @class Creature
        * @brief \83N\83\8a\81[\83`\83\83\81[\82Ì\83N\83\89\83X
@@ -142,7 +151,7 @@ namespace Deeangband
                {
                        if(version >= 0)
                        {
-                               archive & BOOST_SERIALIZATION_NVP(name);
+                               archive & boost::serialization::make_nvp("Name", name);
                                archive & BOOST_SERIALIZATION_NVP(currentHp);
                                archive & BOOST_SERIALIZATION_NVP(maxHp);
                                archive & BOOST_SERIALIZATION_NVP(hpTable);
@@ -432,4 +441,7 @@ namespace Deeangband
 
        };
 
-}
\ No newline at end of file
+}
+
+//BOOST_CLASS_EXPORT_GUID(Deeangband::Creature, "Deeang_Creature"); 
+BOOST_CLASS_VERSION(Deeangband::Creature, 1);
index d54fc6b..6127bbf 100644 (file)
@@ -105,4 +105,4 @@ namespace Deeangband
                GameWorld *GameElement::GetGameWorld();
        };
 
-}
\ No newline at end of file
+}
index 2f442a6..5d226a2 100644 (file)
@@ -106,7 +106,7 @@ namespace Deeangband
                SDL_FillRect(windowSurface, &rect, SDL_MapRGBA(windowSurface->format, 50, 20, 10, 255));
                SDL_BlitSurface(titleSurface, &title, windowSurface, &title); 
 
-               if(viewFloorPtr) drawFloor(viewFloorPtr, 0, 0, 20, 20);
+               if(viewFloorPtr) drawFloor(gameWorld, viewFloorPtr, 0, 0, 20, 20);
                if(viewCreaturePtr) drawCreatureStatus(viewCreaturePtr);
 
                SDL_UpdateWindowSurface(window);
@@ -276,7 +276,7 @@ namespace Deeangband
                return GAME_COMMAND_REDRAW;
        }
 
-       void GameSurfaceSDL::drawFloor(Floor *floorPtr, int x, int y, int w, int h)
+       void GameSurfaceSDL::drawFloor(GameWorld *gameWorld, Floor *floorPtr, int x, int y, int w, int h)
        {       
                SDL_Surface *windowSurface = SDL_GetWindowSurface(window);
                SDL_Rect symbolRect = {0, 0, 30, 30};
index 060ac81..06b80b4 100644 (file)
@@ -30,6 +30,8 @@ namespace Deeangband
        class GameSurfaceSDL : public GameSurface
        {
        private:
+
+               GameWorld *gameWorld;
                Creature *viewCreaturePtr;
                Floor *viewFloorPtr;
 
@@ -57,7 +59,7 @@ namespace Deeangband
                * @param h \95\\8e¦\82Ì\83}\83X\8d\82\82³
                * @return \82È\82µ
                */
-               void drawFloor(Floor *floorPtr, int x, int y, int w, int h);
+               void drawFloor(GameWorld *gameWorld, Floor *floorPtr, int x, int y, int w, int h);
 
        public:
 
index 591263f..568bd8e 100644 (file)
@@ -43,7 +43,7 @@ namespace Deeangband
                std::ifstream ifs("HFOko.xml");
                boost::archive::xml_iarchive ia(ifs);
                ia >> BOOST_SERIALIZATION_NVP(*creatureList[0]);
-               //creatureList[0]->XMLSave("HFOko.xml");
+               creatureList[0]->XMLSave("HFOko3.xml");
 
        }
 
index 1bc6407..c141340 100644 (file)
@@ -40,6 +40,7 @@
 #include <ctime>
 #include <cassert>
 #include <fstream>
+#include <boost/serialization/export.hpp>
 #include <boost/serialization/serialization.hpp>
 #include <boost/serialization/string.hpp>
 #include <boost/serialization/version.hpp>
@@ -50,6 +51,7 @@
 #include <boost/serialization/map.hpp> 
 #include <boost/serialization/shared_ptr.hpp>
 #include <boost/serialization/list.hpp>
+#include <boost/serialization/assume_abstract.hpp>
 #include <boost/archive/xml_oarchive.hpp>
 #include <boost/archive/xml_iarchive.hpp>
 #include <boost/archive/binary_oarchive.hpp>