Skip to content
Permalink
Browse files

random const's

Conflicts:
	rts/Rendering/GL/RenderDataBuffer.hpp
  • Loading branch information...
rtri
rtri committed Oct 6, 2019
1 parent 47cb678 commit fd77d51fab80ee8cc1a2f77559edeb5cbb223a16
Showing with 9 additions and 17 deletions.
  1. +6 −14 rts/Sim/Misc/GroundBlockingObjectMap.cpp
  2. +3 −3 rts/Sim/Misc/GroundBlockingObjectMap.h
@@ -185,10 +185,13 @@ void CGroundBlockingObjectMap::CloseBlockingYard(CSolidObject* object)
}


inline bool CGroundBlockingObjectMap::CheckYard(CSolidObject* yardUnit, const YardMapStatus& mask) const
bool CGroundBlockingObjectMap::CheckYard(const CSolidObject* yardUnit, const YardMapStatus& mask) const
{
for (int z = yardUnit->mapPos.y; z < yardUnit->mapPos.y + yardUnit->zsize; ++z) {
for (int x = yardUnit->mapPos.x; x < yardUnit->mapPos.x + yardUnit->xsize; ++x) {
const int2 mins = yardUnit->mapPos;
const int2 maxs = mins + int2(yardUnit->xsize, yardUnit->zsize);

for (int z = mins.y; z < maxs.y; ++z) {
for (int x = mins.x; x < maxs.x; ++x) {
if ((yardUnit->GetGroundBlockingMaskAtPos(float3(x * SQUARE_SIZE, 0.0f, z * SQUARE_SIZE)) & mask) == 0)
continue;

@@ -201,17 +204,6 @@ inline bool CGroundBlockingObjectMap::CheckYard(CSolidObject* yardUnit, const Ya
}


bool CGroundBlockingObjectMap::CanOpenYard(CSolidObject* yardUnit) const
{
return CheckYard(yardUnit, YARDMAP_YARDINV);
}

bool CGroundBlockingObjectMap::CanCloseYard(CSolidObject* yardUnit) const
{
return CheckYard(yardUnit, YARDMAP_YARD);
}


unsigned int CGroundBlockingObjectMap::CalcChecksum() const
{
unsigned int checksum = 666;
@@ -127,8 +127,8 @@ class CGroundBlockingObjectMap

void OpenBlockingYard(CSolidObject* object);
void CloseBlockingYard(CSolidObject* object);
bool CanOpenYard(CSolidObject* object) const;
bool CanCloseYard(CSolidObject* object) const;
bool CanOpenYard(const CSolidObject* object) const { return CheckYard(object, YARDMAP_YARDINV); }
bool CanCloseYard(const CSolidObject* object) const { return CheckYard(object, YARDMAP_YARD); }


// these retrieve either the first object in
@@ -171,7 +171,7 @@ class CGroundBlockingObjectMap
}

private:
bool CheckYard(CSolidObject* yardUnit, const YardMapStatus& mask) const;
bool CheckYard(const CSolidObject* yardUnit, const YardMapStatus& mask) const;

const ArrCell& GetArrCell(unsigned int mapSquare) const { return arrCells[mapSquare] ; }
ArrCell& GetArrCell(unsigned int mapSquare) { return arrCells[mapSquare] ; }

0 comments on commit fd77d51

Please sign in to comment.
You can’t perform that action at this time.