| 577 | } |
| 578 | |
| 579 | int backupeditundo(vector<uchar> &buf, int undolimit, int redolimit) |
| 580 | { |
| 581 | int numundo = 0; |
| 582 | vector<uchar> tmp; |
| 583 | loopvrev(undos) |
| 584 | { |
| 585 | tmp.setsize(0); |
| 586 | undolimit -= rlencodeundo(10, tmp, undos[i]); |
| 587 | if(undolimit < 0) break; |
| 588 | buf.put(tmp.getbuf(), tmp.length()); |
| 589 | numundo++; |
| 590 | #ifdef _DEBUG |
| 591 | if(worldiodebug) clientlogf(" written undo x %d, y %d, xs %d, ys %d, compressed length %d", undos[i]->x, undos[i]->y, undos[i]->xs, undos[i]->ys, tmp.length()); |
| 592 | #endif |
| 593 | } |
| 594 | loopvrev(redos) |
| 595 | { |
| 596 | tmp.setsize(0); |
| 597 | redolimit -= rlencodeundo(20, tmp, redos[i]); |
| 598 | if(redolimit < 0) break; |
| 599 | buf.put(tmp.getbuf(), tmp.length()); |
| 600 | #ifdef _DEBUG |
| 601 | if(worldiodebug) clientlogf(" written redo x %d, y %d, xs %d, ys %d, compressed length %d", redos[i]->x, redos[i]->y, redos[i]->xs, redos[i]->ys, tmp.length()); |
| 602 | #endif |
| 603 | } |
| 604 | putuint(buf, 0); |
| 605 | return numundo; |
| 606 | } |
| 607 | |
| 608 | vector<block *> copybuffers; |
| 609 | void *copytexconfig = NULL; |
no test coverage detected