aboutsummaryrefslogtreecommitdiff
path: root/src/server/collision
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2011-09-15 14:08:17 +0200
committerSpp <spp@jorge.gr>2011-09-15 14:12:57 +0200
commitaf05915b9e36497eda8f2f061c29ffee0c8042b6 (patch)
treefa9e603e2a8d90b9842148ee9fa767f475566b67 /src/server/collision
parent9006e4e8dc1c2cbf30303dd2d5e34f3d9a2380a9 (diff)
[Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions)
Diffstat (limited to 'src/server/collision')
-rwxr-xr-xsrc/server/collision/BoundingIntervalHierarchy.cpp4
-rwxr-xr-xsrc/server/collision/BoundingIntervalHierarchy.h4
-rwxr-xr-xsrc/server/collision/Management/VMapFactory.cpp2
-rw-r--r--src/server/collision/Maps/MapTree.cpp28
-rwxr-xr-xsrc/server/collision/Maps/MapTree.h14
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp14
-rw-r--r--src/server/collision/Models/ModelInstance.cpp6
-rwxr-xr-xsrc/server/collision/Models/ModelInstance.h8
-rw-r--r--src/server/collision/Models/WorldModel.cpp14
-rwxr-xr-xsrc/server/collision/Models/WorldModel.h12
-rw-r--r--src/server/collision/VMapDefinitions.h2
11 files changed, 54 insertions, 54 deletions
diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp
index e411d1c2889..1540d1af667 100755
--- a/src/server/collision/BoundingIntervalHierarchy.cpp
+++ b/src/server/collision/BoundingIntervalHierarchy.cpp
@@ -238,7 +238,7 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat
stats.updateLeaf(depth + 1, 0);
}
-bool BIH::writeToFile(FILE *wf) const
+bool BIH::writeToFile(FILE* wf) const
{
uint32 treeSize = tree.size();
uint32 check=0, count=0;
@@ -252,7 +252,7 @@ bool BIH::writeToFile(FILE *wf) const
return check == (3 + 3 + 2 + treeSize + count);
}
-bool BIH::readFromFile(FILE *rf)
+bool BIH::readFromFile(FILE* rf)
{
uint32 treeSize;
Vector3 lo, hi;
diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h
index f7bfdf73ccc..f4636b38bac 100755
--- a/src/server/collision/BoundingIntervalHierarchy.h
+++ b/src/server/collision/BoundingIntervalHierarchy.h
@@ -334,8 +334,8 @@ class BIH
}
}
- bool writeToFile(FILE *wf) const;
- bool readFromFile(FILE *rf);
+ bool writeToFile(FILE* wf) const;
+ bool readFromFile(FILE* rf);
protected:
std::vector<uint32> tree;
diff --git a/src/server/collision/Management/VMapFactory.cpp b/src/server/collision/Management/VMapFactory.cpp
index 93236bbb674..21907fef263 100755
--- a/src/server/collision/Management/VMapFactory.cpp
+++ b/src/server/collision/Management/VMapFactory.cpp
@@ -53,7 +53,7 @@ namespace VMAP
}
}
- IVMapManager *gVMapManager = 0;
+ IVMapManager* gVMapManager = 0;
Table<unsigned int , bool>* iIgnoreSpellIds=0;
//===============================================
diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp
index c8a0a19d6e6..6b5c9b5a2c6 100644
--- a/src/server/collision/Maps/MapTree.cpp
+++ b/src/server/collision/Maps/MapTree.cpp
@@ -41,7 +41,7 @@ namespace VMAP
class MapRayCallback
{
public:
- MapRayCallback(ModelInstance *val): prims(val), hit(false) {}
+ MapRayCallback(ModelInstance* val): prims(val), hit(false) {}
bool operator()(const G3D::Ray& ray, uint32 entry, float& distance, bool pStopAtFirstHit=true)
{
bool result = prims[entry].intersectRay(ray, distance, pStopAtFirstHit);
@@ -51,14 +51,14 @@ namespace VMAP
}
bool didHit() { return hit; }
protected:
- ModelInstance *prims;
+ ModelInstance* prims;
bool hit;
};
class AreaInfoCallback
{
public:
- AreaInfoCallback(ModelInstance *val): prims(val) {}
+ AreaInfoCallback(ModelInstance* val): prims(val) {}
void operator()(const Vector3& point, uint32 entry)
{
#ifdef VMAP_DEBUG
@@ -67,14 +67,14 @@ namespace VMAP
prims[entry].intersectPoint(point, aInfo);
}
- ModelInstance *prims;
+ ModelInstance* prims;
AreaInfo aInfo;
};
class LocationInfoCallback
{
public:
- LocationInfoCallback(ModelInstance *val, LocationInfo &info): prims(val), locInfo(info), result(false) {}
+ LocationInfoCallback(ModelInstance* val, LocationInfo &info): prims(val), locInfo(info), result(false) {}
void operator()(const Vector3& point, uint32 entry)
{
#ifdef VMAP_DEBUG
@@ -84,7 +84,7 @@ namespace VMAP
result = true;
}
- ModelInstance *prims;
+ ModelInstance* prims;
LocationInfo &locInfo;
bool result;
};
@@ -245,7 +245,7 @@ namespace VMAP
basePath.push_back('/');
std::string fullname = basePath + VMapManager2::getMapFileName(mapID);
bool success = true;
- FILE *rf = fopen(fullname.c_str(), "rb");
+ FILE* rf = fopen(fullname.c_str(), "rb");
if (!rf)
return false;
// TODO: check magic number when implemented...
@@ -275,12 +275,12 @@ namespace VMAP
//=========================================================
- bool StaticMapTree::InitMap(const std::string &fname, VMapManager2 *vm)
+ bool StaticMapTree::InitMap(const std::string &fname, VMapManager2* vm)
{
sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str());
bool success = true;
std::string fullname = iBasePath + fname;
- FILE *rf = fopen(fullname.c_str(), "rb");
+ FILE* rf = fopen(fullname.c_str(), "rb");
if (!rf)
return false;
else
@@ -309,7 +309,7 @@ namespace VMAP
#endif
if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn))
{
- WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name);
+ WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading %s", spawn.name.c_str());
if (model)
{
@@ -331,7 +331,7 @@ namespace VMAP
//=========================================================
- void StaticMapTree::UnloadMap(VMapManager2 *vm)
+ void StaticMapTree::UnloadMap(VMapManager2* vm)
{
for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i)
{
@@ -345,7 +345,7 @@ namespace VMAP
//=========================================================
- bool StaticMapTree::LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm)
+ bool StaticMapTree::LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm)
{
if (!iIsTiled)
{
@@ -380,7 +380,7 @@ namespace VMAP
if (result)
{
// acquire model instance
- WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name);
+ WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
if (!model)
sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
@@ -426,7 +426,7 @@ namespace VMAP
//=========================================================
- void StaticMapTree::UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm)
+ void StaticMapTree::UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm)
{
uint32 tileID = packTileID(tileX, tileY);
loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
diff --git a/src/server/collision/Maps/MapTree.h b/src/server/collision/Maps/MapTree.h
index 8b288842a71..47716a925b5 100755
--- a/src/server/collision/Maps/MapTree.h
+++ b/src/server/collision/Maps/MapTree.h
@@ -32,8 +32,8 @@ namespace VMAP
struct LocationInfo
{
LocationInfo(): hitInstance(0), hitModel(0), ground_Z(-G3D::inf()) {};
- const ModelInstance *hitInstance;
- const GroupModel *hitModel;
+ const ModelInstance* hitInstance;
+ const GroupModel* hitModel;
float ground_Z;
};
@@ -45,7 +45,7 @@ namespace VMAP
uint32 iMapID;
bool iIsTiled;
BIH iTree;
- ModelInstance *iTreeValues; // the tree entries
+ ModelInstance* iTreeValues; // the tree entries
uint32 iNTreeValues;
// Store all the map tile idents that are loaded for that map
@@ -74,10 +74,10 @@ namespace VMAP
bool getAreaInfo(G3D::Vector3 &pos, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const;
bool GetLocationInfo(const Vector3 &pos, LocationInfo &info) const;
- bool InitMap(const std::string &fname, VMapManager2 *vm);
- void UnloadMap(VMapManager2 *vm);
- bool LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm);
- void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm);
+ bool InitMap(const std::string &fname, VMapManager2* vm);
+ void UnloadMap(VMapManager2* vm);
+ bool LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
+ void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
bool isTiled() const { return iIsTiled; }
uint32 numLoadedTiles() const { return iLoadedTiles.size(); }
};
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index 4509caa8154..bfbbef3d915 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -39,7 +39,7 @@ template<> struct BoundsTrait<VMAP::ModelSpawn*>
namespace VMAP
{
- bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len)
+ bool readChunk(FILE* rf, char *dest, const char *compare, uint32 len)
{
if (fread(dest, sizeof(char), len, rf) != len) return false;
return memcmp(dest, compare, len) == 0;
@@ -113,7 +113,7 @@ namespace VMAP
// write map tree file
std::stringstream mapfilename;
mapfilename << iDestDir << '/' << std::setfill('0') << std::setw(3) << map_iter->first << ".vmtree";
- FILE *mapfile = fopen(mapfilename.str().c_str(), "wb");
+ FILE* mapfile = fopen(mapfilename.str().c_str(), "wb");
if (!mapfile)
{
success = false;
@@ -157,7 +157,7 @@ namespace VMAP
uint32 x, y;
StaticMapTree::unpackTileID(tile->first, x, y);
tilefilename << std::setw(2) << x << '_' << std::setw(2) << y << ".vmtile";
- FILE *tilefile = fopen(tilefilename.str().c_str(), "wb");
+ FILE* tilefile = fopen(tilefilename.str().c_str(), "wb");
// file header
if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8) success = false;
// write number of tile spawns
@@ -202,7 +202,7 @@ namespace VMAP
bool TileAssembler::readMapSpawns()
{
std::string fname = iSrcDir + "/dir_bin";
- FILE *dirf = fopen(fname.c_str(), "rb");
+ FILE* dirf = fopen(fname.c_str(), "rb");
if (!dirf)
{
printf("Could not read dir_bin file!\n");
@@ -251,7 +251,7 @@ namespace VMAP
modelPosition.iScale = spawn.iScale;
modelPosition.init();
- FILE *rf = fopen(modelFilename.c_str(), "rb");
+ FILE* rf = fopen(modelFilename.c_str(), "rb");
if (!rf)
{
printf("ERROR: Can't open model file: %s\n", modelFilename.c_str());
@@ -363,7 +363,7 @@ namespace VMAP
if (filename.length() >0)
filename.push_back('/');
filename.append(pModelFilename);
- FILE *rf = fopen(filename.c_str(), "rb");
+ FILE* rf = fopen(filename.c_str(), "rb");
if (!rf)
{
@@ -466,7 +466,7 @@ namespace VMAP
delete[] vectorarray;
}
// ----- liquid
- WmoLiquid *liquid = 0;
+ WmoLiquid* liquid = 0;
if (liquidflags& 1)
{
WMOLiquidHeader hlq;
diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp
index 957b15e9282..a86f6cac45a 100644
--- a/src/server/collision/Models/ModelInstance.cpp
+++ b/src/server/collision/Models/ModelInstance.cpp
@@ -26,7 +26,7 @@ using G3D::Ray;
namespace VMAP
{
- ModelInstance::ModelInstance(const ModelSpawn &spawn, WorldModel *model): ModelSpawn(spawn), iModel(model)
+ ModelInstance::ModelInstance(const ModelSpawn &spawn, WorldModel* model): ModelSpawn(spawn), iModel(model)
{
iInvRot = G3D::Matrix3::fromEulerAnglesZYX(G3D::pi()*iRot.y/180.f, G3D::pi()*iRot.x/180.f, G3D::pi()*iRot.z/180.f).inverse();
iInvScale = 1.f/iScale;
@@ -151,7 +151,7 @@ namespace VMAP
return false;
}
- bool ModelSpawn::readFromFile(FILE *rf, ModelSpawn &spawn)
+ bool ModelSpawn::readFromFile(FILE* rf, ModelSpawn &spawn)
{
uint32 check = 0, nameLen;
check += fread(&spawn.flags, sizeof(uint32), 1, rf);
@@ -197,7 +197,7 @@ namespace VMAP
return true;
}
- bool ModelSpawn::writeToFile(FILE *wf, const ModelSpawn &spawn)
+ bool ModelSpawn::writeToFile(FILE* wf, const ModelSpawn &spawn)
{
uint32 check=0;
check += fwrite(&spawn.flags, sizeof(uint32), 1, wf);
diff --git a/src/server/collision/Models/ModelInstance.h b/src/server/collision/Models/ModelInstance.h
index 289fd5ff3fe..c29f6756654 100755
--- a/src/server/collision/Models/ModelInstance.h
+++ b/src/server/collision/Models/ModelInstance.h
@@ -56,15 +56,15 @@ namespace VMAP
// temp?
const G3D::AABox& getBounds() const { return iBound; }
- static bool readFromFile(FILE *rf, ModelSpawn &spawn);
- static bool writeToFile(FILE *rw, const ModelSpawn &spawn);
+ static bool readFromFile(FILE* rf, ModelSpawn &spawn);
+ static bool writeToFile(FILE* rw, const ModelSpawn &spawn);
};
class ModelInstance: public ModelSpawn
{
public:
ModelInstance(): iModel(0) {}
- ModelInstance(const ModelSpawn &spawn, WorldModel *model);
+ ModelInstance(const ModelSpawn &spawn, WorldModel* model);
void setUnloaded() { iModel = 0; }
bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit) const;
void intersectPoint(const G3D::Vector3& p, AreaInfo &info) const;
@@ -73,7 +73,7 @@ namespace VMAP
protected:
G3D::Matrix3 iInvRot;
float iInvScale;
- WorldModel *iModel;
+ WorldModel* iModel;
};
} // namespace VMAP
diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp
index 501be416a26..3dad4a10174 100644
--- a/src/server/collision/Models/WorldModel.cpp
+++ b/src/server/collision/Models/WorldModel.cpp
@@ -202,7 +202,7 @@ namespace VMAP
iTilesX * iTilesY;
}
- bool WmoLiquid::writeToFile(FILE *wf)
+ bool WmoLiquid::writeToFile(FILE* wf)
{
bool result = true;
if (result && fwrite(&iTilesX, sizeof(uint32), 1, wf) != 1) result = false;
@@ -216,10 +216,10 @@ namespace VMAP
return result;
}
- bool WmoLiquid::readFromFile(FILE *rf, WmoLiquid *&out)
+ bool WmoLiquid::readFromFile(FILE* rf, WmoLiquid* &out)
{
bool result = true;
- WmoLiquid *liquid = new WmoLiquid();
+ WmoLiquid* liquid = new WmoLiquid();
if (result && fread(&liquid->iTilesX, sizeof(uint32), 1, rf) != 1) result = false;
if (result && fread(&liquid->iTilesY, sizeof(uint32), 1, rf) != 1) result = false;
if (result && fread(&liquid->iCorner, sizeof(Vector3), 1, rf) != 1) result = false;
@@ -254,7 +254,7 @@ namespace VMAP
meshTree.build(triangles, bFunc);
}
- bool GroupModel::writeToFile(FILE *wf)
+ bool GroupModel::writeToFile(FILE* wf)
{
bool result = true;
uint32 chunkSize, count;
@@ -300,7 +300,7 @@ namespace VMAP
return result;
}
- bool GroupModel::readFromFile(FILE *rf)
+ bool GroupModel::readFromFile(FILE* rf)
{
char chunk[8];
bool result = true;
@@ -501,7 +501,7 @@ namespace VMAP
bool WorldModel::writeFile(const std::string &filename)
{
- FILE *wf = fopen(filename.c_str(), "wb");
+ FILE* wf = fopen(filename.c_str(), "wb");
if (!wf)
return false;
@@ -535,7 +535,7 @@ namespace VMAP
bool WorldModel::readFile(const std::string &filename)
{
- FILE *rf = fopen(filename.c_str(), "rb");
+ FILE* rf = fopen(filename.c_str(), "rb");
if (!rf)
return false;
diff --git a/src/server/collision/Models/WorldModel.h b/src/server/collision/Models/WorldModel.h
index e3b11ccef29..7acd3c80376 100755
--- a/src/server/collision/Models/WorldModel.h
+++ b/src/server/collision/Models/WorldModel.h
@@ -56,8 +56,8 @@ namespace VMAP
float *GetHeightStorage() { return iHeight; }
uint8 *GetFlagsStorage() { return iFlags; }
uint32 GetFileSize();
- bool writeToFile(FILE *wf);
- static bool readFromFile(FILE *rf, WmoLiquid *&liquid);
+ bool writeToFile(FILE* wf);
+ static bool readFromFile(FILE* rf, WmoLiquid* &liquid);
private:
WmoLiquid(): iHeight(0), iFlags(0) {};
uint32 iTilesX; //!< number of tiles in x direction, each
@@ -80,13 +80,13 @@ namespace VMAP
//! pass mesh data to object and create BIH. Passed vectors get get swapped with old geometry!
void setMeshData(std::vector<Vector3> &vert, std::vector<MeshTriangle> &tri);
- void setLiquidData(WmoLiquid *liquid) { iLiquid = liquid; }
+ void setLiquidData(WmoLiquid* liquid) { iLiquid = liquid; }
bool IntersectRay(const G3D::Ray &ray, float &distance, bool stopAtFirstHit) const;
bool IsInsideObject(const Vector3 &pos, const Vector3 &down, float &z_dist) const;
bool GetLiquidLevel(const Vector3 &pos, float &liqHeight) const;
uint32 GetLiquidType() const;
- bool writeToFile(FILE *wf);
- bool readFromFile(FILE *rf);
+ bool writeToFile(FILE* wf);
+ bool readFromFile(FILE* rf);
const G3D::AABox& GetBound() const { return iBound; }
uint32 GetMogpFlags() const { return iMogpFlags; }
uint32 GetWmoID() const { return iGroupWMOID; }
@@ -97,7 +97,7 @@ namespace VMAP
std::vector<Vector3> vertices;
std::vector<MeshTriangle> triangles;
BIH meshTree;
- WmoLiquid *iLiquid;
+ WmoLiquid* iLiquid;
};
/*! Holds a model (converted M2 or WMO) in its original coordinate space */
class WorldModel
diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h
index 96ceb982d00..74e5a9f1dbb 100644
--- a/src/server/collision/VMapDefinitions.h
+++ b/src/server/collision/VMapDefinitions.h
@@ -27,6 +27,6 @@ namespace VMAP
const char VMAP_MAGIC[] = "VMAP_3.0";
// defined in TileAssembler.cpp currently...
- bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len);
+ bool readChunk(FILE* rf, char *dest, const char *compare, uint32 len);
}
#endif