Add spaces after commas
This commit is contained in:
@@ -63,7 +63,7 @@ namespace VMAP
|
||||
virtual bool isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2) = 0;
|
||||
virtual float getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist) = 0;
|
||||
/**
|
||||
test if we hit an object. return true if we hit one. rx,ry,rz will hold the hit position or the dest position, if no intersection was found
|
||||
test if we hit an object. return true if we hit one. rx, ry, rz will hold the hit position or the dest position, if no intersection was found
|
||||
return a position, that is pReduceDist closer to the origin
|
||||
*/
|
||||
virtual bool getObjectHitPos(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float pModifyDist) = 0;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace VMAP
|
||||
char lc = str[str.length()-1];
|
||||
if(lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'')
|
||||
{
|
||||
str = str.substr(0,str.length()-1);
|
||||
str = str.substr(0, str.length()-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -43,7 +43,7 @@ namespace VMAP
|
||||
char lc = str[0];
|
||||
if(lc == ' ' || lc == '"' || lc == '\'')
|
||||
{
|
||||
str = str.substr(1,str.length()-1);
|
||||
str = str.substr(1, str.length()-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -161,8 +161,8 @@ namespace VMAP
|
||||
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
|
||||
if (instanceTree != iInstanceMapTrees.end())
|
||||
{
|
||||
Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1);
|
||||
Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2);
|
||||
Vector3 pos1 = convertPositionToInternalRep(x1, y1, z1);
|
||||
Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2);
|
||||
if (pos1 != pos2)
|
||||
{
|
||||
result = instanceTree->second->isInLineOfSight(pos1, pos2);
|
||||
@@ -186,11 +186,11 @@ namespace VMAP
|
||||
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
|
||||
if (instanceTree != iInstanceMapTrees.end())
|
||||
{
|
||||
Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1);
|
||||
Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2);
|
||||
Vector3 pos1 = convertPositionToInternalRep(x1, y1, z1);
|
||||
Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2);
|
||||
Vector3 resultPos;
|
||||
result = instanceTree->second->getObjectHitPos(pos1, pos2, resultPos, pModifyDist);
|
||||
resultPos = convertPositionToMangosRep(resultPos.x,resultPos.y,resultPos.z);
|
||||
resultPos = convertPositionToMangosRep(resultPos.x, resultPos.y, resultPos.z);
|
||||
rx = resultPos.x;
|
||||
ry = resultPos.y;
|
||||
rz = resultPos.z;
|
||||
@@ -212,7 +212,7 @@ namespace VMAP
|
||||
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
|
||||
if (instanceTree != iInstanceMapTrees.end())
|
||||
{
|
||||
Vector3 pos = convertPositionToInternalRep(x,y,z);
|
||||
Vector3 pos = convertPositionToInternalRep(x, y, z);
|
||||
height = instanceTree->second->getHeight(pos, maxSearchDist);
|
||||
if (!(height < G3D::inf()))
|
||||
{
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace VMAP
|
||||
float StaticMapTree::getHeight(const Vector3& pPos, float maxSearchDist) const
|
||||
{
|
||||
float height = G3D::inf();
|
||||
Vector3 dir = Vector3(0,0,-1);
|
||||
Vector3 dir = Vector3(0, 0, -1);
|
||||
G3D::Ray ray(pPos, dir); // direction with length of 1
|
||||
float maxDist = maxSearchDist;
|
||||
if (getIntersectionTime(ray, maxDist, false))
|
||||
@@ -356,7 +356,7 @@ namespace VMAP
|
||||
}
|
||||
if (!iTreeValues)
|
||||
{
|
||||
sLog->outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u,%u]", tileX, tileY);
|
||||
sLog->outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u, %u]", tileX, tileY);
|
||||
return false;
|
||||
}
|
||||
bool result = true;
|
||||
@@ -382,7 +382,7 @@ namespace VMAP
|
||||
// acquire model instance
|
||||
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name);
|
||||
if (!model)
|
||||
sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u,%u]", tileX, tileY);
|
||||
sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
|
||||
|
||||
// update tree
|
||||
uint32 referencedVal;
|
||||
|
||||
@@ -262,12 +262,12 @@ namespace VMAP
|
||||
int readOperation = 1;
|
||||
|
||||
// temporary use defines to simplify read/check code (close file and return at fail)
|
||||
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { \
|
||||
#define READ_OR_RETURN(V, S) if(fread((V), (S), 1, rf) != 1) { \
|
||||
fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); }readOperation++;
|
||||
#define READ_OR_RETURN_WITH_DELETE(V,S) if(fread((V), (S), 1, rf) != 1) { \
|
||||
#define READ_OR_RETURN_WITH_DELETE(V, S) if(fread((V), (S), 1, rf) != 1) { \
|
||||
fclose(rf); printf("readfail, op = %i\n", readOperation); delete V; return(false); }readOperation++;
|
||||
|
||||
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { \
|
||||
#define CMP_OR_RETURN(V, S) if(strcmp((V), (S)) != 0) { \
|
||||
fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); }
|
||||
|
||||
READ_OR_RETURN(&ident, 8);
|
||||
@@ -362,8 +362,8 @@ namespace VMAP
|
||||
|
||||
if (!rf)
|
||||
{
|
||||
printf("ERROR: Can't open model file in form: %s",pModelFilename.c_str());
|
||||
printf("... or form: %s",filename.c_str() );
|
||||
printf("ERROR: Can't open model file in form: %s", pModelFilename.c_str());
|
||||
printf("... or form: %s", filename.c_str() );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -372,11 +372,11 @@ namespace VMAP
|
||||
int readOperation = 1;
|
||||
|
||||
// temporary use defines to simplify read/check code (close file and return at fail)
|
||||
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { \
|
||||
#define READ_OR_RETURN(V, S) if(fread((V), (S), 1, rf) != 1) { \
|
||||
fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); }readOperation++;
|
||||
#define READ_OR_RETURN_WITH_DELETE(V,S) if(fread((V), (S), 1, rf) != 1) { \
|
||||
#define READ_OR_RETURN_WITH_DELETE(V, S) if(fread((V), (S), 1, rf) != 1) { \
|
||||
fclose(rf); printf("readfail, op = %i\n", readOperation); delete V; return(false); }readOperation++;
|
||||
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { \
|
||||
#define CMP_OR_RETURN(V, S) if(strcmp((V), (S)) != 0) { \
|
||||
fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); }
|
||||
|
||||
READ_OR_RETURN(&ident, 8);
|
||||
|
||||
@@ -456,7 +456,7 @@ namespace VMAP
|
||||
}
|
||||
#ifdef VMAP_DEBUG
|
||||
const GroupModel &gm = prims[entry];
|
||||
printf("%10u %8X %7.3f,%7.3f,%7.3f | %7.3f,%7.3f,%7.3f | z=%f, p_z=%f\n", gm.GetWmoID(), gm.GetMogpFlags(),
|
||||
printf("%10u %8X %7.3f, %7.3f, %7.3f | %7.3f, %7.3f, %7.3f | z=%f, p_z=%f\n", gm.GetWmoID(), gm.GetMogpFlags(),
|
||||
gm.GetBound().low().x, gm.GetBound().low().y, gm.GetBound().low().z,
|
||||
gm.GetBound().high().x, gm.GetBound().high().y, gm.GetBound().high().z, group_Z, point.z);
|
||||
#endif
|
||||
@@ -507,7 +507,7 @@ namespace VMAP
|
||||
|
||||
bool result = true;
|
||||
uint32 chunkSize, count;
|
||||
result = fwrite(VMAP_MAGIC,1,8,wf) == 8;
|
||||
result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8;
|
||||
if (result && fwrite("WMOD", 1, 4, wf) != 4) result = false;
|
||||
chunkSize = sizeof(uint32) + sizeof(uint32);
|
||||
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false;
|
||||
|
||||
Reference in New Issue
Block a user