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

Function CompareLayers

src/tools/map_replace_area.cpp:202–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202bool CompareLayers(const char aaMapNames[3][64], CDataFileReader aInputMaps[2])
203{
204 int aStart[2], aNum[2];
205 for(int i = 0; i < 2; i++)
206 aInputMaps[i].GetType(MAPITEMTYPE_LAYER, &aStart[i], &aNum[i]);
207
208 if(aNum[0] != aNum[1])
209 {
210 dbg_msg("map_replace_area", "ERROR: different layers quantity");
211 for(int i = 0; i < 2; i++)
212 dbg_msg("map_replace_area", " \"%s\": %d layers", aaMapNames[i], aNum[i]);
213 return false;
214 }
215
216 for(int i = 0; i < aNum[0]; i++)
217 {
218 CMapItemLayer *apItem[2];
219 for(int j = 0; j < 2; j++)
220 apItem[j] = (CMapItemLayer *)aInputMaps[j].GetItem(aStart[j] + i);
221
222 if(apItem[0]->m_Type != apItem[1]->m_Type)
223 {
224 dbg_msg("map_replace_area", "ERROR: different types on layer #%d", i);
225 for(int j = 0; j < 2; j++)
226 dbg_msg("map_replace_area", " \"%s\": %s", aaMapNames[j], apItem[j]->m_Type == LAYERTYPE_TILES ? "tiles layer" : "quad layer");
227 return false;
228 }
229 }
230
231 return true;
232}
233
234void CompareGroups(const char aaMapNames[3][64], CDataFileReader aInputMaps[2])
235{

Callers 1

ReplaceAreaFunction · 0.85

Calls 3

dbg_msgFunction · 0.85
GetTypeMethod · 0.45
GetItemMethod · 0.45

Tested by

no test coverage detected