aboutsummaryrefslogtreecommitdiff
path: root/src/server/collision
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2011-09-29 12:43:05 +0200
committerSpp <spp@jorge.gr>2011-09-29 12:43:05 +0200
commitb16d2245bbd374805d15cdca585e8b42bf139605 (patch)
treeb7b63c567112e1999a2566611363cf5e83adb1be /src/server/collision
parent8b820baa7324d41df264f48e344d62584bff70f8 (diff)
Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '(' - Added missing space after a comma and remove space before comma (with some exceptions) - Remove trailing spaces - Convert tab to spaces Note: Only affects files with extension "cpp" and "h" under /src/server
Diffstat (limited to 'src/server/collision')
-rwxr-xr-xsrc/server/collision/BoundingIntervalHierarchy.h8
-rwxr-xr-xsrc/server/collision/Management/VMapFactory.cpp26
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp12
-rw-r--r--src/server/collision/Models/ModelInstance.cpp2
-rw-r--r--src/server/collision/Models/WorldModel.cpp6
5 files changed, 27 insertions, 27 deletions
diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h
index f4636b38bac..0dc597e98bc 100755
--- a/src/server/collision/BoundingIntervalHierarchy.h
+++ b/src/server/collision/BoundingIntervalHierarchy.h
@@ -86,7 +86,7 @@ class BIH
template< class T, class BoundsFunc >
void build(const std::vector<T> &primitives, BoundsFunc &getBounds, uint32 leafSize = 3, bool printStats=false)
{
- if(primitives.empty())
+ if (primitives.empty())
return;
buildData dat;
dat.maxPrims = leafSize;
@@ -156,7 +156,7 @@ class BIH
uint32 offsetBack3[3];
// compute custom offsets from direction sign bit
- for(int i=0; i<3; ++i)
+ for (int i=0; i<3; ++i)
{
offsetFront[i] = floatToRawIntBits(dir[i]) >> 31;
offsetBack[i] = offsetFront[i] ^ 1;
@@ -218,7 +218,7 @@ class BIH
int n = tree[node + 1];
while (n > 0) {
bool hit = intersectCallback(r, objects[offset], maxDist, stopAtFirst);
- if(stopAtFirst && hit) return;
+ if (stopAtFirst && hit) return;
--n;
++offset;
}
@@ -376,7 +376,7 @@ class BIH
maxObjects(0xFFFFFFFF), sumDepth(0), minDepth(0x0FFFFFFF),
maxDepth(0xFFFFFFFF), numBVH2(0)
{
- for(int i=0; i<6; ++i) numLeavesN[i] = 0;
+ for (int i=0; i<6; ++i) numLeavesN[i] = 0;
}
void updateInner() { numNodes++; }
diff --git a/src/server/collision/Management/VMapFactory.cpp b/src/server/collision/Management/VMapFactory.cpp
index 21907fef263..438b854de16 100755
--- a/src/server/collision/Management/VMapFactory.cpp
+++ b/src/server/collision/Management/VMapFactory.cpp
@@ -27,10 +27,10 @@ namespace VMAP
{
void chompAndTrim(std::string& str)
{
- while(str.length() >0)
+ while (str.length() >0)
{
char lc = str[str.length()-1];
- if(lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'')
+ if (lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'')
{
str = str.substr(0, str.length()-1);
}
@@ -39,10 +39,10 @@ namespace VMAP
break;
}
}
- while(str.length() >0)
+ while (str.length() >0)
{
char lc = str[0];
- if(lc == ' ' || lc == '"' || lc == '\'')
+ if (lc == ' ' || lc == '"' || lc == '\'')
{
str = str.substr(1, str.length()-1);
}
@@ -54,7 +54,7 @@ namespace VMAP
}
IVMapManager* gVMapManager = 0;
- Table<unsigned int , bool>* iIgnoreSpellIds=0;
+ Table<unsigned int, bool>* iIgnoreSpellIds=0;
//===============================================
// result false, if no more id are found
@@ -63,14 +63,14 @@ namespace VMAP
{
bool result = false;
unsigned int i;
- for(i=pStartPos;i<pString.size(); ++i)
+ for (i=pStartPos;i<pString.size(); ++i)
{
- if(pString[i] == ',')
+ if (pString[i] == ',')
{
break;
}
}
- if(i>pStartPos)
+ if (i>pStartPos)
{
std::string idString = pString.substr(pStartPos, i-pStartPos);
pStartPos = i+1;
@@ -88,15 +88,15 @@ namespace VMAP
void VMapFactory::preventSpellsFromBeingTestedForLoS(const char* pSpellIdString)
{
- if(!iIgnoreSpellIds)
- iIgnoreSpellIds = new Table<unsigned int , bool>();
- if(pSpellIdString != NULL)
+ if (!iIgnoreSpellIds)
+ iIgnoreSpellIds = new Table<unsigned int, bool>();
+ if (pSpellIdString != NULL)
{
unsigned int pos =0;
unsigned int id;
std::string confString(pSpellIdString);
chompAndTrim(confString);
- while(getNextId(confString, pos, id))
+ while (getNextId(confString, pos, id))
{
iIgnoreSpellIds->set(id, true);
}
@@ -114,7 +114,7 @@ namespace VMAP
// just return the instance
IVMapManager* VMapFactory::createOrGetVMapManager()
{
- if(gVMapManager == 0)
+ if (gVMapManager == 0)
gVMapManager= new VMapManager2(); // should be taken from config ... Please change if you like :-)
return gVMapManager;
}
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index bfbbef3d915..594e1a9382b 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -265,13 +265,13 @@ 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++;
// only use this for array deletes
- #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);
@@ -377,11 +377,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);
diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp
index a86f6cac45a..f0bff0cef73 100644
--- a/src/server/collision/Models/ModelInstance.cpp
+++ b/src/server/collision/Models/ModelInstance.cpp
@@ -57,7 +57,7 @@ namespace VMAP
Ray modRay(p, iInvRot * pRay.direction());
float distance = pMaxDist * iInvScale;
bool hit = iModel->IntersectRay(modRay, distance, pStopAtFirstHit);
- if(hit)
+ if (hit)
{
distance *= iScale;
pMaxDist = distance;
diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp
index 3dad4a10174..da75492c9c6 100644
--- a/src/server/collision/Models/WorldModel.cpp
+++ b/src/server/collision/Models/WorldModel.cpp
@@ -161,7 +161,7 @@ namespace VMAP
if ((iFlags[tx + ty*iTilesX] & 0x0F) == 0x0F)
return false;
- // (dx, dy) coordinates inside tile, in [0,1]^2
+ // (dx, dy) coordinates inside tile, in [0, 1]^2
float dx = tx_f - (float)tx;
float dy = ty_f - (float)ty;
@@ -169,7 +169,7 @@ namespace VMAP
^ dy
|
- 1 x---------x (1,1)
+ 1 x---------x (1, 1)
| (b) / |
| / |
| / |
@@ -442,7 +442,7 @@ namespace VMAP
{
float group_Z;
//float pVol = prims[entry].GetBound().volume();
- //if(pVol < minVol)
+ //if (pVol < minVol)
//{
/* if (prims[entry].iBound.contains(point)) */
if (prims[entry].IsInsideObject(point, zVec, group_Z))