Explorar o código

Some gcc fixups. Automake project updates

Vadim Glazunov %!s(int64=17) %!d(string=hai) anos
pai
achega
9cfa09c076
Modificáronse 4 ficheiros con 78 adicións e 72 borrados
  1. 4 4
      CPathfinder.cpp
  2. 4 0
      CPlayerInterface.h
  3. 3 1
      client/Makefile.am
  4. 67 67
      lib/Connection.h

+ 4 - 4
CPathfinder.cpp

@@ -37,7 +37,7 @@ CPath * CPathfinder::getPath(int3 src, int3 dest, const CGHeroInstance * hero, u
 	tribool blockLandSea; //true - blocks sea, false - blocks land, indeterminate - allows all
 	if (!hero->canWalkOnSea())
 	{
-		if (CGI->mh->ttiles[hpos.x][hpos.y][hpos.z].tileInfo->tertype==EterrainType::water)
+		if (CGI->mh->ttiles[hpos.x][hpos.y][hpos.z].tileInfo->tertype==water)
 			blockLandSea=false;
 		else
 			blockLandSea=true;
@@ -63,11 +63,11 @@ CPath * CPathfinder::getPath(int3 src, int3 dest, const CGHeroInstance * hero, u
 			graph[i][j].coord.x = i;
 			graph[i][j].coord.y = j;
 			graph[i][j].coord.z = dest.z;
-			if (CGI->mh->ttiles[i][j][src.z].tileInfo->tertype==EterrainType::rock)
+			if (CGI->mh->ttiles[i][j][src.z].tileInfo->tertype==rock)
 				graph[i][j].accesible = false;
-			if ((blockLandSea) && (CGI->mh->ttiles[i][j][src.z].tileInfo->tertype==EterrainType::water))
+			if ((blockLandSea) && (CGI->mh->ttiles[i][j][src.z].tileInfo->tertype==water))
 				graph[i][j].accesible = false;
-			else if ((!blockLandSea) && (CGI->mh->ttiles[i][j][src.z].tileInfo->tertype!=EterrainType::water))
+			else if ((!blockLandSea) && (CGI->mh->ttiles[i][j][src.z].tileInfo->tertype!=water))
 				graph[i][j].accesible = false;
 			if(graph[i][j].accesible)
 				graph[i][j].accesible = CGI->state->players[hero->tempOwner].fogOfWarMap[i][j][src.z];

+ 4 - 0
CPlayerInterface.h

@@ -6,6 +6,10 @@
 #include <map>
 #include <list>
 
+#ifdef __GNUC__
+#define sprintf_s snprintf 
+#endif
+
 class CDefEssential;
 class AdventureMapButton;
 class CHighlightableButtonsGroup;

+ 3 - 1
client/Makefile.am

@@ -36,6 +36,7 @@ vcmiclient_SOURCES =  \
 ../mapHandler.cpp \
 ../SDL_Extensions.cpp \
 ../SDL_framerate.cpp \
+./CConfigHandler.cpp \
 ./CSpellWindow.cpp \
 ../AdventureMapButton.h \
 ../AI_Base.h \
@@ -79,4 +80,5 @@ vcmiclient_SOURCES =  \
 ../StartInfo.h \
 ../stdafx.h \
 ../timeHandler.h \
-./CSpellWindow.h
+./CSpellWindow.h \
+./CConfigHandler.h

+ 67 - 67
lib/Connection.h

@@ -49,6 +49,72 @@ enum SerializationLvl
 	Serializable
 };
 
+template<typename Ser,typename T>
+struct SavePrimitive
+{
+	static void invoke(Ser &s, const T &data)
+	{
+		s.savePrimitive(data);
+	}
+};
+template<typename Ser,typename T>
+struct SaveSerializable
+{
+	static void invoke(Ser &s, const T &data)
+	{
+		s.saveSerializable(data);
+	}
+};
+template<typename Ser,typename T>
+struct LoadPrimitive
+{
+	static void invoke(Ser &s, T &data)
+	{
+		s.loadPrimitive(data);
+	}
+};
+template<typename Ser,typename T>
+struct SavePointer
+{
+	static void invoke(Ser &s, const T &data)
+	{
+		s.savePointer(data);
+	}
+};
+template<typename Ser,typename T>
+struct LoadPointer
+{
+	static void invoke(Ser &s, T &data)
+	{
+		s.loadPointer(data);
+	}
+};
+template<typename Ser,typename T>
+struct LoadSerializable
+{
+	static void invoke(Ser &s, T &data)
+	{
+		s.loadSerializable(data);
+	}
+};
+
+template<typename Ser,typename T>
+struct SaveWrong
+{
+	static void invoke(Ser &s, const T &data)
+	{
+		throw std::exception("Wrong save serialization call!");
+	}
+};
+template<typename Ser,typename T>
+struct LoadWrong
+{
+	static void invoke(Ser &s, const T &data)
+	{
+		throw std::exception("Wrong load serialization call!");
+	}
+};
+
 template<typename T>
 struct SerializationLevel
 {    
@@ -288,72 +354,6 @@ public:
 
 };
 
-template<typename Ser,typename T>
-struct SavePrimitive
-{
-	static void invoke(Ser &s, const T &data)
-	{
-		s.savePrimitive(data);
-	}
-};
-template<typename Ser,typename T>
-struct SaveSerializable
-{
-	static void invoke(Ser &s, const T &data)
-	{
-		s.saveSerializable(data);
-	}
-};
-template<typename Ser,typename T>
-struct LoadPrimitive
-{
-	static void invoke(Ser &s, T &data)
-	{
-		s.loadPrimitive(data);
-	}
-};
-template<typename Ser,typename T>
-struct SavePointer
-{
-	static void invoke(Ser &s, const T &data)
-	{
-		s.savePointer(data);
-	}
-};
-template<typename Ser,typename T>
-struct LoadPointer
-{
-	static void invoke(Ser &s, T &data)
-	{
-		s.loadPointer(data);
-	}
-};
-template<typename Ser,typename T>
-struct LoadSerializable
-{
-	static void invoke(Ser &s, T &data)
-	{
-		s.loadSerializable(data);
-	}
-};
-
-template<typename Ser,typename T>
-struct SaveWrong
-{
-	static void invoke(Ser &s, const T &data)
-	{
-		throw std::exception("Wrong save serialization call!");
-	}
-};
-template<typename Ser,typename T>
-struct LoadWrong
-{
-	static void invoke(Ser &s, const T &data)
-	{
-		throw std::exception("Wrong load serialization call!");
-	}
-};
-
 
 class DLL_EXPORT CSaveFile
 	: public COSer<CSaveFile>
@@ -397,4 +397,4 @@ public:
 	int readLine(void * data, unsigned maxSize);
 	void close();
 	~CConnection(void);
-};
+};