| 565 | } |
| 566 | |
| 567 | void UIGrid::LoadState(FileStreamIn& in, bool shouldSetValue) |
| 568 | { |
| 569 | int rev; |
| 570 | in >> rev; |
| 571 | LoadStateValidate(rev <= kSaveStateRev); |
| 572 | |
| 573 | int cols; |
| 574 | int rows; |
| 575 | |
| 576 | if (rev < 1) |
| 577 | { |
| 578 | cols = 100; |
| 579 | rows = 100; |
| 580 | } |
| 581 | else if (rev == 1) |
| 582 | { |
| 583 | cols = 128; |
| 584 | rows = 128; |
| 585 | } |
| 586 | else |
| 587 | { |
| 588 | in >> mCols; |
| 589 | in >> mRows; |
| 590 | cols = mCols; |
| 591 | rows = mRows; |
| 592 | } |
| 593 | |
| 594 | for (int col = 0; col < cols; ++col) |
| 595 | { |
| 596 | for (int row = 0; row < rows; ++row) |
| 597 | { |
| 598 | int dataIndex; |
| 599 | if (rev < 2) |
| 600 | dataIndex = GetDataIndex(row, col); |
| 601 | else |
| 602 | dataIndex = GetDataIndex(col, row); |
| 603 | float oldVal = mData[dataIndex]; |
| 604 | in >> mData[dataIndex]; |
| 605 | if (mListener) |
| 606 | mListener->GridUpdated(this, col, row, mData[dataIndex], oldVal); |
| 607 | } |
| 608 | } |
| 609 | } |
nothing calls this directly
no test coverage detected