1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Some gcc fixups. Automake project updates

This commit is contained in:
Vadim Glazunov 2008-11-19 07:55:17 +00:00
parent 2d1fc64dd9
commit 9cfa09c076
4 changed files with 78 additions and 72 deletions

View File

@ -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];

View File

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

View File

@ -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

View File

@ -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);
};
};