mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-17 05:28:20 +00:00
Remove clang-tidy class/struct name exceptions
- `struct EnvelopedQuad` --> `class CEnvelopedQuad` - `struct MapObject` --> `class CMapObject`
This commit is contained in:
parent
fd33f0fc1a
commit
02a66b301a
|
@ -130,7 +130,7 @@ CheckOptions:
|
|||
- key: readability-identifier-naming.StructPrefix
|
||||
value: S
|
||||
- key: readability-identifier-naming.StructIgnoredRegexp
|
||||
value: '^([CS]|MapObject$|EnvelopedQuad$).*'
|
||||
value: '^C.*'
|
||||
- key: readability-identifier-naming.ClassIgnoredRegexp
|
||||
value: '^(I|CCommandProcessorFragment_Vulkan$).*'
|
||||
- key: readability-identifier-naming.ParameterCase
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
#include <engine/storage.h>
|
||||
#include <game/mapitems.h>
|
||||
|
||||
struct EnvelopedQuad
|
||||
class CEnvelopedQuad
|
||||
{
|
||||
public:
|
||||
int m_GroupId;
|
||||
int m_LayerId;
|
||||
int m_TilePosX;
|
||||
|
@ -48,7 +49,7 @@ int FxToTilePos(const int FxPos)
|
|||
return std::floor(fx2f(FxPos) / 32);
|
||||
}
|
||||
|
||||
bool GetEnvelopedQuads(const CQuad *pQuads, const int NumQuads, const int EnvId, const int GroupId, const int LayerId, int &QuadsCounter, EnvelopedQuad pEnvQuads[1024])
|
||||
bool GetEnvelopedQuads(const CQuad *pQuads, const int NumQuads, const int EnvId, const int GroupId, const int LayerId, int &QuadsCounter, CEnvelopedQuad pEnvQuads[1024])
|
||||
{
|
||||
bool Found = false;
|
||||
for(int i = 0; i < NumQuads; i++)
|
||||
|
@ -68,7 +69,7 @@ bool GetEnvelopedQuads(const CQuad *pQuads, const int NumQuads, const int EnvId,
|
|||
return Found;
|
||||
}
|
||||
|
||||
void PrintEnvelopedQuads(const EnvelopedQuad pEnvQuads[1024], const int EnvId, const int QuadsCounter)
|
||||
void PrintEnvelopedQuads(const CEnvelopedQuad pEnvQuads[1024], const int EnvId, const int QuadsCounter)
|
||||
{
|
||||
if(!QuadsCounter)
|
||||
{
|
||||
|
@ -89,7 +90,7 @@ bool FindEnv(const char aFilename[64], const int EnvId)
|
|||
|
||||
int LayersStart, LayersCount, QuadsCounter = 0;
|
||||
InputMap.GetType(MAPITEMTYPE_LAYER, &LayersStart, &LayersCount);
|
||||
EnvelopedQuad pEnvQuads[1024];
|
||||
CEnvelopedQuad pEnvQuads[1024];
|
||||
|
||||
for(int i = 0; i < LayersCount; i++)
|
||||
{
|
||||
|
|
|
@ -9,8 +9,9 @@ void *g_apNewData[1024];
|
|||
void *g_apNewItem[1024];
|
||||
int g_aNewDataSize[1024];
|
||||
|
||||
struct MapObject // quad pivot or tile layer
|
||||
class CMapObject // quad pivot or tile layer
|
||||
{
|
||||
public:
|
||||
static constexpr float ms_aStandardScreen[2] = {1430 / 2.f, 1050 / 2.f};
|
||||
|
||||
float m_aLayerOffset[2];
|
||||
|
@ -32,22 +33,22 @@ const CMapItemGroup *GetLayerGroup(CDataFileReader &, int);
|
|||
void ReplaceAreaTiles(CDataFileReader[2], const float[][2][2], const CMapItemGroup *[2], CMapItemLayer *[2]);
|
||||
void RemoveDestinationTiles(CMapItemLayerTilemap *, CTile *, float[2][2]);
|
||||
void ReplaceDestinationTiles(CMapItemLayerTilemap *[2], CTile *[2], float[2][2][2]);
|
||||
bool AdaptVisibleAreas(const float[2][2][2], const MapObject[2], float[2][2][2]);
|
||||
bool AdaptReplaceableAreas(const float[2][2][2], const float[2][2][2], const MapObject[2], float[2][2][2]);
|
||||
bool AdaptVisibleAreas(const float[2][2][2], const CMapObject[2], float[2][2][2]);
|
||||
bool AdaptReplaceableAreas(const float[2][2][2], const float[2][2][2], const CMapObject[2], float[2][2][2]);
|
||||
|
||||
void ReplaceAreaQuads(CDataFileReader[2], const float[][2][2], const CMapItemGroup *[2], CMapItemLayer *[2], int);
|
||||
bool RemoveDestinationQuads(const float[2][2], const CQuad *, int, const CMapItemGroup *, CQuad *, int &);
|
||||
bool InsertDestinationQuads(const float[2][2][2], const CQuad *, int, const CMapItemGroup *[2], CQuad *, int &);
|
||||
bool AdaptVisiblePoint(const float[2][2][2], const float[2][2], const MapObject[2], float[2]);
|
||||
bool AdaptVisiblePoint(const float[2][2][2], const float[2][2], const CMapObject[2], float[2]);
|
||||
|
||||
MapObject CreateMapObject(const CMapItemGroup *, int, int, int, int);
|
||||
void SetExtendedArea(MapObject &);
|
||||
bool GetVisibleArea(const float[2][2], const MapObject &, float[2][2] = 0x0);
|
||||
bool GetReplaceableArea(const float[2][2], const MapObject &, float[2][2]);
|
||||
CMapObject CreateMapObject(const CMapItemGroup *, int, int, int, int);
|
||||
void SetExtendedArea(CMapObject &);
|
||||
bool GetVisibleArea(const float[2][2], const CMapObject &, float[2][2] = 0x0);
|
||||
bool GetReplaceableArea(const float[2][2], const CMapObject &, float[2][2]);
|
||||
|
||||
void GetGameAreaDistance(const float[2][2][2], const MapObject[2], const float[2][2][2], float[2]);
|
||||
void GetGameAreaDistance(const float[2][2][2], const MapObject[2], const float[2][2], float[2]);
|
||||
void GetSignificantScreenPos(const MapObject &, const float[2][2], const float[2][2], float[2]);
|
||||
void GetGameAreaDistance(const float[2][2][2], const CMapObject[2], const float[2][2][2], float[2]);
|
||||
void GetGameAreaDistance(const float[2][2][2], const CMapObject[2], const float[2][2], float[2]);
|
||||
void GetSignificantScreenPos(const CMapObject &, const float[2][2], const float[2][2], float[2]);
|
||||
void ConvertToTiles(const float[2][2], int[2][2]);
|
||||
|
||||
bool GetLineIntersection(const float[2], const float[2], float[2] = 0x0);
|
||||
|
@ -262,7 +263,7 @@ void ReplaceAreaTiles(CDataFileReader aInputMaps[2], const float aaaGameAreas[][
|
|||
CMapItemLayerTilemap *apTilemap[2];
|
||||
CTile *apTile[2];
|
||||
float aaaVisibleAreas[2][2][2], aaaReplaceableAreas[2][2][2];
|
||||
MapObject aObs[2];
|
||||
CMapObject aObs[2];
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
|
@ -313,7 +314,7 @@ void ReplaceDestinationTiles(CMapItemLayerTilemap *apTilemap[2], CTile *apTile[2
|
|||
apTile[1][x1 + (y1 * apTilemap[1]->m_Width)] = apTile[0][x0 + (y0 * apTilemap[0]->m_Width)];
|
||||
}
|
||||
|
||||
bool AdaptVisibleAreas(const float aaaGameAreas[2][2][2], const MapObject aObs[2], float aaaVisibleAreas[2][2][2])
|
||||
bool AdaptVisibleAreas(const float aaaGameAreas[2][2][2], const CMapObject aObs[2], float aaaVisibleAreas[2][2][2])
|
||||
{
|
||||
float aDistance[2];
|
||||
GetGameAreaDistance(aaaGameAreas, aObs, aaaVisibleAreas, aDistance);
|
||||
|
@ -336,7 +337,7 @@ bool AdaptVisibleAreas(const float aaaGameAreas[2][2][2], const MapObject aObs[2
|
|||
return true;
|
||||
}
|
||||
|
||||
bool AdaptReplaceableAreas(const float aaaGameAreas[2][2][2], const float aaaVisibleAreas[2][2][2], const MapObject aObs[2], float aaaReplaceableAreas[2][2][2])
|
||||
bool AdaptReplaceableAreas(const float aaaGameAreas[2][2][2], const float aaaVisibleAreas[2][2][2], const CMapObject aObs[2], float aaaReplaceableAreas[2][2][2])
|
||||
{
|
||||
float aDistance[2], aScreenPos[2];
|
||||
GetGameAreaDistance(aaaGameAreas, aObs, aaaVisibleAreas, aDistance);
|
||||
|
@ -398,7 +399,7 @@ bool RemoveDestinationQuads(const float aaGameArea[2][2], const CQuad *pQuads, c
|
|||
|
||||
for(int i = 0; i < NumQuads; i++)
|
||||
{
|
||||
MapObject Ob = CreateMapObject(pLayerGroup, fx2f(pQuads[i].m_aPoints[4].x), fx2f(pQuads[i].m_aPoints[4].y), 0, 0);
|
||||
CMapObject Ob = CreateMapObject(pLayerGroup, fx2f(pQuads[i].m_aPoints[4].x), fx2f(pQuads[i].m_aPoints[4].y), 0, 0);
|
||||
|
||||
if(GetVisibleArea(aaGameArea, Ob))
|
||||
{
|
||||
|
@ -419,7 +420,7 @@ bool InsertDestinationQuads(const float aaaGameAreas[2][2][2], const CQuad *pQua
|
|||
|
||||
for(int i = 0; i < NumQuads; i++)
|
||||
{
|
||||
MapObject aObs[2];
|
||||
CMapObject aObs[2];
|
||||
aObs[0] = CreateMapObject(apLayerGroups[0], fx2f(pQuads[i].m_aPoints[4].x), fx2f(pQuads[i].m_aPoints[4].y), 0, 0);
|
||||
float aaVisibleArea[2][2];
|
||||
|
||||
|
@ -446,7 +447,7 @@ bool InsertDestinationQuads(const float aaaGameAreas[2][2][2], const CQuad *pQua
|
|||
return DataChanged;
|
||||
}
|
||||
|
||||
bool AdaptVisiblePoint(const float aaaGameAreas[2][2][2], const float aaVisibleArea[2][2], const MapObject aObs[2], float aPos[2])
|
||||
bool AdaptVisiblePoint(const float aaaGameAreas[2][2][2], const float aaVisibleArea[2][2], const CMapObject aObs[2], float aPos[2])
|
||||
{
|
||||
float aDistance[2], aScreenPos[2];
|
||||
GetGameAreaDistance(aaaGameAreas, aObs, aaVisibleArea, aDistance);
|
||||
|
@ -455,7 +456,7 @@ bool AdaptVisiblePoint(const float aaaGameAreas[2][2][2], const float aaVisibleA
|
|||
for(int i = 0; i < 2; i++)
|
||||
aPos[i] = aaVisibleArea[i][0] + aDistance[i] + aObs[1].m_aLayerOffset[i] - (aScreenPos[i] + aDistance[i]) * aObs[1].m_aSpeed[i];
|
||||
|
||||
MapObject FinalOb = aObs[1];
|
||||
CMapObject FinalOb = aObs[1];
|
||||
for(int i = 0; i < 2; i++)
|
||||
FinalOb.m_aaBaseArea[i][0] = FinalOb.m_aaBaseArea[i][1] += aPos[i];
|
||||
SetExtendedArea(FinalOb);
|
||||
|
@ -463,9 +464,9 @@ bool AdaptVisiblePoint(const float aaaGameAreas[2][2][2], const float aaVisibleA
|
|||
return GetVisibleArea(aaaGameAreas[1], FinalOb);
|
||||
}
|
||||
|
||||
MapObject CreateMapObject(const CMapItemGroup *pLayerGroup, const int PosX, const int PosY, const int Width, const int Height)
|
||||
CMapObject CreateMapObject(const CMapItemGroup *pLayerGroup, const int PosX, const int PosY, const int Width, const int Height)
|
||||
{
|
||||
MapObject Ob;
|
||||
CMapObject Ob;
|
||||
|
||||
Ob.m_aaBaseArea[0][0] = PosX - pLayerGroup->m_OffsetX;
|
||||
Ob.m_aaBaseArea[1][0] = PosY - pLayerGroup->m_OffsetY;
|
||||
|
@ -483,8 +484,8 @@ MapObject CreateMapObject(const CMapItemGroup *pLayerGroup, const int PosX, cons
|
|||
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
Ob.m_aaScreenOffset[i][0] = -MapObject::ms_aStandardScreen[i];
|
||||
Ob.m_aaScreenOffset[i][1] = MapObject::ms_aStandardScreen[i];
|
||||
Ob.m_aaScreenOffset[i][0] = -CMapObject::ms_aStandardScreen[i];
|
||||
Ob.m_aaScreenOffset[i][1] = CMapObject::ms_aStandardScreen[i];
|
||||
if(Ob.m_aSpeed[i] < 0)
|
||||
std::swap(Ob.m_aaScreenOffset[i][0], Ob.m_aaScreenOffset[i][1]);
|
||||
}
|
||||
|
@ -493,7 +494,7 @@ MapObject CreateMapObject(const CMapItemGroup *pLayerGroup, const int PosX, cons
|
|||
return Ob;
|
||||
}
|
||||
|
||||
void SetExtendedArea(MapObject &Ob)
|
||||
void SetExtendedArea(CMapObject &Ob)
|
||||
{
|
||||
SetInexistent((float *)Ob.m_aaExtendedArea, 4);
|
||||
|
||||
|
@ -515,7 +516,7 @@ void SetExtendedArea(MapObject &Ob)
|
|||
}
|
||||
}
|
||||
|
||||
bool GetVisibleArea(const float aaGameArea[2][2], const MapObject &Ob, float aaVisibleArea[2][2])
|
||||
bool GetVisibleArea(const float aaGameArea[2][2], const CMapObject &Ob, float aaVisibleArea[2][2])
|
||||
{
|
||||
if(IsInexistent((float *)Ob.m_aaExtendedArea, 4))
|
||||
return false;
|
||||
|
@ -547,7 +548,7 @@ bool GetVisibleArea(const float aaGameArea[2][2], const MapObject &Ob, float aaV
|
|||
return true;
|
||||
}
|
||||
|
||||
bool GetReplaceableArea(const float aaVisibleArea[2][2], const MapObject &Ob, float aaReplaceableArea[2][2])
|
||||
bool GetReplaceableArea(const float aaVisibleArea[2][2], const CMapObject &Ob, float aaReplaceableArea[2][2])
|
||||
{
|
||||
SetInexistent((float *)aaReplaceableArea, 4);
|
||||
if(IsInexistent((float *)aaVisibleArea, 4))
|
||||
|
@ -580,7 +581,7 @@ bool GetReplaceableArea(const float aaVisibleArea[2][2], const MapObject &Ob, fl
|
|||
return true;
|
||||
}
|
||||
|
||||
void GetGameAreaDistance(const float aaaGameAreas[2][2][2], const MapObject aObs[2], const float aaaVisibleAreas[2][2][2], float aDistance[2])
|
||||
void GetGameAreaDistance(const float aaaGameAreas[2][2][2], const CMapObject aObs[2], const float aaaVisibleAreas[2][2][2], float aDistance[2])
|
||||
{
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
|
@ -595,7 +596,7 @@ void GetGameAreaDistance(const float aaaGameAreas[2][2][2], const MapObject aObs
|
|||
}
|
||||
}
|
||||
|
||||
void GetGameAreaDistance(const float aaaGameAreas[2][2][2], const MapObject aObs[2], const float aaVisibleArea[2][2], float aDistance[2])
|
||||
void GetGameAreaDistance(const float aaaGameAreas[2][2][2], const CMapObject aObs[2], const float aaVisibleArea[2][2], float aDistance[2])
|
||||
{
|
||||
float aaaVisibleAreas[2][2][2];
|
||||
mem_copy(aaaVisibleAreas[0], aaVisibleArea[0], sizeof(float[2][2]));
|
||||
|
@ -603,7 +604,7 @@ void GetGameAreaDistance(const float aaaGameAreas[2][2][2], const MapObject aObs
|
|||
GetGameAreaDistance(aaaGameAreas, aObs, aaaVisibleAreas, aDistance);
|
||||
}
|
||||
|
||||
void GetSignificantScreenPos(const MapObject &Ob, const float aaVisibleArea[2][2], const float aaReplaceableArea[2][2], float aScreen[2])
|
||||
void GetSignificantScreenPos(const CMapObject &Ob, const float aaVisibleArea[2][2], const float aaReplaceableArea[2][2], float aScreen[2])
|
||||
{
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue