MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetLayerGroupIds

Function GetLayerGroupIds

src/tools/map_find_env.cpp:36–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static bool GetLayerGroupIds(CDataFileReader &InputMap, const int LayerNumber, int &GroupId, int &LayerRelativeId)
37{
38 int Start, Num;
39 InputMap.GetType(MAPITEMTYPE_GROUP, &Start, &Num);
40
41 for(int i = 0; i < Num; i++)
42 {
43 CMapItemGroup *pItem = (CMapItemGroup *)InputMap.GetItem(Start + i);
44 if(LayerNumber >= pItem->m_StartLayer && LayerNumber <= pItem->m_StartLayer + pItem->m_NumLayers)
45 {
46 GroupId = i;
47 LayerRelativeId = LayerNumber - pItem->m_StartLayer - 1;
48 return true;
49 }
50 }
51
52 return false;
53}
54
55static int FxToTilePos(const int FxPos)
56{

Callers 1

FindEnvFunction · 0.85

Calls 2

GetTypeMethod · 0.45
GetItemMethod · 0.45

Tested by

no test coverage detected