MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / moveNext

Method moveNext

libs/patch/PatchIterators.h:285–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283
284private:
285 static void moveNext(PatchControlIterator& it, const IPatch& patch, std::size_t endRow, int rowDelta, int columnDelta)
286 {
287 auto nextColumn = it.getColumn() + columnDelta;
288 auto nextRow = it.getRow();
289
290 if (columnDelta > 0 && nextColumn >= patch.getWidth() ||
291 columnDelta < 0 && nextColumn < 0)
292 {
293 // Advance to the next row
294 // If that doesn't succeed, just leave the indices out of bounds
295 nextRow += rowDelta;
296
297 if (rowDelta > 0 && nextRow <= endRow ||
298 rowDelta < 0 && nextRow >= endRow)
299 {
300 nextColumn = columnDelta > 0 ? 0 : static_cast<int>(patch.getWidth()) - 1;
301 }
302 }
303
304 it.set(nextRow, nextColumn);
305 }
306};
307
308// An iterator traversing a given patch row-wise, iterating over

Callers

nothing calls this directly

Calls 4

getColumnMethod · 0.80
getRowMethod · 0.80
getWidthMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected