| 75 | } |
| 76 | |
| 77 | bool loadDataTable(QFile &src,Pigg_DataTable &target) |
| 78 | { |
| 79 | int table_sizes; |
| 80 | int num_entries; |
| 81 | |
| 82 | if(!readPOD(src,target.datapool_flag)) |
| 83 | return false; |
| 84 | if(!readPOD(src,table_sizes)) |
| 85 | return false; |
| 86 | if(!readPOD(src,num_entries)) |
| 87 | return false; |
| 88 | while(num_entries>0) { |
| 89 | uint32_t entrysize; |
| 90 | if(!readPOD(src,entrysize)) |
| 91 | return false; |
| 92 | if(entrysize>0) |
| 93 | target.data_parts.push_back(QString::fromLocal8Bit(src.read(entrysize))); |
| 94 | num_entries -= entrysize+4; |
| 95 | } |
| 96 | return true; |
| 97 | } |
| 98 | |
| 99 | bool loadPigg(const QString &fname,PiggFile &pigg) |
| 100 | { |