clang-format: fix style

This commit is contained in:
def 2020-09-14 16:00:32 +02:00
parent be90f3f48b
commit a67a8e36aa
6 changed files with 126 additions and 137 deletions

View file

@ -127,9 +127,7 @@ void CCollision::Init(class CLayers *pLayers)
if(Index <= TILE_NPH_ENABLE)
{
if((Index >= TILE_JUMP && Index <= TILE_SUBSTRACT_TIME)
|| Index == TILE_ALLOW_TELE_GUN
|| Index == TILE_ALLOW_BLUE_TELE_GUN)
if((Index >= TILE_JUMP && Index <= TILE_SUBSTRACT_TIME) || Index == TILE_ALLOW_TELE_GUN || Index == TILE_ALLOW_BLUE_TELE_GUN)
m_pSwitch[i].m_Type = Index;
else
m_pSwitch[i].m_Type = 0;

View file

@ -957,8 +957,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
TILE_ADD_TIME,
TILE_SUBSTRACT_TIME,
TILE_ALLOW_TELE_GUN,
TILE_ALLOW_BLUE_TELE_GUN
};
TILE_ALLOW_BLUE_TELE_GUN};
CSwitchTile *pLayerSwitchTiles = ((CLayerSwitch *)pTiles)->m_pSwitchTile;
mem_copy(((CLayerSwitch *)pTiles)->m_pSwitchTile, pSwitchData, pTiles->m_Width*pTiles->m_Height*sizeof(CSwitchTile));

View file

@ -310,21 +310,21 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
for(int x = 0; x < r.w; x++)
{
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x] = ((CLayerSwitch *)this)->m_pSwitchTile[(r.y + y) * m_Width + (r.x + x)];
if(pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == ENTITY_DOOR + ENTITY_OFFSET
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_HIT_ENABLE
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_HIT_DISABLE
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SWITCHOPEN
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SWITCHCLOSE
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SWITCHTIMEDOPEN
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SWITCHTIMEDCLOSE
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == ENTITY_LASER_LONG + ENTITY_OFFSET
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == ENTITY_LASER_MEDIUM + ENTITY_OFFSET
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == ENTITY_LASER_SHORT + ENTITY_OFFSET
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_JUMP
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_ADD_TIME
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SUBSTRACT_TIME
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_ALLOW_TELE_GUN
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_ALLOW_BLUE_TELE_GUN)
if(pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == ENTITY_DOOR + ENTITY_OFFSET ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_HIT_ENABLE ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_HIT_DISABLE ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SWITCHOPEN ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SWITCHCLOSE ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SWITCHTIMEDOPEN ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SWITCHTIMEDCLOSE ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == ENTITY_LASER_LONG + ENTITY_OFFSET ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == ENTITY_LASER_MEDIUM + ENTITY_OFFSET ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == ENTITY_LASER_SHORT + ENTITY_OFFSET ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_JUMP ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_ADD_TIME ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SUBSTRACT_TIME ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_ALLOW_TELE_GUN ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_ALLOW_BLUE_TELE_GUN)
{
m_pEditor->m_SwitchNum = pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Number;
m_pEditor->m_SwitchDelay = pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Delay;

View file

@ -3,59 +3,56 @@
bool IsValidGameTile(int Index)
{
return (
Index == TILE_AIR
|| (Index >= TILE_SOLID && Index <= TILE_THROUGH)
|| Index == TILE_FREEZE
|| (Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE)
|| (Index >= TILE_WALLJUMP && Index <= TILE_SOLO_DISABLE)
|| (Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA)
|| (Index >= TILE_CP && Index <= TILE_THROUGH_DIR)
|| (Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM)
|| (Index >= TILE_NPC_DISABLE && Index <= TILE_NPH_DISABLE)
|| (Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_TELE_GUN_DISABLE)
|| (Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE)
|| (Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE)
|| (Index >= TILE_NPC_ENABLE && Index <= TILE_NPH_ENABLE)
|| (Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2)
|| IsValidEntity(Index)
);
Index == TILE_AIR ||
(Index >= TILE_SOLID && Index <= TILE_THROUGH) ||
Index == TILE_FREEZE ||
(Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE) ||
(Index >= TILE_WALLJUMP && Index <= TILE_SOLO_DISABLE) ||
(Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA) ||
(Index >= TILE_CP && Index <= TILE_THROUGH_DIR) ||
(Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM) ||
(Index >= TILE_NPC_DISABLE && Index <= TILE_NPH_DISABLE) ||
(Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_TELE_GUN_DISABLE) ||
(Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE) ||
(Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE) ||
(Index >= TILE_NPC_ENABLE && Index <= TILE_NPH_ENABLE) ||
(Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2) ||
IsValidEntity(Index));
}
bool IsValidFrontTile(int Index)
{
return (
Index == TILE_AIR
|| Index == TILE_DEATH
|| (Index >= TILE_NOLASER && Index <= TILE_THROUGH)
|| Index == TILE_FREEZE
|| (Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE)
|| (Index >= TILE_WALLJUMP && Index <= TILE_SOLO_DISABLE)
|| (Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA)
|| (Index >= TILE_CP && Index <= TILE_THROUGH_DIR)
|| (Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM)
|| (Index >= TILE_NPC_DISABLE && Index <= TILE_NPH_DISABLE)
|| (Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_ALLOW_BLUE_TELE_GUN)
|| (Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE)
|| (Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE)
|| (Index >= TILE_NPC_ENABLE && Index <= TILE_NPH_ENABLE)
|| (Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2)
|| IsValidEntity(Index)
);
Index == TILE_AIR ||
Index == TILE_DEATH ||
(Index >= TILE_NOLASER && Index <= TILE_THROUGH) ||
Index == TILE_FREEZE ||
(Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE) ||
(Index >= TILE_WALLJUMP && Index <= TILE_SOLO_DISABLE) ||
(Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA) ||
(Index >= TILE_CP && Index <= TILE_THROUGH_DIR) ||
(Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM) ||
(Index >= TILE_NPC_DISABLE && Index <= TILE_NPH_DISABLE) ||
(Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_ALLOW_BLUE_TELE_GUN) ||
(Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE) ||
(Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE) ||
(Index >= TILE_NPC_ENABLE && Index <= TILE_NPH_ENABLE) ||
(Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2) ||
IsValidEntity(Index));
}
bool IsValidTeleTile(int Index)
{
return (
Index == TILE_TELEINEVIL
|| Index == TILE_TELEINWEAPON
|| Index == TILE_TELEINHOOK
|| Index == TILE_TELEIN
|| Index == TILE_TELEOUT
|| Index == TILE_TELECHECK
|| Index == TILE_TELECHECKOUT
|| Index == TILE_TELECHECKIN
|| Index == TILE_TELECHECKINEVIL
);
Index == TILE_TELEINEVIL ||
Index == TILE_TELEINWEAPON ||
Index == TILE_TELEINHOOK ||
Index == TILE_TELEIN ||
Index == TILE_TELEOUT ||
Index == TILE_TELECHECK ||
Index == TILE_TELECHECKOUT ||
Index == TILE_TELECHECKIN ||
Index == TILE_TELECHECKINEVIL);
}
bool IsValidSpeedupTile(int Index)
@ -66,19 +63,18 @@ bool IsValidSpeedupTile(int Index)
bool IsValidSwitchTile(int Index)
{
return (
Index == TILE_JUMP
|| Index == TILE_FREEZE
|| Index == TILE_DFREEZE
|| Index == TILE_DUNFREEZE
|| Index == TILE_HIT_ENABLE
|| Index == TILE_HIT_DISABLE
|| (Index >= TILE_SWITCHTIMEDOPEN && Index <= TILE_SWITCHCLOSE)
|| Index == TILE_ADD_TIME
|| Index == TILE_SUBSTRACT_TIME
|| Index == TILE_ALLOW_TELE_GUN
|| Index == TILE_ALLOW_BLUE_TELE_GUN
|| IsValidEntity(Index)
);
Index == TILE_JUMP ||
Index == TILE_FREEZE ||
Index == TILE_DFREEZE ||
Index == TILE_DUNFREEZE ||
Index == TILE_HIT_ENABLE ||
Index == TILE_HIT_DISABLE ||
(Index >= TILE_SWITCHTIMEDOPEN && Index <= TILE_SWITCHCLOSE) ||
Index == TILE_ADD_TIME ||
Index == TILE_SUBSTRACT_TIME ||
Index == TILE_ALLOW_TELE_GUN ||
Index == TILE_ALLOW_BLUE_TELE_GUN ||
IsValidEntity(Index));
}
bool IsValidTuneTile(int Index)
@ -90,38 +86,35 @@ bool IsValidEntity(int Index)
{
Index -= ENTITY_OFFSET;
return (
(Index >= ENTITY_SPAWN && Index <= ENTITY_LASER_O_FAST)
|| (Index >= ENTITY_PLASMAE && Index <= ENTITY_CRAZY_SHOTGUN)
|| (Index >= ENTITY_DRAGGER_WEAK && Index <= ENTITY_DRAGGER_STRONG_NW)
|| Index == ENTITY_DOOR
);
(Index >= ENTITY_SPAWN && Index <= ENTITY_LASER_O_FAST) ||
(Index >= ENTITY_PLASMAE && Index <= ENTITY_CRAZY_SHOTGUN) ||
(Index >= ENTITY_DRAGGER_WEAK && Index <= ENTITY_DRAGGER_STRONG_NW) ||
Index == ENTITY_DOOR);
}
bool IsRotatableTile(int Index)
{
return (
Index == TILE_STOP
|| Index == TILE_STOPS
|| Index == TILE_CP
|| Index == TILE_CP_F
|| Index == TILE_THROUGH_DIR
|| Index == TILE_ENTITIES_OFF_1
|| Index == TILE_ENTITIES_OFF_2
|| Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN_EX
|| Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN
);
Index == TILE_STOP ||
Index == TILE_STOPS ||
Index == TILE_CP ||
Index == TILE_CP_F ||
Index == TILE_THROUGH_DIR ||
Index == TILE_ENTITIES_OFF_1 ||
Index == TILE_ENTITIES_OFF_2 ||
Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN_EX ||
Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN);
}
bool IsCreditsTile(int TileIndex)
{
return (
(TILE_CREDITS_1 == TileIndex)
|| (TILE_CREDITS_2 == TileIndex)
|| (TILE_CREDITS_3 == TileIndex)
|| (TILE_CREDITS_4 == TileIndex)
|| (TILE_CREDITS_5 == TileIndex)
|| (TILE_CREDITS_6 == TileIndex)
|| (TILE_CREDITS_7 == TileIndex)
|| (TILE_CREDITS_8 == TileIndex)
);
(TILE_CREDITS_1 == TileIndex) ||
(TILE_CREDITS_2 == TileIndex) ||
(TILE_CREDITS_3 == TileIndex) ||
(TILE_CREDITS_4 == TileIndex) ||
(TILE_CREDITS_5 == TileIndex) ||
(TILE_CREDITS_6 == TileIndex) ||
(TILE_CREDITS_7 == TileIndex) ||
(TILE_CREDITS_8 == TileIndex));
}

View file

@ -33,7 +33,6 @@ enum
// format with UUIDs. See src/engine/shared/datafile.cpp for some of
// the implementation.
CURVETYPE_STEP = 0,
CURVETYPE_LINEAR,
CURVETYPE_SLOW,