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

Function rlencodeundo

source/src/editing.cpp:561–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559}
560
561int rlencodeundo(int type, vector<uchar> &t, block *s)
562{
563 putuint(t, type);
564 putuint(t, s->x);
565 putuint(t, s->y);
566 putuint(t, s->xs);
567 putuint(t, s->ys);
568 loopi(5) putint(t, s->p[i]);
569 vector<uchar> tmp;
570 rlencodecubes(tmp, (sqr *)(s+1), s->xs * s->ys, true);
571 putuint(t, tmp.length());
572 t.put(tmp.getbuf(), tmp.length());
573 #ifdef _DEBUG
574 if(worldiodebug) clientlogf(" compressing redo/undo x %d, y %d, xs %d, ys %d, compressed length %d, cubes %d", s->x, s->y, s->xs, s->ys, tmp.length(), s->xs * s->ys);
575 #endif
576 return t.length();
577}
578
579int backupeditundo(vector<uchar> &buf, int undolimit, int redolimit)
580{

Callers 1

loopvrevFunction · 0.85

Calls 8

putuintFunction · 0.85
putintFunction · 0.85
rlencodecubesFunction · 0.85
clientlogfFunction · 0.85
loopiFunction · 0.70
lengthMethod · 0.45
putMethod · 0.45
getbufMethod · 0.45

Tested by

no test coverage detected