| 230 | |
| 231 | private: |
| 232 | bool WriteHeader() |
| 233 | { |
| 234 | _FILEHEADER fhdr; |
| 235 | |
| 236 | memset(&fhdr, 0, sizeof(fhdr)); |
| 237 | fhdr.signature = SDL_SwapLE32('\x1AQPM'); |
| 238 | fhdr.headersize = SDL_SwapLE32(32); |
| 239 | fhdr.filesize = SDL_SwapLE32(static_cast<std::uint32_t>(size)); |
| 240 | fhdr.version = SDL_SwapLE16(0); |
| 241 | fhdr.sectorsizeid = SDL_SwapLE16(3); |
| 242 | fhdr.hashoffset = SDL_SwapLE32(static_cast<std::uint32_t>(kMpqHashEntryOffset)); |
| 243 | fhdr.blockoffset = SDL_SwapLE32(static_cast<std::uint32_t>(kMpqBlockEntryOffset)); |
| 244 | fhdr.hashcount = SDL_SwapLE32(2048); |
| 245 | fhdr.blockcount = SDL_SwapLE32(2048); |
| 246 | |
| 247 | if (!stream.write(reinterpret_cast<const char *>(&fhdr), sizeof(fhdr))) |
| 248 | return false; |
| 249 | return true; |
| 250 | } |
| 251 | |
| 252 | bool WriteBlockTable() |
| 253 | { |