| 33 | for (char* i = (char*)array->BeginX; i != array->EndX; i += size) |
| 34 | |
| 35 | static void construct_impl(sugoi_chunk_view_t view, type_index_t type, EIndex offset, uint32_t size, uint32_t align, uint32_t elemSize, uint32_t maskValue, void (*constructor)(sugoi_chunk_t* chunk, EIndex index, char* data)) |
| 36 | { |
| 37 | char* dst = view.chunk->data() + (size_t)offset + (size_t)size * view.start; |
| 38 | if (type.is_buffer()) |
| 39 | forloop (j, 0, view.count) |
| 40 | { |
| 41 | char* buf = (size_t)j * size + dst; |
| 42 | auto array = new_array(buf, size, elemSize, align); |
| 43 | if (constructor) |
| 44 | for_buffer(curr, array, elemSize) |
| 45 | constructor(view.chunk, view.start + j, curr); |
| 46 | } |
| 47 | else if (type == kMaskComponent) |
| 48 | forloop (j, 0, view.count) |
| 49 | ((mask_t*)dst)[j] = maskValue; |
| 50 | else if (type == kDirtyComponent) |
| 51 | memset(dst, 0xFFFFFFFF, (size_t)size * view.count); |
| 52 | // else if (type == kGuidComponent) |
| 53 | // { |
| 54 | // auto guidDst = (guid_t*)dst; |
| 55 | // auto& registry = type_registry_t::get(); |
| 56 | // forloop (j, 0, view.count) |
| 57 | // guidDst[j] = registry.make_guid(); |
| 58 | // return; |
| 59 | // } |
| 60 | else if (constructor) |
| 61 | forloop (j, 0, view.count) |
| 62 | constructor(view.chunk, view.start + j, (size_t)j * size + dst); |
| 63 | else |
| 64 | memset(dst, 0, (size_t)size * view.count); |
| 65 | } |
| 66 | |
| 67 | static void destruct_impl(sugoi_chunk_view_t view, type_index_t type, EIndex offset, uint32_t size, uint32_t elemSize, resource_fields_t resourceFields, void (*destructor)(sugoi_chunk_t* chunk, EIndex index, char* data)) |
| 68 | { |
no test coverage detected