Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/readfile.cc
| Show First 20 Lines • Show All 1,900 Lines • ▼ Show 20 Lines | #ifdef USE_BHEAD_READ_ON_DEMAND | ||||
| if (BHEADN_FROM_BHEAD(bh)->has_data == false) { | if (BHEADN_FROM_BHEAD(bh)->has_data == false) { | ||||
| bh = blo_bhead_read_full(fd, bh); | bh = blo_bhead_read_full(fd, bh); | ||||
| if (UNLIKELY(bh == nullptr)) { | if (UNLIKELY(bh == nullptr)) { | ||||
| fd->flags &= ~FD_FLAGS_FILE_OK; | fd->flags &= ~FD_FLAGS_FILE_OK; | ||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| } | } | ||||
| #endif | #endif | ||||
| temp = DNA_struct_reconstruct(fd->reconstruct_info, bh->SDNAnr, bh->nr, (bh + 1)); | DNA_ReconstructParams params; | ||||
| params.userdata = fd; | |||||
| params.add_data = [](void *userdata, const void *old_address, void *new_address) { | |||||
| FileData *fd = static_cast<FileData *>(userdata); | |||||
| oldnewmap_insert(fd->datamap, old_address, new_address, 0); | |||||
| }; | |||||
| temp = DNA_struct_reconstruct(fd->reconstruct_info, bh->SDNAnr, bh->nr, (bh + 1), ¶ms); | |||||
| } | } | ||||
| else { | else { | ||||
| /* SDNA_CMP_EQUAL */ | /* SDNA_CMP_EQUAL */ | ||||
| temp = MEM_mallocN(bh->len, blockname); | temp = MEM_mallocN(bh->len, blockname); | ||||
| #ifdef USE_BHEAD_READ_ON_DEMAND | #ifdef USE_BHEAD_READ_ON_DEMAND | ||||
| if (BHEADN_FROM_BHEAD(bh)->has_data) { | if (BHEADN_FROM_BHEAD(bh)->has_data) { | ||||
| memcpy(temp, (bh + 1), bh->len); | memcpy(temp, (bh + 1), bh->len); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 3,296 Lines • Show Last 20 Lines | |||||