MCPcopy Create free account
hub / github.com/assaultcube/AC / pruneundos

Function pruneundos

source/src/editing.cpp:363–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361int undolevel = 0;
362
363void pruneundos(int maxremain) // bound memory
364{
365 int u = 0, r = 0;
366 maxremain /= sizeof(sqr);
367 loopvrev(undos)
368 {
369 u += undos[i]->xs * undos[i]->ys;
370 if(u > maxremain) freeblockp(undos.remove(i));
371 }
372 loopvrev(redos)
373 {
374 r += redos[i]->xs * redos[i]->ys;
375 if(r > maxremain) freeblockp(redos.remove(i));
376 }
377}
378
379void storeposition(short p[])
380{

Callers 2

makeundoFunction · 0.85
reseteditorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected